mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-01-06 07:14:32 +01:00
Now that decoder and recorder implement the packet sink trait, make stream push packets to the sinks without depending on the concrete sink types.
32 lines
531 B
C
32 lines
531 B
C
#ifndef DECODER_H
|
|
#define DECODER_H
|
|
|
|
#include "common.h"
|
|
|
|
#include "trait/packet_sink.h"
|
|
|
|
#include <stdbool.h>
|
|
#include <libavformat/avformat.h>
|
|
|
|
struct video_buffer;
|
|
|
|
struct decoder {
|
|
struct sc_packet_sink packet_sink; // packet sink trait
|
|
|
|
struct video_buffer *video_buffer;
|
|
|
|
AVCodecContext *codec_ctx;
|
|
AVFrame *frame;
|
|
};
|
|
|
|
void
|
|
decoder_init(struct decoder *decoder, struct video_buffer *vb);
|
|
|
|
bool
|
|
decoder_open(struct decoder *decoder, const AVCodec *codec);
|
|
|
|
void
|
|
decoder_close(struct decoder *decoder);
|
|
|
|
#endif
|