encoder/video: add getter methods needed for video transcoding
This commit is contained in:
parent
45b1d9ab9b
commit
91134301a5
@ -61,12 +61,24 @@ impl Video {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn width(&self) -> u32 {
|
||||
unsafe {
|
||||
(*self.as_ptr()).width as u32
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_height(&mut self, value: u32) {
|
||||
unsafe {
|
||||
(*self.as_mut_ptr()).height = value as c_int;
|
||||
}
|
||||
}
|
||||
|
||||
pub fn height(&self) -> u32 {
|
||||
unsafe {
|
||||
(*self.as_ptr()).height as u32
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_gop(&mut self, value: u32) {
|
||||
unsafe {
|
||||
(*self.as_mut_ptr()).gop_size = value as c_int;
|
||||
@ -79,6 +91,12 @@ impl Video {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn format(&self) -> format::Pixel {
|
||||
unsafe {
|
||||
format::Pixel::from((*self.as_ptr()).pix_fmt)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_motion_estimation(&mut self, value: MotionEstimation) {
|
||||
unsafe {
|
||||
(*self.as_mut_ptr()).me_method = value.into();
|
||||
@ -285,6 +303,12 @@ impl Encoder {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn frame_size(&self) -> u32 {
|
||||
unsafe {
|
||||
(*self.as_ptr()).frame_size as u32
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Deref for Encoder {
|
||||
|
Loading…
x
Reference in New Issue
Block a user