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

Function ff_thread_get_ext_buffer

libavcodec/pthread_frame.c:1052–1071  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1050}
1051
1052int ff_thread_get_ext_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
1053{
1054 int ret;
1055
1056 f->owner[0] = f->owner[1] = avctx;
1057 if (!(avctx->active_thread_type & FF_THREAD_FRAME))
1058 return ff_get_buffer(avctx, f->f, flags);
1059
1060 f->progress = av_refstruct_allocz(sizeof(*f->progress));
1061 if (!f->progress)
1062 return AVERROR(ENOMEM);
1063
1064 atomic_init(&f->progress->progress[0], -1);
1065 atomic_init(&f->progress->progress[1], -1);
1066
1067 ret = ff_thread_get_buffer(avctx, f->f, flags);
1068 if (ret)
1069 av_refstruct_unref(&f->progress);
1070 return ret;
1071}
1072
1073void ff_thread_release_ext_buffer(ThreadFrame *f)
1074{

Callers

nothing calls this directly

Calls 4

ff_get_bufferFunction · 0.85
av_refstruct_alloczFunction · 0.85
av_refstruct_unrefFunction · 0.85
ff_thread_get_bufferFunction · 0.70

Tested by

no test coverage detected