encoder/{audio,video}: add flush() methods`

This commit is contained in:
lummax 2015-09-19 11:47:25 +02:00 committed by meh
parent 4471ffc934
commit c8a95364a2
2 changed files with 12 additions and 0 deletions

View File

@ -131,6 +131,12 @@ impl Encoder {
}
}
pub fn flush(&mut self, out: &mut Packet) -> Result<bool, Error> {
unsafe {
self.encode(&frame::Audio::wrap(ptr::null_mut()), out)
}
}
pub fn frame_size(&self) -> u32 {
unsafe {
(*self.as_ptr()).frame_size as u32

View File

@ -304,6 +304,12 @@ impl Encoder {
}
}
pub fn flush(&mut self, out: &mut Packet) -> Result<bool, Error> {
unsafe {
self.encode(&frame::Video::wrap(ptr::null_mut()), out)
}
}
pub fn frame_size(&self) -> u32 {
unsafe {
(*self.as_ptr()).frame_size as u32