forked from mirrors/gstreamer-rs
video: Allow getting an owned reference to the input buffer from a video codec frame
This commit is contained in:
parent
5ee2ce9d10
commit
c37316fac1
1 changed files with 12 additions and 0 deletions
|
@ -140,6 +140,18 @@ impl<'a> VideoCodecFrame<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "get_input_buffer")]
|
||||
pub fn input_buffer_owned(&self) -> Option<gst::Buffer> {
|
||||
unsafe {
|
||||
let ptr = (*self.to_glib_none().0).input_buffer;
|
||||
if ptr.is_null() {
|
||||
None
|
||||
} else {
|
||||
Some(from_glib_none(ptr))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "get_output_buffer")]
|
||||
pub fn output_buffer(&self) -> Option<&gst::BufferRef> {
|
||||
unsafe {
|
||||
|
|
Loading…
Reference in a new issue