return self.convert_buf(bt, ts);
}
},
+ #[cfg(feature="hwaccel")]
+ DecoderType::VideoHW(ref mut vdec) => {
+ let _ = vdec.queue_pkt(pkt);
+ while let Some(frm) = vdec.get_frame() {
+ let bt = frm.get_buffer();
+ if let NABufferType::None = bt { continue; }
+ let ts = frm.get_dts().unwrap_or_else(|| frm.get_pts().unwrap_or(0));
+ return self.convert_buf(bt, ts);
+ }
+ },
_ => panic!("not a video decoder!"),
};
None
return self.convert_buf(bt, ts);
}
},
+ #[cfg(feature="hwaccel")]
+ DecoderType::VideoHW(ref mut vdec) => {
+ while let Some(frm) = vdec.get_frame() {
+ let bt = frm.get_buffer();
+ if let NABufferType::None = bt { continue; }
+ let ts = frm.get_dts().unwrap_or_else(|| frm.get_pts().unwrap_or(0));
+ return self.convert_buf(bt, ts);
+ }
+ },
_ => {},
};
None
return self.convert_buf(bt, ts);
}
},
+ #[cfg(feature="hwaccel")]
+ DecoderType::VideoHW(ref mut dec) => {
+ while let Some(frm) = dec.get_last_frames() {
+ let bt = frm.get_buffer();
+ if let NABufferType::None = bt { continue; }
+ let ts = frm.get_dts().unwrap_or_else(|| frm.get_pts().unwrap_or(0));
+ return self.convert_buf(bt, ts);
+ }
+ },
_ => {},
};
None
dec.flush();
reord.flush();
},
+ #[cfg(feature="hwaccel")]
+ DecoderType::VideoHW(ref mut dec) => {
+ dec.flush();
+ },
_ => {},
};
}
Ok(PktSendEvent::HurryUp) => {
skip_mode = skip_mode.advance();
if let DecoderType::Video(ref mut dec, ref mut _reord) = vdec.dec.dec {
+ println!("setting hurry up mode to {}", skip_mode.to_string());
dec.set_options(&[NAOption{
name: FRAME_SKIP_OPTION,
value: NAValue::String(skip_mode.to_string()),