Use a callback to notify a new frame

Make the decoder independant of the SDL even mechanism, by registering a
callback on the video_buffer.
This commit is contained in:
Romain Vimont 2021-02-19 22:02:36 +01:00
parent 72df2c23f9
commit b1c7c71160
4 changed files with 46 additions and 10 deletions

View file

@ -19,13 +19,7 @@ push_frame(struct decoder *decoder) {
&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;
}
static SDL_Event new_frame_event = {
.type = EVENT_NEW_FRAME,
};
SDL_PushEvent(&new_frame_event);
}
void