Finding a Media Format in an SDP Session Structure
sdp_attr_t *sdp_find_media_rtpmap(sdp_media_t *media, const char *format);
The sdp_find_media_rtpmap
()
function searches the
attribute list of the media structure that is specified by the media
parameter
for the format entry that is specified by the format
parameter.
For more information, see the
sdp_find_media_rtpmap
(3COMMPUTIL) man page.
Example 2-4 Using sdp_find_media_rtpmap
()
The incomplete SDP description in this example has two sections, an audio section and a video section.
m=audio 49170 RTP/AVP 0 8 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 m=video 51372 RTP/AVP 31 32 a=rtpmap:31 H261/90000 a=rtpmap:32 MPV/90000 /* * Assuming that above description is parsed using sdp_parse() and that * the parsed structure is in "session" sdp_session_t structure. */ sdp_media_t *video; sdp_attr_t *mpv; video = sdp_find_media(session->s_media, "video); mpv = sdp_find_media_rtpmap(video, "32"); /* * Now the attribute structure sdp_attr_t, mpv will be having * values from the attribute field "a=rtpmap:32 MPV/90000" */