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

Function thread_get_buffer_internal

libavcodec/pthread_frame.c:1021–1042  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1019}
1020
1021static int thread_get_buffer_internal(AVCodecContext *avctx, AVFrame *f, int flags)
1022{
1023 PerThreadContext *p;
1024 int err;
1025
1026 if (!(avctx->active_thread_type & FF_THREAD_FRAME))
1027 return ff_get_buffer(avctx, f, flags);
1028
1029 p = avctx->internal->thread_ctx;
1030 if (atomic_load(&p->state) != STATE_SETTING_UP &&
1031 ffcodec(avctx->codec)->update_thread_context) {
1032 av_log(avctx, AV_LOG_ERROR, "get_buffer() cannot be called after ff_thread_finish_setup()\n");
1033 return -1;
1034 }
1035
1036 pthread_mutex_lock(&p->parent->buffer_mutex);
1037 err = ff_get_buffer(avctx, f, flags);
1038
1039 pthread_mutex_unlock(&p->parent->buffer_mutex);
1040
1041 return err;
1042}
1043
1044int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f, int flags)
1045{

Callers 1

ff_thread_get_bufferFunction · 0.85

Calls 5

ff_get_bufferFunction · 0.85
ffcodecFunction · 0.85
av_logFunction · 0.85
pthread_mutex_lockFunction · 0.50
pthread_mutex_unlockFunction · 0.50

Tested by

no test coverage detected