Attached is a small patch-in-concept to provide access to extension headers received in RTP streams by passing the header as AVPacket side data. My specific use case is accessing metadata embedded in streams from Parrot hardware [1]. Is this functionality something you would be interested in landing? If so, could you provide some architectural guidance on where to flesh it out - is AV_PKT_DATA_NEW_EXTRADATA appropriate, or define another? Any other places this needs to be handled?
Sincerely, John Laxson [1] https://developer.parrot.com/docs/pdraw/metadata.html Signed-off-by: John Laxson <jlax...@mac.com> --- libavformat/rtpdec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c index 3d5b200099..03d767a1a3 100644 --- a/libavformat/rtpdec.c +++ b/libavformat/rtpdec.c @@ -681,6 +681,11 @@ static int rtp_parse_packet_internal(RTPDemuxContext *s, AVPacket *pkt, if (len < ext) return -1; + + void *side_buf = av_malloc(ext); + memcpy(side_buf, buf, ext); + av_packet_add_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, side_buf, ext); + // skip past RTP header extension len -= ext; buf += ext; -- 2.22.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".