From f486b7c051ed46c37f0c99cfd62acddf9ed0504a Mon Sep 17 00:00:00 2001 From: lummax Date: Wed, 19 Aug 2015 13:20:59 +0200 Subject: [PATCH] format/context: expose the metadata dictionary --- src/format/context.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/format/context.rs b/src/format/context.rs index e0289d5..9c7cc08 100644 --- a/src/format/context.rs +++ b/src/format/context.rs @@ -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())