gst: don't accept StreamFormat by reference

This commit is contained in:
George Hilliard committed 2020-07-18 15:12:26 -05:00
1 parent bae4182bf5
commit cbf03fca5b
2 files changed
+4 -8

No files matched your search

+2 -2
View File
@@ -44,7 +44,7 @@ impl RtspServer {
pub fn add_stream(
&self,
paths: &[&str],
stream_format: &StreamFormat,
stream_format: StreamFormat,
permitted_users: &HashSet<&str>,
) -> Result<MaybeAppSrc> {
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();
+2 -6
View File
@@ -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));
}