mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-18 05:54:20 +01:00
Make stream push packets to sinks
Now that decoder and recorder implement the packet sink trait, make stream push packets to the sinks without depending on the concrete sink types.
This commit is contained in:
@@ -41,8 +41,14 @@ decoder_close(struct decoder *decoder) {
|
||||
avcodec_free_context(&decoder->codec_ctx);
|
||||
}
|
||||
|
||||
bool
|
||||
static bool
|
||||
decoder_push(struct decoder *decoder, const AVPacket *packet) {
|
||||
bool is_config = packet->pts == AV_NOPTS_VALUE;
|
||||
if (is_config) {
|
||||
// nothing to do
|
||||
return true;
|
||||
}
|
||||
|
||||
int ret;
|
||||
if ((ret = avcodec_send_packet(decoder->codec_ctx, packet)) < 0) {
|
||||
LOGE("Could not send video packet: %d", ret);
|
||||
|
||||
Reference in New Issue
Block a user