filter::Source: add close method

Expose av_buffersrc_close.
This commit is contained in:
Zhiming Wang 2020-08-03 18:49:14 +08:00
parent d3270133be
commit f1ccd4e696
No known key found for this signature in database
GPG Key ID: 5B58F95EC95965D8

View File

@ -31,4 +31,13 @@ impl<'a> Source<'a> {
pub fn flush(&mut self) -> Result<(), Error> { pub fn flush(&mut self) -> Result<(), Error> {
unsafe { self.add(&Frame::wrap(ptr::null_mut())) } unsafe { self.add(&Frame::wrap(ptr::null_mut())) }
} }
pub fn close(&mut self, pts: i64) -> Result<(), Error> {
unsafe {
match av_buffersrc_close(self.ctx.as_mut_ptr(), pts, 0) {
0 => Ok(()),
e => Err(Error::from(e)),
}
}
}
} }