scrcpy/app/src/decoder.h

28 lines
629 B
C
Raw Normal View History

2022-02-03 02:27:41 +08:00
#ifndef SC_DECODER_H
#define SC_DECODER_H
#include "common.h"
2023-03-02 16:37:36 +08:00
#include "trait/frame_source.h"
#include "trait/packet_sink.h"
#include <stdbool.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
2022-02-03 02:27:41 +08:00
struct sc_decoder {
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
const char *name; // must be statically allocated (e.g. a string literal)
AVCodecContext *ctx;
AVFrame *frame;
};
// The name must be statically allocated (e.g. a string literal)
void
sc_decoder_init(struct sc_decoder *decoder, const char *name);
#endif