[FFmpeg-devel] Question about AVRtpPayloadTypes

Luca Abeni lucabe72
Fri Aug 10 15:04:42 CEST 2007


Hi all,

I have some doubts about the RTP/RTSP code in libavformat. I hope 
someone here can help me in understanding it...
While trying to implement proper support for mpeg1 and mpeg2 video in 
libavformat/rtp.c, I found some parts of the code that seem to be a 
little bit confusing.

First of all, it is not clear to me how AVRtpPayloadTypes is supposed to 
be used: some parts of the code seem to assume that 
AVRtpPayloadTypes[i].pt == i (for example, see 
rtp.c:rtp_get_codec_info()), while some other parts of the code do not 
make this assumption: for example, rtsp.c:sdp_parse_rtpmap() contains
/* search into AVRtpPayloadTypes[] */
for (i = 0; AVRtpPayloadTypes[i].pt >= 0; ++i)
     if (!strcmp(buf, AVRtpPayloadTypes[i].enc_name) && 
(codec->codec_type == AVRtpPayloadTypes[i].codec_type)){
         codec->codec_id = AVRtpPayloadTypes[i].codec_id;
          break;
     }

So, is rtp_get_codec_info() (and all the code doing 
"AVRtpPayloadTypes[payload_type]") broken, is sdp_parts_rtpmap() doing 
something useless, or am I missing something?


Also, I am confused by the above code in rtsp:sdp_parse_rtpmap()... If 
the payload type is known, and is < 96, why is the codec type searched 
based on enc_name? And, most important, is it possible to find an 
"a=rtpmap" line in the SDP if the payload type is < 96? I would think it 
is useless...


			Thanks,
				Luca




More information about the ffmpeg-devel mailing list