mirror of
https://github.com/encounter/rust-ffmpeg-zmwangx.git
synced 2026-07-10 21:18:40 -07:00
encoder/{audio,video}: add flush() methods`
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user