diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2020-05-30 12:08:49 +0200 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2020-05-30 12:08:49 +0200 |
commit | cceb524cf46b4a768c703fdbae5abe1dae11a92c (patch) | |
tree | 6e259a7b3f76413ef31642b52dfda1b96c47449d | |
parent | 971ae3066382f416b074c24df6b3213431856b81 (diff) | |
download | nihav-cceb524cf46b4a768c703fdbae5abe1dae11a92c.tar.gz |
core: preparation work for introducing options
-rw-r--r-- | nihav-core/src/frame.rs | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/nihav-core/src/frame.rs b/nihav-core/src/frame.rs index 5b090bb..badc7f8 100644 --- a/nihav-core/src/frame.rs +++ b/nihav-core/src/frame.rs @@ -857,15 +857,41 @@ pub const DUMMY_CODEC_INFO: NACodecInfo = NACodecInfo { properties: NACodecTypeInfo::None, extradata: None }; +/// Option definition. +#[derive(Debug)] +pub struct NAOptionDefinition { + /// Option name. + pub name: &'static str, + /// Option meaning. + pub description: &'static str, + /// Minimal value for the option (if applicable). + pub min_value: Option<NAValue>, + /// Maximum value for the option (if applicable). + pub max_value: Option<NAValue>, +} + +/// Option. +#[derive(Clone,Debug,PartialEq)] +pub struct NAOption { + /// Option name. + pub name: String, + /// Option value. + pub value: NAValue, +} + /// A list of accepted option values. -#[derive(Debug,Clone)] +#[derive(Debug,Clone,PartialEq)] pub enum NAValue { /// Empty value. None, + /// Boolean value. + Bool(bool), /// Integer value. Int(i32), /// Long integer value. Long(i64), + /// Floating point value. + Float(f32), /// String value. String(String), /// Binary data value. |