From cdbbec6adc4134a6bd91bd6261e18b1679c9e8f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ant=C3=B4nio=20Cardoso?= Date: Fri, 12 Jan 2024 20:05:14 -0300 Subject: [PATCH] src: stream: Improve shmsrc/shmsink --- src/stream/rtsp/rtsp_server.rs | 6 +++--- src/stream/sink/rtsp_sink.rs | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/stream/rtsp/rtsp_server.rs b/src/stream/rtsp/rtsp_server.rs index 3c3a685d..65634dfd 100644 --- a/src/stream/rtsp/rtsp_server.rs +++ b/src/stream/rtsp/rtsp_server.rs @@ -138,7 +138,7 @@ impl RTSPServer { "H264" => { format!( concat!( - "shmsrc socket-path={socket_path} do-timestamp=true", + "shmsrc socket-path={socket_path} is-live=true", " ! queue leaky=downstream flush-on-eos=true silent=true max-size-buffers=0", " ! capsfilter caps={rtp_caps:?}", " ! rtph264depay", @@ -151,7 +151,7 @@ impl RTSPServer { "RAW" => { format!( concat!( - "shmsrc socket-path={socket_path} do-timestamp=true", + "shmsrc socket-path={socket_path} is-live=true", " ! queue leaky=downstream flush-on-eos=true silent=true max-size-buffers=0", " ! capsfilter caps={rtp_caps:?}", " ! rtpvrawdepay", @@ -164,7 +164,7 @@ impl RTSPServer { "JPEG" => { format!( concat!( - "shmsrc socket-path={socket_path} do-timestamp=true", + "shmsrc socket-path={socket_path} is-live=true", " ! queue leaky=downstream flush-on-eos=true silent=true max-size-buffers=10", " ! capsfilter caps={rtp_caps:?}", " ! rtpjpegdepay", diff --git a/src/stream/sink/rtsp_sink.rs b/src/stream/sink/rtsp_sink.rs index cf3dbaab..cb2757b2 100644 --- a/src/stream/sink/rtsp_sink.rs +++ b/src/stream/sink/rtsp_sink.rs @@ -242,9 +242,10 @@ impl RtspSink { let socket_path = format!("/tmp/{id}"); let sink = gst::ElementFactory::make("shmsink") .property_from_str("socket-path", &socket_path) - .property("sync", true) - .property("wait-for-connection", false) + .property("sync", false) + .property("wait-for-connection", true) .property("shm-size", 10_000_000u32) + .property("enable-last-sample", false) .build()?; let sink_sink_pad = sink.static_pad("sink").context("Failed to get Sink Pad")?;