Optimize the output method of direction information

This commit is contained in:
gz0119 2025-03-03 16:13:09 +08:00
parent fa8d262704
commit 7c167fd67e
2 changed files with 6 additions and 2 deletions

View file

@ -77,6 +77,8 @@ sc_demuxer_recv_video_size(struct sc_demuxer *demuxer, uint32_t *width,
return true;
}
uint32_t last_screen_orientation = -1;
static bool
sc_demuxer_recv_packet(struct sc_demuxer *demuxer, AVPacket *packet) {
// The video and audio streams contain a sequence of raw packets (as
@ -108,7 +110,10 @@ sc_demuxer_recv_packet(struct sc_demuxer *demuxer, AVPacket *packet) {
uint64_t pts_flags = sc_read64be(header);
uint32_t len = sc_read32be(&header[8]);
uint32_t screen_orientation = sc_read32be(&header[12]);
LOGD("Screen Orientation: %u", screen_orientation);
if(last_screen_orientation != screen_orientation){
last_screen_orientation = screen_orientation;
LOGD("Screen Orientation: %u", last_screen_orientation);
};
assert(len);
if (av_new_packet(packet, len)) {

View file

@ -11,7 +11,6 @@ import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Arrays;
import com.genymobile.scrcpy.util.Ln;
public final class Streamer {