aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2020-05-31 15:18:42 +0200
committerKostya Shishkov <kostya.shishkov@gmail.com>2020-05-31 15:18:57 +0200
commitdc80f48ea3097c891b159667ea239d3c20c78bc8 (patch)
treeb459af26e88bd927ca591a8a7f56cd02af4544c7
parenta0ddfb3d1ef6509bfd5cc957187f98d01c806bd8 (diff)
downloadnihav-dc80f48ea3097c891b159667ea239d3c20c78bc8.tar.gz
make muxers handle options
-rw-r--r--nihav-commonfmt/src/muxers/avi.rs6
-rw-r--r--nihav-commonfmt/src/muxers/wav.rs6
-rw-r--r--nihav-core/src/muxers/mod.rs3
3 files changed, 14 insertions, 1 deletions
diff --git a/nihav-commonfmt/src/muxers/avi.rs b/nihav-commonfmt/src/muxers/avi.rs
index ac13cb2..9b83296 100644
--- a/nihav-commonfmt/src/muxers/avi.rs
+++ b/nihav-commonfmt/src/muxers/avi.rs
@@ -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 {
diff --git a/nihav-commonfmt/src/muxers/wav.rs b/nihav-commonfmt/src/muxers/wav.rs
index a11bb2a..3512317 100644
--- a/nihav-commonfmt/src/muxers/wav.rs
+++ b/nihav-commonfmt/src/muxers/wav.rs
@@ -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 {
diff --git a/nihav-core/src/muxers/mod.rs b/nihav-core/src/muxers/mod.rs
index e8a1afb..9f40d54 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<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.