From: Kostya Shishkov Date: Fri, 12 Jun 2020 14:14:53 +0000 (+0200) Subject: add options to print codec and (de)muxer lists X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;ds=sidebyside;h=e6cb09af4353d230189592e288497ea06471f0bd;hp=935215063aed6eb588d0041b677eab6af53f58cd;p=nihav-encoder.git add options to print codec and (de)muxer lists --- diff --git a/src/main.rs b/src/main.rs index 55630fc..e37092b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,6 +13,7 @@ use nihav_core::muxers::*; use nihav_core::scale::*; use nihav_core::soundcvt::*; use nihav_registry::detect; +use nihav_registry::register; use nihav_allstuff::*; use std::env; @@ -571,6 +572,44 @@ fn main() { let mut arg_idx = 1; while arg_idx < args.len() { match args[arg_idx].as_str() { + "--list-decoders" => { + if dec_reg.iter().len() > 0 { + println!("Registered decoders:"); + for dec in dec_reg.iter() { + let cdesc = register::get_codec_description(dec.name); + let full_name = if let Some(cd) = cdesc { cd.get_full_name() } else { "???" }; + println!(" {} ({})", dec.name, full_name); + } + } else { + println!("No registered decoders."); + } + }, + "--list-encoders" => { + if enc_reg.iter().len() > 0 { + println!("Registered encoders:"); + for enc in enc_reg.iter() { + let cdesc = register::get_codec_description(enc.name); + let full_name = if let Some(cd) = cdesc { cd.get_full_name() } else { "???" }; + println!(" {} ({})", enc.name, full_name); + } + } else { + println!("No registered encoders."); + } + }, + "--list-demuxers" => { + print!("Registered demuxers:"); + for dmx in dmx_reg.iter() { + print!(" {}", dmx.get_name()); + } + println!(); + }, + "--list-muxers" => { + print!("Registered muxers:"); + for mux in mux_reg.iter() { + print!(" {}", mux.get_name()); + } + println!(); + }, "--query-decoder-options" => { next_arg!(args, arg_idx); let cname = args[arg_idx].as_str();