media_pp\elements/
rtsp.rs1#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
3pub enum RtspTransport {
4 #[default]
7 Tcp,
8 Udp,
11}
12
13impl RtspTransport {
14 pub(crate) fn as_ffmpeg_option(self) -> &'static str {
15 match self {
16 Self::Tcp => "tcp",
17 Self::Udp => "udp",
18 }
19 }
20}
21
22#[cfg(test)]
23mod tests {
24 use super::RtspTransport;
25
26 #[test]
27 fn maps_transports_to_ffmpeg_options() {
28 assert_eq!(RtspTransport::Tcp.as_ffmpeg_option(), "tcp");
29 assert_eq!(RtspTransport::Udp.as_ffmpeg_option(), "udp");
30 }
31}