mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Use a callback to notify a new frame
Make the decoder independant of the SDL even mechanism, by making the consumer register a callback on the video_buffer.
This commit is contained in:
parent
c50b958ee4
commit
fb9f9848bd
4 changed files with 59 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue