avcodec: allow bypassing frame threading with an optional flag

Normally, this function tries to make sure all threads are saturated with
work to do before returning any frames; and will continue requesting packets
until that is the case.

However, this significantly slows down initial decoding latency when only
requesting a single frame (to e.g. configure the filter graph), and also
wastes a lot of unnecessary memory in the event that the user does not intend
to decode more frames until later.

By introducing a new `flags` paramater and a new flag
`AV_CODEC_RECEIVE_FRAME_FLAG_SYNCHRONOUS` to go along with it, we can allow
users to temporarily bypass this logic.
This commit is contained in:
Niklas Haas
2025-12-05 19:41:36 +01:00
parent 077864dfd6
commit 5e56937b74
7 changed files with 44 additions and 12 deletions
+4
View File
@@ -2,6 +2,10 @@ The last version increases of all libraries were on 2025-03-28
API changes, most recent first:
2025-12-xx - xxxxxxxxxx - lavc 62.22.100 - avcodec.h
Add avcodec_receive_frame2().
Add AV_CODEC_RECEIVE_FRAME_FLAG_SYNCHRONOUS.
2025-09-xx - xxxxxxxxxx - lavfi 11.10.100 - buffersrc.h
Add av_buffersrc_get_status().