//! Demuxer definitions.
pub use crate::frame::*;
pub use crate::io::byteio::*;
+pub use crate::options::*;
/// A list specifying general demuxing errors.
#[derive(Debug,Clone,Copy,PartialEq)]
pub type DemuxerResult<T> = Result<T, DemuxerError>;
/// A trait for demuxing operations.
-pub trait DemuxCore<'a> {
+pub trait DemuxCore<'a>: NAOptionHandler {
/// Opens the input stream, reads required headers and prepares everything for packet demuxing.
fn open(&mut self, strmgr: &mut StreamManager, seek_idx: &mut SeekIndex) -> DemuxerResult<()>;
/// Demuxes a packet.
pub fn get_num_streams(&self) -> usize {
self.streams.get_num_streams()
}
+ /// Returns a reference to the internal stream manager.
+ pub fn get_stream_manager(&self) -> &StreamManager {
+ &self.streams
+ }
/// Returns an iterator over streams.
pub fn get_streams(&self) -> StreamIter {
self.streams.iter()
}
}
+impl<'a> NAOptionHandler for Demuxer<'a> {
+ fn get_supported_options(&self) -> &[NAOptionDefinition] {
+ self.dmx.get_supported_options()
+ }
+ fn set_options(&mut self, options: &[NAOption]) {
+ self.dmx.set_options(options);
+ }
+ fn query_option_value(&self, name: &str) -> Option<NAValue> {
+ self.dmx.query_option_value(name)
+ }
+}
+
impl From<ByteIOError> for DemuxerError {
fn from(_: ByteIOError) -> Self { DemuxerError::IOError }
}