/// Check if a given session description contains at least one H.264 or
/// a general MPEG4 video stream.
Check if a given session description contains at least one H.264 or
a general MPEG4 video stream.
Check if a given session description contains at least one H . 264 or a general MPEG4 video stream .
fn is_supported_rtsp_service(sdp: &[u8]) -> bool {
    if let Ok(sdp) = SessionDescription::parse(sdp) {
        let mut vcodecs   = HashSet::new();
        let video_streams = sdp.media_descriptions.into_iter()
            .filter(|md| md.media_type == MediaType::Video);
        for md in video_streams {
            for attr in md.attributes {
                if let Ok(rtpmap) = RTPMap::parse(&attr) {
                    vcodecs.insert(rtpmap.encoding.to_uppercase());
                }
            }
        }
        vcodecs.contains("H264") ||
            vcodecs.contains("H264-RCDO") ||
            vcodecs.contains("H264-SVC") ||
            vcodecs.contains("MP4V-ES") ||
            vcodecs.contains("MPEG4-GENERIC")
    } else {
        false
    }
}
fn is_supported_rtsp_service ( sdp : & [ u8 ] ) -> bool { if let Ok ( sdp ) = SessionDescription :: parse ( sdp ) { let mut vcodecs = HashSet :: new ( ) ; let video_streams = sdp . media_descriptions . into_iter ( ) . filter ( | md | md . media_type == MediaType :: Video ) ; for md in video_streams { for attr in md . attributes { if let Ok ( rtpmap ) = RTPMap :: parse ( & attr ) { vcodecs . insert ( rtpmap . encoding . to_uppercase ( ) ) ; } } } vcodecs . contains ( " " ) || vcodecs . contains ( " " ) || vcodecs . contains ( " " ) || vcodecs . contains ( " " ) || vcodecs . contains ( " " ) } else { false } }
Check if a given session description contains at least one H.264 or
a general MPEG4 video stream.
Check if a given session description contains at least one H . 264 or a general MPEG4 video stream .
sdp
&[u8]