Pass video size as codec metadata

On initial connection, scrcpy sent some device metadata:
 - the device name (to be used as window title)
 - the initial video size (before any frame or even SPS/PPS)

But it is better to provide the initial video size as part as the video
stream, so that it can be demuxed and exposed via AVCodecContext to
sinks.

This avoids to pass an explicit "initial frame size" for the screen, the
recorder and the v4l2 sink.
This commit is contained in:
Romain Vimont
2023-03-11 09:21:49 +01:00
parent 3a72f3fb4d
commit 238ab872ba
17 changed files with 104 additions and 69 deletions

View File

@@ -19,7 +19,6 @@ struct sc_v4l2_sink {
AVCodecContext *encoder_ctx;
char *device_name;
struct sc_size frame_size;
sc_thread thread;
sc_mutex mutex;
@@ -33,8 +32,7 @@ struct sc_v4l2_sink {
};
bool
sc_v4l2_sink_init(struct sc_v4l2_sink *vs, const char *device_name,
struct sc_size frame_size);
sc_v4l2_sink_init(struct sc_v4l2_sink *vs, const char *device_name);
void
sc_v4l2_sink_destroy(struct sc_v4l2_sink *vs);