format/stream: add stream metadata

This commit is contained in:
Victor Nivet 2017-07-08 15:04:52 +02:00 committed by meh
parent 991bbc24e8
commit 206ccd4e5a

View File

@ -1,7 +1,7 @@
use libc::c_int; use libc::c_int;
use ffi::*; use ffi::*;
use ::codec::{self, packet}; use ::codec::{self, packet};
use ::{Rational, Discard}; use ::{Rational, Discard, DictionaryRef};
use super::Disposition; use super::Disposition;
use format::context::common::Context; use format::context::common::Context;
@ -90,6 +90,12 @@ impl<'a> Stream<'a> {
Rational::from((*self.as_ptr()).avg_frame_rate) Rational::from((*self.as_ptr()).avg_frame_rate)
} }
} }
pub fn metadata(&self) -> DictionaryRef {
unsafe {
DictionaryRef::wrap((*self.as_ptr()).metadata)
}
}
} }
impl<'a> PartialEq for Stream<'a> { impl<'a> PartialEq for Stream<'a> {