2021-10-03 23:13:12 +08:00
|
|
|
#ifndef SC_FRAME_SINK_H
|
|
|
|
#define SC_FRAME_SINK_H
|
2021-04-11 21:39:00 +08:00
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stdbool.h>
|
2023-02-25 23:19:58 +08:00
|
|
|
#include <libavcodec/avcodec.h>
|
2021-04-11 21:39:00 +08:00
|
|
|
|
|
|
|
typedef struct AVFrame AVFrame;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Frame sink trait.
|
|
|
|
*
|
|
|
|
* Component able to receive AVFrames should implement this trait.
|
|
|
|
*/
|
|
|
|
struct sc_frame_sink {
|
|
|
|
const struct sc_frame_sink_ops *ops;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct sc_frame_sink_ops {
|
2023-02-25 23:19:58 +08:00
|
|
|
bool (*open)(struct sc_frame_sink *sink, const AVCodecContext *ctx);
|
2021-04-11 21:39:00 +08:00
|
|
|
void (*close)(struct sc_frame_sink *sink);
|
|
|
|
bool (*push)(struct sc_frame_sink *sink, const AVFrame *frame);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|