X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-core%2Fsrc%2Fmuxers%2Fmod.rs;h=49f4e2d8da197cf0e0d015066d3bce4f2e3f0db5;hb=ee0ca773d99115f67d776735bcad168e1993d2e8;hp=e8a1afbcab46d871a4bf7244ffc086c993310751;hpb=f0081142878786d1a07c61e4df2d2a318609b478;p=nihav.git diff --git a/nihav-core/src/muxers/mod.rs b/nihav-core/src/muxers/mod.rs index e8a1afb..49f4e2d 100644 --- a/nihav-core/src/muxers/mod.rs +++ b/nihav-core/src/muxers/mod.rs @@ -2,6 +2,7 @@ pub use crate::frame::*; pub use crate::io::byteio::*; pub use crate::demuxers::{StreamManager, StreamIter}; +pub use crate::options::*; /// A list specifying general muxing errors. #[derive(Debug,Clone,Copy,PartialEq)] @@ -54,7 +55,7 @@ impl From for MuxerError { } /// A trait for muxing operations. -pub trait MuxCore<'a> { +pub trait MuxCore<'a>: NAOptionHandler { /// Prepares everything for packet muxing. fn create(&mut self, strmgr: &StreamManager) -> MuxerResult<()>; /// Queues a packet for muxing. @@ -110,6 +111,18 @@ impl<'a> Muxer<'a> { } } +impl<'a> NAOptionHandler for Muxer<'a> { + fn get_supported_options(&self) -> &[NAOptionDefinition] { + self.mux.get_supported_options() + } + fn set_options(&mut self, options: &[NAOption]) { + self.mux.set_options(options); + } + fn query_option_value(&self, name: &str) -> Option { + self.mux.query_option_value(name) + } +} + /// The trait for creating muxers. pub trait MuxerCreator { /// Creates new muxer instance that will use `ByteWriter` for output.