From cceb524cf46b4a768c703fdbae5abe1dae11a92c Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 30 May 2020 12:08:49 +0200 Subject: [PATCH] core: preparation work for introducing options --- nihav-core/src/frame.rs | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) 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. -- 2.39.5