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 58c2619a6d
commit 082083b83e
3 changed files with 69 additions and 14 deletions

View File

@@ -347,7 +347,7 @@ scrcpy(const struct scrcpy_options *options) {
file_handler_initialized = true;
}
decoder_init(&decoder, &video_buffer);
decoder_init(&decoder);
dec = &decoder;
}
@@ -410,6 +410,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;