mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-04-19 19:15:08 +00:00
Optimize the output method of direction information
This commit is contained in:
parent
fa8d262704
commit
7c167fd67e
2 changed files with 6 additions and 2 deletions
|
@ -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)) {
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue