make muxers handle options
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sun, 31 May 2020 13:18:42 +0000 (15:18 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sun, 31 May 2020 13:18:57 +0000 (15:18 +0200)
nihav-commonfmt/src/muxers/avi.rs
nihav-commonfmt/src/muxers/wav.rs
nihav-core/src/muxers/mod.rs

index ac13cb231fbd51b456199f874050273303674c51..9b83296db938123f8609bbbc542a1c3fee720316 100644 (file)
@@ -288,6 +288,12 @@ impl<'a> MuxCore<'a> for AVIMuxer<'a> {
     }
 }
 
+impl<'a> NAOptionHandler for AVIMuxer<'a> {
+    fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] }
+    fn set_options(&mut self, _options: &[NAOption]) { }
+    fn query_option_value(&self, _name: &str) -> Option<NAValue> { None }
+}
+
 pub struct AVIMuxerCreator {}
 
 impl MuxerCreator for AVIMuxerCreator {
index a11bb2a510eb6406d5cb8962ea5693495e49514f..351231708531d3dac705b6c0cdd8627ac61484ca 100644 (file)
@@ -98,6 +98,12 @@ impl<'a> MuxCore<'a> for WAVMuxer<'a> {
     }
 }
 
+impl<'a> NAOptionHandler for WAVMuxer<'a> {
+    fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] }
+    fn set_options(&mut self, _options: &[NAOption]) { }
+    fn query_option_value(&self, _name: &str) -> Option<NAValue> { None }
+}
+
 pub struct WAVMuxerCreator {}
 
 impl MuxerCreator for WAVMuxerCreator {
index e8a1afbcab46d871a4bf7244ffc086c993310751..9f40d54424349bd8c1914e31f1f0d9bb36220212 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.