mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-02-17 20:04:27 +01:00
Now that screen implements the packet sink trait, make decoder push packets to the sinks without depending on the concrete sink types.
30 lines
515 B
C
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
|