codec/encoder: implement DerefMut
This commit is contained in:
parent
f6e1690292
commit
cd9db3adc5
@ -21,7 +21,7 @@ pub use self::decision::Decision;
|
|||||||
|
|
||||||
use std::ffi::CString;
|
use std::ffi::CString;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
use std::ops::Deref;
|
use std::ops::{Deref, DerefMut};
|
||||||
|
|
||||||
use libc::c_int;
|
use libc::c_int;
|
||||||
use ffi::*;
|
use ffi::*;
|
||||||
@ -104,6 +104,12 @@ impl Deref for Encoder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl DerefMut for Encoder {
|
||||||
|
fn deref_mut(&mut self) -> &mut<Self as Deref>::Target {
|
||||||
|
&mut self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn find(id: Id) -> Option<Codec<'static>> {
|
pub fn find(id: Id) -> Option<Codec<'static>> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let ptr = avcodec_find_encoder(id.into());
|
let ptr = avcodec_find_encoder(id.into());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user