Change VideoFrameRef::copy_to() and ::copy_plane() to take VideoFrameRefs instead of VideoFrames

VideoFrames can always be converted to a VideoFrameRef if needed.
This commit is contained in:
Sebastian Dröge 2018-01-16 18:59:04 +02:00
parent 4297f8f5c5
commit fc4ad81777

View file

@ -395,7 +395,7 @@ impl<'a> VideoFrameRef<&'a gst::BufferRef> {
self.0.id self.0.id
} }
pub fn copy(&self, dest: &mut VideoFrame<Writable>) -> Result<(), glib::BoolError> { pub fn copy(&self, dest: &mut VideoFrameRef<&mut gst::BufferRef>) -> Result<(), glib::BoolError> {
unsafe { unsafe {
let res: bool = from_glib(ffi::gst_video_frame_copy(&mut dest.0, &self.0)); let res: bool = from_glib(ffi::gst_video_frame_copy(&mut dest.0, &self.0));
if res { if res {
@ -408,7 +408,7 @@ impl<'a> VideoFrameRef<&'a gst::BufferRef> {
pub fn copy_plane( pub fn copy_plane(
&self, &self,
dest: &mut VideoFrame<Writable>, dest: &mut VideoFrameRef<&mut gst::BufferRef>,
plane: u32, plane: u32,
) -> Result<(), glib::BoolError> { ) -> Result<(), glib::BoolError> {
skip_assert_initialized!(); skip_assert_initialized!();