619730edaf
Frame consumers may need details about the frame format. PR #3757 <https://github.com/Genymobile/scrcpy/pull/3757>
27 lines
570 B
C
27 lines
570 B
C
#ifndef SC_FRAME_SINK_H
|
|
#define SC_FRAME_SINK_H
|
|
|
|
#include "common.h"
|
|
|
|
#include <assert.h>
|
|
#include <stdbool.h>
|
|
#include <libavcodec/avcodec.h>
|
|
|
|
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 {
|
|
bool (*open)(struct sc_frame_sink *sink, const AVCodecContext *ctx);
|
|
void (*close)(struct sc_frame_sink *sink);
|
|
bool (*push)(struct sc_frame_sink *sink, const AVFrame *frame);
|
|
};
|
|
|
|
#endif
|