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

Function ff_decode_frame_props_from_pkt

libavcodec/decode.c:1531–1571  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1529}
1530
1531int ff_decode_frame_props_from_pkt(const AVCodecContext *avctx,
1532 AVFrame *frame, const AVPacket *pkt)
1533{
1534 static const SideDataMap sd[] = {
1535 { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC },
1536 { AV_PKT_DATA_AFD, AV_FRAME_DATA_AFD },
1537 { AV_PKT_DATA_DYNAMIC_HDR10_PLUS, AV_FRAME_DATA_DYNAMIC_HDR_PLUS },
1538 { AV_PKT_DATA_S12M_TIMECODE, AV_FRAME_DATA_S12M_TIMECODE },
1539 { AV_PKT_DATA_SKIP_SAMPLES, AV_FRAME_DATA_SKIP_SAMPLES },
1540 { AV_PKT_DATA_LCEVC, AV_FRAME_DATA_LCEVC },
1541 { AV_PKT_DATA_NB }
1542 };
1543
1544 int ret = 0;
1545
1546 frame->pts = pkt->pts;
1547 frame->duration = pkt->duration;
1548
1549 ret = side_data_map(frame, pkt->side_data, pkt->side_data_elems, ff_sd_global_map);
1550 if (ret < 0)
1551 return ret;
1552
1553 ret = side_data_map(frame, pkt->side_data, pkt->side_data_elems, sd);
1554 if (ret < 0)
1555 return ret;
1556
1557 add_metadata_from_side_data(pkt, frame);
1558
1559 if (pkt->flags & AV_PKT_FLAG_DISCARD) {
1560 frame->flags |= AV_FRAME_FLAG_DISCARD;
1561 }
1562
1563 if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) {
1564 int ret = av_buffer_replace(&frame->opaque_ref, pkt->opaque_ref);
1565 if (ret < 0)
1566 return ret;
1567 frame->opaque = pkt->opaque;
1568 }
1569
1570 return 0;
1571}
1572
1573int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
1574{

Callers 3

libxevd_return_frameFunction · 0.85
libdav1d.cFile · 0.85
ff_decode_frame_propsFunction · 0.85

Calls 3

side_data_mapFunction · 0.85
av_buffer_replaceFunction · 0.85

Tested by

no test coverage detected