let mut decode_video = true;
let mut decode_audio = true;
let mut nmode = NumberMode::FrmPTS;
+ let mut smode = FrameSkipMode::None;
let mut seek_time = 0u64;
let mut vpfx: Option<String> = None;
let mut apfx: Option<&str> = None;
"-nm=count" => { nmode = NumberMode::Counter; },
"-nm=pktpts" => { nmode = NumberMode::PktPTS; },
"-nm=frmpts" => { nmode = NumberMode::FrmPTS; },
+ "-skip=key" => { smode = FrameSkipMode::KeyframesOnly; },
+ "-skip=intra" => { smode = FrameSkipMode::IntraOnly; },
"-seek" => {
cur_arg += 1;
if cur_arg == args.len() {
let mut decs: Vec<Option<(Box<NADecoderSupport>, Box<dyn NADecoder>)>> = Vec::new();
let mut sids: Vec<u32> = Vec::new();
let mut writers: Vec<Outputter> = Vec::new();
+ let dec_opts = [NAOption{name: FRAME_SKIP_OPTION, value: NAValue::String(smode.to_string())}];
for i in 0..dmx.get_num_streams() {
let s = dmx.get_stream(i).unwrap();
let info = s.get_info();
let mut dec = (decfunc.unwrap())();
let mut dsupp = Box::new(NADecoderSupport::new());
dec.init(&mut dsupp, info).unwrap();
+ dec.set_options(&dec_opts);
decs.push(Some((dsupp, dec)));
if !noout {
writers.push(Outputter::Video(FrameOutput{prefix: if let Some(ref str) = vpfx { str.clone() } else { "out".to_string() }, streamno: i, frameno: 1, nmode}));