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

Function ff_lcevc_alloc

libavcodec/lcevcdec.c:374–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372};
373
374int ff_lcevc_alloc(FFLCEVCContext **plcevc, void *logctx)
375{
376 FFLCEVCContext *lcevc = NULL;
377 int ret;
378
379 lcevc = av_refstruct_alloc_ext(sizeof(*lcevc), 0, NULL, lcevc_free);
380 if (!lcevc)
381 return AVERROR(ENOMEM);
382
383 lcevc->frag = av_mallocz(sizeof(*lcevc->frag));
384 if (!lcevc->frag) {
385 ret = AVERROR(ENOMEM);
386 goto fail;
387 }
388
389 ret = ff_cbs_init(&lcevc->cbc, AV_CODEC_ID_LCEVC, logctx);
390 if (ret < 0)
391 goto fail;
392
393 lcevc->cbc->decompose_unit_types = decompose_unit_types;
394 lcevc->cbc->nb_decompose_unit_types = FF_ARRAY_ELEMS(decompose_unit_types);
395
396 *plcevc = lcevc;
397 return 0;
398fail:
399 av_refstruct_unref(&lcevc);
400 return ret;
401}
402
403void ff_lcevc_unref(void *opaque)
404{

Callers 1

ff_decode_preinitFunction · 0.85

Calls 3

av_refstruct_alloc_extFunction · 0.85
av_refstruct_unrefFunction · 0.85
av_malloczFunction · 0.50

Tested by

no test coverage detected