Make decoder push frames to sinks

Now that screen implements the packet sink trait, make decoder push
packets to the sinks without depending on the concrete sink types.
This commit is contained in:
Romain Vimont
2021-04-11 15:01:05 +02:00
parent 08b3086ffc
commit 6f5ad21f57
3 changed files with 70 additions and 14 deletions

View File

@@ -318,7 +318,7 @@ scrcpy(const struct scrcpy_options *options) {
file_handler_initialized = true;
}
decoder_init(&decoder, &video_buffer);
decoder_init(&decoder);
dec = &decoder;
}
@@ -382,6 +382,8 @@ scrcpy(const struct scrcpy_options *options) {
}
screen_initialized = true;
decoder_add_sink(&decoder, &screen.frame_sink);
if (options->turn_screen_off) {
struct control_msg msg;
msg.type = CONTROL_MSG_TYPE_SET_SCREEN_POWER_MODE;