format/context: expose the metadata dictionary

This commit is contained in:
lummax 2015-08-19 13:20:59 +02:00 committed by meh
parent e063da22a4
commit f486b7c051

View File

@ -2,7 +2,7 @@ use std::marker::PhantomData;
use libc::c_uint;
use ffi::*;
use ::{Error, Codec, Stream, Packet};
use ::{Error, Codec, Stream, Packet, Dictionary};
pub struct Context {
ptr: *mut AVFormatContext,
@ -55,6 +55,12 @@ impl Context {
}
}
pub fn metadata(&self) -> Dictionary {
unsafe {
Dictionary::wrap((*self.as_ptr()).metadata)
}
}
pub fn probe_score(&self) -> i32 {
unsafe {
av_format_get_probe_score(self.as_ptr())