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

Function avformat_stream_group_create

libavformat/options.c:438–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

436}
437
438AVStreamGroup *avformat_stream_group_create(AVFormatContext *s,
439 enum AVStreamGroupParamsType type,
440 AVDictionary **options)
441{
442 AVStreamGroup **stream_groups;
443 AVStreamGroup *stg;
444 FFStreamGroup *stgi;
445
446 stream_groups = av_realloc_array(s->stream_groups, s->nb_stream_groups + 1,
447 sizeof(*stream_groups));
448 if (!stream_groups)
449 return NULL;
450 s->stream_groups = stream_groups;
451
452 stgi = av_mallocz(sizeof(*stgi));
453 if (!stgi)
454 return NULL;
455 stg = &stgi->pub;
456
457 stg->av_class = &stream_group_class;
458 av_opt_set_defaults(stg);
459 stg->type = type;
460 switch (type) {
461 case AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT:
462 stg->params.iamf_audio_element = av_iamf_audio_element_alloc();
463 if (!stg->params.iamf_audio_element)
464 goto fail;
465 break;
466 case AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION:
467 stg->params.iamf_mix_presentation = av_iamf_mix_presentation_alloc();
468 if (!stg->params.iamf_mix_presentation)
469 goto fail;
470 break;
471 case AV_STREAM_GROUP_PARAMS_TILE_GRID:
472 stg->params.tile_grid = av_mallocz(sizeof(*stg->params.tile_grid));
473 if (!stg->params.tile_grid)
474 goto fail;
475 stg->params.tile_grid->av_class = &tile_grid_class;
476 av_opt_set_defaults(stg->params.tile_grid);
477 break;
478 case AV_STREAM_GROUP_PARAMS_LCEVC:
479 stg->params.lcevc = av_mallocz(sizeof(*stg->params.lcevc));
480 if (!stg->params.lcevc)
481 goto fail;
482 stg->params.lcevc->av_class = &lcevc_class;
483 av_opt_set_defaults(stg->params.lcevc);
484 break;
485 default:
486 goto fail;
487 }
488
489 if (options) {
490 if (av_opt_set_dict2(stg, options, AV_OPT_SEARCH_CHILDREN))
491 goto fail;
492 }
493
494 stgi->fmtctx = s;
495 stg->index = s->nb_stream_groups;

Callers 6

mov_read_iacbFunction · 0.85
mov_parse_tilesFunction · 0.85
mov_parse_lcevc_streamsFunction · 0.85
iamf_read_headerFunction · 0.85
of_parse_group_tokenFunction · 0.85

Calls 7

av_realloc_arrayFunction · 0.85
av_opt_set_defaultsFunction · 0.85
av_opt_set_dict2Function · 0.85
ff_free_stream_groupFunction · 0.85
av_malloczFunction · 0.50

Tested by

no test coverage detected