codec/parameters: add medium
and id
methods
This commit is contained in:
parent
606847cc50
commit
f1ce26a137
@ -1,6 +1,8 @@
|
|||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
use ffi::*;
|
use ffi::*;
|
||||||
|
use media;
|
||||||
|
use super::Id;
|
||||||
|
|
||||||
pub struct Parameters {
|
pub struct Parameters {
|
||||||
ptr: *mut AVCodecParameters,
|
ptr: *mut AVCodecParameters,
|
||||||
@ -29,6 +31,18 @@ impl Parameters {
|
|||||||
Parameters { ptr: avcodec_parameters_alloc(), owner: None }
|
Parameters { ptr: avcodec_parameters_alloc(), owner: None }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn medium(&self) -> media::Type {
|
||||||
|
unsafe {
|
||||||
|
media::Type::from((*self.as_ptr()).codec_type)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn id(&self) -> Id {
|
||||||
|
unsafe {
|
||||||
|
Id::from((*self.as_ptr()).codec_id)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for Parameters {
|
impl Drop for Parameters {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user