From: Kostya Shishkov Date: Sat, 30 May 2020 10:08:49 +0000 (+0200) Subject: core: preparation work for introducing options X-Git-Url: https://git.nihav.org/?p=nihav.git;a=commitdiff_plain;h=cceb524cf46b4a768c703fdbae5abe1dae11a92c core: preparation work for introducing options --- 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, + /// Maximum value for the option (if applicable). + pub max_value: Option, +} + +/// 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.