Expose decoder as packet sink

Make decoder implement the packet sink trait.

This will allow the stream to push packets without depending on the
concrete sink type.
This commit is contained in:
Romain Vimont
2021-04-11 15:01:05 +02:00
parent 5beb7d6c02
commit cbed38799e
2 changed files with 33 additions and 0 deletions

View File

@@ -3,12 +3,16 @@
#include "common.h"
#include "trait/packet_sink.h"
#include <stdbool.h>
#include <libavformat/avformat.h>
struct video_buffer;
struct decoder {
struct sc_packet_sink packet_sink; // packet sink trait
struct video_buffer *video_buffer;
AVCodecContext *codec_ctx;