2022-02-02 18:27:41 +00:00
|
|
|
#ifndef SC_DECODER_H
|
|
|
|
#define SC_DECODER_H
|
2017-12-12 14:12:07 +00:00
|
|
|
|
2021-01-08 18:24:51 +00:00
|
|
|
#include "common.h"
|
|
|
|
|
2021-04-11 13:01:05 +00:00
|
|
|
#include "trait/packet_sink.h"
|
|
|
|
|
2019-03-02 22:52:22 +00:00
|
|
|
#include <stdbool.h>
|
2022-01-16 00:45:36 +00:00
|
|
|
#include <libavcodec/avcodec.h>
|
2019-03-02 15:43:43 +00:00
|
|
|
#include <libavformat/avformat.h>
|
2017-12-12 14:12:07 +00:00
|
|
|
|
2022-02-02 18:27:41 +00:00
|
|
|
#define SC_DECODER_MAX_SINKS 2
|
2017-12-12 14:12:07 +00:00
|
|
|
|
2022-02-02 18:27:41 +00:00
|
|
|
struct sc_decoder {
|
2021-04-11 13:01:05 +00:00
|
|
|
struct sc_packet_sink packet_sink; // packet sink trait
|
|
|
|
|
2022-02-02 18:27:41 +00:00
|
|
|
struct sc_frame_sink *sinks[SC_DECODER_MAX_SINKS];
|
2021-04-11 13:01:05 +00:00
|
|
|
unsigned sink_count;
|
2021-02-19 19:56:09 +00:00
|
|
|
|
2019-03-02 15:43:43 +00:00
|
|
|
AVCodecContext *codec_ctx;
|
2021-04-11 13:01:05 +00:00
|
|
|
AVFrame *frame;
|
2017-12-12 14:12:07 +00:00
|
|
|
};
|
|
|
|
|
2019-03-02 19:09:56 +00:00
|
|
|
void
|
2022-02-02 18:27:41 +00:00
|
|
|
sc_decoder_init(struct sc_decoder *decoder);
|
2019-03-02 15:43:43 +00:00
|
|
|
|
2019-03-02 19:09:56 +00:00
|
|
|
void
|
2022-02-02 18:27:41 +00:00
|
|
|
sc_decoder_add_sink(struct sc_decoder *decoder, struct sc_frame_sink *sink);
|
2019-03-02 19:09:56 +00:00
|
|
|
|
2017-12-12 14:12:07 +00:00
|
|
|
#endif
|