scrcpy/app/src/trait
Romain Vimont 7840c48043 Add session metadata for video stream
Introduce a new packet type, a "session" packet, containing metadata
about the encoding session. It is used only for the video stream,
and currently includes the video resolution.

For illustration, here is a sequence of packets on the video stream:

                                        device rotation
                                        v
    CODEC | SESSION | MEDIA | MEDIA | … | SESSION | MEDIA | MEDIA | …
           1920x1080 <-----------------> 1080x1920 <------------------
                      encoding session 1            encoding session 2

This metadata is not strictly necessary, since the video resolution can
be determined after decoding. However, it allows detection of cases
where the encoder does not respect the requested size (and logs a
warning), even without decoding (e.g., when there is no video playback).

Additional metadata could be added later if necessary, for example the
actual device rotation.

Refs #5918 <https://github.com/Genymobile/scrcpy/pull/5918>
Refs #5894 <https://github.com/Genymobile/scrcpy/pull/5894>

Co-authored-by: gz0119 <liyong2@4399.com>
2025-12-09 20:26:21 +01:00
..
frame_sink.h Add session metadata for video stream 2025-12-09 20:26:21 +01:00
frame_source.c Add session metadata for video stream 2025-12-09 20:26:21 +01:00
frame_source.h Add session metadata for video stream 2025-12-09 20:26:21 +01:00
gamepad_processor.h Cleanup includes 2024-12-23 12:19:47 +01:00
key_processor.h Cleanup includes 2024-12-23 12:19:47 +01:00
mouse_processor.h Cleanup includes 2024-12-23 12:19:47 +01:00
packet_sink.h Add session metadata for video stream 2025-12-09 20:26:21 +01:00
packet_source.c Add session metadata for video stream 2025-12-09 20:26:21 +01:00
packet_source.h Add session metadata for video stream 2025-12-09 20:26:21 +01:00