mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-04-16 04:44:06 +00:00
vulkan: Generate
This commit is contained in:
parent
765aebd395
commit
9501f71fbf
37 changed files with 4352 additions and 0 deletions
38
gstreamer-vulkan/src/auto/constants.rs
Normal file
38
gstreamer-vulkan/src/auto/constants.rs
Normal file
|
@ -0,0 +1,38 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::ffi;
|
||||
use glib::GStr;
|
||||
|
||||
#[doc(alias = "GST_CAPS_FEATURE_MEMORY_VULKAN_BUFFER")]
|
||||
pub static CAPS_FEATURE_MEMORY_VULKAN_BUFFER: &GStr =
|
||||
unsafe { GStr::from_utf8_with_nul_unchecked(ffi::GST_CAPS_FEATURE_MEMORY_VULKAN_BUFFER) };
|
||||
#[doc(alias = "GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE")]
|
||||
pub static CAPS_FEATURE_MEMORY_VULKAN_IMAGE: &GStr =
|
||||
unsafe { GStr::from_utf8_with_nul_unchecked(ffi::GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE) };
|
||||
#[doc(alias = "GST_VULKAN_BUFFER_MEMORY_ALLOCATOR_NAME")]
|
||||
pub static VULKAN_BUFFER_MEMORY_ALLOCATOR_NAME: &GStr =
|
||||
unsafe { GStr::from_utf8_with_nul_unchecked(ffi::GST_VULKAN_BUFFER_MEMORY_ALLOCATOR_NAME) };
|
||||
#[doc(alias = "GST_VULKAN_DEVICE_CONTEXT_TYPE_STR")]
|
||||
pub static VULKAN_DEVICE_CONTEXT_TYPE_STR: &GStr =
|
||||
unsafe { GStr::from_utf8_with_nul_unchecked(ffi::GST_VULKAN_DEVICE_CONTEXT_TYPE_STR) };
|
||||
#[doc(alias = "GST_VULKAN_DISPLAY_CONTEXT_TYPE_STR")]
|
||||
pub static VULKAN_DISPLAY_CONTEXT_TYPE_STR: &GStr =
|
||||
unsafe { GStr::from_utf8_with_nul_unchecked(ffi::GST_VULKAN_DISPLAY_CONTEXT_TYPE_STR) };
|
||||
#[doc(alias = "GST_VULKAN_IMAGE_MEMORY_ALLOCATOR_NAME")]
|
||||
pub static VULKAN_IMAGE_MEMORY_ALLOCATOR_NAME: &GStr =
|
||||
unsafe { GStr::from_utf8_with_nul_unchecked(ffi::GST_VULKAN_IMAGE_MEMORY_ALLOCATOR_NAME) };
|
||||
#[doc(alias = "GST_VULKAN_INSTANCE_CONTEXT_TYPE_STR")]
|
||||
pub static VULKAN_INSTANCE_CONTEXT_TYPE_STR: &GStr =
|
||||
unsafe { GStr::from_utf8_with_nul_unchecked(ffi::GST_VULKAN_INSTANCE_CONTEXT_TYPE_STR) };
|
||||
#[doc(alias = "GST_VULKAN_MEMORY_ALLOCATOR_NAME")]
|
||||
pub static VULKAN_MEMORY_ALLOCATOR_NAME: &GStr =
|
||||
unsafe { GStr::from_utf8_with_nul_unchecked(ffi::GST_VULKAN_MEMORY_ALLOCATOR_NAME) };
|
||||
#[doc(alias = "GST_VULKAN_QUEUE_CONTEXT_TYPE_STR")]
|
||||
pub static VULKAN_QUEUE_CONTEXT_TYPE_STR: &GStr =
|
||||
unsafe { GStr::from_utf8_with_nul_unchecked(ffi::GST_VULKAN_QUEUE_CONTEXT_TYPE_STR) };
|
||||
#[doc(alias = "GST_VULKAN_SWAPPER_VIDEO_FORMATS")]
|
||||
pub static VULKAN_SWAPPER_VIDEO_FORMATS: &GStr =
|
||||
unsafe { GStr::from_utf8_with_nul_unchecked(ffi::GST_VULKAN_SWAPPER_VIDEO_FORMATS) };
|
838
gstreamer-vulkan/src/auto/enums.rs
Normal file
838
gstreamer-vulkan/src/auto/enums.rs
Normal file
|
@ -0,0 +1,838 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::ffi;
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[doc(alias = "GstVulkanBarrierFlags")]
|
||||
pub enum VulkanBarrierFlags {
|
||||
#[doc(alias = "GST_VULKAN_BARRIER_FLAG_NONE")]
|
||||
None,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl IntoGlib for VulkanBarrierFlags {
|
||||
type GlibType = ffi::GstVulkanBarrierFlags;
|
||||
|
||||
#[inline]
|
||||
fn into_glib(self) -> ffi::GstVulkanBarrierFlags {
|
||||
match self {
|
||||
Self::None => ffi::GST_VULKAN_BARRIER_FLAG_NONE,
|
||||
Self::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::GstVulkanBarrierFlags> for VulkanBarrierFlags {
|
||||
#[inline]
|
||||
unsafe fn from_glib(value: ffi::GstVulkanBarrierFlags) -> Self {
|
||||
skip_assert_initialized!();
|
||||
|
||||
match value {
|
||||
ffi::GST_VULKAN_BARRIER_FLAG_NONE => Self::None,
|
||||
value => Self::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl StaticType for VulkanBarrierFlags {
|
||||
#[inline]
|
||||
#[doc(alias = "gst_vulkan_barrier_flags_get_type")]
|
||||
fn static_type() -> glib::Type {
|
||||
unsafe { from_glib(ffi::gst_vulkan_barrier_flags_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::HasParamSpec for VulkanBarrierFlags {
|
||||
type ParamSpec = glib::ParamSpecEnum;
|
||||
type SetValue = Self;
|
||||
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
|
||||
|
||||
fn param_spec_builder() -> Self::BuilderFn {
|
||||
Self::ParamSpec::builder_with_default
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::value::ValueType for VulkanBarrierFlags {
|
||||
type Type = Self;
|
||||
}
|
||||
|
||||
unsafe impl<'a> glib::value::FromValue<'a> for VulkanBarrierFlags {
|
||||
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
||||
|
||||
#[inline]
|
||||
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
||||
skip_assert_initialized!();
|
||||
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
impl ToValue for VulkanBarrierFlags {
|
||||
#[inline]
|
||||
fn to_value(&self) -> glib::Value {
|
||||
let mut value = glib::Value::for_value_type::<Self>();
|
||||
unsafe {
|
||||
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
|
||||
}
|
||||
value
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn value_type(&self) -> glib::Type {
|
||||
Self::static_type()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<VulkanBarrierFlags> for glib::Value {
|
||||
#[inline]
|
||||
fn from(v: VulkanBarrierFlags) -> Self {
|
||||
skip_assert_initialized!();
|
||||
ToValue::to_value(&v)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[doc(alias = "GstVulkanBarrierType")]
|
||||
pub enum VulkanBarrierType {
|
||||
#[doc(alias = "GST_VULKAN_BARRIER_NONE")]
|
||||
None,
|
||||
#[doc(alias = "GST_VULKAN_BARRIER_TYPE_MEMORY")]
|
||||
TypeMemory,
|
||||
#[doc(alias = "GST_VULKAN_BARRIER_TYPE_BUFFER")]
|
||||
TypeBuffer,
|
||||
#[doc(alias = "GST_VULKAN_BARRIER_TYPE_IMAGE")]
|
||||
TypeImage,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl IntoGlib for VulkanBarrierType {
|
||||
type GlibType = ffi::GstVulkanBarrierType;
|
||||
|
||||
#[inline]
|
||||
fn into_glib(self) -> ffi::GstVulkanBarrierType {
|
||||
match self {
|
||||
Self::None => ffi::GST_VULKAN_BARRIER_NONE,
|
||||
Self::TypeMemory => ffi::GST_VULKAN_BARRIER_TYPE_MEMORY,
|
||||
Self::TypeBuffer => ffi::GST_VULKAN_BARRIER_TYPE_BUFFER,
|
||||
Self::TypeImage => ffi::GST_VULKAN_BARRIER_TYPE_IMAGE,
|
||||
Self::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::GstVulkanBarrierType> for VulkanBarrierType {
|
||||
#[inline]
|
||||
unsafe fn from_glib(value: ffi::GstVulkanBarrierType) -> Self {
|
||||
skip_assert_initialized!();
|
||||
|
||||
match value {
|
||||
ffi::GST_VULKAN_BARRIER_NONE => Self::None,
|
||||
ffi::GST_VULKAN_BARRIER_TYPE_MEMORY => Self::TypeMemory,
|
||||
ffi::GST_VULKAN_BARRIER_TYPE_BUFFER => Self::TypeBuffer,
|
||||
ffi::GST_VULKAN_BARRIER_TYPE_IMAGE => Self::TypeImage,
|
||||
value => Self::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl StaticType for VulkanBarrierType {
|
||||
#[inline]
|
||||
#[doc(alias = "gst_vulkan_barrier_type_get_type")]
|
||||
fn static_type() -> glib::Type {
|
||||
unsafe { from_glib(ffi::gst_vulkan_barrier_type_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::HasParamSpec for VulkanBarrierType {
|
||||
type ParamSpec = glib::ParamSpecEnum;
|
||||
type SetValue = Self;
|
||||
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
|
||||
|
||||
fn param_spec_builder() -> Self::BuilderFn {
|
||||
Self::ParamSpec::builder_with_default
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::value::ValueType for VulkanBarrierType {
|
||||
type Type = Self;
|
||||
}
|
||||
|
||||
unsafe impl<'a> glib::value::FromValue<'a> for VulkanBarrierType {
|
||||
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
||||
|
||||
#[inline]
|
||||
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
||||
skip_assert_initialized!();
|
||||
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
impl ToValue for VulkanBarrierType {
|
||||
#[inline]
|
||||
fn to_value(&self) -> glib::Value {
|
||||
let mut value = glib::Value::for_value_type::<Self>();
|
||||
unsafe {
|
||||
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
|
||||
}
|
||||
value
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn value_type(&self) -> glib::Type {
|
||||
Self::static_type()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<VulkanBarrierType> for glib::Value {
|
||||
#[inline]
|
||||
fn from(v: VulkanBarrierType) -> Self {
|
||||
skip_assert_initialized!();
|
||||
ToValue::to_value(&v)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[doc(alias = "GstVulkanError")]
|
||||
pub enum VulkanError {
|
||||
#[doc(alias = "GST_VULKAN_FAILED")]
|
||||
Failed,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
impl VulkanError {
|
||||
//#[doc(alias = "gst_vulkan_error_to_g_error")]
|
||||
//pub fn to_g_error(result: vulkan::Result, format: &str, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) -> (vulkan::Result, glib::Error) {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_error_to_g_error() }
|
||||
//}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl IntoGlib for VulkanError {
|
||||
type GlibType = ffi::GstVulkanError;
|
||||
|
||||
#[inline]
|
||||
fn into_glib(self) -> ffi::GstVulkanError {
|
||||
match self {
|
||||
Self::Failed => ffi::GST_VULKAN_FAILED,
|
||||
Self::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::GstVulkanError> for VulkanError {
|
||||
#[inline]
|
||||
unsafe fn from_glib(value: ffi::GstVulkanError) -> Self {
|
||||
skip_assert_initialized!();
|
||||
|
||||
match value {
|
||||
ffi::GST_VULKAN_FAILED => Self::Failed,
|
||||
value => Self::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::error::ErrorDomain for VulkanError {
|
||||
#[inline]
|
||||
fn domain() -> glib::Quark {
|
||||
skip_assert_initialized!();
|
||||
|
||||
unsafe { from_glib(ffi::gst_vulkan_error_quark()) }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn code(self) -> i32 {
|
||||
self.into_glib()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[allow(clippy::match_single_binding)]
|
||||
fn from(code: i32) -> Option<Self> {
|
||||
skip_assert_initialized!();
|
||||
match unsafe { from_glib(code) } {
|
||||
Self::__Unknown(_) => Some(Self::Failed),
|
||||
value => Some(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl StaticType for VulkanError {
|
||||
#[inline]
|
||||
#[doc(alias = "gst_vulkan_error_get_type")]
|
||||
fn static_type() -> glib::Type {
|
||||
unsafe { from_glib(ffi::gst_vulkan_error_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::HasParamSpec for VulkanError {
|
||||
type ParamSpec = glib::ParamSpecEnum;
|
||||
type SetValue = Self;
|
||||
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
|
||||
|
||||
fn param_spec_builder() -> Self::BuilderFn {
|
||||
Self::ParamSpec::builder_with_default
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::value::ValueType for VulkanError {
|
||||
type Type = Self;
|
||||
}
|
||||
|
||||
unsafe impl<'a> glib::value::FromValue<'a> for VulkanError {
|
||||
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
||||
|
||||
#[inline]
|
||||
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
||||
skip_assert_initialized!();
|
||||
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
impl ToValue for VulkanError {
|
||||
#[inline]
|
||||
fn to_value(&self) -> glib::Value {
|
||||
let mut value = glib::Value::for_value_type::<Self>();
|
||||
unsafe {
|
||||
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
|
||||
}
|
||||
value
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn value_type(&self) -> glib::Type {
|
||||
Self::static_type()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<VulkanError> for glib::Value {
|
||||
#[inline]
|
||||
fn from(v: VulkanError) -> Self {
|
||||
skip_assert_initialized!();
|
||||
ToValue::to_value(&v)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[doc(alias = "GstVulkanFormatScaling")]
|
||||
pub enum VulkanFormatScaling {
|
||||
#[doc(alias = "GST_VULKAN_FORMAT_SCALING_UNORM")]
|
||||
Unorm,
|
||||
#[doc(alias = "GST_VULKAN_FORMAT_SCALING_SNORM")]
|
||||
Snorm,
|
||||
#[doc(alias = "GST_VULKAN_FORMAT_SCALING_USCALED")]
|
||||
Uscaled,
|
||||
#[doc(alias = "GST_VULKAN_FORMAT_SCALING_SSCALED")]
|
||||
Sscaled,
|
||||
#[doc(alias = "GST_VULKAN_FORMAT_SCALING_UINT")]
|
||||
Uint,
|
||||
#[doc(alias = "GST_VULKAN_FORMAT_SCALING_SINT")]
|
||||
Sint,
|
||||
#[doc(alias = "GST_VULKAN_FORMAT_SCALING_SRGB")]
|
||||
Srgb,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl IntoGlib for VulkanFormatScaling {
|
||||
type GlibType = ffi::GstVulkanFormatScaling;
|
||||
|
||||
#[inline]
|
||||
fn into_glib(self) -> ffi::GstVulkanFormatScaling {
|
||||
match self {
|
||||
Self::Unorm => ffi::GST_VULKAN_FORMAT_SCALING_UNORM,
|
||||
Self::Snorm => ffi::GST_VULKAN_FORMAT_SCALING_SNORM,
|
||||
Self::Uscaled => ffi::GST_VULKAN_FORMAT_SCALING_USCALED,
|
||||
Self::Sscaled => ffi::GST_VULKAN_FORMAT_SCALING_SSCALED,
|
||||
Self::Uint => ffi::GST_VULKAN_FORMAT_SCALING_UINT,
|
||||
Self::Sint => ffi::GST_VULKAN_FORMAT_SCALING_SINT,
|
||||
Self::Srgb => ffi::GST_VULKAN_FORMAT_SCALING_SRGB,
|
||||
Self::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::GstVulkanFormatScaling> for VulkanFormatScaling {
|
||||
#[inline]
|
||||
unsafe fn from_glib(value: ffi::GstVulkanFormatScaling) -> Self {
|
||||
skip_assert_initialized!();
|
||||
|
||||
match value {
|
||||
ffi::GST_VULKAN_FORMAT_SCALING_UNORM => Self::Unorm,
|
||||
ffi::GST_VULKAN_FORMAT_SCALING_SNORM => Self::Snorm,
|
||||
ffi::GST_VULKAN_FORMAT_SCALING_USCALED => Self::Uscaled,
|
||||
ffi::GST_VULKAN_FORMAT_SCALING_SSCALED => Self::Sscaled,
|
||||
ffi::GST_VULKAN_FORMAT_SCALING_UINT => Self::Uint,
|
||||
ffi::GST_VULKAN_FORMAT_SCALING_SINT => Self::Sint,
|
||||
ffi::GST_VULKAN_FORMAT_SCALING_SRGB => Self::Srgb,
|
||||
value => Self::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl StaticType for VulkanFormatScaling {
|
||||
#[inline]
|
||||
#[doc(alias = "gst_vulkan_format_scaling_get_type")]
|
||||
fn static_type() -> glib::Type {
|
||||
unsafe { from_glib(ffi::gst_vulkan_format_scaling_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::HasParamSpec for VulkanFormatScaling {
|
||||
type ParamSpec = glib::ParamSpecEnum;
|
||||
type SetValue = Self;
|
||||
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
|
||||
|
||||
fn param_spec_builder() -> Self::BuilderFn {
|
||||
Self::ParamSpec::builder_with_default
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::value::ValueType for VulkanFormatScaling {
|
||||
type Type = Self;
|
||||
}
|
||||
|
||||
unsafe impl<'a> glib::value::FromValue<'a> for VulkanFormatScaling {
|
||||
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
||||
|
||||
#[inline]
|
||||
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
||||
skip_assert_initialized!();
|
||||
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
impl ToValue for VulkanFormatScaling {
|
||||
#[inline]
|
||||
fn to_value(&self) -> glib::Value {
|
||||
let mut value = glib::Value::for_value_type::<Self>();
|
||||
unsafe {
|
||||
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
|
||||
}
|
||||
value
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn value_type(&self) -> glib::Type {
|
||||
Self::static_type()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<VulkanFormatScaling> for glib::Value {
|
||||
#[inline]
|
||||
fn from(v: VulkanFormatScaling) -> Self {
|
||||
skip_assert_initialized!();
|
||||
ToValue::to_value(&v)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[doc(alias = "GstVulkanHandleType")]
|
||||
pub enum VulkanHandleType {
|
||||
#[doc(alias = "GST_VULKAN_HANDLE_TYPE_DESCRIPTOR_SET_LAYOUT")]
|
||||
DescriptorSetLayout,
|
||||
#[doc(alias = "GST_VULKAN_HANDLE_TYPE_PIPELINE_LAYOUT")]
|
||||
PipelineLayout,
|
||||
#[doc(alias = "GST_VULKAN_HANDLE_TYPE_PIPELINE")]
|
||||
Pipeline,
|
||||
#[doc(alias = "GST_VULKAN_HANDLE_TYPE_RENDER_PASS")]
|
||||
RenderPass,
|
||||
#[doc(alias = "GST_VULKAN_HANDLE_TYPE_SAMPLER")]
|
||||
Sampler,
|
||||
#[doc(alias = "GST_VULKAN_HANDLE_TYPE_FRAMEBUFFER")]
|
||||
Framebuffer,
|
||||
#[doc(alias = "GST_VULKAN_HANDLE_TYPE_SHADER")]
|
||||
Shader,
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
#[doc(alias = "GST_VULKAN_HANDLE_TYPE_VIDEO_SESSION")]
|
||||
VideoSession,
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
#[doc(alias = "GST_VULKAN_HANDLE_TYPE_VIDEO_SESSION_PARAMETERS")]
|
||||
VideoSessionParameters,
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
#[doc(alias = "GST_VULKAN_HANDLE_TYPE_SAMPLER_YCBCR_CONVERSION")]
|
||||
SamplerYcbcrConversion,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl IntoGlib for VulkanHandleType {
|
||||
type GlibType = ffi::GstVulkanHandleType;
|
||||
|
||||
#[inline]
|
||||
fn into_glib(self) -> ffi::GstVulkanHandleType {
|
||||
match self {
|
||||
Self::DescriptorSetLayout => ffi::GST_VULKAN_HANDLE_TYPE_DESCRIPTOR_SET_LAYOUT,
|
||||
Self::PipelineLayout => ffi::GST_VULKAN_HANDLE_TYPE_PIPELINE_LAYOUT,
|
||||
Self::Pipeline => ffi::GST_VULKAN_HANDLE_TYPE_PIPELINE,
|
||||
Self::RenderPass => ffi::GST_VULKAN_HANDLE_TYPE_RENDER_PASS,
|
||||
Self::Sampler => ffi::GST_VULKAN_HANDLE_TYPE_SAMPLER,
|
||||
Self::Framebuffer => ffi::GST_VULKAN_HANDLE_TYPE_FRAMEBUFFER,
|
||||
Self::Shader => ffi::GST_VULKAN_HANDLE_TYPE_SHADER,
|
||||
#[cfg(feature = "v1_24")]
|
||||
Self::VideoSession => ffi::GST_VULKAN_HANDLE_TYPE_VIDEO_SESSION,
|
||||
#[cfg(feature = "v1_24")]
|
||||
Self::VideoSessionParameters => ffi::GST_VULKAN_HANDLE_TYPE_VIDEO_SESSION_PARAMETERS,
|
||||
#[cfg(feature = "v1_24")]
|
||||
Self::SamplerYcbcrConversion => ffi::GST_VULKAN_HANDLE_TYPE_SAMPLER_YCBCR_CONVERSION,
|
||||
Self::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::GstVulkanHandleType> for VulkanHandleType {
|
||||
#[inline]
|
||||
unsafe fn from_glib(value: ffi::GstVulkanHandleType) -> Self {
|
||||
skip_assert_initialized!();
|
||||
|
||||
match value {
|
||||
ffi::GST_VULKAN_HANDLE_TYPE_DESCRIPTOR_SET_LAYOUT => Self::DescriptorSetLayout,
|
||||
ffi::GST_VULKAN_HANDLE_TYPE_PIPELINE_LAYOUT => Self::PipelineLayout,
|
||||
ffi::GST_VULKAN_HANDLE_TYPE_PIPELINE => Self::Pipeline,
|
||||
ffi::GST_VULKAN_HANDLE_TYPE_RENDER_PASS => Self::RenderPass,
|
||||
ffi::GST_VULKAN_HANDLE_TYPE_SAMPLER => Self::Sampler,
|
||||
ffi::GST_VULKAN_HANDLE_TYPE_FRAMEBUFFER => Self::Framebuffer,
|
||||
ffi::GST_VULKAN_HANDLE_TYPE_SHADER => Self::Shader,
|
||||
#[cfg(feature = "v1_24")]
|
||||
ffi::GST_VULKAN_HANDLE_TYPE_VIDEO_SESSION => Self::VideoSession,
|
||||
#[cfg(feature = "v1_24")]
|
||||
ffi::GST_VULKAN_HANDLE_TYPE_VIDEO_SESSION_PARAMETERS => Self::VideoSessionParameters,
|
||||
#[cfg(feature = "v1_24")]
|
||||
ffi::GST_VULKAN_HANDLE_TYPE_SAMPLER_YCBCR_CONVERSION => Self::SamplerYcbcrConversion,
|
||||
value => Self::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl StaticType for VulkanHandleType {
|
||||
#[inline]
|
||||
#[doc(alias = "gst_vulkan_handle_type_get_type")]
|
||||
fn static_type() -> glib::Type {
|
||||
unsafe { from_glib(ffi::gst_vulkan_handle_type_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::HasParamSpec for VulkanHandleType {
|
||||
type ParamSpec = glib::ParamSpecEnum;
|
||||
type SetValue = Self;
|
||||
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
|
||||
|
||||
fn param_spec_builder() -> Self::BuilderFn {
|
||||
Self::ParamSpec::builder_with_default
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::value::ValueType for VulkanHandleType {
|
||||
type Type = Self;
|
||||
}
|
||||
|
||||
unsafe impl<'a> glib::value::FromValue<'a> for VulkanHandleType {
|
||||
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
||||
|
||||
#[inline]
|
||||
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
||||
skip_assert_initialized!();
|
||||
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
impl ToValue for VulkanHandleType {
|
||||
#[inline]
|
||||
fn to_value(&self) -> glib::Value {
|
||||
let mut value = glib::Value::for_value_type::<Self>();
|
||||
unsafe {
|
||||
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
|
||||
}
|
||||
value
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn value_type(&self) -> glib::Type {
|
||||
Self::static_type()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<VulkanHandleType> for glib::Value {
|
||||
#[inline]
|
||||
fn from(v: VulkanHandleType) -> Self {
|
||||
skip_assert_initialized!();
|
||||
ToValue::to_value(&v)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[doc(alias = "GstVulkanVideoOperation")]
|
||||
pub enum VulkanVideoOperation {
|
||||
#[doc(alias = "GST_VULKAN_VIDEO_OPERATION_DECODE")]
|
||||
Decode,
|
||||
#[doc(alias = "GST_VULKAN_VIDEO_OPERATION_ENCODE")]
|
||||
Encode,
|
||||
#[doc(alias = "GST_VULKAN_VIDEO_OPERATION_UNKNOWN")]
|
||||
Unknown,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
#[doc(hidden)]
|
||||
impl IntoGlib for VulkanVideoOperation {
|
||||
type GlibType = ffi::GstVulkanVideoOperation;
|
||||
|
||||
#[inline]
|
||||
fn into_glib(self) -> ffi::GstVulkanVideoOperation {
|
||||
match self {
|
||||
Self::Decode => ffi::GST_VULKAN_VIDEO_OPERATION_DECODE,
|
||||
Self::Encode => ffi::GST_VULKAN_VIDEO_OPERATION_ENCODE,
|
||||
Self::Unknown => ffi::GST_VULKAN_VIDEO_OPERATION_UNKNOWN,
|
||||
Self::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::GstVulkanVideoOperation> for VulkanVideoOperation {
|
||||
#[inline]
|
||||
unsafe fn from_glib(value: ffi::GstVulkanVideoOperation) -> Self {
|
||||
skip_assert_initialized!();
|
||||
|
||||
match value {
|
||||
ffi::GST_VULKAN_VIDEO_OPERATION_DECODE => Self::Decode,
|
||||
ffi::GST_VULKAN_VIDEO_OPERATION_ENCODE => Self::Encode,
|
||||
ffi::GST_VULKAN_VIDEO_OPERATION_UNKNOWN => Self::Unknown,
|
||||
value => Self::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
impl StaticType for VulkanVideoOperation {
|
||||
#[inline]
|
||||
#[doc(alias = "gst_vulkan_video_operation_get_type")]
|
||||
fn static_type() -> glib::Type {
|
||||
unsafe { from_glib(ffi::gst_vulkan_video_operation_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
impl glib::HasParamSpec for VulkanVideoOperation {
|
||||
type ParamSpec = glib::ParamSpecEnum;
|
||||
type SetValue = Self;
|
||||
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
|
||||
|
||||
fn param_spec_builder() -> Self::BuilderFn {
|
||||
Self::ParamSpec::builder_with_default
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
impl glib::value::ValueType for VulkanVideoOperation {
|
||||
type Type = Self;
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
unsafe impl<'a> glib::value::FromValue<'a> for VulkanVideoOperation {
|
||||
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
||||
|
||||
#[inline]
|
||||
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
||||
skip_assert_initialized!();
|
||||
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
impl ToValue for VulkanVideoOperation {
|
||||
#[inline]
|
||||
fn to_value(&self) -> glib::Value {
|
||||
let mut value = glib::Value::for_value_type::<Self>();
|
||||
unsafe {
|
||||
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
|
||||
}
|
||||
value
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn value_type(&self) -> glib::Type {
|
||||
Self::static_type()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
impl From<VulkanVideoOperation> for glib::Value {
|
||||
#[inline]
|
||||
fn from(v: VulkanVideoOperation) -> Self {
|
||||
skip_assert_initialized!();
|
||||
ToValue::to_value(&v)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[doc(alias = "GstVulkanWindowError")]
|
||||
pub enum VulkanWindowError {
|
||||
#[doc(alias = "GST_VULKAN_WINDOW_ERROR_FAILED")]
|
||||
Failed,
|
||||
#[doc(alias = "GST_VULKAN_WINDOW_ERROR_OLD_LIBS")]
|
||||
OldLibs,
|
||||
#[doc(alias = "GST_VULKAN_WINDOW_ERROR_RESOURCE_UNAVAILABLE")]
|
||||
ResourceUnavailable,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
impl VulkanWindowError {
|
||||
#[doc(alias = "gst_vulkan_window_error_quark")]
|
||||
pub fn quark() -> glib::Quark {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib(ffi::gst_vulkan_window_error_quark()) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl IntoGlib for VulkanWindowError {
|
||||
type GlibType = ffi::GstVulkanWindowError;
|
||||
|
||||
#[inline]
|
||||
fn into_glib(self) -> ffi::GstVulkanWindowError {
|
||||
match self {
|
||||
Self::Failed => ffi::GST_VULKAN_WINDOW_ERROR_FAILED,
|
||||
Self::OldLibs => ffi::GST_VULKAN_WINDOW_ERROR_OLD_LIBS,
|
||||
Self::ResourceUnavailable => ffi::GST_VULKAN_WINDOW_ERROR_RESOURCE_UNAVAILABLE,
|
||||
Self::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::GstVulkanWindowError> for VulkanWindowError {
|
||||
#[inline]
|
||||
unsafe fn from_glib(value: ffi::GstVulkanWindowError) -> Self {
|
||||
skip_assert_initialized!();
|
||||
|
||||
match value {
|
||||
ffi::GST_VULKAN_WINDOW_ERROR_FAILED => Self::Failed,
|
||||
ffi::GST_VULKAN_WINDOW_ERROR_OLD_LIBS => Self::OldLibs,
|
||||
ffi::GST_VULKAN_WINDOW_ERROR_RESOURCE_UNAVAILABLE => Self::ResourceUnavailable,
|
||||
value => Self::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::error::ErrorDomain for VulkanWindowError {
|
||||
#[inline]
|
||||
fn domain() -> glib::Quark {
|
||||
skip_assert_initialized!();
|
||||
|
||||
static QUARK: ::std::sync::OnceLock<glib::ffi::GQuark> = ::std::sync::OnceLock::new();
|
||||
let quark = *QUARK.get_or_init(|| unsafe {
|
||||
glib::ffi::g_quark_from_static_string(
|
||||
b"gst-gl-window-error-quark\0".as_ptr() as *const _
|
||||
)
|
||||
});
|
||||
unsafe { from_glib(quark) }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn code(self) -> i32 {
|
||||
self.into_glib()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[allow(clippy::match_single_binding)]
|
||||
fn from(code: i32) -> Option<Self> {
|
||||
skip_assert_initialized!();
|
||||
match unsafe { from_glib(code) } {
|
||||
Self::__Unknown(_) => Some(Self::Failed),
|
||||
value => Some(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl StaticType for VulkanWindowError {
|
||||
#[inline]
|
||||
#[doc(alias = "gst_vulkan_window_error_get_type")]
|
||||
fn static_type() -> glib::Type {
|
||||
unsafe { from_glib(ffi::gst_vulkan_window_error_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::HasParamSpec for VulkanWindowError {
|
||||
type ParamSpec = glib::ParamSpecEnum;
|
||||
type SetValue = Self;
|
||||
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
|
||||
|
||||
fn param_spec_builder() -> Self::BuilderFn {
|
||||
Self::ParamSpec::builder_with_default
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::value::ValueType for VulkanWindowError {
|
||||
type Type = Self;
|
||||
}
|
||||
|
||||
unsafe impl<'a> glib::value::FromValue<'a> for VulkanWindowError {
|
||||
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
||||
|
||||
#[inline]
|
||||
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
||||
skip_assert_initialized!();
|
||||
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
impl ToValue for VulkanWindowError {
|
||||
#[inline]
|
||||
fn to_value(&self) -> glib::Value {
|
||||
let mut value = glib::Value::for_value_type::<Self>();
|
||||
unsafe {
|
||||
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
|
||||
}
|
||||
value
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn value_type(&self) -> glib::Type {
|
||||
Self::static_type()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<VulkanWindowError> for glib::Value {
|
||||
#[inline]
|
||||
fn from(v: VulkanWindowError) -> Self {
|
||||
skip_assert_initialized!();
|
||||
ToValue::to_value(&v)
|
||||
}
|
||||
}
|
209
gstreamer-vulkan/src/auto/flags.rs
Normal file
209
gstreamer-vulkan/src/auto/flags.rs
Normal file
|
@ -0,0 +1,209 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::ffi;
|
||||
use glib::{bitflags::bitflags, prelude::*, translate::*};
|
||||
|
||||
bitflags! {
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
#[doc(alias = "GstVulkanDisplayType")]
|
||||
pub struct VulkanDisplayType: u32 {
|
||||
#[doc(alias = "GST_VULKAN_DISPLAY_TYPE_NONE")]
|
||||
const NONE = ffi::GST_VULKAN_DISPLAY_TYPE_NONE as _;
|
||||
#[doc(alias = "GST_VULKAN_DISPLAY_TYPE_XCB")]
|
||||
const XCB = ffi::GST_VULKAN_DISPLAY_TYPE_XCB as _;
|
||||
#[doc(alias = "GST_VULKAN_DISPLAY_TYPE_WAYLAND")]
|
||||
const WAYLAND = ffi::GST_VULKAN_DISPLAY_TYPE_WAYLAND as _;
|
||||
#[doc(alias = "GST_VULKAN_DISPLAY_TYPE_COCOA")]
|
||||
const COCOA = ffi::GST_VULKAN_DISPLAY_TYPE_COCOA as _;
|
||||
#[doc(alias = "GST_VULKAN_DISPLAY_TYPE_IOS")]
|
||||
const IOS = ffi::GST_VULKAN_DISPLAY_TYPE_IOS as _;
|
||||
#[doc(alias = "GST_VULKAN_DISPLAY_TYPE_WIN32")]
|
||||
const WIN32 = ffi::GST_VULKAN_DISPLAY_TYPE_WIN32 as _;
|
||||
#[doc(alias = "GST_VULKAN_DISPLAY_TYPE_ANDROID")]
|
||||
const ANDROID = ffi::GST_VULKAN_DISPLAY_TYPE_ANDROID as _;
|
||||
#[doc(alias = "GST_VULKAN_DISPLAY_TYPE_ANY")]
|
||||
const ANY = ffi::GST_VULKAN_DISPLAY_TYPE_ANY as _;
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanDisplayType {
|
||||
#[doc(alias = "gst_vulkan_display_type_to_extension_string")]
|
||||
pub fn to_extension_string(self) -> Option<glib::GString> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_vulkan_display_type_to_extension_string(
|
||||
self.into_glib(),
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl IntoGlib for VulkanDisplayType {
|
||||
type GlibType = ffi::GstVulkanDisplayType;
|
||||
|
||||
#[inline]
|
||||
fn into_glib(self) -> ffi::GstVulkanDisplayType {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::GstVulkanDisplayType> for VulkanDisplayType {
|
||||
#[inline]
|
||||
unsafe fn from_glib(value: ffi::GstVulkanDisplayType) -> Self {
|
||||
skip_assert_initialized!();
|
||||
Self::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl StaticType for VulkanDisplayType {
|
||||
#[inline]
|
||||
#[doc(alias = "gst_vulkan_display_type_get_type")]
|
||||
fn static_type() -> glib::Type {
|
||||
unsafe { from_glib(ffi::gst_vulkan_display_type_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::HasParamSpec for VulkanDisplayType {
|
||||
type ParamSpec = glib::ParamSpecFlags;
|
||||
type SetValue = Self;
|
||||
type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
|
||||
|
||||
fn param_spec_builder() -> Self::BuilderFn {
|
||||
Self::ParamSpec::builder
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::value::ValueType for VulkanDisplayType {
|
||||
type Type = Self;
|
||||
}
|
||||
|
||||
unsafe impl<'a> glib::value::FromValue<'a> for VulkanDisplayType {
|
||||
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
||||
|
||||
#[inline]
|
||||
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
||||
skip_assert_initialized!();
|
||||
from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
impl ToValue for VulkanDisplayType {
|
||||
#[inline]
|
||||
fn to_value(&self) -> glib::Value {
|
||||
let mut value = glib::Value::for_value_type::<Self>();
|
||||
unsafe {
|
||||
glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
|
||||
}
|
||||
value
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn value_type(&self) -> glib::Type {
|
||||
Self::static_type()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<VulkanDisplayType> for glib::Value {
|
||||
#[inline]
|
||||
fn from(v: VulkanDisplayType) -> Self {
|
||||
skip_assert_initialized!();
|
||||
ToValue::to_value(&v)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
#[doc(alias = "GstVulkanFormatFlags")]
|
||||
pub struct VulkanFormatFlags: u32 {
|
||||
#[doc(alias = "GST_VULKAN_FORMAT_FLAG_YUV")]
|
||||
const YUV = ffi::GST_VULKAN_FORMAT_FLAG_YUV as _;
|
||||
#[doc(alias = "GST_VULKAN_FORMAT_FLAG_RGB")]
|
||||
const RGB = ffi::GST_VULKAN_FORMAT_FLAG_RGB as _;
|
||||
#[doc(alias = "GST_VULKAN_FORMAT_FLAG_ALPHA")]
|
||||
const ALPHA = ffi::GST_VULKAN_FORMAT_FLAG_ALPHA as _;
|
||||
#[doc(alias = "GST_VULKAN_FORMAT_FLAG_LE")]
|
||||
const LE = ffi::GST_VULKAN_FORMAT_FLAG_LE as _;
|
||||
#[doc(alias = "GST_VULKAN_FORMAT_FLAG_COMPLEX")]
|
||||
const COMPLEX = ffi::GST_VULKAN_FORMAT_FLAG_COMPLEX as _;
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl IntoGlib for VulkanFormatFlags {
|
||||
type GlibType = ffi::GstVulkanFormatFlags;
|
||||
|
||||
#[inline]
|
||||
fn into_glib(self) -> ffi::GstVulkanFormatFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::GstVulkanFormatFlags> for VulkanFormatFlags {
|
||||
#[inline]
|
||||
unsafe fn from_glib(value: ffi::GstVulkanFormatFlags) -> Self {
|
||||
skip_assert_initialized!();
|
||||
Self::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl StaticType for VulkanFormatFlags {
|
||||
#[inline]
|
||||
#[doc(alias = "gst_vulkan_format_flags_get_type")]
|
||||
fn static_type() -> glib::Type {
|
||||
unsafe { from_glib(ffi::gst_vulkan_format_flags_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::HasParamSpec for VulkanFormatFlags {
|
||||
type ParamSpec = glib::ParamSpecFlags;
|
||||
type SetValue = Self;
|
||||
type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
|
||||
|
||||
fn param_spec_builder() -> Self::BuilderFn {
|
||||
Self::ParamSpec::builder
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::value::ValueType for VulkanFormatFlags {
|
||||
type Type = Self;
|
||||
}
|
||||
|
||||
unsafe impl<'a> glib::value::FromValue<'a> for VulkanFormatFlags {
|
||||
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
||||
|
||||
#[inline]
|
||||
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
||||
skip_assert_initialized!();
|
||||
from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
impl ToValue for VulkanFormatFlags {
|
||||
#[inline]
|
||||
fn to_value(&self) -> glib::Value {
|
||||
let mut value = glib::Value::for_value_type::<Self>();
|
||||
unsafe {
|
||||
glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
|
||||
}
|
||||
value
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn value_type(&self) -> glib::Type {
|
||||
Self::static_type()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<VulkanFormatFlags> for glib::Value {
|
||||
#[inline]
|
||||
fn from(v: VulkanFormatFlags) -> Self {
|
||||
skip_assert_initialized!();
|
||||
ToValue::to_value(&v)
|
||||
}
|
||||
}
|
189
gstreamer-vulkan/src/auto/functions.rs
Normal file
189
gstreamer-vulkan/src/auto/functions.rs
Normal file
|
@ -0,0 +1,189 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanDevice, VulkanHandle, VulkanImageMemory, VulkanImageView};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
#[doc(alias = "gst_is_vulkan_buffer_memory")]
|
||||
pub fn is_vulkan_buffer_memory(mem: &gst::Memory) -> bool {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib(ffi::gst_is_vulkan_buffer_memory(mem.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_is_vulkan_image_memory")]
|
||||
pub fn is_vulkan_image_memory(mem: &gst::Memory) -> bool {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib(ffi::gst_is_vulkan_image_memory(mem.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_is_vulkan_memory")]
|
||||
pub fn is_vulkan_memory(mem: &gst::Memory) -> bool {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib(ffi::gst_is_vulkan_memory(mem.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_create_shader")]
|
||||
pub fn vulkan_create_shader(
|
||||
device: &impl IsA<VulkanDevice>,
|
||||
code: &str,
|
||||
size: usize,
|
||||
) -> Result<VulkanHandle, glib::Error> {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let ret = ffi::gst_vulkan_create_shader(
|
||||
device.as_ref().to_glib_none().0,
|
||||
code.to_glib_none().0,
|
||||
size,
|
||||
&mut error,
|
||||
);
|
||||
if error.is_null() {
|
||||
Ok(from_glib_full(ret))
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_ensure_element_data")]
|
||||
//pub fn vulkan_ensure_element_data(element: &impl IsA<gst::Element>, display_ptr: impl IsA<VulkanDisplay>, instance_ptr: impl IsA<VulkanInstance>) -> bool {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_ensure_element_data() }
|
||||
//}
|
||||
|
||||
#[doc(alias = "gst_vulkan_format_from_video_info")]
|
||||
pub fn vulkan_format_from_video_info(v_info: &gst_video::VideoInfo, plane: u32) -> vulkan::Format {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { ffi::gst_vulkan_format_from_video_info(mut_override(v_info.to_glib_none().0), plane) }
|
||||
}
|
||||
|
||||
//#[cfg(feature = "v1_24")]
|
||||
//#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
//#[doc(alias = "gst_vulkan_format_from_video_info_2")]
|
||||
//pub fn vulkan_format_from_video_info_2(physical_device: &impl IsA<VulkanPhysicalDevice>, info: &mut gst_video::VideoInfo, tiling: vulkan::ImageTiling, no_multiplane: bool, requested_usage: vulkan::ImageUsageFlags, fmts: /*Unimplemented*/FixedArray TypeId { ns_id: 8, id: 38 }; 4) -> Option<(i32, vulkan::ImageUsageFlags)> {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_format_from_video_info_2() }
|
||||
//}
|
||||
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
#[doc(alias = "gst_vulkan_format_get_aspect")]
|
||||
pub fn vulkan_format_get_aspect(format: vulkan::Format) -> u32 {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { ffi::gst_vulkan_format_get_aspect(format) }
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_format_get_info")]
|
||||
//pub fn vulkan_format_get_info(format: vulkan::Format) -> /*Ignored*/Option<VulkanFormatInfo> {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_format_get_info() }
|
||||
//}
|
||||
|
||||
//#[cfg(feature = "v1_26")]
|
||||
//#[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
|
||||
//#[doc(alias = "gst_vulkan_format_get_map")]
|
||||
//pub fn vulkan_format_get_map(format: gst_video::VideoFormat) -> /*Ignored*/Option<VulkanFormatMap> {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_format_get_map() }
|
||||
//}
|
||||
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
#[doc(alias = "gst_vulkan_format_to_video_format")]
|
||||
pub fn vulkan_format_to_video_format(vk_format: vulkan::Format) -> gst_video::VideoFormat {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib(ffi::gst_vulkan_format_to_video_format(vk_format)) }
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_get_or_create_image_view")]
|
||||
pub fn vulkan_get_or_create_image_view(image: &mut VulkanImageMemory) -> VulkanImageView {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_get_or_create_image_view(
|
||||
image.to_glib_none_mut().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
#[doc(alias = "gst_vulkan_get_or_create_image_view_with_info")]
|
||||
pub fn vulkan_get_or_create_image_view_with_info(
|
||||
image: &mut VulkanImageMemory,
|
||||
create_info: vulkan::ImageViewCreateInfo,
|
||||
) -> VulkanImageView {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_get_or_create_image_view_with_info(
|
||||
image.to_glib_none_mut().0,
|
||||
create_info,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_global_context_query")]
|
||||
pub fn vulkan_global_context_query(element: &impl IsA<gst::Element>, context_type: &str) {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
ffi::gst_vulkan_global_context_query(
|
||||
element.as_ref().to_glib_none().0,
|
||||
context_type.to_glib_none().0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_local_context_query")]
|
||||
pub fn vulkan_local_context_query(
|
||||
element: &impl IsA<gst::Element>,
|
||||
context_type: &str,
|
||||
) -> gst::Query {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_local_context_query(
|
||||
element.as_ref().to_glib_none().0,
|
||||
context_type.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_20")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
||||
#[doc(alias = "gst_vulkan_present_mode_to_string")]
|
||||
pub fn vulkan_present_mode_to_string(present_mode: vulkan::PresentModeKHR) -> glib::GString {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_none(ffi::gst_vulkan_present_mode_to_string(present_mode)) }
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_22")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
|
||||
#[doc(alias = "gst_vulkan_result_to_string")]
|
||||
pub fn vulkan_result_to_string(result: vulkan::Result) -> glib::GString {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_none(ffi::gst_vulkan_result_to_string(result)) }
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_run_query")]
|
||||
pub fn vulkan_run_query(
|
||||
element: &impl IsA<gst::Element>,
|
||||
query: &gst::Query,
|
||||
direction: gst::PadDirection,
|
||||
) -> bool {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_run_query(
|
||||
element.as_ref().to_glib_none().0,
|
||||
query.to_glib_none().0,
|
||||
direction.into_glib(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_sample_count_flags_to_string")]
|
||||
pub fn vulkan_sample_count_flags_to_string(
|
||||
sample_count_bits: vulkan::SampleCountFlags,
|
||||
) -> glib::GString {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_sample_count_flags_to_string(
|
||||
sample_count_bits,
|
||||
))
|
||||
}
|
||||
}
|
132
gstreamer-vulkan/src/auto/mod.rs
Normal file
132
gstreamer-vulkan/src/auto/mod.rs
Normal file
|
@ -0,0 +1,132 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
mod vulkan_buffer_memory_allocator;
|
||||
pub use self::vulkan_buffer_memory_allocator::VulkanBufferMemoryAllocator;
|
||||
|
||||
mod vulkan_buffer_pool;
|
||||
pub use self::vulkan_buffer_pool::VulkanBufferPool;
|
||||
|
||||
mod vulkan_command_pool;
|
||||
pub use self::vulkan_command_pool::VulkanCommandPool;
|
||||
|
||||
mod vulkan_descriptor_cache;
|
||||
pub use self::vulkan_descriptor_cache::VulkanDescriptorCache;
|
||||
|
||||
mod vulkan_descriptor_pool;
|
||||
pub use self::vulkan_descriptor_pool::VulkanDescriptorPool;
|
||||
|
||||
mod vulkan_device;
|
||||
pub use self::vulkan_device::VulkanDevice;
|
||||
|
||||
mod vulkan_display;
|
||||
pub use self::vulkan_display::VulkanDisplay;
|
||||
|
||||
mod vulkan_fence_cache;
|
||||
pub use self::vulkan_fence_cache::VulkanFenceCache;
|
||||
|
||||
mod vulkan_full_screen_quad;
|
||||
pub use self::vulkan_full_screen_quad::VulkanFullScreenQuad;
|
||||
|
||||
mod vulkan_handle_pool;
|
||||
pub use self::vulkan_handle_pool::VulkanHandlePool;
|
||||
|
||||
mod vulkan_image_buffer_pool;
|
||||
pub use self::vulkan_image_buffer_pool::VulkanImageBufferPool;
|
||||
|
||||
mod vulkan_image_memory_allocator;
|
||||
pub use self::vulkan_image_memory_allocator::VulkanImageMemoryAllocator;
|
||||
|
||||
mod vulkan_instance;
|
||||
pub use self::vulkan_instance::VulkanInstance;
|
||||
|
||||
mod vulkan_memory_allocator;
|
||||
pub use self::vulkan_memory_allocator::VulkanMemoryAllocator;
|
||||
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
mod vulkan_operation;
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
pub use self::vulkan_operation::VulkanOperation;
|
||||
|
||||
mod vulkan_physical_device;
|
||||
pub use self::vulkan_physical_device::VulkanPhysicalDevice;
|
||||
|
||||
mod vulkan_queue;
|
||||
pub use self::vulkan_queue::VulkanQueue;
|
||||
|
||||
mod vulkan_swapper;
|
||||
pub use self::vulkan_swapper::VulkanSwapper;
|
||||
|
||||
mod vulkan_trash_fence_list;
|
||||
pub use self::vulkan_trash_fence_list::VulkanTrashFenceList;
|
||||
|
||||
mod vulkan_trash_list;
|
||||
pub use self::vulkan_trash_list::VulkanTrashList;
|
||||
|
||||
mod vulkan_video_filter;
|
||||
pub use self::vulkan_video_filter::VulkanVideoFilter;
|
||||
|
||||
mod vulkan_window;
|
||||
pub use self::vulkan_window::VulkanWindow;
|
||||
|
||||
mod vulkan_fence;
|
||||
pub use self::vulkan_fence::VulkanFence;
|
||||
|
||||
mod vulkan_handle;
|
||||
pub use self::vulkan_handle::VulkanHandle;
|
||||
|
||||
mod vulkan_trash;
|
||||
pub use self::vulkan_trash::VulkanTrash;
|
||||
|
||||
mod enums;
|
||||
pub use self::enums::VulkanBarrierFlags;
|
||||
pub use self::enums::VulkanBarrierType;
|
||||
pub use self::enums::VulkanError;
|
||||
pub use self::enums::VulkanFormatScaling;
|
||||
pub use self::enums::VulkanHandleType;
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
pub use self::enums::VulkanVideoOperation;
|
||||
pub use self::enums::VulkanWindowError;
|
||||
|
||||
mod flags;
|
||||
pub use self::flags::VulkanDisplayType;
|
||||
pub use self::flags::VulkanFormatFlags;
|
||||
|
||||
pub(crate) mod functions;
|
||||
|
||||
mod constants;
|
||||
pub use self::constants::CAPS_FEATURE_MEMORY_VULKAN_BUFFER;
|
||||
pub use self::constants::CAPS_FEATURE_MEMORY_VULKAN_IMAGE;
|
||||
pub use self::constants::VULKAN_BUFFER_MEMORY_ALLOCATOR_NAME;
|
||||
pub use self::constants::VULKAN_DEVICE_CONTEXT_TYPE_STR;
|
||||
pub use self::constants::VULKAN_DISPLAY_CONTEXT_TYPE_STR;
|
||||
pub use self::constants::VULKAN_IMAGE_MEMORY_ALLOCATOR_NAME;
|
||||
pub use self::constants::VULKAN_INSTANCE_CONTEXT_TYPE_STR;
|
||||
pub use self::constants::VULKAN_MEMORY_ALLOCATOR_NAME;
|
||||
pub use self::constants::VULKAN_QUEUE_CONTEXT_TYPE_STR;
|
||||
pub use self::constants::VULKAN_SWAPPER_VIDEO_FORMATS;
|
||||
|
||||
pub(crate) mod traits {
|
||||
pub use super::vulkan_command_pool::VulkanCommandPoolExt;
|
||||
pub use super::vulkan_descriptor_cache::VulkanDescriptorCacheExt;
|
||||
pub use super::vulkan_descriptor_pool::VulkanDescriptorPoolExt;
|
||||
pub use super::vulkan_device::VulkanDeviceExt;
|
||||
pub use super::vulkan_display::VulkanDisplayExt;
|
||||
pub use super::vulkan_full_screen_quad::VulkanFullScreenQuadExt;
|
||||
pub use super::vulkan_handle_pool::VulkanHandlePoolExt;
|
||||
pub use super::vulkan_instance::VulkanInstanceExt;
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
pub use super::vulkan_operation::VulkanOperationExt;
|
||||
pub use super::vulkan_physical_device::VulkanPhysicalDeviceExt;
|
||||
pub use super::vulkan_queue::VulkanQueueExt;
|
||||
pub use super::vulkan_swapper::VulkanSwapperExt;
|
||||
pub use super::vulkan_trash_list::VulkanTrashListExt;
|
||||
pub use super::vulkan_video_filter::VulkanVideoFilterExt;
|
||||
pub use super::vulkan_window::VulkanWindowExt;
|
||||
}
|
3
gstreamer-vulkan/src/auto/versions.txt
Normal file
3
gstreamer-vulkan/src/auto/versions.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ 876968b635c3)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ 3ede86d6a218)
|
||||
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 83be677e7578)
|
22
gstreamer-vulkan/src/auto/vulkan_buffer_memory_allocator.rs
Normal file
22
gstreamer-vulkan/src/auto/vulkan_buffer_memory_allocator.rs
Normal file
|
@ -0,0 +1,22 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::ffi;
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanBufferMemoryAllocator")]
|
||||
pub struct VulkanBufferMemoryAllocator(Object<ffi::GstVulkanBufferMemoryAllocator, ffi::GstVulkanBufferMemoryAllocatorClass>) @extends gst::Allocator, gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_buffer_memory_allocator_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanBufferMemoryAllocator {
|
||||
pub const NONE: Option<&'static VulkanBufferMemoryAllocator> = None;
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanBufferMemoryAllocator {}
|
||||
unsafe impl Sync for VulkanBufferMemoryAllocator {}
|
34
gstreamer-vulkan/src/auto/vulkan_buffer_pool.rs
Normal file
34
gstreamer-vulkan/src/auto/vulkan_buffer_pool.rs
Normal file
|
@ -0,0 +1,34 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanDevice};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanBufferPool")]
|
||||
pub struct VulkanBufferPool(Object<ffi::GstVulkanBufferPool, ffi::GstVulkanBufferPoolClass>) @extends gst::BufferPool, gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_buffer_pool_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanBufferPool {
|
||||
pub const NONE: Option<&'static VulkanBufferPool> = None;
|
||||
|
||||
#[doc(alias = "gst_vulkan_buffer_pool_new")]
|
||||
pub fn new(device: &impl IsA<VulkanDevice>) -> VulkanBufferPool {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
gst::BufferPool::from_glib_full(ffi::gst_vulkan_buffer_pool_new(
|
||||
device.as_ref().to_glib_none().0,
|
||||
))
|
||||
.unsafe_cast()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanBufferPool {}
|
||||
unsafe impl Sync for VulkanBufferPool {}
|
65
gstreamer-vulkan/src/auto/vulkan_command_pool.rs
Normal file
65
gstreamer-vulkan/src/auto/vulkan_command_pool.rs
Normal file
|
@ -0,0 +1,65 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanCommandBuffer, VulkanQueue};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanCommandPool")]
|
||||
pub struct VulkanCommandPool(Object<ffi::GstVulkanCommandPool, ffi::GstVulkanCommandPoolClass>) @extends gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_command_pool_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanCommandPool {
|
||||
pub const NONE: Option<&'static VulkanCommandPool> = None;
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanCommandPool {}
|
||||
unsafe impl Sync for VulkanCommandPool {}
|
||||
|
||||
pub trait VulkanCommandPoolExt: IsA<VulkanCommandPool> + 'static {
|
||||
#[doc(alias = "gst_vulkan_command_pool_create")]
|
||||
fn create(&self) -> Result<VulkanCommandBuffer, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let ret =
|
||||
ffi::gst_vulkan_command_pool_create(self.as_ref().to_glib_none().0, &mut error);
|
||||
if error.is_null() {
|
||||
Ok(from_glib_full(ret))
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_command_pool_get_queue")]
|
||||
#[doc(alias = "get_queue")]
|
||||
fn queue(&self) -> VulkanQueue {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_command_pool_get_queue(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_command_pool_lock")]
|
||||
fn lock(&self) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_command_pool_lock(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_command_pool_unlock")]
|
||||
fn unlock(&self) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_command_pool_unlock(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<O: IsA<VulkanCommandPool>> VulkanCommandPoolExt for O {}
|
59
gstreamer-vulkan/src/auto/vulkan_descriptor_cache.rs
Normal file
59
gstreamer-vulkan/src/auto/vulkan_descriptor_cache.rs
Normal file
|
@ -0,0 +1,59 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanDescriptorPool, VulkanDescriptorSet, VulkanHandle, VulkanHandlePool};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanDescriptorCache")]
|
||||
pub struct VulkanDescriptorCache(Object<ffi::GstVulkanDescriptorCache, ffi::GstVulkanDescriptorCacheClass>) @extends VulkanHandlePool, gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_descriptor_cache_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanDescriptorCache {
|
||||
pub const NONE: Option<&'static VulkanDescriptorCache> = None;
|
||||
|
||||
#[doc(alias = "gst_vulkan_descriptor_cache_new")]
|
||||
pub fn new(
|
||||
pool: &impl IsA<VulkanDescriptorPool>,
|
||||
layouts: &[VulkanHandle],
|
||||
) -> VulkanDescriptorCache {
|
||||
skip_assert_initialized!();
|
||||
let n_layouts = layouts.len() as _;
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_descriptor_cache_new(
|
||||
pool.as_ref().to_glib_none().0,
|
||||
n_layouts,
|
||||
layouts.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanDescriptorCache {}
|
||||
unsafe impl Sync for VulkanDescriptorCache {}
|
||||
|
||||
pub trait VulkanDescriptorCacheExt: IsA<VulkanDescriptorCache> + 'static {
|
||||
#[doc(alias = "gst_vulkan_descriptor_cache_acquire")]
|
||||
fn acquire(&self) -> Result<VulkanDescriptorSet, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let ret = ffi::gst_vulkan_descriptor_cache_acquire(
|
||||
self.as_ref().to_glib_none().0,
|
||||
&mut error,
|
||||
);
|
||||
if error.is_null() {
|
||||
Ok(from_glib_full(ret))
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<O: IsA<VulkanDescriptorCache>> VulkanDescriptorCacheExt for O {}
|
78
gstreamer-vulkan/src/auto/vulkan_descriptor_pool.rs
Normal file
78
gstreamer-vulkan/src/auto/vulkan_descriptor_pool.rs
Normal file
|
@ -0,0 +1,78 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanDescriptorSet, VulkanDevice, VulkanHandle};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanDescriptorPool")]
|
||||
pub struct VulkanDescriptorPool(Object<ffi::GstVulkanDescriptorPool, ffi::GstVulkanDescriptorPoolClass>) @extends gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_descriptor_pool_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanDescriptorPool {
|
||||
pub const NONE: Option<&'static VulkanDescriptorPool> = None;
|
||||
|
||||
#[doc(alias = "gst_vulkan_descriptor_pool_new_wrapped")]
|
||||
pub fn new_wrapped(
|
||||
device: &impl IsA<VulkanDevice>,
|
||||
pool: vulkan::DescriptorPool,
|
||||
max_sets: usize,
|
||||
) -> VulkanDescriptorPool {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_descriptor_pool_new_wrapped(
|
||||
device.as_ref().to_glib_none().0,
|
||||
pool,
|
||||
max_sets,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanDescriptorPool {}
|
||||
unsafe impl Sync for VulkanDescriptorPool {}
|
||||
|
||||
pub trait VulkanDescriptorPoolExt: IsA<VulkanDescriptorPool> + 'static {
|
||||
#[doc(alias = "gst_vulkan_descriptor_pool_create")]
|
||||
fn create(&self, layouts: &[VulkanHandle]) -> Result<VulkanDescriptorSet, glib::Error> {
|
||||
let n_layouts = layouts.len() as _;
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let ret = ffi::gst_vulkan_descriptor_pool_create(
|
||||
self.as_ref().to_glib_none().0,
|
||||
n_layouts,
|
||||
layouts.to_glib_none().0,
|
||||
&mut error,
|
||||
);
|
||||
if error.is_null() {
|
||||
Ok(from_glib_full(ret))
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_descriptor_pool_get_device")]
|
||||
#[doc(alias = "get_device")]
|
||||
fn device(&self) -> VulkanDevice {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_descriptor_pool_get_device(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_descriptor_pool_get_max_sets")]
|
||||
#[doc(alias = "get_max_sets")]
|
||||
fn max_sets(&self) -> usize {
|
||||
unsafe { ffi::gst_vulkan_descriptor_pool_get_max_sets(self.as_ref().to_glib_none().0) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<O: IsA<VulkanDescriptorPool>> VulkanDescriptorPoolExt for O {}
|
260
gstreamer-vulkan/src/auto/vulkan_device.rs
Normal file
260
gstreamer-vulkan/src/auto/vulkan_device.rs
Normal file
|
@ -0,0 +1,260 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanFence, VulkanInstance, VulkanPhysicalDevice, VulkanQueue};
|
||||
use glib::{
|
||||
prelude::*,
|
||||
signal::{connect_raw, SignalHandlerId},
|
||||
translate::*,
|
||||
};
|
||||
use std::boxed::Box as Box_;
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanDevice")]
|
||||
pub struct VulkanDevice(Object<ffi::GstVulkanDevice, ffi::GstVulkanDeviceClass>) @extends gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_device_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanDevice {
|
||||
pub const NONE: Option<&'static VulkanDevice> = None;
|
||||
|
||||
#[doc(alias = "gst_vulkan_device_new")]
|
||||
pub fn new(physical_device: &impl IsA<VulkanPhysicalDevice>) -> VulkanDevice {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_device_new(
|
||||
physical_device.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_device_new_with_index")]
|
||||
#[doc(alias = "new_with_index")]
|
||||
pub fn with_index(instance: &impl IsA<VulkanInstance>, device_index: u32) -> VulkanDevice {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_device_new_with_index(
|
||||
instance.as_ref().to_glib_none().0,
|
||||
device_index,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_device_handle_context_query")]
|
||||
pub fn handle_context_query(
|
||||
element: &impl IsA<gst::Element>,
|
||||
query: &gst::Query,
|
||||
device: &impl IsA<VulkanDevice>,
|
||||
) -> bool {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_device_handle_context_query(
|
||||
element.as_ref().to_glib_none().0,
|
||||
query.to_glib_none().0,
|
||||
device.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_device_run_context_query")]
|
||||
//pub fn run_context_query(element: &impl IsA<gst::Element>, device: impl IsA<VulkanDevice>) -> bool {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_device_run_context_query() }
|
||||
//}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanDevice {}
|
||||
unsafe impl Sync for VulkanDevice {}
|
||||
|
||||
pub trait VulkanDeviceExt: IsA<VulkanDevice> + 'static {
|
||||
#[doc(alias = "gst_vulkan_device_create_fence")]
|
||||
fn create_fence(&self) -> Result<Option<VulkanFence>, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let ret =
|
||||
ffi::gst_vulkan_device_create_fence(self.as_ref().to_glib_none().0, &mut error);
|
||||
if error.is_null() {
|
||||
Ok(from_glib_full(ret))
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_device_disable_extension")]
|
||||
fn disable_extension(&self, name: &str) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_device_disable_extension(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_device_enable_extension")]
|
||||
fn enable_extension(&self, name: &str) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_device_enable_extension(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_device_enable_layer")]
|
||||
fn enable_layer(&self, name: &str) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_device_enable_layer(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_device_foreach_queue")]
|
||||
fn foreach_queue<P: FnMut(&VulkanDevice, &VulkanQueue) -> bool>(&self, func: P) {
|
||||
let mut func_data: P = func;
|
||||
unsafe extern "C" fn func_func<P: FnMut(&VulkanDevice, &VulkanQueue) -> bool>(
|
||||
device: *mut ffi::GstVulkanDevice,
|
||||
queue: *mut ffi::GstVulkanQueue,
|
||||
user_data: glib::ffi::gpointer,
|
||||
) -> glib::ffi::gboolean {
|
||||
let device = from_glib_borrow(device);
|
||||
let queue = from_glib_borrow(queue);
|
||||
let callback = user_data as *mut P;
|
||||
(*callback)(&device, &queue).into_glib()
|
||||
}
|
||||
let func = Some(func_func::<P> as _);
|
||||
let super_callback0: &mut P = &mut func_data;
|
||||
unsafe {
|
||||
ffi::gst_vulkan_device_foreach_queue(
|
||||
self.as_ref().to_glib_none().0,
|
||||
func,
|
||||
super_callback0 as *mut _ as *mut _,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_device_get_instance")]
|
||||
#[doc(alias = "get_instance")]
|
||||
fn instance(&self) -> Option<VulkanInstance> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_device_get_instance(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_device_get_physical_device")]
|
||||
#[doc(alias = "get_physical_device")]
|
||||
#[doc(alias = "physical-device")]
|
||||
fn physical_device(&self) -> vulkan::PhysicalDevice {
|
||||
unsafe { ffi::gst_vulkan_device_get_physical_device(self.as_ref().to_glib_none().0) }
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_device_get_proc_address")]
|
||||
//#[doc(alias = "get_proc_address")]
|
||||
//fn proc_address(&self, name: &str) -> /*Unimplemented*/Option<Basic: Pointer> {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_device_get_proc_address() }
|
||||
//}
|
||||
|
||||
#[doc(alias = "gst_vulkan_device_get_queue")]
|
||||
#[doc(alias = "get_queue")]
|
||||
fn queue(&self, queue_family: u32, queue_i: u32) -> VulkanQueue {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_device_get_queue(
|
||||
self.as_ref().to_glib_none().0,
|
||||
queue_family,
|
||||
queue_i,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_device_is_extension_enabled")]
|
||||
fn is_extension_enabled(&self, name: &str) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_device_is_extension_enabled(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_device_is_layer_enabled")]
|
||||
fn is_layer_enabled(&self, name: &str) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_device_is_layer_enabled(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_device_open")]
|
||||
fn open(&self) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let is_ok = ffi::gst_vulkan_device_open(self.as_ref().to_glib_none().0, &mut error);
|
||||
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//#[cfg(feature = "v1_24")]
|
||||
//#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
//#[doc(alias = "gst_vulkan_device_queue_family_indices")]
|
||||
//fn queue_family_indices(&self) -> /*Unknown conversion*//*Unimplemented*/Array TypeId { ns_id: 0, id: 7 } {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_device_queue_family_indices() }
|
||||
//}
|
||||
|
||||
#[cfg(feature = "v1_24")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||
#[doc(alias = "gst_vulkan_device_select_queue")]
|
||||
fn select_queue(&self, expected_flags: vulkan::QueueFlagBits) -> Option<VulkanQueue> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_device_select_queue(
|
||||
self.as_ref().to_glib_none().0,
|
||||
expected_flags,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "instance")]
|
||||
fn connect_instance_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_instance_trampoline<
|
||||
P: IsA<VulkanDevice>,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstVulkanDevice,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(VulkanDevice::from_glib_borrow(this).unsafe_cast_ref())
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
c"notify::instance".as_ptr() as *const _,
|
||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
||||
notify_instance_trampoline::<Self, F> as *const (),
|
||||
)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<O: IsA<VulkanDevice>> VulkanDeviceExt for O {}
|
123
gstreamer-vulkan/src/auto/vulkan_display.rs
Normal file
123
gstreamer-vulkan/src/auto/vulkan_display.rs
Normal file
|
@ -0,0 +1,123 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanDisplayType, VulkanInstance, VulkanWindow};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanDisplay")]
|
||||
pub struct VulkanDisplay(Object<ffi::GstVulkanDisplay, ffi::GstVulkanDisplayClass>) @extends gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_display_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanDisplay {
|
||||
pub const NONE: Option<&'static VulkanDisplay> = None;
|
||||
|
||||
#[doc(alias = "gst_vulkan_display_new")]
|
||||
pub fn new(instance: &impl IsA<VulkanInstance>) -> VulkanDisplay {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_display_new(
|
||||
instance.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_display_new_with_type")]
|
||||
#[doc(alias = "new_with_type")]
|
||||
pub fn with_type(
|
||||
instance: &impl IsA<VulkanInstance>,
|
||||
type_: VulkanDisplayType,
|
||||
) -> Option<VulkanDisplay> {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_display_new_with_type(
|
||||
instance.as_ref().to_glib_none().0,
|
||||
type_.into_glib(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_display_choose_type")]
|
||||
pub fn choose_type(instance: &impl IsA<VulkanInstance>) -> VulkanDisplayType {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_display_choose_type(
|
||||
instance.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_display_handle_context_query")]
|
||||
pub fn handle_context_query(
|
||||
element: &impl IsA<gst::Element>,
|
||||
query: &gst::Query,
|
||||
display: Option<&impl IsA<VulkanDisplay>>,
|
||||
) -> bool {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_display_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,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_display_run_context_query")]
|
||||
//pub fn run_context_query(element: &impl IsA<gst::Element>, display: impl IsA<VulkanDisplay>) -> bool {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_display_run_context_query() }
|
||||
//}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanDisplay {}
|
||||
unsafe impl Sync for VulkanDisplay {}
|
||||
|
||||
pub trait VulkanDisplayExt: IsA<VulkanDisplay> + 'static {
|
||||
#[doc(alias = "gst_vulkan_display_create_window")]
|
||||
fn create_window(&self) -> Option<VulkanWindow> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_display_create_window(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_display_find_window")]
|
||||
//fn find_window(&self, data: /*Unimplemented*/Option<Basic: Pointer>, compare_func: /*Unimplemented*/FnMut(/*Unimplemented*/Option<Basic: Pointer>) -> i32) -> Option<VulkanWindow> {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_display_find_window() }
|
||||
//}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_display_get_handle")]
|
||||
//#[doc(alias = "get_handle")]
|
||||
//fn handle(&self) -> /*Unimplemented*/Option<Basic: Pointer> {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_display_get_handle() }
|
||||
//}
|
||||
|
||||
#[doc(alias = "gst_vulkan_display_get_handle_type")]
|
||||
#[doc(alias = "get_handle_type")]
|
||||
fn handle_type(&self) -> VulkanDisplayType {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_display_get_handle_type(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_display_remove_window")]
|
||||
fn remove_window(&self, window: &impl IsA<VulkanWindow>) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_display_remove_window(
|
||||
self.as_ref().to_glib_none().0,
|
||||
window.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<O: IsA<VulkanDisplay>> VulkanDisplayExt for O {}
|
59
gstreamer-vulkan/src/auto/vulkan_fence.rs
Normal file
59
gstreamer-vulkan/src/auto/vulkan_fence.rs
Normal file
|
@ -0,0 +1,59 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanDevice};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
glib::wrapper! {
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct VulkanFence(Boxed<ffi::GstVulkanFence>);
|
||||
|
||||
match fn {
|
||||
copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::gst_vulkan_fence_get_type(), ptr as *mut _) as *mut ffi::GstVulkanFence,
|
||||
free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::gst_vulkan_fence_get_type(), ptr as *mut _),
|
||||
type_ => || ffi::gst_vulkan_fence_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanFence {
|
||||
#[doc(alias = "gst_vulkan_fence_new")]
|
||||
pub fn new(device: &impl IsA<VulkanDevice>) -> Result<VulkanFence, glib::Error> {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let ret = ffi::gst_vulkan_fence_new(device.as_ref().to_glib_none().0, &mut error);
|
||||
if error.is_null() {
|
||||
Ok(from_glib_full(ret))
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_fence_new_always_signalled")]
|
||||
pub fn new_always_signalled(device: &impl IsA<VulkanDevice>) -> VulkanFence {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_fence_new_always_signalled(
|
||||
device.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_fence_is_signaled")]
|
||||
pub fn is_signaled(&mut self) -> bool {
|
||||
unsafe { from_glib(ffi::gst_vulkan_fence_is_signaled(self.to_glib_none_mut().0)) }
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_fence_reset")]
|
||||
pub fn reset(&mut self) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_fence_reset(self.to_glib_none_mut().0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanFence {}
|
||||
unsafe impl Sync for VulkanFence {}
|
33
gstreamer-vulkan/src/auto/vulkan_fence_cache.rs
Normal file
33
gstreamer-vulkan/src/auto/vulkan_fence_cache.rs
Normal file
|
@ -0,0 +1,33 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanDevice, VulkanHandlePool};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanFenceCache")]
|
||||
pub struct VulkanFenceCache(Object<ffi::GstVulkanFenceCache, ffi::GstVulkanFenceCacheClass>) @extends VulkanHandlePool, gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_fence_cache_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanFenceCache {
|
||||
pub const NONE: Option<&'static VulkanFenceCache> = None;
|
||||
|
||||
#[doc(alias = "gst_vulkan_fence_cache_new")]
|
||||
pub fn new(device: &impl IsA<VulkanDevice>) -> VulkanFenceCache {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_vulkan_fence_cache_new(
|
||||
device.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanFenceCache {}
|
||||
unsafe impl Sync for VulkanFenceCache {}
|
309
gstreamer-vulkan/src/auto/vulkan_full_screen_quad.rs
Normal file
309
gstreamer-vulkan/src/auto/vulkan_full_screen_quad.rs
Normal file
|
@ -0,0 +1,309 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanCommandBuffer, VulkanFence, VulkanHandle, VulkanQueue};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanFullScreenQuad")]
|
||||
pub struct VulkanFullScreenQuad(Object<ffi::GstVulkanFullScreenQuad, ffi::GstVulkanFullScreenQuadClass>) @extends gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_full_screen_quad_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanFullScreenQuad {
|
||||
pub const NONE: Option<&'static VulkanFullScreenQuad> = None;
|
||||
|
||||
#[doc(alias = "gst_vulkan_full_screen_quad_new")]
|
||||
pub fn new(queue: &impl IsA<VulkanQueue>) -> VulkanFullScreenQuad {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_full_screen_quad_new(
|
||||
queue.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanFullScreenQuad {}
|
||||
unsafe impl Sync for VulkanFullScreenQuad {}
|
||||
|
||||
pub trait VulkanFullScreenQuadExt: IsA<VulkanFullScreenQuad> + 'static {
|
||||
#[doc(alias = "gst_vulkan_full_screen_quad_draw")]
|
||||
fn draw(&self) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let is_ok =
|
||||
ffi::gst_vulkan_full_screen_quad_draw(self.as_ref().to_glib_none().0, &mut error);
|
||||
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_22")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
|
||||
#[doc(alias = "gst_vulkan_full_screen_quad_enable_blend")]
|
||||
fn enable_blend(&self, enable_blend: bool) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_full_screen_quad_enable_blend(
|
||||
self.as_ref().to_glib_none().0,
|
||||
enable_blend.into_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_22")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
|
||||
#[doc(alias = "gst_vulkan_full_screen_quad_enable_clear")]
|
||||
fn enable_clear(&self, enable_clear: bool) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_full_screen_quad_enable_clear(
|
||||
self.as_ref().to_glib_none().0,
|
||||
enable_clear.into_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_full_screen_quad_fill_command_buffer")]
|
||||
fn fill_command_buffer(
|
||||
&self,
|
||||
cmd: &mut VulkanCommandBuffer,
|
||||
fence: &mut VulkanFence,
|
||||
) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let is_ok = ffi::gst_vulkan_full_screen_quad_fill_command_buffer(
|
||||
self.as_ref().to_glib_none().0,
|
||||
cmd.to_glib_none_mut().0,
|
||||
fence.to_glib_none_mut().0,
|
||||
&mut error,
|
||||
);
|
||||
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_full_screen_quad_get_last_fence")]
|
||||
#[doc(alias = "get_last_fence")]
|
||||
fn last_fence(&self) -> VulkanFence {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_full_screen_quad_get_last_fence(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_26")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
|
||||
#[doc(alias = "gst_vulkan_full_screen_quad_get_queue")]
|
||||
#[doc(alias = "get_queue")]
|
||||
fn queue(&self) -> Option<VulkanQueue> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_full_screen_quad_get_queue(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_full_screen_quad_prepare_draw")]
|
||||
fn prepare_draw(&self, fence: &mut VulkanFence) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let is_ok = ffi::gst_vulkan_full_screen_quad_prepare_draw(
|
||||
self.as_ref().to_glib_none().0,
|
||||
fence.to_glib_none_mut().0,
|
||||
&mut error,
|
||||
);
|
||||
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_22")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
|
||||
#[doc(alias = "gst_vulkan_full_screen_quad_set_blend_factors")]
|
||||
fn set_blend_factors(
|
||||
&self,
|
||||
src_blend_factor: vulkan::BlendFactor,
|
||||
dst_blend_factor: vulkan::BlendFactor,
|
||||
src_alpha_blend_factor: vulkan::BlendFactor,
|
||||
dst_alpha_blend_factor: vulkan::BlendFactor,
|
||||
) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_full_screen_quad_set_blend_factors(
|
||||
self.as_ref().to_glib_none().0,
|
||||
src_blend_factor,
|
||||
dst_blend_factor,
|
||||
src_alpha_blend_factor,
|
||||
dst_alpha_blend_factor,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_22")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
|
||||
#[doc(alias = "gst_vulkan_full_screen_quad_set_blend_operation")]
|
||||
fn set_blend_operation(
|
||||
&self,
|
||||
colour_blend_op: vulkan::BlendOp,
|
||||
alpha_blend_op: vulkan::BlendOp,
|
||||
) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_full_screen_quad_set_blend_operation(
|
||||
self.as_ref().to_glib_none().0,
|
||||
colour_blend_op,
|
||||
alpha_blend_op,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_full_screen_quad_set_index_buffer")]
|
||||
fn set_index_buffer(&self, indices: &gst::Memory, n_indices: usize) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let is_ok = ffi::gst_vulkan_full_screen_quad_set_index_buffer(
|
||||
self.as_ref().to_glib_none().0,
|
||||
indices.to_glib_none().0,
|
||||
n_indices,
|
||||
&mut error,
|
||||
);
|
||||
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_full_screen_quad_set_info")]
|
||||
fn set_info(&self, in_info: &gst_video::VideoInfo, out_info: &gst_video::VideoInfo) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_full_screen_quad_set_info(
|
||||
self.as_ref().to_glib_none().0,
|
||||
in_info.to_glib_none().0,
|
||||
out_info.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_full_screen_quad_set_input_buffer")]
|
||||
fn set_input_buffer(&self, buffer: Option<&gst::Buffer>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let is_ok = ffi::gst_vulkan_full_screen_quad_set_input_buffer(
|
||||
self.as_ref().to_glib_none().0,
|
||||
buffer.to_glib_none().0,
|
||||
&mut error,
|
||||
);
|
||||
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_full_screen_quad_set_output_buffer")]
|
||||
fn set_output_buffer(&self, buffer: Option<&gst::Buffer>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let is_ok = ffi::gst_vulkan_full_screen_quad_set_output_buffer(
|
||||
self.as_ref().to_glib_none().0,
|
||||
buffer.to_glib_none().0,
|
||||
&mut error,
|
||||
);
|
||||
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_full_screen_quad_set_shaders")]
|
||||
fn set_shaders(&self, vert: &mut VulkanHandle, frag: &mut VulkanHandle) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_full_screen_quad_set_shaders(
|
||||
self.as_ref().to_glib_none().0,
|
||||
vert.to_glib_none_mut().0,
|
||||
frag.to_glib_none_mut().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_full_screen_quad_set_uniform_buffer")]
|
||||
fn set_uniform_buffer(&self, uniforms: &gst::Memory) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let is_ok = ffi::gst_vulkan_full_screen_quad_set_uniform_buffer(
|
||||
self.as_ref().to_glib_none().0,
|
||||
uniforms.to_glib_none().0,
|
||||
&mut error,
|
||||
);
|
||||
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_full_screen_quad_set_vertex_buffer")]
|
||||
fn set_vertex_buffer(&self, vertices: &gst::Memory) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let is_ok = ffi::gst_vulkan_full_screen_quad_set_vertex_buffer(
|
||||
self.as_ref().to_glib_none().0,
|
||||
vertices.to_glib_none().0,
|
||||
&mut error,
|
||||
);
|
||||
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_full_screen_quad_submit")]
|
||||
fn submit(&self, cmd: VulkanCommandBuffer, fence: &mut VulkanFence) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let is_ok = ffi::gst_vulkan_full_screen_quad_submit(
|
||||
self.as_ref().to_glib_none().0,
|
||||
cmd.into_glib_ptr(),
|
||||
fence.to_glib_none_mut().0,
|
||||
&mut error,
|
||||
);
|
||||
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<O: IsA<VulkanFullScreenQuad>> VulkanFullScreenQuadExt for O {}
|
115
gstreamer-vulkan/src/auto/vulkan_handle.rs
Normal file
115
gstreamer-vulkan/src/auto/vulkan_handle.rs
Normal file
|
@ -0,0 +1,115 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{
|
||||
ffi, VulkanDevice, VulkanDisplay, VulkanHandleType, VulkanHandleTypedef, VulkanInstance,
|
||||
};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
glib::wrapper! {
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct VulkanHandle(Boxed<ffi::GstVulkanHandle>);
|
||||
|
||||
match fn {
|
||||
copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::gst_vulkan_handle_get_type(), ptr as *mut _) as *mut ffi::GstVulkanHandle,
|
||||
free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::gst_vulkan_handle_get_type(), ptr as *mut _),
|
||||
type_ => || ffi::gst_vulkan_handle_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanHandle {
|
||||
#[doc(alias = "gst_vulkan_handle_new_wrapped")]
|
||||
pub fn new_wrapped<P: FnMut(&VulkanHandle)>(
|
||||
device: &impl IsA<VulkanDevice>,
|
||||
type_: VulkanHandleType,
|
||||
handle: VulkanHandleTypedef,
|
||||
notify: P,
|
||||
) -> VulkanHandle {
|
||||
skip_assert_initialized!();
|
||||
let mut notify_data: P = notify;
|
||||
unsafe extern "C" fn notify_func<P: FnMut(&VulkanHandle)>(
|
||||
handle: *mut ffi::GstVulkanHandle,
|
||||
user_data: glib::ffi::gpointer,
|
||||
) {
|
||||
let handle = from_glib_borrow(handle);
|
||||
let callback = user_data as *mut P;
|
||||
(*callback)(&handle)
|
||||
}
|
||||
let notify = Some(notify_func::<P> as _);
|
||||
let super_callback0: &mut P = &mut notify_data;
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_handle_new_wrapped(
|
||||
device.as_ref().to_glib_none().0,
|
||||
type_.into_glib(),
|
||||
handle,
|
||||
notify,
|
||||
super_callback0 as *mut _ as *mut _,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_handle_free_descriptor_set_layout")]
|
||||
//pub fn free_descriptor_set_layout(&mut self, user_data: /*Unimplemented*/Option<Basic: Pointer>) {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_handle_free_descriptor_set_layout() }
|
||||
//}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_handle_free_framebuffer")]
|
||||
//pub fn free_framebuffer(&mut self, user_data: /*Unimplemented*/Option<Basic: Pointer>) {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_handle_free_framebuffer() }
|
||||
//}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_handle_free_pipeline")]
|
||||
//pub fn free_pipeline(&mut self, user_data: /*Unimplemented*/Option<Basic: Pointer>) {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_handle_free_pipeline() }
|
||||
//}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_handle_free_pipeline_layout")]
|
||||
//pub fn free_pipeline_layout(&mut self, user_data: /*Unimplemented*/Option<Basic: Pointer>) {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_handle_free_pipeline_layout() }
|
||||
//}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_handle_free_render_pass")]
|
||||
//pub fn free_render_pass(&mut self, user_data: /*Unimplemented*/Option<Basic: Pointer>) {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_handle_free_render_pass() }
|
||||
//}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_handle_free_sampler")]
|
||||
//pub fn free_sampler(&mut self, user_data: /*Unimplemented*/Option<Basic: Pointer>) {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_handle_free_sampler() }
|
||||
//}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_handle_free_shader")]
|
||||
//pub fn free_shader(&mut 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 {}
|
||||
unsafe impl Sync for VulkanHandle {}
|
42
gstreamer-vulkan/src/auto/vulkan_handle_pool.rs
Normal file
42
gstreamer-vulkan/src/auto/vulkan_handle_pool.rs
Normal file
|
@ -0,0 +1,42 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::ffi;
|
||||
use glib::prelude::*;
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanHandlePool")]
|
||||
pub struct VulkanHandlePool(Object<ffi::GstVulkanHandlePool, ffi::GstVulkanHandlePoolClass>) @extends gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_handle_pool_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanHandlePool {
|
||||
pub const NONE: Option<&'static VulkanHandlePool> = None;
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanHandlePool {}
|
||||
unsafe impl Sync for VulkanHandlePool {}
|
||||
|
||||
pub trait VulkanHandlePoolExt: IsA<VulkanHandlePool> + 'static {
|
||||
//#[doc(alias = "gst_vulkan_handle_pool_acquire")]
|
||||
//fn acquire(&self) -> Result</*Unimplemented*/Option<Basic: Pointer>, glib::Error> {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_handle_pool_acquire() }
|
||||
//}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_handle_pool_alloc")]
|
||||
//fn alloc(&self) -> Result</*Unimplemented*/Option<Basic: Pointer>, glib::Error> {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_handle_pool_alloc() }
|
||||
//}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_handle_pool_release")]
|
||||
//fn release(&self, handle: /*Unimplemented*/Option<Basic: Pointer>) {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_handle_pool_release() }
|
||||
//}
|
||||
}
|
||||
|
||||
impl<O: IsA<VulkanHandlePool>> VulkanHandlePoolExt for O {}
|
34
gstreamer-vulkan/src/auto/vulkan_image_buffer_pool.rs
Normal file
34
gstreamer-vulkan/src/auto/vulkan_image_buffer_pool.rs
Normal file
|
@ -0,0 +1,34 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanDevice};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanImageBufferPool")]
|
||||
pub struct VulkanImageBufferPool(Object<ffi::GstVulkanImageBufferPool, ffi::GstVulkanImageBufferPoolClass>) @extends gst::BufferPool, gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_image_buffer_pool_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanImageBufferPool {
|
||||
pub const NONE: Option<&'static VulkanImageBufferPool> = None;
|
||||
|
||||
#[doc(alias = "gst_vulkan_image_buffer_pool_new")]
|
||||
pub fn new(device: &impl IsA<VulkanDevice>) -> VulkanImageBufferPool {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
gst::BufferPool::from_glib_full(ffi::gst_vulkan_image_buffer_pool_new(
|
||||
device.as_ref().to_glib_none().0,
|
||||
))
|
||||
.unsafe_cast()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanImageBufferPool {}
|
||||
unsafe impl Sync for VulkanImageBufferPool {}
|
22
gstreamer-vulkan/src/auto/vulkan_image_memory_allocator.rs
Normal file
22
gstreamer-vulkan/src/auto/vulkan_image_memory_allocator.rs
Normal file
|
@ -0,0 +1,22 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::ffi;
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanImageMemoryAllocator")]
|
||||
pub struct VulkanImageMemoryAllocator(Object<ffi::GstVulkanImageMemoryAllocator, ffi::GstVulkanImageMemoryAllocatorClass>) @extends gst::Allocator, gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_image_memory_allocator_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanImageMemoryAllocator {
|
||||
pub const NONE: Option<&'static VulkanImageMemoryAllocator> = None;
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanImageMemoryAllocator {}
|
||||
unsafe impl Sync for VulkanImageMemoryAllocator {}
|
348
gstreamer-vulkan/src/auto/vulkan_instance.rs
Normal file
348
gstreamer-vulkan/src/auto/vulkan_instance.rs
Normal file
|
@ -0,0 +1,348 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanDevice};
|
||||
use glib::{
|
||||
object::ObjectType as _,
|
||||
prelude::*,
|
||||
signal::{connect_raw, SignalHandlerId},
|
||||
translate::*,
|
||||
};
|
||||
use std::boxed::Box as Box_;
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanInstance")]
|
||||
pub struct VulkanInstance(Object<ffi::GstVulkanInstance, ffi::GstVulkanInstanceClass>) @extends gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_instance_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanInstance {
|
||||
pub const NONE: Option<&'static VulkanInstance> = None;
|
||||
|
||||
#[doc(alias = "gst_vulkan_instance_new")]
|
||||
pub fn new() -> VulkanInstance {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_full(ffi::gst_vulkan_instance_new()) }
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_instance_handle_context_query")]
|
||||
pub fn handle_context_query(
|
||||
element: &impl IsA<gst::Element>,
|
||||
query: &gst::Query,
|
||||
instance: Option<&impl IsA<VulkanInstance>>,
|
||||
) -> bool {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_instance_handle_context_query(
|
||||
element.as_ref().to_glib_none().0,
|
||||
query.to_glib_none().0,
|
||||
instance.map(|p| p.as_ref()).to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_instance_run_context_query")]
|
||||
//pub fn run_context_query(element: &impl IsA<gst::Element>, instance: impl IsA<VulkanInstance>) -> bool {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_instance_run_context_query() }
|
||||
//}
|
||||
}
|
||||
|
||||
impl Default for VulkanInstance {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanInstance {}
|
||||
unsafe impl Sync for VulkanInstance {}
|
||||
|
||||
pub trait VulkanInstanceExt: IsA<VulkanInstance> + 'static {
|
||||
#[doc(alias = "gst_vulkan_instance_check_version")]
|
||||
fn check_version(&self, major: u32, minor: u32, patch: u32) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_instance_check_version(
|
||||
self.as_ref().to_glib_none().0,
|
||||
major,
|
||||
minor,
|
||||
patch,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_instance_create_device")]
|
||||
fn create_device(&self) -> Result<VulkanDevice, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let ret =
|
||||
ffi::gst_vulkan_instance_create_device(self.as_ref().to_glib_none().0, &mut error);
|
||||
if error.is_null() {
|
||||
Ok(from_glib_full(ret))
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_instance_disable_extension")]
|
||||
fn disable_extension(&self, name: &str) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_instance_disable_extension(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_instance_enable_extension")]
|
||||
fn enable_extension(&self, name: &str) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_instance_enable_extension(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_instance_enable_layer")]
|
||||
fn enable_layer(&self, name: &str) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_instance_enable_layer(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_instance_fill_info")]
|
||||
fn fill_info(&self) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let is_ok =
|
||||
ffi::gst_vulkan_instance_fill_info(self.as_ref().to_glib_none().0, &mut error);
|
||||
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_instance_get_extension_info")]
|
||||
#[doc(alias = "get_extension_info")]
|
||||
fn extension_info(&self, name: &str) -> Option<u32> {
|
||||
unsafe {
|
||||
let mut spec_version = std::mem::MaybeUninit::uninit();
|
||||
let ret = from_glib(ffi::gst_vulkan_instance_get_extension_info(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
spec_version.as_mut_ptr(),
|
||||
));
|
||||
if ret {
|
||||
Some(spec_version.assume_init())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_instance_get_layer_info")]
|
||||
#[doc(alias = "get_layer_info")]
|
||||
fn layer_info(&self, name: &str) -> Option<(Option<glib::GString>, u32, u32)> {
|
||||
unsafe {
|
||||
let mut description = std::ptr::null_mut();
|
||||
let mut spec_version = std::mem::MaybeUninit::uninit();
|
||||
let mut implementation_version = std::mem::MaybeUninit::uninit();
|
||||
let ret = from_glib(ffi::gst_vulkan_instance_get_layer_info(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
&mut description,
|
||||
spec_version.as_mut_ptr(),
|
||||
implementation_version.as_mut_ptr(),
|
||||
));
|
||||
if ret {
|
||||
Some((
|
||||
from_glib_full(description),
|
||||
spec_version.assume_init(),
|
||||
implementation_version.assume_init(),
|
||||
))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_instance_get_proc_address")]
|
||||
//#[doc(alias = "get_proc_address")]
|
||||
//fn proc_address(&self, name: &str) -> /*Unimplemented*/Option<Basic: Pointer> {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_instance_get_proc_address() }
|
||||
//}
|
||||
|
||||
#[doc(alias = "gst_vulkan_instance_get_version")]
|
||||
#[doc(alias = "get_version")]
|
||||
fn version(&self) -> (u32, u32, u32) {
|
||||
unsafe {
|
||||
let mut major = std::mem::MaybeUninit::uninit();
|
||||
let mut minor = std::mem::MaybeUninit::uninit();
|
||||
let mut patch = std::mem::MaybeUninit::uninit();
|
||||
ffi::gst_vulkan_instance_get_version(
|
||||
self.as_ref().to_glib_none().0,
|
||||
major.as_mut_ptr(),
|
||||
minor.as_mut_ptr(),
|
||||
patch.as_mut_ptr(),
|
||||
);
|
||||
(
|
||||
major.assume_init(),
|
||||
minor.assume_init(),
|
||||
patch.assume_init(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_instance_is_extension_enabled")]
|
||||
fn is_extension_enabled(&self, name: &str) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_instance_is_extension_enabled(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_instance_is_layer_enabled")]
|
||||
fn is_layer_enabled(&self, name: &str) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_instance_is_layer_enabled(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_instance_open")]
|
||||
fn open(&self) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let is_ok = ffi::gst_vulkan_instance_open(self.as_ref().to_glib_none().0, &mut error);
|
||||
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "requested-api-major")]
|
||||
fn requested_api_major(&self) -> u32 {
|
||||
ObjectExt::property(self.as_ref(), "requested-api-major")
|
||||
}
|
||||
|
||||
#[doc(alias = "requested-api-major")]
|
||||
fn set_requested_api_major(&self, requested_api_major: u32) {
|
||||
ObjectExt::set_property(self.as_ref(), "requested-api-major", requested_api_major)
|
||||
}
|
||||
|
||||
#[doc(alias = "requested-api-minor")]
|
||||
fn requested_api_minor(&self) -> u32 {
|
||||
ObjectExt::property(self.as_ref(), "requested-api-minor")
|
||||
}
|
||||
|
||||
#[doc(alias = "requested-api-minor")]
|
||||
fn set_requested_api_minor(&self, requested_api_minor: u32) {
|
||||
ObjectExt::set_property(self.as_ref(), "requested-api-minor", requested_api_minor)
|
||||
}
|
||||
|
||||
#[doc(alias = "create-device")]
|
||||
fn connect_create_device<F: Fn(&Self) -> VulkanDevice + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn create_device_trampoline<
|
||||
P: IsA<VulkanInstance>,
|
||||
F: Fn(&P) -> VulkanDevice + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstVulkanInstance,
|
||||
f: glib::ffi::gpointer,
|
||||
) -> *mut ffi::GstVulkanDevice {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(VulkanInstance::from_glib_borrow(this).unsafe_cast_ref()).to_glib_full()
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
c"create-device".as_ptr() as *const _,
|
||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
||||
create_device_trampoline::<Self, F> as *const (),
|
||||
)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "requested-api-major")]
|
||||
fn connect_requested_api_major_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_requested_api_major_trampoline<
|
||||
P: IsA<VulkanInstance>,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstVulkanInstance,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(VulkanInstance::from_glib_borrow(this).unsafe_cast_ref())
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
c"notify::requested-api-major".as_ptr() as *const _,
|
||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
||||
notify_requested_api_major_trampoline::<Self, F> as *const (),
|
||||
)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "requested-api-minor")]
|
||||
fn connect_requested_api_minor_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_requested_api_minor_trampoline<
|
||||
P: IsA<VulkanInstance>,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstVulkanInstance,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(VulkanInstance::from_glib_borrow(this).unsafe_cast_ref())
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
c"notify::requested-api-minor".as_ptr() as *const _,
|
||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
||||
notify_requested_api_minor_trampoline::<Self, F> as *const (),
|
||||
)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<O: IsA<VulkanInstance>> VulkanInstanceExt for O {}
|
22
gstreamer-vulkan/src/auto/vulkan_memory_allocator.rs
Normal file
22
gstreamer-vulkan/src/auto/vulkan_memory_allocator.rs
Normal file
|
@ -0,0 +1,22 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::ffi;
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanMemoryAllocator")]
|
||||
pub struct VulkanMemoryAllocator(Object<ffi::GstVulkanMemoryAllocator, ffi::GstVulkanMemoryAllocatorClass>) @extends gst::Allocator, gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_memory_allocator_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanMemoryAllocator {
|
||||
pub const NONE: Option<&'static VulkanMemoryAllocator> = None;
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanMemoryAllocator {}
|
||||
unsafe impl Sync for VulkanMemoryAllocator {}
|
214
gstreamer-vulkan/src/auto/vulkan_operation.rs
Normal file
214
gstreamer-vulkan/src/auto/vulkan_operation.rs
Normal file
|
@ -0,0 +1,214 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanCommandPool, VulkanQueue};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanOperation")]
|
||||
pub struct VulkanOperation(Object<ffi::GstVulkanOperation, ffi::GstVulkanOperationClass>) @extends gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_operation_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanOperation {
|
||||
pub const NONE: Option<&'static VulkanOperation> = None;
|
||||
|
||||
#[doc(alias = "gst_vulkan_operation_new")]
|
||||
pub fn new(cmd_pool: &impl IsA<VulkanCommandPool>) -> VulkanOperation {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_operation_new(
|
||||
cmd_pool.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanOperation {}
|
||||
unsafe impl Sync for VulkanOperation {}
|
||||
|
||||
pub trait VulkanOperationExt: IsA<VulkanOperation> + 'static {
|
||||
#[doc(alias = "gst_vulkan_operation_add_dependency_frame")]
|
||||
fn add_dependency_frame(
|
||||
&self,
|
||||
frame: &gst::Buffer,
|
||||
wait_stage: u64,
|
||||
signal_stage: u64,
|
||||
) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_operation_add_dependency_frame(
|
||||
self.as_ref().to_glib_none().0,
|
||||
frame.to_glib_none().0,
|
||||
wait_stage,
|
||||
signal_stage,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_operation_add_extra_image_barriers")]
|
||||
//fn add_extra_image_barriers(&self, extra_barriers: /*Unknown conversion*//*Unimplemented*/Array TypeId { ns_id: 0, id: 25 }) {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_operation_add_extra_image_barriers() }
|
||||
//}
|
||||
|
||||
#[doc(alias = "gst_vulkan_operation_add_frame_barrier")]
|
||||
fn add_frame_barrier(
|
||||
&self,
|
||||
frame: &gst::Buffer,
|
||||
src_stage: u64,
|
||||
dst_stage: u64,
|
||||
new_access: u64,
|
||||
new_layout: vulkan::ImageLayout,
|
||||
new_queue: Option<&impl IsA<VulkanQueue>>,
|
||||
) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_operation_add_frame_barrier(
|
||||
self.as_ref().to_glib_none().0,
|
||||
frame.to_glib_none().0,
|
||||
src_stage,
|
||||
dst_stage,
|
||||
new_access,
|
||||
new_layout,
|
||||
new_queue.map(|p| p.as_ref()).to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_operation_begin")]
|
||||
fn begin(&self) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let is_ok = ffi::gst_vulkan_operation_begin(self.as_ref().to_glib_none().0, &mut error);
|
||||
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_operation_begin_query")]
|
||||
fn begin_query(&self, id: u32) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_operation_begin_query(
|
||||
self.as_ref().to_glib_none().0,
|
||||
id,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_operation_discard_dependencies")]
|
||||
fn discard_dependencies(&self) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_operation_discard_dependencies(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_operation_enable_query")]
|
||||
//fn enable_query(&self, query_type: u32, n_queries: u32, pnext: /*Unimplemented*/Option<Basic: Pointer>) -> Result<(), glib::Error> {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_operation_enable_query() }
|
||||
//}
|
||||
|
||||
#[doc(alias = "gst_vulkan_operation_end")]
|
||||
fn end(&self) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let is_ok = ffi::gst_vulkan_operation_end(self.as_ref().to_glib_none().0, &mut error);
|
||||
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_operation_end_query")]
|
||||
fn end_query(&self, id: u32) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_operation_end_query(
|
||||
self.as_ref().to_glib_none().0,
|
||||
id,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_operation_get_query")]
|
||||
//#[doc(alias = "get_query")]
|
||||
//fn query(&self, data: /*Unimplemented*/&mut Option<Basic: Pointer>) -> Result<(), glib::Error> {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_operation_get_query() }
|
||||
//}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_operation_new_extra_image_barriers")]
|
||||
//fn new_extra_image_barriers(&self) -> /*Unknown conversion*//*Unimplemented*/Array TypeId { ns_id: 0, id: 25 } {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_operation_new_extra_image_barriers() }
|
||||
//}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_operation_pipeline_barrier2")]
|
||||
//fn pipeline_barrier2(&self, dependency_info: /*Unimplemented*/Option<Basic: Pointer>) -> bool {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_operation_pipeline_barrier2() }
|
||||
//}
|
||||
|
||||
#[doc(alias = "gst_vulkan_operation_reset")]
|
||||
fn reset(&self) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_operation_reset(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_operation_retrieve_image_barriers")]
|
||||
//fn retrieve_image_barriers(&self) -> /*Unknown conversion*//*Unimplemented*/Array TypeId { ns_id: 0, id: 25 } {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_operation_retrieve_image_barriers() }
|
||||
//}
|
||||
|
||||
#[doc(alias = "gst_vulkan_operation_update_frame")]
|
||||
fn update_frame(
|
||||
&self,
|
||||
frame: &gst::Buffer,
|
||||
dst_stage: u64,
|
||||
new_access: u64,
|
||||
new_layout: vulkan::ImageLayout,
|
||||
new_queue: Option<&impl IsA<VulkanQueue>>,
|
||||
) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_operation_update_frame(
|
||||
self.as_ref().to_glib_none().0,
|
||||
frame.to_glib_none().0,
|
||||
dst_stage,
|
||||
new_access,
|
||||
new_layout,
|
||||
new_queue.map(|p| p.as_ref()).to_glib_none().0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_operation_use_sync2")]
|
||||
fn use_sync2(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_operation_use_sync2(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_operation_wait")]
|
||||
fn wait(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_operation_wait(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "command-pool")]
|
||||
fn command_pool(&self) -> Option<VulkanCommandPool> {
|
||||
ObjectExt::property(self.as_ref(), "command-pool")
|
||||
}
|
||||
}
|
||||
|
||||
impl<O: IsA<VulkanOperation>> VulkanOperationExt for O {}
|
109
gstreamer-vulkan/src/auto/vulkan_physical_device.rs
Normal file
109
gstreamer-vulkan/src/auto/vulkan_physical_device.rs
Normal file
|
@ -0,0 +1,109 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanInstance};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanPhysicalDevice")]
|
||||
pub struct VulkanPhysicalDevice(Object<ffi::GstVulkanPhysicalDevice, ffi::GstVulkanPhysicalDeviceClass>) @extends gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_physical_device_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanPhysicalDevice {
|
||||
pub const NONE: Option<&'static VulkanPhysicalDevice> = None;
|
||||
|
||||
#[doc(alias = "gst_vulkan_physical_device_new")]
|
||||
pub fn new(instance: &impl IsA<VulkanInstance>, device_index: u32) -> VulkanPhysicalDevice {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_physical_device_new(
|
||||
instance.as_ref().to_glib_none().0,
|
||||
device_index,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_physical_device_type_to_string")]
|
||||
pub fn type_to_string(type_: vulkan::PhysicalDeviceType) -> glib::GString {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_none(ffi::gst_vulkan_physical_device_type_to_string(type_)) }
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanPhysicalDevice {}
|
||||
unsafe impl Sync for VulkanPhysicalDevice {}
|
||||
|
||||
pub trait VulkanPhysicalDeviceExt: IsA<VulkanPhysicalDevice> + 'static {
|
||||
#[doc(alias = "gst_vulkan_physical_device_get_extension_info")]
|
||||
#[doc(alias = "get_extension_info")]
|
||||
fn extension_info(&self, name: &str) -> Option<u32> {
|
||||
unsafe {
|
||||
let mut spec_version = std::mem::MaybeUninit::uninit();
|
||||
let ret = from_glib(ffi::gst_vulkan_physical_device_get_extension_info(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
spec_version.as_mut_ptr(),
|
||||
));
|
||||
if ret {
|
||||
Some(spec_version.assume_init())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_physical_device_get_handle")]
|
||||
#[doc(alias = "get_handle")]
|
||||
fn handle(&self) -> vulkan::PhysicalDevice {
|
||||
unsafe { ffi::gst_vulkan_physical_device_get_handle(self.as_ref().to_glib_none().0) }
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_physical_device_get_instance")]
|
||||
#[doc(alias = "get_instance")]
|
||||
fn instance(&self) -> VulkanInstance {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_physical_device_get_instance(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_physical_device_get_layer_info")]
|
||||
#[doc(alias = "get_layer_info")]
|
||||
fn layer_info(&self, name: &str) -> Option<(Option<glib::GString>, u32, u32)> {
|
||||
unsafe {
|
||||
let mut description = std::ptr::null_mut();
|
||||
let mut spec_version = std::mem::MaybeUninit::uninit();
|
||||
let mut implementation_version = std::mem::MaybeUninit::uninit();
|
||||
let ret = from_glib(ffi::gst_vulkan_physical_device_get_layer_info(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
&mut description,
|
||||
spec_version.as_mut_ptr(),
|
||||
implementation_version.as_mut_ptr(),
|
||||
));
|
||||
if ret {
|
||||
Some((
|
||||
from_glib_full(description),
|
||||
spec_version.assume_init(),
|
||||
implementation_version.assume_init(),
|
||||
))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "device-index")]
|
||||
fn device_index(&self) -> u32 {
|
||||
ObjectExt::property(self.as_ref(), "device-index")
|
||||
}
|
||||
}
|
||||
|
||||
impl<O: IsA<VulkanPhysicalDevice>> VulkanPhysicalDeviceExt for O {}
|
94
gstreamer-vulkan/src/auto/vulkan_queue.rs
Normal file
94
gstreamer-vulkan/src/auto/vulkan_queue.rs
Normal file
|
@ -0,0 +1,94 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanCommandPool, VulkanDevice};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanQueue")]
|
||||
pub struct VulkanQueue(Object<ffi::GstVulkanQueue, ffi::GstVulkanQueueClass>) @extends gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_queue_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanQueue {
|
||||
pub const NONE: Option<&'static VulkanQueue> = None;
|
||||
|
||||
#[doc(alias = "gst_vulkan_queue_flags_to_string")]
|
||||
pub fn flags_to_string(queue_bits: vulkan::QueueFlags) -> glib::GString {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_full(ffi::gst_vulkan_queue_flags_to_string(queue_bits)) }
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_queue_handle_context_query")]
|
||||
pub fn handle_context_query(
|
||||
element: &impl IsA<gst::Element>,
|
||||
query: &gst::Query,
|
||||
queue: Option<&impl IsA<VulkanQueue>>,
|
||||
) -> bool {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_queue_handle_context_query(
|
||||
element.as_ref().to_glib_none().0,
|
||||
query.to_glib_none().0,
|
||||
queue.map(|p| p.as_ref()).to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_queue_run_context_query")]
|
||||
//pub fn run_context_query(element: &impl IsA<gst::Element>, queue: impl IsA<VulkanQueue>) -> bool {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_queue_run_context_query() }
|
||||
//}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanQueue {}
|
||||
unsafe impl Sync for VulkanQueue {}
|
||||
|
||||
pub trait VulkanQueueExt: IsA<VulkanQueue> + 'static {
|
||||
#[doc(alias = "gst_vulkan_queue_create_command_pool")]
|
||||
fn create_command_pool(&self) -> Result<VulkanCommandPool, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let ret = ffi::gst_vulkan_queue_create_command_pool(
|
||||
self.as_ref().to_glib_none().0,
|
||||
&mut error,
|
||||
);
|
||||
if error.is_null() {
|
||||
Ok(from_glib_full(ret))
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_queue_get_device")]
|
||||
#[doc(alias = "get_device")]
|
||||
fn device(&self) -> Option<VulkanDevice> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_queue_get_device(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_queue_submit_lock")]
|
||||
fn submit_lock(&self) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_queue_submit_lock(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_queue_submit_unlock")]
|
||||
fn submit_unlock(&self) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_queue_submit_unlock(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<O: IsA<VulkanQueue>> VulkanQueueExt for O {}
|
195
gstreamer-vulkan/src/auto/vulkan_swapper.rs
Normal file
195
gstreamer-vulkan/src/auto/vulkan_swapper.rs
Normal file
|
@ -0,0 +1,195 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanDevice, VulkanQueue, VulkanWindow};
|
||||
use glib::{
|
||||
prelude::*,
|
||||
signal::{connect_raw, SignalHandlerId},
|
||||
translate::*,
|
||||
};
|
||||
use std::boxed::Box as Box_;
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanSwapper")]
|
||||
pub struct VulkanSwapper(Object<ffi::GstVulkanSwapper, ffi::GstVulkanSwapperClass>) @extends gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_swapper_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanSwapper {
|
||||
pub const NONE: Option<&'static VulkanSwapper> = None;
|
||||
|
||||
#[doc(alias = "gst_vulkan_swapper_new")]
|
||||
pub fn new(device: &impl IsA<VulkanDevice>, window: &impl IsA<VulkanWindow>) -> VulkanSwapper {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
from_glib_none(ffi::gst_vulkan_swapper_new(
|
||||
device.as_ref().to_glib_none().0,
|
||||
window.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanSwapper {}
|
||||
unsafe impl Sync for VulkanSwapper {}
|
||||
|
||||
pub trait VulkanSwapperExt: IsA<VulkanSwapper> + 'static {
|
||||
#[doc(alias = "gst_vulkan_swapper_choose_queue")]
|
||||
fn choose_queue(
|
||||
&self,
|
||||
available_queue: Option<&impl IsA<VulkanQueue>>,
|
||||
) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let is_ok = ffi::gst_vulkan_swapper_choose_queue(
|
||||
self.as_ref().to_glib_none().0,
|
||||
available_queue.map(|p| p.as_ref()).to_glib_none().0,
|
||||
&mut error,
|
||||
);
|
||||
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_swapper_get_supported_caps")]
|
||||
#[doc(alias = "get_supported_caps")]
|
||||
fn supported_caps(&self) -> Result<gst::Caps, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let ret = ffi::gst_vulkan_swapper_get_supported_caps(
|
||||
self.as_ref().to_glib_none().0,
|
||||
&mut error,
|
||||
);
|
||||
if error.is_null() {
|
||||
Ok(from_glib_full(ret))
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_swapper_render_buffer")]
|
||||
fn render_buffer(&self, buffer: &gst::Buffer) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let is_ok = ffi::gst_vulkan_swapper_render_buffer(
|
||||
self.as_ref().to_glib_none().0,
|
||||
buffer.to_glib_none().0,
|
||||
&mut error,
|
||||
);
|
||||
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_swapper_set_caps")]
|
||||
fn set_caps(&self, caps: &gst::Caps) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let is_ok = ffi::gst_vulkan_swapper_set_caps(
|
||||
self.as_ref().to_glib_none().0,
|
||||
caps.to_glib_none().0,
|
||||
&mut error,
|
||||
);
|
||||
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "force-aspect-ratio")]
|
||||
fn is_force_aspect_ratio(&self) -> bool {
|
||||
ObjectExt::property(self.as_ref(), "force-aspect-ratio")
|
||||
}
|
||||
|
||||
#[doc(alias = "force-aspect-ratio")]
|
||||
fn set_force_aspect_ratio(&self, force_aspect_ratio: bool) {
|
||||
ObjectExt::set_property(self.as_ref(), "force-aspect-ratio", force_aspect_ratio)
|
||||
}
|
||||
|
||||
#[doc(alias = "pixel-aspect-ratio")]
|
||||
fn pixel_aspect_ratio(&self) -> gst::Fraction {
|
||||
ObjectExt::property(self.as_ref(), "pixel-aspect-ratio")
|
||||
}
|
||||
|
||||
#[doc(alias = "pixel-aspect-ratio")]
|
||||
fn set_pixel_aspect_ratio(&self, pixel_aspect_ratio: gst::Fraction) {
|
||||
ObjectExt::set_property(self.as_ref(), "pixel-aspect-ratio", pixel_aspect_ratio)
|
||||
}
|
||||
|
||||
#[doc(alias = "force-aspect-ratio")]
|
||||
fn connect_force_aspect_ratio_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_force_aspect_ratio_trampoline<
|
||||
P: IsA<VulkanSwapper>,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstVulkanSwapper,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(VulkanSwapper::from_glib_borrow(this).unsafe_cast_ref())
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
c"notify::force-aspect-ratio".as_ptr() as *const _,
|
||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
||||
notify_force_aspect_ratio_trampoline::<Self, F> as *const (),
|
||||
)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "pixel-aspect-ratio")]
|
||||
fn connect_pixel_aspect_ratio_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_pixel_aspect_ratio_trampoline<
|
||||
P: IsA<VulkanSwapper>,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstVulkanSwapper,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(VulkanSwapper::from_glib_borrow(this).unsafe_cast_ref())
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
c"notify::pixel-aspect-ratio".as_ptr() as *const _,
|
||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
||||
notify_pixel_aspect_ratio_trampoline::<Self, F> as *const (),
|
||||
)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<O: IsA<VulkanSwapper>> VulkanSwapperExt for O {}
|
74
gstreamer-vulkan/src/auto/vulkan_trash.rs
Normal file
74
gstreamer-vulkan/src/auto/vulkan_trash.rs
Normal file
|
@ -0,0 +1,74 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanDevice, VulkanFence};
|
||||
use glib::translate::*;
|
||||
use std::boxed::Box as Box_;
|
||||
|
||||
glib::wrapper! {
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct VulkanTrash(Boxed<ffi::GstVulkanTrash>);
|
||||
|
||||
match fn {
|
||||
copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::gst_vulkan_trash_get_type(), ptr as *mut _) as *mut ffi::GstVulkanTrash,
|
||||
free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::gst_vulkan_trash_get_type(), ptr as *mut _),
|
||||
type_ => || ffi::gst_vulkan_trash_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanTrash {
|
||||
#[doc(alias = "gst_vulkan_trash_new")]
|
||||
pub fn new<P: FnOnce(&VulkanDevice) + Send + Sync + 'static>(
|
||||
fence: &mut VulkanFence,
|
||||
notify: P,
|
||||
) -> VulkanTrash {
|
||||
assert_initialized_main_thread!();
|
||||
let notify_data: Box_<P> = Box_::new(notify);
|
||||
unsafe extern "C" fn notify_func<P: FnOnce(&VulkanDevice) + Send + Sync + 'static>(
|
||||
device: *mut ffi::GstVulkanDevice,
|
||||
user_data: glib::ffi::gpointer,
|
||||
) {
|
||||
let device = from_glib_borrow(device);
|
||||
let callback = Box_::from_raw(user_data as *mut P);
|
||||
(*callback)(&device)
|
||||
}
|
||||
let notify = Some(notify_func::<P> as _);
|
||||
let super_callback0: Box_<P> = notify_data;
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_trash_new(
|
||||
fence.to_glib_none_mut().0,
|
||||
notify,
|
||||
Box_::into_raw(super_callback0) as *mut _,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_trash_new_free_semaphore")]
|
||||
pub fn new_free_semaphore(
|
||||
fence: &mut VulkanFence,
|
||||
semaphore: vulkan::Semaphore,
|
||||
) -> VulkanTrash {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_trash_new_free_semaphore(
|
||||
fence.to_glib_none_mut().0,
|
||||
semaphore,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_trash_mini_object_unref")]
|
||||
//pub fn mini_object_unref(device: &impl IsA<VulkanDevice>, user_data: /*Unimplemented*/Option<Basic: Pointer>) {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_trash_mini_object_unref() }
|
||||
//}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_trash_object_unref")]
|
||||
//pub fn object_unref(device: &impl IsA<VulkanDevice>, user_data: /*Unimplemented*/Option<Basic: Pointer>) {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_trash_object_unref() }
|
||||
//}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanTrash {}
|
||||
unsafe impl Sync for VulkanTrash {}
|
35
gstreamer-vulkan/src/auto/vulkan_trash_fence_list.rs
Normal file
35
gstreamer-vulkan/src/auto/vulkan_trash_fence_list.rs
Normal file
|
@ -0,0 +1,35 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanHandlePool, VulkanTrashList};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanTrashFenceList")]
|
||||
pub struct VulkanTrashFenceList(Object<ffi::GstVulkanTrashFenceList, ffi::GstVulkanTrashFenceListClass>) @extends VulkanTrashList, VulkanHandlePool, gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_trash_fence_list_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanTrashFenceList {
|
||||
#[doc(alias = "gst_vulkan_trash_fence_list_new")]
|
||||
pub fn new() -> VulkanTrashFenceList {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
VulkanTrashList::from_glib_full(ffi::gst_vulkan_trash_fence_list_new()).unsafe_cast()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for VulkanTrashFenceList {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanTrashFenceList {}
|
||||
unsafe impl Sync for VulkanTrashFenceList {}
|
82
gstreamer-vulkan/src/auto/vulkan_trash_list.rs
Normal file
82
gstreamer-vulkan/src/auto/vulkan_trash_list.rs
Normal file
|
@ -0,0 +1,82 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanDevice, VulkanFence, VulkanHandlePool, VulkanTrash};
|
||||
use glib::{prelude::*, translate::*};
|
||||
use std::boxed::Box as Box_;
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanTrashList")]
|
||||
pub struct VulkanTrashList(Object<ffi::GstVulkanTrashList, ffi::GstVulkanTrashListClass>) @extends VulkanHandlePool, gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_trash_list_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanTrashList {
|
||||
pub const NONE: Option<&'static VulkanTrashList> = None;
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanTrashList {}
|
||||
unsafe impl Sync for VulkanTrashList {}
|
||||
|
||||
pub trait VulkanTrashListExt: IsA<VulkanTrashList> + 'static {
|
||||
#[doc(alias = "gst_vulkan_trash_list_acquire")]
|
||||
fn acquire<P: FnOnce(&VulkanDevice) + Send + Sync + 'static>(
|
||||
&self,
|
||||
fence: &mut VulkanFence,
|
||||
notify: P,
|
||||
) -> VulkanTrash {
|
||||
let notify_data: Box_<P> = Box_::new(notify);
|
||||
unsafe extern "C" fn notify_func<P: FnOnce(&VulkanDevice) + Send + Sync + 'static>(
|
||||
device: *mut ffi::GstVulkanDevice,
|
||||
user_data: glib::ffi::gpointer,
|
||||
) {
|
||||
let device = from_glib_borrow(device);
|
||||
let callback = Box_::from_raw(user_data as *mut P);
|
||||
(*callback)(&device)
|
||||
}
|
||||
let notify = Some(notify_func::<P> as _);
|
||||
let super_callback0: Box_<P> = notify_data;
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_trash_list_acquire(
|
||||
self.as_ref().to_glib_none().0,
|
||||
fence.to_glib_none_mut().0,
|
||||
notify,
|
||||
Box_::into_raw(super_callback0) as *mut _,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_trash_list_add")]
|
||||
fn add(&self, trash: &mut VulkanTrash) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_trash_list_add(
|
||||
self.as_ref().to_glib_none().0,
|
||||
trash.to_glib_none_mut().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_trash_list_gc")]
|
||||
fn gc(&self) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_trash_list_gc(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_trash_list_wait")]
|
||||
fn wait(&self, timeout: u64) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_trash_list_wait(
|
||||
self.as_ref().to_glib_none().0,
|
||||
timeout,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<O: IsA<VulkanTrashList>> VulkanTrashListExt for O {}
|
69
gstreamer-vulkan/src/auto/vulkan_video_filter.rs
Normal file
69
gstreamer-vulkan/src/auto/vulkan_video_filter.rs
Normal file
|
@ -0,0 +1,69 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::ffi;
|
||||
#[cfg(feature = "v1_26")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
|
||||
use crate::{VulkanDevice, VulkanInstance, VulkanQueue};
|
||||
use glib::prelude::*;
|
||||
#[cfg(feature = "v1_26")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
|
||||
use glib::translate::*;
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanVideoFilter")]
|
||||
pub struct VulkanVideoFilter(Object<ffi::GstVulkanVideoFilter, ffi::GstVulkanVideoFilterClass>) @extends gst_base::BaseTransform, gst::Element, gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_video_filter_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanVideoFilter {
|
||||
pub const NONE: Option<&'static VulkanVideoFilter> = None;
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanVideoFilter {}
|
||||
unsafe impl Sync for VulkanVideoFilter {}
|
||||
|
||||
pub trait VulkanVideoFilterExt: IsA<VulkanVideoFilter> + 'static {
|
||||
#[cfg(feature = "v1_26")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
|
||||
#[doc(alias = "gst_vulkan_video_filter_get_device")]
|
||||
#[doc(alias = "get_device")]
|
||||
fn device(&self) -> Option<VulkanDevice> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_video_filter_get_device(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_26")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
|
||||
#[doc(alias = "gst_vulkan_video_filter_get_instance")]
|
||||
#[doc(alias = "get_instance")]
|
||||
fn instance(&self) -> Option<VulkanInstance> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_video_filter_get_instance(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_26")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
|
||||
#[doc(alias = "gst_vulkan_video_filter_get_queue")]
|
||||
#[doc(alias = "get_queue")]
|
||||
fn queue(&self) -> Option<VulkanQueue> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_video_filter_get_queue(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<O: IsA<VulkanVideoFilter>> VulkanVideoFilterExt for O {}
|
358
gstreamer-vulkan/src/auto/vulkan_window.rs
Normal file
358
gstreamer-vulkan/src/auto/vulkan_window.rs
Normal file
|
@ -0,0 +1,358 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{ffi, VulkanDevice, VulkanDisplay};
|
||||
use glib::{
|
||||
object::ObjectType as _,
|
||||
prelude::*,
|
||||
signal::{connect_raw, SignalHandlerId},
|
||||
translate::*,
|
||||
};
|
||||
use std::boxed::Box as Box_;
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanWindow")]
|
||||
pub struct VulkanWindow(Object<ffi::GstVulkanWindow, ffi::GstVulkanWindowClass>) @extends gst::Object;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_window_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanWindow {
|
||||
pub const NONE: Option<&'static VulkanWindow> = None;
|
||||
|
||||
#[doc(alias = "gst_vulkan_window_new")]
|
||||
pub fn new(display: &impl IsA<VulkanDisplay>) -> VulkanWindow {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_window_new(
|
||||
display.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanWindow {}
|
||||
unsafe impl Sync for VulkanWindow {}
|
||||
|
||||
pub trait VulkanWindowExt: IsA<VulkanWindow> + 'static {
|
||||
#[doc(alias = "gst_vulkan_window_close")]
|
||||
fn close(&self) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_window_close(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_window_get_display")]
|
||||
#[doc(alias = "get_display")]
|
||||
fn display(&self) -> VulkanDisplay {
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_vulkan_window_get_display(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_window_get_presentation_support")]
|
||||
#[doc(alias = "get_presentation_support")]
|
||||
fn is_presentation_support(
|
||||
&self,
|
||||
device: &impl IsA<VulkanDevice>,
|
||||
queue_family_idx: u32,
|
||||
) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_vulkan_window_get_presentation_support(
|
||||
self.as_ref().to_glib_none().0,
|
||||
device.as_ref().to_glib_none().0,
|
||||
queue_family_idx,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_window_get_surface")]
|
||||
#[doc(alias = "get_surface")]
|
||||
fn surface(&self) -> Result<vulkan::SurfaceKHR, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let ret =
|
||||
ffi::gst_vulkan_window_get_surface(self.as_ref().to_glib_none().0, &mut error);
|
||||
if error.is_null() {
|
||||
Ok(ret)
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_window_get_surface_dimensions")]
|
||||
#[doc(alias = "get_surface_dimensions")]
|
||||
fn surface_dimensions(&self) -> (u32, u32) {
|
||||
unsafe {
|
||||
let mut width = std::mem::MaybeUninit::uninit();
|
||||
let mut height = std::mem::MaybeUninit::uninit();
|
||||
ffi::gst_vulkan_window_get_surface_dimensions(
|
||||
self.as_ref().to_glib_none().0,
|
||||
width.as_mut_ptr(),
|
||||
height.as_mut_ptr(),
|
||||
);
|
||||
(width.assume_init(), height.assume_init())
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_window_handle_events")]
|
||||
fn handle_events(&self, handle_events: bool) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_window_handle_events(
|
||||
self.as_ref().to_glib_none().0,
|
||||
handle_events.into_glib(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_window_open")]
|
||||
fn open(&self) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = std::ptr::null_mut();
|
||||
let is_ok = ffi::gst_vulkan_window_open(self.as_ref().to_glib_none().0, &mut error);
|
||||
debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
|
||||
if error.is_null() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(from_glib_full(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_window_redraw")]
|
||||
fn redraw(&self) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_window_redraw(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_window_resize")]
|
||||
fn resize(&self, width: i32, height: i32) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_window_resize(self.as_ref().to_glib_none().0, width, height);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_window_send_key_event")]
|
||||
fn send_key_event(&self, event_type: &str, key_str: &str) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_window_send_key_event(
|
||||
self.as_ref().to_glib_none().0,
|
||||
event_type.to_glib_none().0,
|
||||
key_str.to_glib_none().0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "gst_vulkan_window_send_mouse_event")]
|
||||
fn send_mouse_event(&self, event_type: &str, button: i32, posx: f64, posy: f64) {
|
||||
unsafe {
|
||||
ffi::gst_vulkan_window_send_mouse_event(
|
||||
self.as_ref().to_glib_none().0,
|
||||
event_type.to_glib_none().0,
|
||||
button,
|
||||
posx,
|
||||
posy,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_window_set_window_handle")]
|
||||
//fn set_window_handle(&self, handle: /*Unimplemented*/Basic: UIntPtr) {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_window_set_window_handle() }
|
||||
//}
|
||||
|
||||
#[doc(alias = "close")]
|
||||
fn connect_close<F: Fn(&Self) -> bool + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe extern "C" fn close_trampoline<
|
||||
P: IsA<VulkanWindow>,
|
||||
F: Fn(&P) -> bool + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstVulkanWindow,
|
||||
f: glib::ffi::gpointer,
|
||||
) -> glib::ffi::gboolean {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(VulkanWindow::from_glib_borrow(this).unsafe_cast_ref()).into_glib()
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
c"close".as_ptr() as *const _,
|
||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
||||
close_trampoline::<Self, F> as *const (),
|
||||
)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "draw")]
|
||||
fn connect_draw<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe extern "C" fn draw_trampoline<
|
||||
P: IsA<VulkanWindow>,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstVulkanWindow,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(VulkanWindow::from_glib_borrow(this).unsafe_cast_ref())
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
c"draw".as_ptr() as *const _,
|
||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
||||
draw_trampoline::<Self, F> as *const (),
|
||||
)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "key-event")]
|
||||
fn connect_key_event<F: Fn(&Self, &str, &str) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn key_event_trampoline<
|
||||
P: IsA<VulkanWindow>,
|
||||
F: Fn(&P, &str, &str) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstVulkanWindow,
|
||||
id: *mut std::ffi::c_char,
|
||||
key: *mut std::ffi::c_char,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(
|
||||
VulkanWindow::from_glib_borrow(this).unsafe_cast_ref(),
|
||||
&glib::GString::from_glib_borrow(id),
|
||||
&glib::GString::from_glib_borrow(key),
|
||||
)
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
c"key-event".as_ptr() as *const _,
|
||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
||||
key_event_trampoline::<Self, F> as *const (),
|
||||
)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "mouse-event")]
|
||||
fn connect_mouse_event<F: Fn(&Self, &str, i32, f64, f64) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn mouse_event_trampoline<
|
||||
P: IsA<VulkanWindow>,
|
||||
F: Fn(&P, &str, i32, f64, f64) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstVulkanWindow,
|
||||
id: *mut std::ffi::c_char,
|
||||
button: std::ffi::c_int,
|
||||
x: std::ffi::c_double,
|
||||
y: std::ffi::c_double,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(
|
||||
VulkanWindow::from_glib_borrow(this).unsafe_cast_ref(),
|
||||
&glib::GString::from_glib_borrow(id),
|
||||
button,
|
||||
x,
|
||||
y,
|
||||
)
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
c"mouse-event".as_ptr() as *const _,
|
||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
||||
mouse_event_trampoline::<Self, F> as *const (),
|
||||
)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "resize")]
|
||||
fn connect_resize<F: Fn(&Self, u32, u32) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn resize_trampoline<
|
||||
P: IsA<VulkanWindow>,
|
||||
F: Fn(&P, u32, u32) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstVulkanWindow,
|
||||
object: std::ffi::c_uint,
|
||||
p0: std::ffi::c_uint,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(
|
||||
VulkanWindow::from_glib_borrow(this).unsafe_cast_ref(),
|
||||
object,
|
||||
p0,
|
||||
)
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
c"resize".as_ptr() as *const _,
|
||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
||||
resize_trampoline::<Self, F> as *const (),
|
||||
)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "display")]
|
||||
fn connect_display_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_display_trampoline<
|
||||
P: IsA<VulkanWindow>,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstVulkanWindow,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(VulkanWindow::from_glib_borrow(this).unsafe_cast_ref())
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
self.as_ptr() as *mut _,
|
||||
c"notify::display".as_ptr() as *const _,
|
||||
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
|
||||
notify_display_trampoline::<Self, F> as *const (),
|
||||
)),
|
||||
Box_::into_raw(f),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<O: IsA<VulkanWindow>> VulkanWindowExt for O {}
|
7
gstreamer-vulkan/wayland/src/auto/mod.rs
Normal file
7
gstreamer-vulkan/wayland/src/auto/mod.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
mod vulkan_display_wayland;
|
||||
pub use self::vulkan_display_wayland::VulkanDisplayWayland;
|
3
gstreamer-vulkan/wayland/src/auto/versions.txt
Normal file
3
gstreamer-vulkan/wayland/src/auto/versions.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ 876968b635c3)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ 3ede86d6a218)
|
||||
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 83be677e7578)
|
38
gstreamer-vulkan/wayland/src/auto/vulkan_display_wayland.rs
Normal file
38
gstreamer-vulkan/wayland/src/auto/vulkan_display_wayland.rs
Normal file
|
@ -0,0 +1,38 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::ffi;
|
||||
use glib::translate::*;
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanDisplayWayland")]
|
||||
pub struct VulkanDisplayWayland(Object<ffi::GstVulkanDisplayWayland, ffi::GstVulkanDisplayWaylandClass>) @extends gst_vulkan::VulkanDisplay;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_display_wayland_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanDisplayWayland {
|
||||
pub const NONE: Option<&'static VulkanDisplayWayland> = None;
|
||||
|
||||
#[doc(alias = "gst_vulkan_display_wayland_new")]
|
||||
pub fn new(name: Option<&str>) -> Result<VulkanDisplayWayland, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(ffi::gst_vulkan_display_wayland_new(name.to_glib_none().0))
|
||||
.ok_or_else(|| glib::bool_error!("Failed to crate new Wayland Vulkan display"))
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "gst_vulkan_display_wayland_new_with_display")]
|
||||
//#[doc(alias = "new_with_display")]
|
||||
//pub fn with_display(display: /*Unimplemented*/Option<Basic: Pointer>) -> VulkanDisplayWayland {
|
||||
// unsafe { TODO: call ffi:gst_vulkan_display_wayland_new_with_display() }
|
||||
//}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanDisplayWayland {}
|
||||
unsafe impl Sync for VulkanDisplayWayland {}
|
7
gstreamer-vulkan/xcb/src/auto/mod.rs
Normal file
7
gstreamer-vulkan/xcb/src/auto/mod.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
mod vulkan_display_xcb;
|
||||
pub use self::vulkan_display_xcb::VulkanDisplayXCB;
|
3
gstreamer-vulkan/xcb/src/auto/versions.txt
Normal file
3
gstreamer-vulkan/xcb/src/auto/versions.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ 876968b635c3)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ 3ede86d6a218)
|
||||
from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 83be677e7578)
|
30
gstreamer-vulkan/xcb/src/auto/vulkan_display_xcb.rs
Normal file
30
gstreamer-vulkan/xcb/src/auto/vulkan_display_xcb.rs
Normal file
|
@ -0,0 +1,30 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::ffi;
|
||||
use glib::translate::*;
|
||||
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "GstVulkanDisplayXCB")]
|
||||
pub struct VulkanDisplayXCB(Object<ffi::GstVulkanDisplayXCB, ffi::GstVulkanDisplayXCBClass>) @extends gst_vulkan::VulkanDisplay;
|
||||
|
||||
match fn {
|
||||
type_ => || ffi::gst_vulkan_display_xcb_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl VulkanDisplayXCB {
|
||||
#[doc(alias = "gst_vulkan_display_xcb_new")]
|
||||
pub fn new(name: Option<&str>) -> Result<VulkanDisplayXCB, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(ffi::gst_vulkan_display_xcb_new(name.to_glib_none().0))
|
||||
.ok_or_else(|| glib::bool_error!("Failed to crate new XCB Vulkan display"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for VulkanDisplayXCB {}
|
||||
unsafe impl Sync for VulkanDisplayXCB {}
|
Loading…
Reference in a new issue