Skip to content

Commit

Permalink
src: stream: Improve shmsrc/shmsink
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso authored and patrickelectric committed Feb 7, 2024
1 parent 0d73e63 commit cdbbec6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/stream/rtsp/rtsp_server.rs
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions src/stream/sink/rtsp_sink.rs
Expand Up @@ -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")?;
Expand Down

0 comments on commit cdbbec6

Please sign in to comment.