fn find_rtsp_path(
    mac: MacAddr,
    addr: SocketAddr,
    paths: &[String]) -> Result<Service> {
    let mut service = Service::UnknownRTSP(mac, addr);

    for path in paths {
        let status = try!(get_rtsp_describe_status(addr, path));
        if status == DescribeStatus::Ok {
            service = Service::RTSP(mac, addr, path.to_string());
        } else if status == DescribeStatus::Unsupported {
            service = Service::UnsupportedRTSP(mac, addr, path.to_string());
        } else if status == DescribeStatus::Locked {
            service = Service::LockedRTSP(mac, addr);
        }

        match status {
            DescribeStatus::Ok     => break,
            DescribeStatus::Locked => break,
            _ => ()
        }
    }

    Ok(service)
}
/// Find the first available RTSP path for a given RTSP service.
Find the first available RTSP path for a given RTSP service.
Find the first available RTSP path for a given RTSP service .
fn find_rtsp_path(
    mac: MacAddr,
    addr: SocketAddr,
    paths: &[String]) -> Result<Service> {
    let mut service = Service::UnknownRTSP(mac, addr);
    for path in paths {
        let status = try!(get_rtsp_describe_status(addr, path));
        if status == DescribeStatus::Ok {
            service = Service::RTSP(mac, addr, path.to_string());
        } else if status == DescribeStatus::Unsupported {
            service = Service::UnsupportedRTSP(mac, addr, path.to_string());
        } else if status == DescribeStatus::Locked {
            service = Service::LockedRTSP(mac, addr);
        }
        match status {
            DescribeStatus::Ok     => break,
            DescribeStatus::Locked => break,
            _ => ()
        }
    }
    Ok(service)
}
fn find_rtsp_path ( mac : MacAddr , addr : SocketAddr , paths : & [ String ] ) -> Result < Service > { let mut service = Service :: UnknownRTSP ( mac , addr ) ; for path in paths { let status = try ! ( get_rtsp_describe_status ( addr path ) ) ; if status == DescribeStatus :: Ok { service = Service :: RTSP ( mac , addr , path . to_string ( ) ) ; } else if status == DescribeStatus :: Unsupported { service = Service :: UnsupportedRTSP ( mac , addr , path . to_string ( ) ) ; } else if status == DescribeStatus :: Locked { service = Service :: LockedRTSP ( mac , addr ) ; } match status { DescribeStatus :: Ok => break , DescribeStatus :: Locked => break , _ => ( ) } } Ok ( service ) }
Find the first available RTSP path for a given RTSP service.
Find the first available RTSP path for a given RTSP service .
mac
MacAddr
addr
SocketAddr
paths
&[String]
mac
MacAddr
addr
SocketAddr
paths
&[String]