From cbf03fca5b6b8a7a6acd03687d746ba578004395 Mon Sep 17 00:00:00 2001 From: George Hilliard Date: Sun, 5 Jul 2020 14:34:09 -0500 Subject: [PATCH] gst: don't accept StreamFormat by reference --- src/gst.rs | 4 ++-- src/main.rs | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/gst.rs b/src/gst.rs index ec651a6..be0a0e7 100644 --- a/src/gst.rs +++ b/src/gst.rs @@ -44,7 +44,7 @@ impl RtspServer { pub fn add_stream( &self, paths: &[&str], - stream_format: &StreamFormat, + stream_format: StreamFormat, permitted_users: &HashSet<&str>, ) -> Result { let mounts = self @@ -55,7 +55,7 @@ impl RtspServer { let launch_str = match stream_format { StreamFormat::H264 => "! h264parse ! rtph264pay name=pay0", StreamFormat::H265 => "! h265parse ! rtph265pay name=pay0", - StreamFormat::Custom(custom_format) => custom_format, + StreamFormat::Custom(ref custom_format) => custom_format, }; let factory = RTSPMediaFactory::new(); diff --git a/src/main.rs b/src/main.rs index 59ebc5b..aa4957e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -79,17 +79,13 @@ fn main() -> Result<(), Error> { &*format!("/{}", arc_cam.name), &*format!("/{}/mainStream", arc_cam.name), ]; - let mut output = rtsp - .add_stream(paths, &stream_format, &permitted_users) - .unwrap(); + let mut output = rtsp.add_stream(paths, stream_format, &permitted_users).unwrap(); let main_camera = arc_cam.clone(); s.spawn(move |_| camera_loop(&*main_camera, "mainStream", &mut output)); } if ["both", "subStream"].iter().any(|&e| e == arc_cam.stream) { let paths = &[&*format!("/{}/subStream", arc_cam.name)]; - let mut output = rtsp - .add_stream(paths, &substream_format, &permitted_users) - .unwrap(); + let mut output = rtsp.add_stream(paths, substream_format, &permitted_users).unwrap(); let sub_camera = arc_cam.clone(); s.spawn(move |_| camera_loop(&*sub_camera, "subStream", &mut output)); }