Default live publishers to relay passthrough
This commit is contained in:
parent
168e9928a5
commit
b49dcff27d
2 changed files with 49 additions and 10 deletions
|
|
@ -457,8 +457,8 @@ struct WsSubscribeArgs {
|
|||
#[derive(Parser, Debug)]
|
||||
struct WtPublishArgs {
|
||||
/// Relay URL (WebTransport) to connect to.
|
||||
/// Default points at moq.dev's public relay.
|
||||
#[arg(long, default_value = "https://cdn.moq.dev/anon")]
|
||||
/// Default points at every.channel's public relay.
|
||||
#[arg(long, default_value = "https://relay.every.channel/anon")]
|
||||
url: String,
|
||||
/// Broadcast name to publish.
|
||||
///
|
||||
|
|
@ -483,7 +483,7 @@ struct WtPublishArgs {
|
|||
movflags: String,
|
||||
/// Transmit fMP4 fragments directly (passthrough mode).
|
||||
/// When false, the importer may reframe into CMAF fragments.
|
||||
#[arg(long, default_value_t = false, action = clap::ArgAction::Set)]
|
||||
#[arg(long, default_value_t = true, action = clap::ArgAction::Set)]
|
||||
passthrough: bool,
|
||||
/// Danger: disable TLS verification for the relay.
|
||||
#[arg(long, default_value_t = false)]
|
||||
|
|
@ -531,7 +531,7 @@ struct NbcBootstrapArgs {
|
|||
#[derive(Parser, Debug)]
|
||||
struct NbcWtPublishArgs {
|
||||
/// Relay URL (WebTransport) to connect to.
|
||||
#[arg(long, default_value = "https://cdn.moq.dev/anon")]
|
||||
#[arg(long, default_value = "https://relay.every.channel/anon")]
|
||||
url: String,
|
||||
/// Broadcast name to publish.
|
||||
#[arg(long)]
|
||||
|
|
@ -540,7 +540,7 @@ struct NbcWtPublishArgs {
|
|||
#[arg(long)]
|
||||
source_url: String,
|
||||
/// Transmit fMP4 fragments directly (passthrough mode).
|
||||
#[arg(long, default_value_t = false, action = clap::ArgAction::Set)]
|
||||
#[arg(long, default_value_t = true, action = clap::ArgAction::Set)]
|
||||
passthrough: bool,
|
||||
/// H.264 GOP/keyframe interval in frames.
|
||||
#[arg(long, default_value_t = WT_PUBLISH_GOP_FRAMES)]
|
||||
|
|
@ -1795,6 +1795,41 @@ mod tests {
|
|||
assert!(set.contains("d"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn publish_commands_default_to_current_relay_passthrough() {
|
||||
let cli = Cli::parse_from([
|
||||
"ec-node",
|
||||
"wt-publish",
|
||||
"--name",
|
||||
"la-test",
|
||||
"--input",
|
||||
"http://example.invalid/auto/v2.1",
|
||||
]);
|
||||
match cli.command {
|
||||
Commands::WtPublish(args) => {
|
||||
assert_eq!(args.url, "https://relay.every.channel/anon");
|
||||
assert!(args.passthrough);
|
||||
}
|
||||
_ => panic!("expected wt-publish command"),
|
||||
}
|
||||
|
||||
let cli = Cli::parse_from([
|
||||
"ec-node",
|
||||
"nbc-wt-publish",
|
||||
"--name",
|
||||
"nbc-test",
|
||||
"--source-url",
|
||||
"https://example.invalid/live",
|
||||
]);
|
||||
match cli.command {
|
||||
Commands::NbcWtPublish(args) => {
|
||||
assert_eq!(args.url, "https://relay.every.channel/anon");
|
||||
assert!(args.passthrough);
|
||||
}
|
||||
_ => panic!("expected nbc-wt-publish command"),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn deterministic_enabled_reads_env() {
|
||||
let prev = std::env::var("EVERY_CHANNEL_DETERMINISTIC").ok();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue