format/stream: add set_metadata function to StreamMut
This commit is contained in:
parent
0bcd4550b8
commit
67b7f13305
@ -4,7 +4,7 @@ use std::ops::Deref;
|
||||
use super::Stream;
|
||||
use ffi::*;
|
||||
use format::context::common::Context;
|
||||
use {codec, Rational};
|
||||
use {codec, Dictionary, Rational};
|
||||
|
||||
pub struct StreamMut<'a> {
|
||||
context: &'a mut Context,
|
||||
@ -56,6 +56,13 @@ impl<'a> StreamMut<'a> {
|
||||
avcodec_parameters_copy((*self.as_mut_ptr()).codecpar, parameters.as_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_metadata(&mut self, metadata: Dictionary) {
|
||||
unsafe {
|
||||
let metadata = metadata.disown();
|
||||
(*self.as_mut_ptr()).metadata = metadata;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Deref for StreamMut<'a> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user