2022-02-03 02:27:41 +08:00
|
|
|
#ifndef SC_DECODER_H
|
|
|
|
#define SC_DECODER_H
|
2017-12-12 22:12:07 +08:00
|
|
|
|
2021-01-09 02:24:51 +08:00
|
|
|
#include "common.h"
|
|
|
|
|
2023-03-02 16:37:36 +08:00
|
|
|
#include "trait/frame_source.h"
|
2021-04-11 21:01:05 +08:00
|
|
|
#include "trait/packet_sink.h"
|
|
|
|
|
2019-03-03 06:52:22 +08:00
|
|
|
#include <stdbool.h>
|
2022-01-16 08:45:36 +08:00
|
|
|
#include <libavcodec/avcodec.h>
|
2019-03-02 23:43:43 +08:00
|
|
|
#include <libavformat/avformat.h>
|
2017-12-12 22:12:07 +08:00
|
|
|
|
2022-02-03 02:27:41 +08:00
|
|
|
struct sc_decoder {
|
2021-04-11 21:01:05 +08:00
|
|
|
struct sc_packet_sink packet_sink; // packet sink trait
|
2023-03-02 16:37:36 +08:00
|
|
|
struct sc_frame_source frame_source; // frame source trait
|
2021-04-11 21:01:05 +08:00
|
|
|
|
2023-02-25 04:22:35 +08:00
|
|
|
const char *name; // must be statically allocated (e.g. a string literal)
|
|
|
|
|
2023-03-11 02:25:45 +08:00
|
|
|
AVCodecContext *ctx;
|
2021-04-11 21:01:05 +08:00
|
|
|
AVFrame *frame;
|
2017-12-12 22:12:07 +08:00
|
|
|
};
|
|
|
|
|
2023-02-25 04:22:35 +08:00
|
|
|
// The name must be statically allocated (e.g. a string literal)
|
2019-03-03 03:09:56 +08:00
|
|
|
void
|
2023-02-25 04:22:35 +08:00
|
|
|
sc_decoder_init(struct sc_decoder *decoder, const char *name);
|
2019-03-02 23:43:43 +08:00
|
|
|
|
2017-12-12 22:12:07 +08:00
|
|
|
#endif
|