mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-09-01 01:13:48 +00:00
vulkan: detach gst_vulkan_handle_context_query function from VulkanHandle struct
This commit is contained in:
parent
88fe62a37d
commit
09a6f7f21f
4 changed files with 36 additions and 27 deletions
|
@ -123,6 +123,12 @@ concurrency = "none"
|
|||
name = "GstVulkan.VulkanHandle"
|
||||
status = "generate"
|
||||
ref_mode = "ref"
|
||||
[[object.function]]
|
||||
name = "context_query"
|
||||
ignore = true
|
||||
[[object.function]]
|
||||
name = "set_context"
|
||||
ignore = true
|
||||
|
||||
[[object]]
|
||||
name = "GstVulkan.VulkanOperation"
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanDevice, VulkanDisplay, VulkanInstance};
|
||||
use glib::{prelude::*, translate::*};
|
||||
use crate::ffi;
|
||||
|
||||
glib::wrapper! {
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
|
@ -57,31 +56,6 @@ impl VulkanHandle {
|
|||
//pub fn free_shader(&self, user_data: /*Unimplemented*/Option<Basic: Pointer>) {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_handle_free_shader() }
|
||||
//}
|
||||
|
||||
#[doc(alias = "gst_vulkan_handle_context_query")]
|
||||
pub fn context_query(
|
||||
element: &impl IsA<gst::Element>,
|
||||
query: &gst::Query,
|
||||
display: Option<&impl IsA<VulkanDisplay>>,
|
||||
instance: Option<&impl IsA<VulkanInstance>>,
|
||||
device: Option<&impl IsA<VulkanDevice>>,
|
||||
) -> bool {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_handle_context_query(
|
||||
element.as_ref().to_glib_none().0,
|
||||
query.to_glib_none().0,
|
||||
display.map(|p| p.as_ref()).to_glib_none().0,
|
||||
instance.map(|p| p.as_ref()).to_glib_none().0,
|
||||
device.map(|p| p.as_ref()).to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_handle_set_context")]
|
||||
//pub fn set_context(element: &impl IsA<gst::Element>, context: &gst::Context, display: impl IsA<VulkanDisplay>, instance: impl IsA<VulkanInstance>) -> bool {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_handle_set_context() }
|
||||
//}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanHandle {}
|
||||
|
|
|
@ -32,6 +32,7 @@ mod vulkan_full_screen_quad;
|
|||
mod vulkan_operation;
|
||||
mod vulkan_queue;
|
||||
mod vulkan_swapper;
|
||||
mod vulkan_utils;
|
||||
|
||||
// Re-export all the traits in a prelude module, so that applications
|
||||
// can always "use gst_vulkan::prelude::*" without getting conflicts
|
||||
|
@ -53,3 +54,5 @@ pub mod subclass;
|
|||
|
||||
mod caps_features;
|
||||
pub use caps_features::*;
|
||||
|
||||
pub use vulkan_utils::context_query;
|
||||
|
|
26
gstreamer-vulkan/src/vulkan_utils.rs
Normal file
26
gstreamer-vulkan/src/vulkan_utils.rs
Normal file
|
@ -0,0 +1,26 @@
|
|||
use glib::prelude::*;
|
||||
use glib::translate::*;
|
||||
|
||||
use crate::VulkanDevice;
|
||||
use crate::VulkanDisplay;
|
||||
use crate::VulkanInstance;
|
||||
|
||||
#[doc(alias = "gst_vulkan_handle_context_query")]
|
||||
pub fn context_query(
|
||||
element: &impl IsA<gst::Element>,
|
||||
query: &gst::Query,
|
||||
display: Option<&impl IsA<VulkanDisplay>>,
|
||||
instance: Option<&impl IsA<VulkanInstance>>,
|
||||
device: Option<&impl IsA<VulkanDevice>>,
|
||||
) -> bool {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_handle_context_query(
|
||||
element.as_ref().to_glib_none().0,
|
||||
query.to_glib_none().0,
|
||||
display.map(|p| p.as_ref()).to_glib_none().0,
|
||||
instance.map(|p| p.as_ref()).to_glib_none().0,
|
||||
device.map(|p| p.as_ref()).to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue