Skip to content

Commit

Permalink
helper: Add check if rtsp is enabled
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
  • Loading branch information
patrickelectric committed May 21, 2020
1 parent 31536e2 commit 30ab814
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,18 @@ Example of valid arguments:
);

if cfg!(feature = "gst") {
matches = matches.arg(
clap::Arg::with_name("pipeline")
.long("pipeline")
.value_name("GSTREAMER_PIPELINE")
.help("Gstreamer pipeline that ends with a sink type.")
.takes_value(true)
.conflicts_with_all(&["pipeline-rtsp", "port"])
.default_value("videotestsrc ! video/x-raw,width=640,height=480 ! videoconvert ! x264enc ! rtph264pay ! udpsink host=0.0.0.0 port=5600"),
)
let mut arg = clap::Arg::with_name("pipeline")
.long("pipeline")
.value_name("GSTREAMER_PIPELINE")
.help("Gstreamer pipeline that ends with a sink type.")
.takes_value(true)
.conflicts_with_all(&["pipeline-rtsp", "port"]);

if !cfg!(feature = "rtsp") {
arg = arg.default_value("videotestsrc ! video/x-raw,width=640,height=480 ! videoconvert ! x264enc ! rtph264pay ! udpsink host=0.0.0.0 port=5600");
}
// Needs: https://github.com/clap-rs/clap/issues/1406
matches = matches.arg(arg);
}

if cfg!(feature = "rtsp") {
Expand Down

0 comments on commit 30ab814

Please sign in to comment.