1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00

fftools/thread_queue: switch from AVFifo+ObjPool to AVContainerFifo

The queue needs to track each frame/packet's stream index, this is
achieved by maintaining a parallel AVFifo instance for that purpose.
This is simpler than implementing custom AVContainerFifo callbacks.
This commit is contained in:
Anton Khirnov
2024-12-11 11:02:37 +01:00
parent 2ac34d0854
commit 8e0cceffa0
4 changed files with 42 additions and 63 deletions

View File

@@ -375,7 +375,6 @@ static int queue_alloc(ThreadQueue **ptq, unsigned nb_streams, unsigned queue_si
enum QueueType type)
{
ThreadQueue *tq;
ObjPool *op;
if (queue_size <= 0) {
if (type == QUEUE_FRAMES)
@@ -393,18 +392,11 @@ static int queue_alloc(ThreadQueue **ptq, unsigned nb_streams, unsigned queue_si
av_assert0(queue_size == DEFAULT_FRAME_THREAD_QUEUE_SIZE);
}
op = (type == QUEUE_PACKETS) ? objpool_alloc_packets() :
objpool_alloc_frames();
if (!op)
tq = tq_alloc(nb_streams, queue_size,
(type == QUEUE_PACKETS) ? THREAD_QUEUE_PACKETS : THREAD_QUEUE_FRAMES);
if (!tq)
return AVERROR(ENOMEM);
tq = tq_alloc(nb_streams, queue_size, op,
(type == QUEUE_PACKETS) ? pkt_move : frame_move);
if (!tq) {
objpool_free(&op);
return AVERROR(ENOMEM);
}
*ptq = tq;
return 0;
}