2022-01-27 12:34:00 +00:00
|
|
|
// Take a look at the license at the top of the repository in the LICENSE file.
|
|
|
|
|
2023-01-03 18:58:25 +00:00
|
|
|
use glib::{prelude::*, subclass::prelude::*, translate::*};
|
|
|
|
|
2022-01-27 12:34:00 +00:00
|
|
|
use super::prelude::*;
|
|
|
|
|
|
|
|
pub trait RTPHeaderExtensionImpl: RTPHeaderExtensionImplExt + ElementImpl {
|
|
|
|
const URI: &'static str;
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn supported_flags(&self) -> crate::RTPHeaderExtensionFlags {
|
|
|
|
self.parent_supported_flags()
|
2022-01-27 12:34:00 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn max_size(&self, input: &gst::BufferRef) -> usize {
|
|
|
|
self.parent_max_size(input)
|
2022-01-27 12:34:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn write(
|
|
|
|
&self,
|
|
|
|
input: &gst::BufferRef,
|
|
|
|
write_flags: crate::RTPHeaderExtensionFlags,
|
2024-02-22 10:12:39 +00:00
|
|
|
output: &gst::BufferRef,
|
2022-01-27 12:34:00 +00:00
|
|
|
output_data: &mut [u8],
|
|
|
|
) -> Result<usize, gst::LoggableError> {
|
2022-10-08 18:50:06 +00:00
|
|
|
self.parent_write(input, write_flags, output, output_data)
|
2022-01-27 12:34:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn read(
|
|
|
|
&self,
|
|
|
|
read_flags: crate::RTPHeaderExtensionFlags,
|
|
|
|
input_data: &[u8],
|
|
|
|
output: &mut gst::BufferRef,
|
|
|
|
) -> Result<(), gst::LoggableError> {
|
2022-10-08 18:50:06 +00:00
|
|
|
self.parent_read(read_flags, input_data, output)
|
2022-01-27 12:34:00 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn set_non_rtp_sink_caps(&self, caps: &gst::Caps) -> Result<(), gst::LoggableError> {
|
|
|
|
self.parent_set_non_rtp_sink_caps(caps)
|
2022-01-27 12:34:00 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn update_non_rtp_src_caps(&self, caps: &mut gst::CapsRef) -> Result<(), gst::LoggableError> {
|
|
|
|
self.parent_update_non_rtp_src_caps(caps)
|
2022-01-27 12:34:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn set_attributes(
|
|
|
|
&self,
|
|
|
|
direction: crate::RTPHeaderExtensionDirection,
|
|
|
|
attributes: &str,
|
|
|
|
) -> Result<(), gst::LoggableError> {
|
2022-10-08 18:50:06 +00:00
|
|
|
self.parent_set_attributes(direction, attributes)
|
2022-01-27 12:34:00 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn set_caps_from_attributes(&self, caps: &mut gst::CapsRef) -> Result<(), gst::LoggableError> {
|
|
|
|
self.parent_set_caps_from_attributes(caps)
|
2022-01-27 12:34:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 20:21:43 +00:00
|
|
|
mod sealed {
|
|
|
|
pub trait Sealed {}
|
|
|
|
impl<T: super::RTPHeaderExtensionImplExt> Sealed for T {}
|
2022-01-27 12:34:00 +00:00
|
|
|
}
|
|
|
|
|
2023-07-05 20:21:43 +00:00
|
|
|
pub trait RTPHeaderExtensionImplExt: sealed::Sealed + ObjectSubclass {
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_supported_flags(&self) -> crate::RTPHeaderExtensionFlags {
|
2022-01-27 12:34:00 +00:00
|
|
|
unsafe {
|
|
|
|
let data = Self::type_data();
|
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTPHeaderExtensionClass;
|
|
|
|
let f = (*parent_class)
|
|
|
|
.get_supported_flags
|
|
|
|
.expect("no parent \"get_supported_flags\" implementation");
|
2022-10-08 18:50:06 +00:00
|
|
|
from_glib(f(self
|
2022-10-23 19:59:23 +00:00
|
|
|
.obj()
|
2022-01-27 12:34:00 +00:00
|
|
|
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
|
|
|
|
.to_glib_none()
|
|
|
|
.0))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_max_size(&self, input: &gst::BufferRef) -> usize {
|
2022-01-27 12:34:00 +00:00
|
|
|
unsafe {
|
|
|
|
let data = Self::type_data();
|
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTPHeaderExtensionClass;
|
|
|
|
let f = (*parent_class)
|
|
|
|
.get_max_size
|
|
|
|
.expect("no parent \"get_max_size\" implementation");
|
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj()
|
2022-01-27 12:34:00 +00:00
|
|
|
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
|
|
|
|
.to_glib_none()
|
|
|
|
.0,
|
|
|
|
input.as_ptr(),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn parent_write(
|
|
|
|
&self,
|
|
|
|
input: &gst::BufferRef,
|
|
|
|
write_flags: crate::RTPHeaderExtensionFlags,
|
2024-02-22 10:12:39 +00:00
|
|
|
output: &gst::BufferRef,
|
2022-01-27 12:34:00 +00:00
|
|
|
output_data: &mut [u8],
|
|
|
|
) -> Result<usize, gst::LoggableError> {
|
|
|
|
unsafe {
|
|
|
|
let data = Self::type_data();
|
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTPHeaderExtensionClass;
|
|
|
|
let f = (*parent_class)
|
|
|
|
.write
|
|
|
|
.expect("no parent \"write\" implementation");
|
|
|
|
|
|
|
|
let res = f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj()
|
2022-01-27 12:34:00 +00:00
|
|
|
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
|
|
|
|
.to_glib_none()
|
|
|
|
.0,
|
|
|
|
input.as_ptr(),
|
|
|
|
write_flags.into_glib(),
|
2024-02-22 10:12:39 +00:00
|
|
|
mut_override(output.as_ptr()),
|
2022-01-27 12:34:00 +00:00
|
|
|
output_data.as_mut_ptr(),
|
|
|
|
output_data.len(),
|
|
|
|
);
|
|
|
|
|
|
|
|
if res < 0 {
|
|
|
|
Err(gst::loggable_error!(
|
|
|
|
gst::CAT_RUST,
|
|
|
|
"Failed to write extension data"
|
|
|
|
))
|
|
|
|
} else {
|
|
|
|
Ok(res as usize)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn parent_read(
|
|
|
|
&self,
|
|
|
|
read_flags: crate::RTPHeaderExtensionFlags,
|
|
|
|
input_data: &[u8],
|
|
|
|
output: &mut gst::BufferRef,
|
|
|
|
) -> Result<(), gst::LoggableError> {
|
|
|
|
unsafe {
|
|
|
|
let data = Self::type_data();
|
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTPHeaderExtensionClass;
|
|
|
|
let f = (*parent_class)
|
|
|
|
.read
|
|
|
|
.expect("no parent \"read\" implementation");
|
|
|
|
|
|
|
|
gst::result_from_gboolean!(
|
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj()
|
2022-01-27 12:34:00 +00:00
|
|
|
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
|
|
|
|
.to_glib_none()
|
|
|
|
.0,
|
|
|
|
read_flags.into_glib(),
|
|
|
|
input_data.as_ptr(),
|
|
|
|
input_data.len(),
|
|
|
|
output.as_mut_ptr(),
|
|
|
|
),
|
|
|
|
gst::CAT_RUST,
|
|
|
|
"Failed to read extension data",
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
fn parent_set_non_rtp_sink_caps(&self, caps: &gst::Caps) -> Result<(), gst::LoggableError> {
|
2022-01-27 12:34:00 +00:00
|
|
|
unsafe {
|
|
|
|
let data = Self::type_data();
|
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTPHeaderExtensionClass;
|
|
|
|
if let Some(f) = (*parent_class).set_non_rtp_sink_caps {
|
|
|
|
gst::result_from_gboolean!(
|
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj()
|
2022-01-27 12:34:00 +00:00
|
|
|
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
|
|
|
|
.to_glib_none()
|
|
|
|
.0,
|
|
|
|
caps.as_mut_ptr(),
|
|
|
|
),
|
|
|
|
gst::CAT_RUST,
|
|
|
|
"Failed to set non-RTP sink caps",
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn parent_update_non_rtp_src_caps(
|
|
|
|
&self,
|
|
|
|
caps: &mut gst::CapsRef,
|
|
|
|
) -> Result<(), gst::LoggableError> {
|
|
|
|
unsafe {
|
|
|
|
let data = Self::type_data();
|
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTPHeaderExtensionClass;
|
|
|
|
if let Some(f) = (*parent_class).update_non_rtp_src_caps {
|
|
|
|
gst::result_from_gboolean!(
|
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj()
|
2022-01-27 12:34:00 +00:00
|
|
|
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
|
|
|
|
.to_glib_none()
|
|
|
|
.0,
|
|
|
|
caps.as_mut_ptr(),
|
|
|
|
),
|
|
|
|
gst::CAT_RUST,
|
|
|
|
"Failed to update non-RTP source caps",
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn parent_set_attributes(
|
|
|
|
&self,
|
|
|
|
direction: crate::RTPHeaderExtensionDirection,
|
|
|
|
attributes: &str,
|
|
|
|
) -> Result<(), gst::LoggableError> {
|
|
|
|
unsafe {
|
|
|
|
let data = Self::type_data();
|
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTPHeaderExtensionClass;
|
|
|
|
if let Some(f) = (*parent_class).set_attributes {
|
|
|
|
gst::result_from_gboolean!(
|
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj()
|
2022-01-27 12:34:00 +00:00
|
|
|
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
|
|
|
|
.to_glib_none()
|
|
|
|
.0,
|
|
|
|
direction.into_glib(),
|
|
|
|
attributes.to_glib_none().0,
|
|
|
|
),
|
|
|
|
gst::CAT_RUST,
|
|
|
|
"Failed to set attributes",
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn parent_set_caps_from_attributes(
|
|
|
|
&self,
|
|
|
|
caps: &mut gst::CapsRef,
|
|
|
|
) -> Result<(), gst::LoggableError> {
|
|
|
|
unsafe {
|
|
|
|
let data = Self::type_data();
|
|
|
|
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTPHeaderExtensionClass;
|
|
|
|
let f = (*parent_class)
|
|
|
|
.set_caps_from_attributes
|
|
|
|
.expect("no parent \"set_caps_from_attributes\" implementation");
|
|
|
|
|
|
|
|
gst::result_from_gboolean!(
|
|
|
|
f(
|
2022-10-23 19:59:23 +00:00
|
|
|
self.obj()
|
2022-01-27 12:34:00 +00:00
|
|
|
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
|
|
|
|
.to_glib_none()
|
|
|
|
.0,
|
|
|
|
caps.as_mut_ptr(),
|
|
|
|
),
|
|
|
|
gst::CAT_RUST,
|
|
|
|
"Failed to set caps from attributes",
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 20:21:43 +00:00
|
|
|
impl<T: RTPHeaderExtensionImpl> RTPHeaderExtensionImplExt for T {}
|
|
|
|
|
2022-01-27 12:34:00 +00:00
|
|
|
unsafe impl<T: RTPHeaderExtensionImpl> IsSubclassable<T> for crate::RTPHeaderExtension {
|
|
|
|
fn class_init(klass: &mut glib::Class<Self>) {
|
|
|
|
Self::parent_class_init::<T>(klass);
|
|
|
|
let klass = klass.as_mut();
|
|
|
|
klass.get_supported_flags = Some(get_supported_flags::<T>);
|
|
|
|
klass.get_max_size = Some(get_max_size::<T>);
|
|
|
|
klass.write = Some(write::<T>);
|
|
|
|
klass.read = Some(read::<T>);
|
|
|
|
klass.set_non_rtp_sink_caps = Some(set_non_rtp_sink_caps::<T>);
|
|
|
|
klass.update_non_rtp_src_caps = Some(update_non_rtp_src_caps::<T>);
|
|
|
|
klass.set_attributes = Some(set_attributes::<T>);
|
|
|
|
klass.set_caps_from_attributes = Some(set_caps_from_attributes::<T>);
|
|
|
|
|
|
|
|
unsafe {
|
|
|
|
ffi::gst_rtp_header_extension_class_set_uri(&mut *klass, T::URI.to_glib_none().0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe extern "C" fn get_supported_flags<T: RTPHeaderExtensionImpl>(
|
|
|
|
ptr: *mut ffi::GstRTPHeaderExtension,
|
|
|
|
) -> ffi::GstRTPHeaderExtensionFlags {
|
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
|
|
|
let imp = instance.imp();
|
2022-10-08 18:50:06 +00:00
|
|
|
|
|
|
|
gst::panic_to_error!(imp, crate::RTPHeaderExtensionFlags::empty(), {
|
|
|
|
imp.supported_flags()
|
|
|
|
})
|
2022-01-27 12:34:00 +00:00
|
|
|
.into_glib()
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe extern "C" fn get_max_size<T: RTPHeaderExtensionImpl>(
|
|
|
|
ptr: *mut ffi::GstRTPHeaderExtension,
|
|
|
|
input: *const gst::ffi::GstBuffer,
|
|
|
|
) -> usize {
|
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
|
|
|
let imp = instance.imp();
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
gst::panic_to_error!(imp, 0, { imp.max_size(gst::BufferRef::from_ptr(input)) })
|
2022-01-27 12:34:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
unsafe extern "C" fn write<T: RTPHeaderExtensionImpl>(
|
|
|
|
ptr: *mut ffi::GstRTPHeaderExtension,
|
|
|
|
input: *const gst::ffi::GstBuffer,
|
|
|
|
write_flags: ffi::GstRTPHeaderExtensionFlags,
|
|
|
|
output: *mut gst::ffi::GstBuffer,
|
|
|
|
output_data: *mut u8,
|
|
|
|
output_data_len: usize,
|
|
|
|
) -> isize {
|
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
|
|
|
let imp = instance.imp();
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
gst::panic_to_error!(imp, -1, {
|
2022-01-27 12:34:00 +00:00
|
|
|
match imp.write(
|
|
|
|
gst::BufferRef::from_ptr(input),
|
|
|
|
from_glib(write_flags),
|
2024-02-22 10:12:39 +00:00
|
|
|
gst::BufferRef::from_ptr(output),
|
2022-02-07 10:21:13 +00:00
|
|
|
if output_data_len == 0 {
|
|
|
|
&mut []
|
|
|
|
} else {
|
|
|
|
std::slice::from_raw_parts_mut(output_data, output_data_len)
|
|
|
|
},
|
2022-01-27 12:34:00 +00:00
|
|
|
) {
|
|
|
|
Ok(len) => len as isize,
|
|
|
|
Err(err) => {
|
2022-10-08 18:50:06 +00:00
|
|
|
err.log_with_imp(imp);
|
2022-01-27 12:34:00 +00:00
|
|
|
-1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe extern "C" fn read<T: RTPHeaderExtensionImpl>(
|
|
|
|
ptr: *mut ffi::GstRTPHeaderExtension,
|
|
|
|
read_flags: ffi::GstRTPHeaderExtensionFlags,
|
|
|
|
input_data: *const u8,
|
|
|
|
input_data_len: usize,
|
|
|
|
output: *mut gst::ffi::GstBuffer,
|
|
|
|
) -> glib::ffi::gboolean {
|
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
|
|
|
let imp = instance.imp();
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
gst::panic_to_error!(imp, false, {
|
2022-01-27 12:34:00 +00:00
|
|
|
match imp.read(
|
|
|
|
from_glib(read_flags),
|
2022-02-07 10:21:13 +00:00
|
|
|
if input_data_len == 0 {
|
|
|
|
&[]
|
|
|
|
} else {
|
|
|
|
std::slice::from_raw_parts(input_data, input_data_len)
|
|
|
|
},
|
2022-01-27 12:34:00 +00:00
|
|
|
gst::BufferRef::from_mut_ptr(output),
|
|
|
|
) {
|
|
|
|
Ok(_) => true,
|
|
|
|
Err(err) => {
|
2022-10-08 18:50:06 +00:00
|
|
|
err.log_with_imp(imp);
|
2022-01-27 12:34:00 +00:00
|
|
|
false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.into_glib()
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe extern "C" fn set_non_rtp_sink_caps<T: RTPHeaderExtensionImpl>(
|
|
|
|
ptr: *mut ffi::GstRTPHeaderExtension,
|
|
|
|
caps: *mut gst::ffi::GstCaps,
|
|
|
|
) -> glib::ffi::gboolean {
|
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
|
|
|
let imp = instance.imp();
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
gst::panic_to_error!(imp, false, {
|
|
|
|
match imp.set_non_rtp_sink_caps(&from_glib_borrow(caps)) {
|
2022-01-27 12:34:00 +00:00
|
|
|
Ok(_) => true,
|
|
|
|
Err(err) => {
|
2022-10-08 18:50:06 +00:00
|
|
|
err.log_with_imp(imp);
|
2022-01-27 12:34:00 +00:00
|
|
|
false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.into_glib()
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe extern "C" fn update_non_rtp_src_caps<T: RTPHeaderExtensionImpl>(
|
|
|
|
ptr: *mut ffi::GstRTPHeaderExtension,
|
|
|
|
caps: *mut gst::ffi::GstCaps,
|
|
|
|
) -> glib::ffi::gboolean {
|
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
|
|
|
let imp = instance.imp();
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
gst::panic_to_error!(imp, false, {
|
|
|
|
match imp.update_non_rtp_src_caps(gst::CapsRef::from_mut_ptr(caps)) {
|
2022-01-27 12:34:00 +00:00
|
|
|
Ok(_) => true,
|
|
|
|
Err(err) => {
|
2022-10-08 18:50:06 +00:00
|
|
|
err.log_with_imp(imp);
|
2022-01-27 12:34:00 +00:00
|
|
|
false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.into_glib()
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe extern "C" fn set_attributes<T: RTPHeaderExtensionImpl>(
|
|
|
|
ptr: *mut ffi::GstRTPHeaderExtension,
|
|
|
|
direction: ffi::GstRTPHeaderExtensionDirection,
|
|
|
|
attributes: *const libc::c_char,
|
|
|
|
) -> glib::ffi::gboolean {
|
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
|
|
|
let imp = instance.imp();
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
gst::panic_to_error!(imp, false, {
|
2022-01-27 12:34:00 +00:00
|
|
|
match imp.set_attributes(
|
|
|
|
from_glib(direction),
|
|
|
|
&glib::GString::from_glib_borrow(attributes),
|
|
|
|
) {
|
|
|
|
Ok(_) => true,
|
|
|
|
Err(err) => {
|
2022-10-08 18:50:06 +00:00
|
|
|
err.log_with_imp(imp);
|
2022-01-27 12:34:00 +00:00
|
|
|
false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.into_glib()
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe extern "C" fn set_caps_from_attributes<T: RTPHeaderExtensionImpl>(
|
|
|
|
ptr: *mut ffi::GstRTPHeaderExtension,
|
|
|
|
caps: *mut gst::ffi::GstCaps,
|
|
|
|
) -> glib::ffi::gboolean {
|
|
|
|
let instance = &*(ptr as *mut T::Instance);
|
|
|
|
let imp = instance.imp();
|
|
|
|
|
2022-10-08 18:50:06 +00:00
|
|
|
gst::panic_to_error!(imp, false, {
|
|
|
|
match imp.set_caps_from_attributes(gst::CapsRef::from_mut_ptr(caps)) {
|
2022-01-27 12:34:00 +00:00
|
|
|
Ok(_) => true,
|
|
|
|
Err(err) => {
|
2022-10-08 18:50:06 +00:00
|
|
|
err.log_with_imp(imp);
|
2022-01-27 12:34:00 +00:00
|
|
|
false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.into_glib()
|
|
|
|
}
|