Make video_buffer more generic

The video buffer took ownership of the producer frame (so that it could
swap frames quickly).

In order to support multiple sinks plugged to the decoder, the decoded
frame must not be consumed by the display video buffer.

Therefore, move the producer and consumer frames out of the video
buffer, and use FFmpeg AVFrame refcounting to share ownership while
avoiding copies.
This commit is contained in:
Romain Vimont 2021-04-11 15:01:05 +02:00
parent e1b2824730
commit f43d66d5d6
6 changed files with 77 additions and 60 deletions

View file

@ -12,6 +12,7 @@ struct decoder {
struct video_buffer *video_buffer;
AVCodecContext *codec_ctx;
AVFrame *frame;
};
void