From e6cb09af4353d230189592e288497ea06471f0bd Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Fri, 12 Jun 2020 16:14:53 +0200 Subject: [PATCH] add options to print codec and (de)muxer lists --- src/main.rs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) 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(); -- 2.39.5