core/frame: add get_num_components() call to NAVideoBuffer
authorKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 10 Dec 2019 17:44:52 +0000 (18:44 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 10 Dec 2019 17:44:52 +0000 (18:44 +0100)
nihav-core/src/frame.rs

index 697013c442a99d653004bcc4a593f1feb8ab1753..3af0d1d1af3ba09c11272b4d50702f11695779cf 100644 (file)
@@ -118,6 +118,7 @@ impl<T: Clone> NAVideoBuffer<T> {
     pub fn get_info(&self) -> NAVideoInfo { self.info }
     pub fn get_data(&self) -> &Vec<T> { self.data.as_ref() }
     pub fn get_data_mut(&mut self) -> Option<&mut Vec<T>> { 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<T> = Vec::with_capacity(self.data.len());
         data.clone_from(self.data.as_ref());