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

Function side_data_map

libavcodec/decode.c:1473–1517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1471}
1472
1473static int side_data_map(AVFrame *dst,
1474 const AVPacketSideData *sd_src, int nb_sd_src,
1475 const SideDataMap *map)
1476
1477{
1478 for (int i = 0; map[i].packet < AV_PKT_DATA_NB; i++) {
1479 const enum AVPacketSideDataType type_pkt = map[i].packet;
1480 const enum AVFrameSideDataType type_frame = map[i].frame;
1481 const AVPacketSideData *sd_pkt;
1482 AVFrameSideData *sd_frame;
1483
1484 sd_pkt = packet_side_data_get(sd_src, nb_sd_src, type_pkt);
1485 if (!sd_pkt)
1486 continue;
1487
1488 sd_frame = av_frame_get_side_data(dst, type_frame);
1489 if (sd_frame) {
1490 if (type_frame == AV_FRAME_DATA_STEREO3D) {
1491 int ret = side_data_stereo3d_merge(sd_frame, sd_pkt);
1492 if (ret < 0)
1493 return ret;
1494 }
1495
1496 continue;
1497 }
1498
1499 switch (type_pkt) {
1500 case AV_PKT_DATA_EXIF: {
1501 int ret = side_data_exif_parse(dst, sd_pkt);
1502 if (ret < 0)
1503 return ret;
1504 break;
1505 }
1506 default:
1507 sd_frame = av_frame_new_side_data(dst, type_frame, sd_pkt->size);
1508 if (!sd_frame)
1509 return AVERROR(ENOMEM);
1510
1511 memcpy(sd_frame->data, sd_pkt->data, sd_pkt->size);
1512 break;
1513 }
1514 }
1515
1516 return 0;
1517}
1518
1519static int add_metadata_from_side_data(const AVPacket *avpkt, AVFrame *frame)
1520{

Callers 2

ff_decode_frame_propsFunction · 0.85

Calls 5

packet_side_data_getFunction · 0.85
av_frame_get_side_dataFunction · 0.85
side_data_stereo3d_mergeFunction · 0.85
side_data_exif_parseFunction · 0.85
av_frame_new_side_dataFunction · 0.85

Tested by

no test coverage detected