Move fps counter out of video buffer

In order to make video buffer more generic, move out its specific
responsibility to count the fps between the decoder and the renderer.
This commit is contained in:
Romain Vimont
2021-02-19 20:56:09 +01:00
parent 218636dc10
commit cb197ee3a2
9 changed files with 27 additions and 23 deletions

View File

@@ -18,6 +18,7 @@ push_frame(struct decoder *decoder) {
video_buffer_offer_decoded_frame(decoder->video_buffer,
&previous_frame_skipped);
if (previous_frame_skipped) {
fps_counter_add_skipped_frame(decoder->fps_counter);
// the previous EVENT_NEW_FRAME will consume this frame
return;
}
@@ -28,8 +29,10 @@ push_frame(struct decoder *decoder) {
}
void
decoder_init(struct decoder *decoder, struct video_buffer *vb) {
decoder_init(struct decoder *decoder, struct video_buffer *vb,
struct fps_counter *fps_counter) {
decoder->video_buffer = vb;
decoder->fps_counter = fps_counter;
}
bool