mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
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:
parent
fb9f9848bd
commit
cb9c42bdcb
6 changed files with 24 additions and 29 deletions
|
|
@ -10,14 +10,12 @@ struct video_buffer;
|
|||
|
||||
struct decoder {
|
||||
struct video_buffer *video_buffer;
|
||||
struct fps_counter *fps_counter;
|
||||
|
||||
AVCodecContext *codec_ctx;
|
||||
};
|
||||
|
||||
void
|
||||
decoder_init(struct decoder *decoder, struct video_buffer *vb,
|
||||
struct fps_counter *fps_counter);
|
||||
decoder_init(struct decoder *decoder, struct video_buffer *vb);
|
||||
|
||||
bool
|
||||
decoder_open(struct decoder *decoder, const AVCodec *codec);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue