#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum RtspTransport {
#[default]
Tcp,
Udp,
}
impl RtspTransport {
pub(crate) fn as_ffmpeg_option(self) -> &'static str {
match self {
Self::Tcp => "tcp",
Self::Udp => "udp",
}
}
}
#[cfg(test)]
mod tests {
use super::RtspTransport;
#[test]
fn maps_transports_to_ffmpeg_options() {
assert_eq!(RtspTransport::Tcp.as_ffmpeg_option(), "tcp");
assert_eq!(RtspTransport::Udp.as_ffmpeg_option(), "udp");
}
}