From: Kostya Shishkov Date: Tue, 10 Dec 2019 17:44:52 +0000 (+0100) Subject: core/frame: add get_num_components() call to NAVideoBuffer X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=b914ee01a678df890f66d7e7c63dde8f43ec6a80;p=nihav.git core/frame: add get_num_components() call to NAVideoBuffer --- diff --git a/nihav-core/src/frame.rs b/nihav-core/src/frame.rs index 697013c..3af0d1d 100644 --- a/nihav-core/src/frame.rs +++ b/nihav-core/src/frame.rs @@ -118,6 +118,7 @@ impl NAVideoBuffer { pub fn get_info(&self) -> NAVideoInfo { self.info } pub fn get_data(&self) -> &Vec { self.data.as_ref() } pub fn get_data_mut(&mut self) -> Option<&mut Vec> { self.data.as_mut() } + pub fn get_num_components(&self) -> usize { self.offs.len() } pub fn copy_buffer(&mut self) -> Self { let mut data: Vec = Vec::with_capacity(self.data.len()); data.clone_from(self.data.as_ref());