avformat: add an LCEVC stream group

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2024-08-20 13:56:48 -03:00
parent 5896318229
commit ba0ef0860f
6 changed files with 94 additions and 3 deletions

View file

@ -789,6 +789,33 @@ static void dump_stream_group(const AVFormatContext *ic, uint8_t *printed,
}
break;
}
case AV_STREAM_GROUP_PARAMS_LCEVC: {
const AVStreamGroupLCEVC *lcevc = stg->params.lcevc;
AVCodecContext *avctx = avcodec_alloc_context3(NULL);
const char *ptr = NULL;
av_log(NULL, AV_LOG_INFO, " LCEVC:");
if (avctx && stg->nb_streams && !avcodec_parameters_to_context(avctx, stg->streams[0]->codecpar)) {
avctx->width = lcevc->width;
avctx->height = lcevc->height;
avctx->coded_width = lcevc->width;
avctx->coded_height = lcevc->height;
if (ic->dump_separator)
av_opt_set(avctx, "dump_separator", ic->dump_separator, 0);
buf[0] = 0;
avcodec_string(buf, sizeof(buf), avctx, is_output);
ptr = av_stristr(buf, " ");
}
avcodec_free_context(&avctx);
if (ptr)
av_log(NULL, AV_LOG_INFO, "%s", ptr);
av_log(NULL, AV_LOG_INFO, "\n");
for (int i = 0; i < stg->nb_streams; i++) {
const AVStream *st = stg->streams[i];
dump_stream_format(ic, st->index, i, index, is_output, AV_LOG_VERBOSE);
printed[st->index] = 1;
}
break;
}
default:
break;
}