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 5d9e96dc4e
commit 2ddf760c09
6 changed files with 77 additions and 60 deletions

View File

@@ -36,6 +36,8 @@ struct screen {
bool fullscreen;
bool maximized;
bool mipmaps;
AVFrame *frame;
};
struct screen_params {