mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-22 09:31:06 +00:00
gstreamer: Implement glib::HasParamSpec
for our custom pspecs
This allows using `gst::Fraction` / `gst::Array` properties via the new properties macro. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1213>
This commit is contained in:
parent
91eec7a33f
commit
172e22c4b3
1 changed files with 22 additions and 0 deletions
|
@ -28,6 +28,17 @@ impl std::ops::Deref for ParamSpecFraction {
|
|||
|
||||
unsafe impl glib::ParamSpecType for ParamSpecFraction {}
|
||||
|
||||
impl glib::HasParamSpec for crate::Fraction {
|
||||
type ParamSpec = ParamSpecFraction;
|
||||
|
||||
type SetValue = crate::Fraction;
|
||||
type BuilderFn = for<'a> fn(&'a str) -> ParamSpecFractionBuilder;
|
||||
|
||||
fn param_spec_builder() -> Self::BuilderFn {
|
||||
ParamSpecFraction::builder
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlibPtrFull<*mut gobject_ffi::GParamSpec> for ParamSpecFraction {
|
||||
#[inline]
|
||||
|
@ -228,6 +239,17 @@ impl std::ops::Deref for ParamSpecArray {
|
|||
|
||||
unsafe impl glib::ParamSpecType for ParamSpecArray {}
|
||||
|
||||
impl glib::HasParamSpec for crate::Array {
|
||||
type ParamSpec = ParamSpecArray;
|
||||
|
||||
type SetValue = crate::Array;
|
||||
type BuilderFn = for<'a> fn(&'a str) -> ParamSpecArrayBuilder;
|
||||
|
||||
fn param_spec_builder() -> Self::BuilderFn {
|
||||
ParamSpecArray::builder
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlibPtrFull<*mut gobject_ffi::GParamSpec> for ParamSpecArray {
|
||||
#[inline]
|
||||
|
|
Loading…
Reference in a new issue