Use a callback to notify frame skip
A skipped frame is detected when the producer offers a frame while the current pending frame has not been consumed. However, the producer (in practice the decoder) is not interested in the fact that a frame has been skipped, only the consumer (the renderer) is. Therefore, notify frame skip via a consumer callback. This allows to manage the skipped and rendered frames count at the same place, and remove fps_counter from decoder.
This commit is contained in:
@@ -346,7 +346,7 @@ scrcpy(const struct scrcpy_options *options) {
|
||||
file_handler_initialized = true;
|
||||
}
|
||||
|
||||
decoder_init(&decoder, &video_buffer, &fps_counter);
|
||||
decoder_init(&decoder, &video_buffer);
|
||||
dec = &decoder;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user