2017-12-12 15:12:07 +01:00
|
|
|
#ifndef DECODER_H
|
|
|
|
#define DECODER_H
|
|
|
|
|
2021-01-08 19:24:51 +01:00
|
|
|
#include "common.h"
|
|
|
|
|
2021-04-11 15:01:05 +02:00
|
|
|
#include "trait/packet_sink.h"
|
|
|
|
|
2019-03-02 23:52:22 +01:00
|
|
|
#include <stdbool.h>
|
2019-03-02 16:43:43 +01:00
|
|
|
#include <libavformat/avformat.h>
|
2017-12-12 15:12:07 +01:00
|
|
|
|
2021-04-04 00:10:44 +02:00
|
|
|
#define DECODER_MAX_SINKS 2
|
2017-12-12 15:12:07 +01:00
|
|
|
|
|
|
|
struct decoder {
|
2021-04-11 15:01:05 +02:00
|
|
|
struct sc_packet_sink packet_sink; // packet sink trait
|
|
|
|
|
2021-04-11 15:01:05 +02:00
|
|
|
struct sc_frame_sink *sinks[DECODER_MAX_SINKS];
|
|
|
|
unsigned sink_count;
|
2021-02-19 20:56:09 +01:00
|
|
|
|
2019-03-02 16:43:43 +01:00
|
|
|
AVCodecContext *codec_ctx;
|
2021-04-11 15:01:05 +02:00
|
|
|
AVFrame *frame;
|
2017-12-12 15:12:07 +01:00
|
|
|
};
|
|
|
|
|
2019-03-02 20:09:56 +01:00
|
|
|
void
|
2021-04-11 15:01:05 +02:00
|
|
|
decoder_init(struct decoder *decoder);
|
2019-03-02 16:43:43 +01:00
|
|
|
|
2019-03-02 20:09:56 +01:00
|
|
|
void
|
2021-04-11 15:01:05 +02:00
|
|
|
decoder_add_sink(struct decoder *decoder, struct sc_frame_sink *sink);
|
2019-03-02 20:09:56 +01:00
|
|
|
|
2017-12-12 15:12:07 +01:00
|
|
|
#endif
|