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

Function ff_decklink_packet_queue_get

libavdevice/decklink_common.cpp:468–490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

466}
467
468int ff_decklink_packet_queue_get(DecklinkPacketQueue *q, AVPacket *pkt, int block)
469{
470 int ret;
471
472 pthread_mutex_lock(&q->mutex);
473
474 for (;; ) {
475 ret = avpriv_packet_list_get(&q->pkt_list, pkt);
476 if (ret == 0) {
477 q->nb_packets--;
478 q->size -= pkt->size + sizeof(AVPacket);
479 ret = 1;
480 break;
481 } else if (!block) {
482 ret = 0;
483 break;
484 } else {
485 pthread_cond_wait(&q->cond, &q->mutex);
486 }
487 }
488 pthread_mutex_unlock(&q->mutex);
489 return ret;
490}
491
492int64_t ff_decklink_packet_queue_peekpts(DecklinkPacketQueue *q)
493{

Callers 2

ff_decklink_read_packetFunction · 0.85
decklink_construct_vancFunction · 0.85

Calls 4

avpriv_packet_list_getFunction · 0.85
pthread_mutex_lockFunction · 0.50
pthread_cond_waitFunction · 0.50
pthread_mutex_unlockFunction · 0.50

Tested by

no test coverage detected