mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Make video buffer more generic
Video buffer is a tool between a frame producer and a frame consumer. For now, it is used between a decoder and a renderer, but in the future another instance might be used to swscale decoded frames.
This commit is contained in:
parent
c9d4755bf9
commit
72df2c23f9
4 changed files with 54 additions and 55 deletions
|
|
@ -15,8 +15,8 @@
|
|||
static void
|
||||
push_frame(struct decoder *decoder) {
|
||||
bool previous_frame_skipped;
|
||||
video_buffer_offer_decoded_frame(decoder->video_buffer,
|
||||
&previous_frame_skipped);
|
||||
video_buffer_producer_offer_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
|
||||
|
|
@ -69,7 +69,7 @@ decoder_push(struct decoder *decoder, const AVPacket *packet) {
|
|||
return false;
|
||||
}
|
||||
ret = avcodec_receive_frame(decoder->codec_ctx,
|
||||
decoder->video_buffer->decoding_frame);
|
||||
decoder->video_buffer->producer_frame);
|
||||
if (!ret) {
|
||||
// a frame was received
|
||||
push_frame(decoder);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue