Skip to content

Commit

Permalink
src: stream: sink: Silent Queues
Browse files Browse the repository at this point in the history
Since we are not using their signals, we can silent them, making them
more lightweight
  • Loading branch information
joaoantoniocardoso authored and patrickelectric committed Feb 7, 2024
1 parent c1dd31e commit 0d73e63
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/stream/rtsp/rtsp_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl RTSPServer {
format!(
concat!(
"shmsrc socket-path={socket_path} do-timestamp=true",
" ! queue leaky=downstream flush-on-eos=true max-size-buffers=0",
" ! queue leaky=downstream flush-on-eos=true silent=true max-size-buffers=0",
" ! capsfilter caps={rtp_caps:?}",
" ! rtph264depay",
" ! rtph264pay name=pay0 aggregate-mode=zero-latency config-interval=10 pt=96",
Expand All @@ -152,7 +152,7 @@ impl RTSPServer {
format!(
concat!(
"shmsrc socket-path={socket_path} do-timestamp=true",
" ! queue leaky=downstream flush-on-eos=true max-size-buffers=0",
" ! queue leaky=downstream flush-on-eos=true silent=true max-size-buffers=0",
" ! capsfilter caps={rtp_caps:?}",
" ! rtpvrawdepay",
" ! rtpvrawpay name=pay0 pt=96",
Expand All @@ -165,7 +165,7 @@ impl RTSPServer {
format!(
concat!(
"shmsrc socket-path={socket_path} do-timestamp=true",
" ! queue leaky=downstream flush-on-eos=true max-size-buffers=0",
" ! queue leaky=downstream flush-on-eos=true silent=true max-size-buffers=10",
" ! capsfilter caps={rtp_caps:?}",
" ! rtpjpegdepay",
" ! rtpjpegpay name=pay0 pt=96",
Expand Down
2 changes: 2 additions & 0 deletions src/stream/sink/image_sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ impl ImageSink {
pub fn try_new(sink_id: uuid::Uuid, encoding: VideoEncodeType) -> Result<Self> {
let queue = gst::ElementFactory::make("queue")
.property_from_str("leaky", "downstream") // Throw away any data
.property("silent", true)
.property("flush-on-eos", true)
.property("max-size-buffers", 0u32) // Disable buffers
.build()?;
Expand All @@ -315,6 +316,7 @@ impl ImageSink {
{
Some(element) => {
element.set_property_from_str("leaky", "downstream"); // Throw away any data
element.set_property("silent", true);
element.set_property("flush-on-eos", true);
element.set_property("max-size-buffers", 0u32); // Disable buffers
}
Expand Down
1 change: 1 addition & 0 deletions src/stream/sink/rtsp_sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ impl RtspSink {
pub fn try_new(id: uuid::Uuid, addresses: Vec<url::Url>) -> Result<Self> {
let queue = gst::ElementFactory::make("queue")
.property_from_str("leaky", "downstream") // Throw away any data
.property("silent", true)
.property("flush-on-eos", true)
.property("max-size-buffers", 0u32) // Disable buffers
.build()?;
Expand Down
1 change: 1 addition & 0 deletions src/stream/sink/udp_sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ impl UdpSink {
pub fn try_new(sink_id: uuid::Uuid, addresses: Vec<url::Url>) -> Result<Self> {
let queue = gst::ElementFactory::make("queue")
.property_from_str("leaky", "downstream") // Throw away any data
.property("silent", true)
.property("flush-on-eos", true)
.property("max-size-buffers", 0u32) // Disable buffers
.build()?;
Expand Down
1 change: 1 addition & 0 deletions src/stream/sink/webrtc_sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ impl WebRTCSink {
) -> Result<Self> {
let queue = gst::ElementFactory::make("queue")
.property_from_str("leaky", "downstream") // Throw away any data
.property("silent", true)
.property("flush-on-eos", true)
.property("max-size-buffers", 0u32) // Disable buffers
.build()?;
Expand Down

0 comments on commit 0d73e63

Please sign in to comment.