core: improve interaction with stream type
authorKostya Shishkov <kostya.shishkov@gmail.com>
Fri, 15 Nov 2019 18:58:55 +0000 (19:58 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Fri, 15 Nov 2019 18:58:55 +0000 (19:58 +0100)
nihav-core/src/frame.rs

index ae61c8810a16a7539e22490adf69d686999cb8d6..25c3856e7d9cd613b6dc2352e8f324d1d5aa66d1 100644 (file)
@@ -771,7 +771,7 @@ impl fmt::Display for NAFrame {
 }
 
 /// Possible stream types.
-#[derive(Debug,Clone,Copy)]
+#[derive(Debug,Clone,Copy,PartialEq)]
 #[allow(dead_code)]
 pub enum StreamType {
     /// video stream
@@ -832,6 +832,7 @@ impl NAStream {
         NAStream { media_type: mt, id, num: 0, info: info.into_ref(), tb_num: n, tb_den: d }
     }
     pub fn get_id(&self) -> u32 { self.id }
+    pub fn get_media_type(&self) -> StreamType { self.media_type }
     pub fn get_num(&self) -> usize { self.num }
     pub fn set_num(&mut self, num: usize) { self.num = num; }
     pub fn get_info(&self) -> NACodecInfoRef { self.info.clone() }