Files
scrcpy/app/src/decoder.h
Romain Vimont 0da276ccba Make decoder push frames to sinks
Now that screen implements the packet sink trait, make decoder push
packets to the sinks without depending on the concrete sink types.
2021-04-18 17:21:26 +02:00

30 lines
515 B
C

#ifndef DECODER_H
#define DECODER_H
#include "common.h"
#include "trait/packet_sink.h"
#include <stdbool.h>
#include <libavformat/avformat.h>
#define DECODER_MAX_SINKS 1
struct decoder {
struct sc_packet_sink packet_sink; // packet sink trait
struct sc_frame_sink *sinks[DECODER_MAX_SINKS];
unsigned sink_count;
AVCodecContext *codec_ctx;
AVFrame *frame;
};
void
decoder_init(struct decoder *decoder);
void
decoder_add_sink(struct decoder *decoder, struct sc_frame_sink *sink);
#endif