mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
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.
This commit is contained in:
parent
b7cdbce8e5
commit
6795564044
3 changed files with 69 additions and 14 deletions
|
|
@ -8,24 +8,22 @@
|
|||
#include <stdbool.h>
|
||||
#include <libavformat/avformat.h>
|
||||
|
||||
struct video_buffer;
|
||||
#define DECODER_MAX_SINKS 1
|
||||
|
||||
struct decoder {
|
||||
struct sc_packet_sink packet_sink; // packet sink trait
|
||||
|
||||
struct video_buffer *video_buffer;
|
||||
struct sc_frame_sink *sinks[DECODER_MAX_SINKS];
|
||||
unsigned sink_count;
|
||||
|
||||
AVCodecContext *codec_ctx;
|
||||
AVFrame *frame;
|
||||
};
|
||||
|
||||
void
|
||||
decoder_init(struct decoder *decoder, struct video_buffer *vb);
|
||||
|
||||
bool
|
||||
decoder_open(struct decoder *decoder, const AVCodec *codec);
|
||||
decoder_init(struct decoder *decoder);
|
||||
|
||||
void
|
||||
decoder_close(struct decoder *decoder);
|
||||
decoder_add_sink(struct decoder *decoder, struct sc_frame_sink *sink);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue