avviddec: Support draining for some decoders
Submitted by Yeongjin Jeong
Link to original bug (#796042)
Description
Created attachment 371951
avviddec: Support draining for some decoders
Some decoders (those marked with AV_CODEC_CAP_DELAY) have a delay between input and output.
It means that for some packets they will not immediately produce decoded output and need to be flushed at the end of decoding to get all the decoded data.
However, even if AV_CODEC_CAP_DELAY is not set, there are decoders that need to be flushed if they work on multi-threads.
I experienced that the frame is not drained when I using the ffmpeg native PNG decoder.
e.g.
gst-launch-1.0 filesrc location="png file location" ! pngparse ! avdec_png ! autovideoconvert
gst-play-1.0 "png file location"
Note.)
If you use ffmpeg native PNG decoder and set the thread_count to 1 in codecCtx, decoding will be done without draining. So you must be set thread_count more than 1 to test.
Patch 371951, "avviddec: Support draining for some decoders":
0001-avviddec-Support-draining-for-some-decoders.patch
Version: 1.14.0