]> git.nihav.org Git - nihav.git/blobdiff - nihav-core/src/muxers/mod.rs
factor out keyframe interval option
[nihav.git] / nihav-core / src / muxers / mod.rs
index e8a1afbcab46d871a4bf7244ffc086c993310751..49f4e2d8da197cf0e0d015066d3bce4f2e3f0db5 100644 (file)
@@ -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<ByteIOError> 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<NAValue> {
+        self.mux.query_option_value(name)
+    }
+}
+
 /// The trait for creating muxers.
 pub trait MuxerCreator {
     /// Creates new muxer instance that will use `ByteWriter` for output.