gstreamer_gl/auto/gl_video_allocation_params.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6use crate::{ffi, GLContext, GLFormat, GLTextureTarget};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10 #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
11 pub struct GLVideoAllocationParams(Boxed<ffi::GstGLVideoAllocationParams>);
12
13 match fn {
14 copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::gst_gl_video_allocation_params_get_type(), ptr as *mut _) as *mut ffi::GstGLVideoAllocationParams,
15 free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::gst_gl_video_allocation_params_get_type(), ptr as *mut _),
16 type_ => || ffi::gst_gl_video_allocation_params_get_type(),
17 }
18}
19
20impl GLVideoAllocationParams {
21 /// ## `context`
22 /// a [`GLContext`][crate::GLContext]
23 /// ## `alloc_params`
24 /// the [`gst::AllocationParams`][crate::gst::AllocationParams] for sysmem mappings of the texture
25 /// ## `v_info`
26 /// the [`gst_video::VideoInfo`][crate::gst_video::VideoInfo] for the texture
27 /// ## `plane`
28 /// the video plane of `v_info` to allocate
29 /// ## `valign`
30 /// any [`gst_video::VideoAlignment`][crate::gst_video::VideoAlignment] applied to symem mappings of the texture
31 /// ## `target`
32 /// the [`GLTextureTarget`][crate::GLTextureTarget] for the created textures
33 /// ## `tex_format`
34 /// the [`GLFormat`][crate::GLFormat] for the created textures
35 ///
36 /// # Returns
37 ///
38 /// a new [`GLVideoAllocationParams`][crate::GLVideoAllocationParams] for allocating [`GLMemory`][crate::GLMemory]'s
39 #[doc(alias = "gst_gl_video_allocation_params_new")]
40 pub fn new(
41 context: &impl IsA<GLContext>,
42 alloc_params: Option<&gst::AllocationParams>,
43 v_info: &gst_video::VideoInfo,
44 plane: u32,
45 valign: Option<&gst_video::VideoAlignment>,
46 target: GLTextureTarget,
47 tex_format: GLFormat,
48 ) -> GLVideoAllocationParams {
49 skip_assert_initialized!();
50 unsafe {
51 from_glib_full(ffi::gst_gl_video_allocation_params_new(
52 context.as_ref().to_glib_none().0,
53 alloc_params.to_glib_none().0,
54 v_info.to_glib_none().0,
55 plane,
56 valign.to_glib_none().0,
57 target.into_glib(),
58 tex_format.into_glib(),
59 ))
60 }
61 }
62
63 //#[doc(alias = "gst_gl_video_allocation_params_new_wrapped_data")]
64 //pub fn new_wrapped_data(context: &impl IsA<GLContext>, alloc_params: Option<&gst::AllocationParams>, v_info: &gst_video::VideoInfo, plane: u32, valign: Option<&gst_video::VideoAlignment>, target: GLTextureTarget, tex_format: GLFormat, wrapped_data: /*Unimplemented*/Option<Basic: Pointer>, user_data: /*Unimplemented*/Option<Basic: Pointer>) -> GLVideoAllocationParams {
65 // unsafe { TODO: call ffi:gst_gl_video_allocation_params_new_wrapped_data() }
66 //}
67
68 //#[doc(alias = "gst_gl_video_allocation_params_new_wrapped_gl_handle")]
69 //pub fn new_wrapped_gl_handle(context: &impl IsA<GLContext>, alloc_params: Option<&gst::AllocationParams>, v_info: &gst_video::VideoInfo, plane: u32, valign: Option<&gst_video::VideoAlignment>, target: GLTextureTarget, tex_format: GLFormat, gl_handle: /*Unimplemented*/Option<Basic: Pointer>, user_data: /*Unimplemented*/Option<Basic: Pointer>) -> GLVideoAllocationParams {
70 // unsafe { TODO: call ffi:gst_gl_video_allocation_params_new_wrapped_gl_handle() }
71 //}
72
73 //#[doc(alias = "gst_gl_video_allocation_params_new_wrapped_texture")]
74 //pub fn new_wrapped_texture(context: &impl IsA<GLContext>, alloc_params: Option<&gst::AllocationParams>, v_info: &gst_video::VideoInfo, plane: u32, valign: Option<&gst_video::VideoAlignment>, target: GLTextureTarget, tex_format: GLFormat, tex_id: u32, user_data: /*Unimplemented*/Option<Basic: Pointer>) -> GLVideoAllocationParams {
75 // unsafe { TODO: call ffi:gst_gl_video_allocation_params_new_wrapped_texture() }
76 //}
77
78 /// Copy and set any dynamically allocated resources in `dest_vid`. Intended
79 /// for subclass usage only to chain up at the end of a subclass copy function.
80 /// ## `dest_vid`
81 /// destination [`GLVideoAllocationParams`][crate::GLVideoAllocationParams] to copy into
82 #[doc(alias = "gst_gl_video_allocation_params_copy_data")]
83 pub fn copy_data(&self, dest_vid: &mut GLVideoAllocationParams) {
84 unsafe {
85 ffi::gst_gl_video_allocation_params_copy_data(
86 mut_override(self.to_glib_none().0),
87 dest_vid.to_glib_none_mut().0,
88 );
89 }
90 }
91
92 //#[doc(alias = "gst_gl_video_allocation_params_init_full")]
93 //pub fn init_full<P: Fn(&GLAllocationParams) + Send + Sync + 'static, Q: Fn() + Send + Sync + 'static>(&mut self, struct_size: usize, alloc_flags: u32, copy: P, free: Q, context: &impl IsA<GLContext>, alloc_params: Option<&gst::AllocationParams>, v_info: &gst_video::VideoInfo, plane: u32, valign: Option<&gst_video::VideoAlignment>, target: GLTextureTarget, tex_format: GLFormat, wrapped_data: /*Unimplemented*/Option<Basic: Pointer>, gl_handle: /*Unimplemented*/Option<Basic: Pointer>) -> bool {
94 // unsafe { TODO: call ffi:gst_gl_video_allocation_params_init_full() }
95 //}
96}
97
98unsafe impl Send for GLVideoAllocationParams {}
99unsafe impl Sync for GLVideoAllocationParams {}