scrcpy/app/src/decoder.h

31 lines
574 B
C
Raw Normal View History

2022-02-02 18:27:41 +00:00
#ifndef SC_DECODER_H
#define SC_DECODER_H
#include "common.h"
#include "trait/packet_sink.h"
#include <stdbool.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
2022-02-02 18:27:41 +00:00
#define SC_DECODER_MAX_SINKS 2
2022-02-02 18:27:41 +00:00
struct sc_decoder {
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];
unsigned sink_count;
AVCodecContext *codec_ctx;
AVFrame *frame;
};
void
2022-02-02 18:27:41 +00:00
sc_decoder_init(struct sc_decoder *decoder);
void
2022-02-02 18:27:41 +00:00
sc_decoder_add_sink(struct sc_decoder *decoder, struct sc_frame_sink *sink);
#endif