MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ff_decode_get_packet

Function ff_decode_get_packet

libavcodec/decode.c:251–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249}
250
251int ff_decode_get_packet(AVCodecContext *avctx, AVPacket *pkt)
252{
253 AVCodecInternal *avci = avctx->internal;
254 DecodeContext *dc = decode_ctx(avci);
255
256 if (avci->draining)
257 return AVERROR_EOF;
258
259 /* If we are a worker thread, get the next packet from the threading
260 * context. Otherwise we are the main (user-facing) context, so we get the
261 * next packet from the input filterchain.
262 */
263 if (avctx->internal->is_frame_mt)
264 return ff_thread_get_packet(avctx, pkt);
265
266 while (1) {
267 int ret = decode_get_packet(avctx, pkt);
268 if (ret == AVERROR(EAGAIN) &&
269 (!AVPACKET_IS_EMPTY(avci->buffer_pkt) || dc->draining_started)) {
270 ret = av_bsf_send_packet(avci->bsf, avci->buffer_pkt);
271 if (ret >= 0)
272 continue;
273
274 av_packet_unref(avci->buffer_pkt);
275 }
276
277 if (ret == AVERROR_EOF)
278 avci->draining = 1;
279 return ret;
280 }
281}
282
283/**
284 * Attempt to guess proper monotonic timestamps for decoded video frames

Callers 15

ff_thread_receive_frameFunction · 0.85
osq_receive_frameFunction · 0.85
libxevd_receive_frameFunction · 0.85
v4l2_receive_frameFunction · 0.85
amf_decode_frameFunction · 0.85
rkmpp_receive_frameFunction · 0.85
mediacodec_receive_frameFunction · 0.85
apv_receive_frameFunction · 0.85
av1_receive_frameFunction · 0.85
libjxl_receive_frameFunction · 0.85
ffmmal_receive_frameFunction · 0.85

Calls 5

decode_ctxFunction · 0.85
ff_thread_get_packetFunction · 0.85
decode_get_packetFunction · 0.85
av_bsf_send_packetFunction · 0.85
av_packet_unrefFunction · 0.85

Tested by

no test coverage detected