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

Function ff_lcevc_parse_frame

libavcodec/lcevcdec.c:333–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333int ff_lcevc_parse_frame(FFLCEVCContext *lcevc, const AVFrame *frame,
334 int *width, int *height, void *logctx)
335{
336 LCEVCRawProcessBlock *block = NULL;
337 LCEVCRawGlobalConfig *gc = NULL;
338 AVFrameSideData *sd = av_frame_get_side_data(frame, AV_FRAME_DATA_LCEVC);
339 int ret;
340
341 ret = ff_cbs_read(lcevc->cbc, lcevc->frag, sd->buf, sd->data, sd->size);
342 if (ret < 0) {
343 av_log(logctx, AV_LOG_ERROR, "Failed to parse Access Unit.\n");
344 goto end;
345 }
346
347 ret = ff_cbs_lcevc_find_process_block(lcevc->cbc, lcevc->frag,
348 LCEVC_PAYLOAD_TYPE_GLOBAL_CONFIG, &block);
349 if (ret < 0) {
350 ret = 0;
351 goto end;
352 }
353
354 gc = block->payload;
355 if (gc->resolution_type < 63) {
356 *width = ff_lcevc_resolution_type[gc->resolution_type].width;
357 *height = ff_lcevc_resolution_type[gc->resolution_type].height;
358 } else {
359 *width = gc->custom_resolution_width;
360 *height = gc->custom_resolution_height;
361 }
362
363 ret = 0;
364end:
365 ff_cbs_fragment_reset(lcevc->frag);
366
367 return ret;
368}
369
370static const CodedBitstreamUnitType decompose_unit_types[] = {
371 LCEVC_IDR_NUT,

Callers 1

update_frame_propsFunction · 0.85

Calls 3

av_frame_get_side_dataFunction · 0.85
av_logFunction · 0.85

Tested by

no test coverage detected