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

Function queue_alloc

fftools/ffmpeg_sched.c:372–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372static int queue_alloc(ThreadQueue **ptq, unsigned nb_streams, unsigned queue_size,
373 enum QueueType type)
374{
375 ThreadQueue *tq;
376
377 if (queue_size <= 0) {
378 if (type == QUEUE_FRAMES)
379 queue_size = DEFAULT_FRAME_THREAD_QUEUE_SIZE;
380 else
381 queue_size = DEFAULT_PACKET_THREAD_QUEUE_SIZE;
382 }
383
384 if (type == QUEUE_FRAMES) {
385 // This queue length is used in the decoder code to ensure that
386 // there are enough entries in fixed-size frame pools to account
387 // for frames held in queues inside the ffmpeg utility. If this
388 // can ever dynamically change then the corresponding decode
389 // code needs to be updated as well.
390 av_assert0(queue_size <= DEFAULT_FRAME_THREAD_QUEUE_SIZE);
391 }
392
393 tq = tq_alloc(nb_streams, queue_size,
394 (type == QUEUE_PACKETS) ? THREAD_QUEUE_PACKETS : THREAD_QUEUE_FRAMES);
395 if (!tq)
396 return AVERROR(ENOMEM);
397
398 *ptq = tq;
399 return 0;
400}
401
402static void *task_wrapper(void *arg);
403

Callers 4

sch_add_decFunction · 0.85
sch_add_encFunction · 0.85
sch_add_filtergraphFunction · 0.85
start_prepareFunction · 0.85

Calls 1

tq_allocFunction · 0.85

Tested by

no test coverage detected