From 0eb584593487fcecb12815c302aeedff04d085ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 19 Apr 2021 19:24:43 +0300 Subject: [PATCH] Regenerate with latest gir --- gstreamer-app/src/auto/app_sink.rs | 4 +- gstreamer-app/src/auto/app_src.rs | 22 +- gstreamer-app/src/auto/enums.rs | 30 +- gstreamer-app/src/auto/versions.txt | 2 +- gstreamer-app/sys/build.rs | 2 +- gstreamer-app/sys/src/lib.rs | 2 +- gstreamer-app/sys/tests/abi.rs | 2 +- gstreamer-app/sys/tests/constant.c | 2 +- gstreamer-app/sys/tests/layout.c | 2 +- gstreamer-audio/src/auto/audio_base_sink.rs | 10 +- gstreamer-audio/src/auto/audio_base_src.rs | 9 +- gstreamer-audio/src/auto/enums.rs | 192 ++- gstreamer-audio/src/auto/flags.rs | 84 +- gstreamer-audio/src/auto/versions.txt | 2 +- gstreamer-audio/sys/build.rs | 2 +- gstreamer-audio/sys/src/lib.rs | 2 +- gstreamer-audio/sys/tests/abi.rs | 2 +- gstreamer-audio/sys/tests/constant.c | 2 +- gstreamer-audio/sys/tests/layout.c | 2 +- gstreamer-base/src/auto/aggregator.rs | 10 +- gstreamer-base/src/auto/aggregator_pad.rs | 6 +- gstreamer-base/src/auto/base_parse.rs | 4 +- gstreamer-base/src/auto/base_sink.rs | 14 +- gstreamer-base/src/auto/base_src.rs | 7 +- gstreamer-base/src/auto/base_transform.rs | 8 +- gstreamer-base/src/auto/enums.rs | 32 +- gstreamer-base/src/auto/versions.txt | 2 +- gstreamer-base/sys/build.rs | 2 +- gstreamer-base/sys/src/lib.rs | 2 +- gstreamer-base/sys/tests/abi.rs | 2 +- gstreamer-base/sys/tests/constant.c | 2 +- gstreamer-base/sys/tests/layout.c | 2 +- gstreamer-check/src/auto/test_clock.rs | 5 +- gstreamer-check/src/auto/versions.txt | 2 +- gstreamer-check/sys/build.rs | 2 +- gstreamer-check/sys/src/lib.rs | 2 +- gstreamer-check/sys/tests/abi.rs | 2 +- gstreamer-check/sys/tests/constant.c | 2 +- gstreamer-check/sys/tests/layout.c | 2 +- .../src/auto/argb_control_binding.rs | 9 +- .../src/auto/direct_control_binding.rs | 4 +- gstreamer-controller/src/auto/enums.rs | 57 +- .../src/auto/interpolation_control_source.rs | 4 +- .../src/auto/lfo_control_source.rs | 16 +- .../src/auto/trigger_control_source.rs | 4 +- gstreamer-controller/src/auto/versions.txt | 2 +- gstreamer-controller/sys/build.rs | 2 +- gstreamer-controller/sys/src/lib.rs | 2 +- gstreamer-controller/sys/tests/abi.rs | 2 +- gstreamer-controller/sys/tests/constant.c | 2 +- gstreamer-controller/sys/tests/layout.c | 2 +- .../src/auto/container.rs | 2 +- gstreamer-editing-services/src/auto/effect.rs | 1 + gstreamer-editing-services/src/auto/enums.rs | 84 +- gstreamer-editing-services/src/auto/flags.rs | 57 +- gstreamer-editing-services/src/auto/group.rs | 16 +- .../src/auto/pipeline.rs | 9 +- .../src/auto/timeline_element.rs | 7 +- gstreamer-editing-services/src/auto/track.rs | 5 +- .../src/auto/transition_clip.rs | 4 +- .../src/auto/uri_clip_asset.rs | 4 +- .../src/auto/versions.txt | 2 +- gstreamer-editing-services/sys/build.rs | 2 +- gstreamer-editing-services/sys/src/lib.rs | 2 +- gstreamer-editing-services/sys/tests/abi.rs | 2 +- .../sys/tests/constant.c | 2 +- gstreamer-editing-services/sys/tests/layout.c | 2 +- gstreamer-gl/egl/src/auto/versions.txt | 2 +- gstreamer-gl/egl/sys/build.rs | 2 +- gstreamer-gl/egl/sys/src/lib.rs | 2 +- gstreamer-gl/egl/sys/tests/abi.rs | 2 +- gstreamer-gl/egl/sys/tests/constant.c | 2 +- gstreamer-gl/egl/sys/tests/layout.c | 2 +- gstreamer-gl/src/auto/enums.rs | 246 ++-- gstreamer-gl/src/auto/flags.rs | 111 +- gstreamer-gl/src/auto/gl_base_filter.rs | 1 + .../src/auto/gl_overlay_compositor.rs | 6 +- gstreamer-gl/src/auto/gl_view_convert.rs | 16 +- gstreamer-gl/src/auto/versions.txt | 2 +- gstreamer-gl/sys/build.rs | 2 +- gstreamer-gl/sys/src/lib.rs | 2 +- gstreamer-gl/sys/tests/abi.rs | 2 +- gstreamer-gl/sys/tests/constant.c | 2 +- gstreamer-gl/sys/tests/layout.c | 2 +- gstreamer-gl/wayland/src/auto/versions.txt | 2 +- gstreamer-gl/wayland/sys/build.rs | 2 +- gstreamer-gl/wayland/sys/src/lib.rs | 2 +- gstreamer-gl/wayland/sys/tests/abi.rs | 2 +- gstreamer-gl/wayland/sys/tests/constant.c | 2 +- gstreamer-gl/wayland/sys/tests/layout.c | 2 +- gstreamer-gl/x11/src/auto/versions.txt | 2 +- gstreamer-gl/x11/sys/build.rs | 2 +- gstreamer-gl/x11/sys/src/lib.rs | 2 +- gstreamer-gl/x11/sys/tests/abi.rs | 2 +- gstreamer-gl/x11/sys/tests/constant.c | 2 +- gstreamer-gl/x11/sys/tests/layout.c | 2 +- gstreamer-mpegts/sys/build.rs | 2 +- gstreamer-mpegts/sys/src/lib.rs | 2 +- gstreamer-mpegts/sys/tests/abi.rs | 2 +- gstreamer-mpegts/sys/tests/constant.c | 2 +- gstreamer-mpegts/sys/tests/layout.c | 2 +- gstreamer-net/src/auto/net_client_clock.rs | 18 +- gstreamer-net/src/auto/net_time_provider.rs | 8 +- gstreamer-net/src/auto/ptp_clock.rs | 4 +- gstreamer-net/src/auto/versions.txt | 2 +- gstreamer-net/sys/build.rs | 2 +- gstreamer-net/sys/src/lib.rs | 2 +- gstreamer-net/sys/tests/abi.rs | 2 +- gstreamer-net/sys/tests/constant.c | 2 +- gstreamer-net/sys/tests/layout.c | 2 +- gstreamer-pbutils/src/auto/discoverer.rs | 6 +- gstreamer-pbutils/src/auto/enums.rs | 30 +- gstreamer-pbutils/src/auto/flags.rs | 30 +- gstreamer-pbutils/src/auto/versions.txt | 2 +- gstreamer-pbutils/sys/build.rs | 2 +- gstreamer-pbutils/sys/src/lib.rs | 2 +- gstreamer-pbutils/sys/tests/abi.rs | 2 +- gstreamer-pbutils/sys/tests/constant.c | 2 +- gstreamer-pbutils/sys/tests/layout.c | 2 +- gstreamer-player/src/auto/enums.rs | 84 +- gstreamer-player/src/auto/player.rs | 9 +- .../player_gmain_context_signal_dispatcher.rs | 1 + .../player_video_overlay_video_renderer.rs | 3 +- gstreamer-player/src/auto/versions.txt | 2 +- gstreamer-player/sys/build.rs | 2 +- gstreamer-player/sys/src/lib.rs | 2 +- gstreamer-player/sys/tests/abi.rs | 2 +- gstreamer-player/sys/tests/constant.c | 2 +- gstreamer-player/sys/tests/layout.c | 2 +- gstreamer-rtp/src/auto/enums.rs | 165 ++- gstreamer-rtp/src/auto/flags.rs | 57 +- gstreamer-rtp/src/auto/versions.txt | 2 +- gstreamer-rtp/sys/build.rs | 2 +- gstreamer-rtp/sys/src/lib.rs | 2 +- gstreamer-rtp/sys/tests/abi.rs | 2 +- gstreamer-rtp/sys/tests/constant.c | 2 +- gstreamer-rtp/sys/tests/layout.c | 2 +- gstreamer-rtsp-server/src/auto/enums.rs | 57 +- gstreamer-rtsp-server/src/auto/flags.rs | 30 +- gstreamer-rtsp-server/src/auto/rtsp_client.rs | 7 +- gstreamer-rtsp-server/src/auto/rtsp_media.rs | 12 +- .../src/auto/rtsp_media_factory.rs | 11 +- .../src/auto/rtsp_media_factory_uri.rs | 4 +- gstreamer-rtsp-server/src/auto/rtsp_server.rs | 4 +- .../src/auto/rtsp_session.rs | 7 +- gstreamer-rtsp-server/src/auto/versions.txt | 2 +- gstreamer-rtsp-server/sys/build.rs | 2 +- gstreamer-rtsp-server/sys/src/lib.rs | 2 +- gstreamer-rtsp-server/sys/tests/abi.rs | 2 +- gstreamer-rtsp-server/sys/tests/constant.c | 2 +- gstreamer-rtsp-server/sys/tests/layout.c | 2 +- gstreamer-rtsp/src/auto/enums.rs | 246 ++-- gstreamer-rtsp/src/auto/flags.rs | 138 +- gstreamer-rtsp/src/auto/versions.txt | 2 +- gstreamer-rtsp/sys/build.rs | 2 +- gstreamer-rtsp/sys/src/lib.rs | 2 +- gstreamer-rtsp/sys/tests/abi.rs | 2 +- gstreamer-rtsp/sys/tests/constant.c | 2 +- gstreamer-rtsp/sys/tests/layout.c | 2 +- gstreamer-sdp/src/auto/versions.txt | 2 +- gstreamer-sdp/sys/build.rs | 2 +- gstreamer-sdp/sys/src/lib.rs | 2 +- gstreamer-sdp/sys/tests/abi.rs | 2 +- gstreamer-sdp/sys/tests/constant.c | 2 +- gstreamer-sdp/sys/tests/layout.c | 2 +- gstreamer-tag/sys/build.rs | 2 +- gstreamer-tag/sys/src/lib.rs | 2 +- gstreamer-tag/sys/tests/abi.rs | 2 +- gstreamer-tag/sys/tests/constant.c | 2 +- gstreamer-tag/sys/tests/layout.c | 2 +- gstreamer-video/src/auto/enums.rs | 543 +++++--- gstreamer-video/src/auto/flags.rs | 246 ++-- gstreamer-video/src/auto/versions.txt | 2 +- gstreamer-video/src/auto/video_decoder.rs | 10 +- gstreamer-video/src/auto/video_encoder.rs | 8 +- gstreamer-video/src/auto/video_sink.rs | 4 +- gstreamer-video/sys/build.rs | 2 +- gstreamer-video/sys/src/lib.rs | 2 +- gstreamer-video/sys/tests/abi.rs | 2 +- gstreamer-video/sys/tests/constant.c | 2 +- gstreamer-video/sys/tests/layout.c | 2 +- gstreamer-webrtc/src/auto/enums.rs | 462 ++++--- gstreamer-webrtc/src/auto/versions.txt | 2 +- .../src/auto/web_rtc_data_channel.rs | 18 +- .../src/auto/web_rtcdtls_transport.rs | 9 +- .../src/auto/web_rtcice_transport.rs | 4 +- .../src/auto/web_rtcrtp_transceiver.rs | 5 +- gstreamer-webrtc/sys/build.rs | 2 +- gstreamer-webrtc/sys/src/lib.rs | 2 +- gstreamer-webrtc/sys/tests/abi.rs | 2 +- gstreamer-webrtc/sys/tests/constant.c | 2 +- gstreamer-webrtc/sys/tests/layout.c | 2 +- gstreamer/src/auto/bin.rs | 7 +- gstreamer/src/auto/clock.rs | 7 +- gstreamer/src/auto/control_binding.rs | 1 + gstreamer/src/auto/device_monitor.rs | 4 +- gstreamer/src/auto/enums.rs | 1110 +++++++++++------ gstreamer/src/auto/flags.rs | 678 ++++++---- gstreamer/src/auto/pad.rs | 1 + gstreamer/src/auto/pad_template.rs | 4 +- gstreamer/src/auto/system_clock.rs | 4 +- gstreamer/src/auto/versions.txt | 2 +- gstreamer/sys/build.rs | 2 +- gstreamer/sys/src/lib.rs | 2 +- gstreamer/sys/tests/abi.rs | 2 +- gstreamer/sys/tests/constant.c | 2 +- gstreamer/sys/tests/layout.c | 2 +- 207 files changed, 3448 insertions(+), 1968 deletions(-) diff --git a/gstreamer-app/src/auto/app_sink.rs b/gstreamer-app/src/auto/app_sink.rs index be233151f..518a3dd77 100644 --- a/gstreamer-app/src/auto/app_sink.rs +++ b/gstreamer-app/src/auto/app_sink.rs @@ -8,6 +8,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -165,7 +166,6 @@ impl AppSink { value .get() .expect("Return Value for property `buffer-list` getter") - .unwrap() } } @@ -175,7 +175,7 @@ impl AppSink { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"buffer-list\0".as_ptr() as *const _, - glib::Value::from(&buffer_list).to_glib_none().0, + buffer_list.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-app/src/auto/app_src.rs b/gstreamer-app/src/auto/app_src.rs index d9dcc4f5b..89f7e8b33 100644 --- a/gstreamer-app/src/auto/app_src.rs +++ b/gstreamer-app/src/auto/app_src.rs @@ -9,6 +9,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -119,7 +120,6 @@ impl AppSrc { value .get() .expect("Return Value for property `block` getter") - .unwrap() } } @@ -129,7 +129,7 @@ impl AppSrc { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"block\0".as_ptr() as *const _, - glib::Value::from(&block).to_glib_none().0, + block.to_value().to_glib_none().0, ); } } @@ -146,7 +146,6 @@ impl AppSrc { value .get() .expect("Return Value for property `format` getter") - .unwrap() } } @@ -156,7 +155,7 @@ impl AppSrc { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"format\0".as_ptr() as *const _, - glib::Value::from(&format).to_glib_none().0, + format.to_value().to_glib_none().0, ); } } @@ -175,7 +174,6 @@ impl AppSrc { value .get() .expect("Return Value for property `handle-segment-change` getter") - .unwrap() } } @@ -187,7 +185,7 @@ impl AppSrc { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"handle-segment-change\0".as_ptr() as *const _, - glib::Value::from(&handle_segment_change).to_glib_none().0, + handle_segment_change.to_value().to_glib_none().0, ); } } @@ -204,7 +202,6 @@ impl AppSrc { value .get() .expect("Return Value for property `is-live` getter") - .unwrap() } } @@ -214,7 +211,7 @@ impl AppSrc { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"is-live\0".as_ptr() as *const _, - glib::Value::from(&is_live).to_glib_none().0, + is_live.to_value().to_glib_none().0, ); } } @@ -231,7 +228,6 @@ impl AppSrc { value .get() .expect("Return Value for property `max-latency` getter") - .unwrap() } } @@ -241,7 +237,7 @@ impl AppSrc { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"max-latency\0".as_ptr() as *const _, - glib::Value::from(&max_latency).to_glib_none().0, + max_latency.to_value().to_glib_none().0, ); } } @@ -258,7 +254,6 @@ impl AppSrc { value .get() .expect("Return Value for property `min-latency` getter") - .unwrap() } } @@ -268,7 +263,7 @@ impl AppSrc { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"min-latency\0".as_ptr() as *const _, - glib::Value::from(&min_latency).to_glib_none().0, + min_latency.to_value().to_glib_none().0, ); } } @@ -285,7 +280,6 @@ impl AppSrc { value .get() .expect("Return Value for property `min-percent` getter") - .unwrap() } } @@ -295,7 +289,7 @@ impl AppSrc { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"min-percent\0".as_ptr() as *const _, - glib::Value::from(&min_percent).to_glib_none().0, + min_percent.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-app/src/auto/enums.rs b/gstreamer-app/src/auto/enums.rs index 582b7a87e..99d12c3a8 100644 --- a/gstreamer-app/src/auto/enums.rs +++ b/gstreamer-app/src/auto/enums.rs @@ -5,8 +5,7 @@ use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; @@ -57,20 +56,29 @@ impl StaticType for AppStreamType { } } -impl<'a> FromValueOptional<'a> for AppStreamType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for AppStreamType { + type Type = Self; } -impl<'a> FromValue<'a> for AppStreamType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for AppStreamType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for AppStreamType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for AppStreamType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-app/src/auto/versions.txt b/gstreamer-app/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-app/src/auto/versions.txt +++ b/gstreamer-app/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-app/sys/build.rs b/gstreamer-app/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-app/sys/build.rs +++ b/gstreamer-app/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-app/sys/src/lib.rs b/gstreamer-app/sys/src/lib.rs index bfceffade..637b52efe 100644 --- a/gstreamer-app/sys/src/lib.rs +++ b/gstreamer-app/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-app/sys/tests/abi.rs b/gstreamer-app/sys/tests/abi.rs index 5b61f3d53..8f824e916 100644 --- a/gstreamer-app/sys/tests/abi.rs +++ b/gstreamer-app/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-app/sys/tests/constant.c b/gstreamer-app/sys/tests/constant.c index c23276ac1..c2e5b145d 100644 --- a/gstreamer-app/sys/tests/constant.c +++ b/gstreamer-app/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-app/sys/tests/layout.c b/gstreamer-app/sys/tests/layout.c index 92722ff49..27dbfb90c 100644 --- a/gstreamer-app/sys/tests/layout.c +++ b/gstreamer-app/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-audio/src/auto/audio_base_sink.rs b/gstreamer-audio/src/auto/audio_base_sink.rs index 6b97cf54c..8b5d3cec4 100644 --- a/gstreamer-audio/src/auto/audio_base_sink.rs +++ b/gstreamer-audio/src/auto/audio_base_sink.rs @@ -9,6 +9,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -222,7 +223,6 @@ impl> AudioBaseSinkExt for O { value .get() .expect("Return Value for property `buffer-time` getter") - .unwrap() } } @@ -231,7 +231,7 @@ impl> AudioBaseSinkExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"buffer-time\0".as_ptr() as *const _, - glib::Value::from(&buffer_time).to_glib_none().0, + buffer_time.to_value().to_glib_none().0, ); } } @@ -247,7 +247,6 @@ impl> AudioBaseSinkExt for O { value .get() .expect("Return Value for property `can-activate-pull` getter") - .unwrap() } } @@ -256,7 +255,7 @@ impl> AudioBaseSinkExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"can-activate-pull\0".as_ptr() as *const _, - glib::Value::from(&can_activate_pull).to_glib_none().0, + can_activate_pull.to_value().to_glib_none().0, ); } } @@ -272,7 +271,6 @@ impl> AudioBaseSinkExt for O { value .get() .expect("Return Value for property `latency-time` getter") - .unwrap() } } @@ -281,7 +279,7 @@ impl> AudioBaseSinkExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"latency-time\0".as_ptr() as *const _, - glib::Value::from(&latency_time).to_glib_none().0, + latency_time.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-audio/src/auto/audio_base_src.rs b/gstreamer-audio/src/auto/audio_base_src.rs index 775d22089..60d96edd3 100644 --- a/gstreamer-audio/src/auto/audio_base_src.rs +++ b/gstreamer-audio/src/auto/audio_base_src.rs @@ -9,6 +9,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -131,7 +132,6 @@ impl> AudioBaseSrcExt for O { value .get() .expect("Return Value for property `actual-buffer-time` getter") - .unwrap() } } @@ -146,7 +146,6 @@ impl> AudioBaseSrcExt for O { value .get() .expect("Return Value for property `actual-latency-time` getter") - .unwrap() } } @@ -161,7 +160,6 @@ impl> AudioBaseSrcExt for O { value .get() .expect("Return Value for property `buffer-time` getter") - .unwrap() } } @@ -170,7 +168,7 @@ impl> AudioBaseSrcExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"buffer-time\0".as_ptr() as *const _, - glib::Value::from(&buffer_time).to_glib_none().0, + buffer_time.to_value().to_glib_none().0, ); } } @@ -186,7 +184,6 @@ impl> AudioBaseSrcExt for O { value .get() .expect("Return Value for property `latency-time` getter") - .unwrap() } } @@ -195,7 +192,7 @@ impl> AudioBaseSrcExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"latency-time\0".as_ptr() as *const _, - glib::Value::from(&latency_time).to_glib_none().0, + latency_time.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-audio/src/auto/enums.rs b/gstreamer-audio/src/auto/enums.rs index 0eccf7ec2..e6a1eca46 100644 --- a/gstreamer-audio/src/auto/enums.rs +++ b/gstreamer-audio/src/auto/enums.rs @@ -5,8 +5,7 @@ use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; use std::fmt; @@ -182,21 +181,30 @@ impl StaticType for AudioChannelPosition { } } -impl<'a> FromValueOptional<'a> for AudioChannelPosition { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for AudioChannelPosition { + type Type = Self; } -impl<'a> FromValue<'a> for AudioChannelPosition { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for AudioChannelPosition { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for AudioChannelPosition { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for AudioChannelPosition { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -251,21 +259,30 @@ impl StaticType for AudioDitherMethod { } } -impl<'a> FromValueOptional<'a> for AudioDitherMethod { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for AudioDitherMethod { + type Type = Self; } -impl<'a> FromValue<'a> for AudioDitherMethod { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for AudioDitherMethod { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for AudioDitherMethod { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for AudioDitherMethod { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -447,21 +464,30 @@ impl StaticType for AudioFormat { } } -impl<'a> FromValueOptional<'a> for AudioFormat { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for AudioFormat { + type Type = Self; } -impl<'a> FromValue<'a> for AudioFormat { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for AudioFormat { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for AudioFormat { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for AudioFormat { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -508,21 +534,30 @@ impl StaticType for AudioLayout { } } -impl<'a> FromValueOptional<'a> for AudioLayout { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for AudioLayout { + type Type = Self; } -impl<'a> FromValue<'a> for AudioLayout { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for AudioLayout { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for AudioLayout { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for AudioLayout { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -581,21 +616,30 @@ impl StaticType for AudioNoiseShapingMethod { } } -impl<'a> FromValueOptional<'a> for AudioNoiseShapingMethod { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for AudioNoiseShapingMethod { + type Type = Self; } -impl<'a> FromValue<'a> for AudioNoiseShapingMethod { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for AudioNoiseShapingMethod { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for AudioNoiseShapingMethod { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for AudioNoiseShapingMethod { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -666,25 +710,34 @@ impl StaticType for AudioResamplerMethod { #[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] -impl<'a> FromValueOptional<'a> for AudioResamplerMethod { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for AudioResamplerMethod { + type Type = Self; } #[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] -impl<'a> FromValue<'a> for AudioResamplerMethod { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for AudioResamplerMethod { + type Checker = glib::value::GenericValueTypeChecker; + + 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(any(feature = "v1_10", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] -impl SetValue for AudioResamplerMethod { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for AudioResamplerMethod { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -799,21 +852,30 @@ impl StaticType for AudioRingBufferFormatType { } } -impl<'a> FromValueOptional<'a> for AudioRingBufferFormatType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for AudioRingBufferFormatType { + type Type = Self; } -impl<'a> FromValue<'a> for AudioRingBufferFormatType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for AudioRingBufferFormatType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for AudioRingBufferFormatType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for AudioRingBufferFormatType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-audio/src/auto/flags.rs b/gstreamer-audio/src/auto/flags.rs index cfbe78cf6..6b1aa209e 100644 --- a/gstreamer-audio/src/auto/flags.rs +++ b/gstreamer-audio/src/auto/flags.rs @@ -6,8 +6,7 @@ use bitflags::bitflags; use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; @@ -40,21 +39,30 @@ impl StaticType for AudioFlags { } } -impl<'a> FromValueOptional<'a> for AudioFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for AudioFlags { + type Type = Self; } -impl<'a> FromValue<'a> for AudioFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for AudioFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for AudioFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for AudioFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -91,21 +99,30 @@ impl StaticType for AudioFormatFlags { } } -impl<'a> FromValueOptional<'a> for AudioFormatFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for AudioFormatFlags { + type Type = Self; } -impl<'a> FromValue<'a> for AudioFormatFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for AudioFormatFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for AudioFormatFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for AudioFormatFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -138,20 +155,29 @@ impl StaticType for AudioPackFlags { } } -impl<'a> FromValueOptional<'a> for AudioPackFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for AudioPackFlags { + type Type = Self; } -impl<'a> FromValue<'a> for AudioPackFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for AudioPackFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for AudioPackFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for AudioPackFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-audio/src/auto/versions.txt b/gstreamer-audio/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-audio/src/auto/versions.txt +++ b/gstreamer-audio/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-audio/sys/build.rs b/gstreamer-audio/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-audio/sys/build.rs +++ b/gstreamer-audio/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-audio/sys/src/lib.rs b/gstreamer-audio/sys/src/lib.rs index efd00f8e1..bff5b2204 100644 --- a/gstreamer-audio/sys/src/lib.rs +++ b/gstreamer-audio/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-audio/sys/tests/abi.rs b/gstreamer-audio/sys/tests/abi.rs index 9370dc80f..e639742b5 100644 --- a/gstreamer-audio/sys/tests/abi.rs +++ b/gstreamer-audio/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-audio/sys/tests/constant.c b/gstreamer-audio/sys/tests/constant.c index 79263d2a5..b3bfa0a07 100644 --- a/gstreamer-audio/sys/tests/constant.c +++ b/gstreamer-audio/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-audio/sys/tests/layout.c b/gstreamer-audio/sys/tests/layout.c index 12b330e66..754b4e9a9 100644 --- a/gstreamer-audio/sys/tests/layout.c +++ b/gstreamer-audio/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-base/src/auto/aggregator.rs b/gstreamer-base/src/auto/aggregator.rs index 155569ff6..19653ec2e 100644 --- a/gstreamer-base/src/auto/aggregator.rs +++ b/gstreamer-base/src/auto/aggregator.rs @@ -15,6 +15,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -211,7 +212,6 @@ impl> AggregatorExt for O { value .get() .expect("Return Value for property `emit-signals` getter") - .unwrap() } } @@ -222,7 +222,7 @@ impl> AggregatorExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"emit-signals\0".as_ptr() as *const _, - glib::Value::from(&emit_signals).to_glib_none().0, + emit_signals.to_value().to_glib_none().0, ); } } @@ -238,7 +238,6 @@ impl> AggregatorExt for O { value .get() .expect("Return Value for property `start-time` getter") - .unwrap() } } @@ -247,7 +246,7 @@ impl> AggregatorExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"start-time\0".as_ptr() as *const _, - glib::Value::from(&start_time).to_glib_none().0, + start_time.to_value().to_glib_none().0, ); } } @@ -266,7 +265,6 @@ impl> AggregatorExt for O { value .get() .expect("Return Value for property `start-time-selection` getter") - .unwrap() } } @@ -277,7 +275,7 @@ impl> AggregatorExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"start-time-selection\0".as_ptr() as *const _, - glib::Value::from(&start_time_selection).to_glib_none().0, + start_time_selection.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-base/src/auto/aggregator_pad.rs b/gstreamer-base/src/auto/aggregator_pad.rs index c50bd893e..5d214b1d1 100644 --- a/gstreamer-base/src/auto/aggregator_pad.rs +++ b/gstreamer-base/src/auto/aggregator_pad.rs @@ -11,6 +11,9 @@ use glib::translate::*; #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] use glib::StaticType; +#[cfg(any(feature = "v1_16", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -124,7 +127,6 @@ impl> AggregatorPadExt for O { value .get() .expect("Return Value for property `emit-signals` getter") - .unwrap() } } @@ -135,7 +137,7 @@ impl> AggregatorPadExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"emit-signals\0".as_ptr() as *const _, - glib::Value::from(&emit_signals).to_glib_none().0, + emit_signals.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-base/src/auto/base_parse.rs b/gstreamer-base/src/auto/base_parse.rs index 4380d1f58..a8f31ba09 100644 --- a/gstreamer-base/src/auto/base_parse.rs +++ b/gstreamer-base/src/auto/base_parse.rs @@ -9,6 +9,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -185,7 +186,6 @@ impl> BaseParseExt for O { value .get() .expect("Return Value for property `disable-passthrough` getter") - .unwrap() } } @@ -194,7 +194,7 @@ impl> BaseParseExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"disable-passthrough\0".as_ptr() as *const _, - glib::Value::from(&disable_passthrough).to_glib_none().0, + disable_passthrough.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-base/src/auto/base_sink.rs b/gstreamer-base/src/auto/base_sink.rs index dde1a0c98..70ebeb903 100644 --- a/gstreamer-base/src/auto/base_sink.rs +++ b/gstreamer-base/src/auto/base_sink.rs @@ -9,6 +9,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -407,7 +408,6 @@ impl> BaseSinkExt for O { value .get() .expect("Return Value for property `async` getter") - .unwrap() } } @@ -416,7 +416,7 @@ impl> BaseSinkExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"async\0".as_ptr() as *const _, - glib::Value::from(&async_).to_glib_none().0, + async_.to_value().to_glib_none().0, ); } } @@ -432,7 +432,6 @@ impl> BaseSinkExt for O { value .get() .expect("Return Value for property `enable-last-sample` getter") - .unwrap() } } @@ -441,7 +440,7 @@ impl> BaseSinkExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"enable-last-sample\0".as_ptr() as *const _, - glib::Value::from(&enable_last_sample).to_glib_none().0, + enable_last_sample.to_value().to_glib_none().0, ); } } @@ -454,10 +453,7 @@ impl> BaseSinkExt for O { b"qos\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); - value - .get() - .expect("Return Value for property `qos` getter") - .unwrap() + value.get().expect("Return Value for property `qos` getter") } } @@ -466,7 +462,7 @@ impl> BaseSinkExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"qos\0".as_ptr() as *const _, - glib::Value::from(&qos).to_glib_none().0, + qos.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-base/src/auto/base_src.rs b/gstreamer-base/src/auto/base_src.rs index c3ac5db2f..90230300e 100644 --- a/gstreamer-base/src/auto/base_src.rs +++ b/gstreamer-base/src/auto/base_src.rs @@ -9,6 +9,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -225,7 +226,6 @@ impl> BaseSrcExt for O { value .get() .expect("Return Value for property `num-buffers` getter") - .unwrap() } } @@ -234,7 +234,7 @@ impl> BaseSrcExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"num-buffers\0".as_ptr() as *const _, - glib::Value::from(&num_buffers).to_glib_none().0, + num_buffers.to_value().to_glib_none().0, ); } } @@ -250,7 +250,6 @@ impl> BaseSrcExt for O { value .get() .expect("Return Value for property `typefind` getter") - .unwrap() } } @@ -259,7 +258,7 @@ impl> BaseSrcExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"typefind\0".as_ptr() as *const _, - glib::Value::from(&typefind).to_glib_none().0, + typefind.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-base/src/auto/base_transform.rs b/gstreamer-base/src/auto/base_transform.rs index 088e6c65f..809850289 100644 --- a/gstreamer-base/src/auto/base_transform.rs +++ b/gstreamer-base/src/auto/base_transform.rs @@ -9,6 +9,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -220,10 +221,7 @@ impl> BaseTransformExt for O { b"qos\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); - value - .get() - .expect("Return Value for property `qos` getter") - .unwrap() + value.get().expect("Return Value for property `qos` getter") } } @@ -232,7 +230,7 @@ impl> BaseTransformExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"qos\0".as_ptr() as *const _, - glib::Value::from(&qos).to_glib_none().0, + qos.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-base/src/auto/enums.rs b/gstreamer-base/src/auto/enums.rs index 09c19cec4..4745ed0db 100644 --- a/gstreamer-base/src/auto/enums.rs +++ b/gstreamer-base/src/auto/enums.rs @@ -11,10 +11,7 @@ use glib::translate::*; use glib::value::FromValue; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -use glib::value::FromValueOptional; -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -use glib::value::SetValue; +use glib::value::ToValue; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] use glib::StaticType; @@ -79,24 +76,33 @@ impl StaticType for AggregatorStartTimeSelection { #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -impl<'a> FromValueOptional<'a> for AggregatorStartTimeSelection { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for AggregatorStartTimeSelection { + type Type = Self; } #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -impl<'a> FromValue<'a> for AggregatorStartTimeSelection { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for AggregatorStartTimeSelection { + type Checker = glib::value::GenericValueTypeChecker; + + 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(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -impl SetValue for AggregatorStartTimeSelection { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for AggregatorStartTimeSelection { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-base/src/auto/versions.txt b/gstreamer-base/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-base/src/auto/versions.txt +++ b/gstreamer-base/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-base/sys/build.rs b/gstreamer-base/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-base/sys/build.rs +++ b/gstreamer-base/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-base/sys/src/lib.rs b/gstreamer-base/sys/src/lib.rs index af3a7103e..eca7acbbb 100644 --- a/gstreamer-base/sys/src/lib.rs +++ b/gstreamer-base/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-base/sys/tests/abi.rs b/gstreamer-base/sys/tests/abi.rs index 20d0b36d4..4c8e28f78 100644 --- a/gstreamer-base/sys/tests/abi.rs +++ b/gstreamer-base/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-base/sys/tests/constant.c b/gstreamer-base/sys/tests/constant.c index 5e484e569..d1878bad5 100644 --- a/gstreamer-base/sys/tests/constant.c +++ b/gstreamer-base/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-base/sys/tests/layout.c b/gstreamer-base/sys/tests/layout.c index ddffc242f..f83a073d6 100644 --- a/gstreamer-base/sys/tests/layout.c +++ b/gstreamer-base/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-check/src/auto/test_clock.rs b/gstreamer-check/src/auto/test_clock.rs index ef33dd388..db5d370fb 100644 --- a/gstreamer-check/src/auto/test_clock.rs +++ b/gstreamer-check/src/auto/test_clock.rs @@ -9,6 +9,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -134,7 +135,6 @@ impl TestClock { value .get() .expect("Return Value for property `clock-type` getter") - .unwrap() } } @@ -144,7 +144,7 @@ impl TestClock { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"clock-type\0".as_ptr() as *const _, - glib::Value::from(&clock_type).to_glib_none().0, + clock_type.to_value().to_glib_none().0, ); } } @@ -161,7 +161,6 @@ impl TestClock { value .get() .expect("Return Value for property `start-time` getter") - .unwrap() } } diff --git a/gstreamer-check/src/auto/versions.txt b/gstreamer-check/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-check/src/auto/versions.txt +++ b/gstreamer-check/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-check/sys/build.rs b/gstreamer-check/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-check/sys/build.rs +++ b/gstreamer-check/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-check/sys/src/lib.rs b/gstreamer-check/sys/src/lib.rs index afe51e2ae..decec1cfd 100644 --- a/gstreamer-check/sys/src/lib.rs +++ b/gstreamer-check/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-check/sys/tests/abi.rs b/gstreamer-check/sys/tests/abi.rs index 24fbb3803..e53c3d2e0 100644 --- a/gstreamer-check/sys/tests/abi.rs +++ b/gstreamer-check/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-check/sys/tests/constant.c b/gstreamer-check/sys/tests/constant.c index c6a623122..b16aaa884 100644 --- a/gstreamer-check/sys/tests/constant.c +++ b/gstreamer-check/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-check/sys/tests/layout.c b/gstreamer-check/sys/tests/layout.c index dd1bae222..742f597e4 100644 --- a/gstreamer-check/sys/tests/layout.c +++ b/gstreamer-check/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-controller/src/auto/argb_control_binding.rs b/gstreamer-controller/src/auto/argb_control_binding.rs index 5e8103999..aa6c3ba88 100644 --- a/gstreamer-controller/src/auto/argb_control_binding.rs +++ b/gstreamer-controller/src/auto/argb_control_binding.rs @@ -9,6 +9,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -123,7 +124,7 @@ impl> ARGBControlBindingExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"control-source-a\0".as_ptr() as *const _, - glib::Value::from(control_source_a).to_glib_none().0, + control_source_a.to_value().to_glib_none().0, ); } } @@ -148,7 +149,7 @@ impl> ARGBControlBindingExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"control-source-b\0".as_ptr() as *const _, - glib::Value::from(control_source_b).to_glib_none().0, + control_source_b.to_value().to_glib_none().0, ); } } @@ -173,7 +174,7 @@ impl> ARGBControlBindingExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"control-source-g\0".as_ptr() as *const _, - glib::Value::from(control_source_g).to_glib_none().0, + control_source_g.to_value().to_glib_none().0, ); } } @@ -198,7 +199,7 @@ impl> ARGBControlBindingExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"control-source-r\0".as_ptr() as *const _, - glib::Value::from(control_source_r).to_glib_none().0, + control_source_r.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-controller/src/auto/direct_control_binding.rs b/gstreamer-controller/src/auto/direct_control_binding.rs index 51c1d144d..116b6012d 100644 --- a/gstreamer-controller/src/auto/direct_control_binding.rs +++ b/gstreamer-controller/src/auto/direct_control_binding.rs @@ -9,6 +9,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -89,7 +90,6 @@ impl> DirectControlBindingExt for O { value .get() .expect("Return Value for property `absolute` getter") - .unwrap() } } @@ -113,7 +113,7 @@ impl> DirectControlBindingExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"control-source\0".as_ptr() as *const _, - glib::Value::from(control_source).to_glib_none().0, + control_source.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-controller/src/auto/enums.rs b/gstreamer-controller/src/auto/enums.rs index 4a5b1c840..d0cc17e2f 100644 --- a/gstreamer-controller/src/auto/enums.rs +++ b/gstreamer-controller/src/auto/enums.rs @@ -5,8 +5,7 @@ use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; @@ -61,21 +60,30 @@ impl StaticType for InterpolationMode { } } -impl<'a> FromValueOptional<'a> for InterpolationMode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for InterpolationMode { + type Type = Self; } -impl<'a> FromValue<'a> for InterpolationMode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for InterpolationMode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for InterpolationMode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for InterpolationMode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -134,20 +142,29 @@ impl StaticType for LFOWaveform { } } -impl<'a> FromValueOptional<'a> for LFOWaveform { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for LFOWaveform { + type Type = Self; } -impl<'a> FromValue<'a> for LFOWaveform { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for LFOWaveform { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for LFOWaveform { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for LFOWaveform { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-controller/src/auto/interpolation_control_source.rs b/gstreamer-controller/src/auto/interpolation_control_source.rs index 8055ac8a8..58c4edfca 100644 --- a/gstreamer-controller/src/auto/interpolation_control_source.rs +++ b/gstreamer-controller/src/auto/interpolation_control_source.rs @@ -11,6 +11,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -70,7 +71,6 @@ impl> InterpolationControlSourceExt for O { value .get() .expect("Return Value for property `mode` getter") - .unwrap() } } @@ -79,7 +79,7 @@ impl> InterpolationControlSourceExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"mode\0".as_ptr() as *const _, - glib::Value::from(&mode).to_glib_none().0, + mode.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-controller/src/auto/lfo_control_source.rs b/gstreamer-controller/src/auto/lfo_control_source.rs index cdf836b86..714f91067 100644 --- a/gstreamer-controller/src/auto/lfo_control_source.rs +++ b/gstreamer-controller/src/auto/lfo_control_source.rs @@ -10,6 +10,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -111,7 +112,6 @@ impl> LFOControlSourceExt for O { value .get() .expect("Return Value for property `amplitude` getter") - .unwrap() } } @@ -120,7 +120,7 @@ impl> LFOControlSourceExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"amplitude\0".as_ptr() as *const _, - glib::Value::from(&litude).to_glib_none().0, + amplitude.to_value().to_glib_none().0, ); } } @@ -136,7 +136,6 @@ impl> LFOControlSourceExt for O { value .get() .expect("Return Value for property `frequency` getter") - .unwrap() } } @@ -145,7 +144,7 @@ impl> LFOControlSourceExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"frequency\0".as_ptr() as *const _, - glib::Value::from(&frequency).to_glib_none().0, + frequency.to_value().to_glib_none().0, ); } } @@ -161,7 +160,6 @@ impl> LFOControlSourceExt for O { value .get() .expect("Return Value for property `offset` getter") - .unwrap() } } @@ -170,7 +168,7 @@ impl> LFOControlSourceExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"offset\0".as_ptr() as *const _, - glib::Value::from(&offset).to_glib_none().0, + offset.to_value().to_glib_none().0, ); } } @@ -186,7 +184,6 @@ impl> LFOControlSourceExt for O { value .get() .expect("Return Value for property `timeshift` getter") - .unwrap() } } @@ -195,7 +192,7 @@ impl> LFOControlSourceExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"timeshift\0".as_ptr() as *const _, - glib::Value::from(×hift).to_glib_none().0, + timeshift.to_value().to_glib_none().0, ); } } @@ -211,7 +208,6 @@ impl> LFOControlSourceExt for O { value .get() .expect("Return Value for property `waveform` getter") - .unwrap() } } @@ -220,7 +216,7 @@ impl> LFOControlSourceExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"waveform\0".as_ptr() as *const _, - glib::Value::from(&waveform).to_glib_none().0, + waveform.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-controller/src/auto/trigger_control_source.rs b/gstreamer-controller/src/auto/trigger_control_source.rs index cdc28cd77..99ab83988 100644 --- a/gstreamer-controller/src/auto/trigger_control_source.rs +++ b/gstreamer-controller/src/auto/trigger_control_source.rs @@ -10,6 +10,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -67,7 +68,6 @@ impl> TriggerControlSourceExt for O { value .get() .expect("Return Value for property `tolerance` getter") - .unwrap() } } @@ -76,7 +76,7 @@ impl> TriggerControlSourceExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"tolerance\0".as_ptr() as *const _, - glib::Value::from(&tolerance).to_glib_none().0, + tolerance.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-controller/src/auto/versions.txt b/gstreamer-controller/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-controller/src/auto/versions.txt +++ b/gstreamer-controller/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-controller/sys/build.rs b/gstreamer-controller/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-controller/sys/build.rs +++ b/gstreamer-controller/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-controller/sys/src/lib.rs b/gstreamer-controller/sys/src/lib.rs index 8e688b4fd..5d5634f9a 100644 --- a/gstreamer-controller/sys/src/lib.rs +++ b/gstreamer-controller/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-controller/sys/tests/abi.rs b/gstreamer-controller/sys/tests/abi.rs index 247c6d541..739e6570c 100644 --- a/gstreamer-controller/sys/tests/abi.rs +++ b/gstreamer-controller/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-controller/sys/tests/constant.c b/gstreamer-controller/sys/tests/constant.c index 26e98d3a7..5593d3116 100644 --- a/gstreamer-controller/sys/tests/constant.c +++ b/gstreamer-controller/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-controller/sys/tests/layout.c b/gstreamer-controller/sys/tests/layout.c index 21c372c52..1e021a291 100644 --- a/gstreamer-controller/sys/tests/layout.c +++ b/gstreamer-controller/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-editing-services/src/auto/container.rs b/gstreamer-editing-services/src/auto/container.rs index 269d7d6ac..50a816e43 100644 --- a/gstreamer-editing-services/src/auto/container.rs +++ b/gstreamer-editing-services/src/auto/container.rs @@ -14,6 +14,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -152,7 +153,6 @@ impl> GESContainerExt for O { value .get() .expect("Return Value for property `height` getter") - .unwrap() } } diff --git a/gstreamer-editing-services/src/auto/effect.rs b/gstreamer-editing-services/src/auto/effect.rs index 5b44a2a8f..b508811d0 100644 --- a/gstreamer-editing-services/src/auto/effect.rs +++ b/gstreamer-editing-services/src/auto/effect.rs @@ -10,6 +10,7 @@ use crate::TrackElement; use glib::object::IsA; use glib::translate::*; use glib::StaticType; +use glib::ToValue; glib::wrapper! { pub struct Effect(Object) @extends BaseEffect, TrackElement, TimelineElement, @implements Extractable; diff --git a/gstreamer-editing-services/src/auto/enums.rs b/gstreamer-editing-services/src/auto/enums.rs index 969f5fbd7..909fb33d1 100644 --- a/gstreamer-editing-services/src/auto/enums.rs +++ b/gstreamer-editing-services/src/auto/enums.rs @@ -5,8 +5,7 @@ use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; #[cfg(any(feature = "v1_16", feature = "dox"))] @@ -88,21 +87,30 @@ impl StaticType for Edge { } } -impl<'a> FromValueOptional<'a> for Edge { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for Edge { + type Type = Self; } -impl<'a> FromValue<'a> for Edge { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for Edge { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for Edge { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for Edge { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -186,21 +194,30 @@ impl StaticType for EditMode { } } -impl<'a> FromValueOptional<'a> for EditMode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for EditMode { + type Type = Self; } -impl<'a> FromValue<'a> for EditMode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for EditMode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for EditMode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for EditMode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -649,20 +666,29 @@ impl StaticType for VideoStandardTransitionType { } } -impl<'a> FromValueOptional<'a> for VideoStandardTransitionType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoStandardTransitionType { + type Type = Self; } -impl<'a> FromValue<'a> for VideoStandardTransitionType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoStandardTransitionType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoStandardTransitionType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoStandardTransitionType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-editing-services/src/auto/flags.rs b/gstreamer-editing-services/src/auto/flags.rs index 4c1bc6e36..134a944ff 100644 --- a/gstreamer-editing-services/src/auto/flags.rs +++ b/gstreamer-editing-services/src/auto/flags.rs @@ -6,8 +6,7 @@ use bitflags::bitflags; use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; use std::ffi::CStr; @@ -46,21 +45,30 @@ impl StaticType for PipelineFlags { } } -impl<'a> FromValueOptional<'a> for PipelineFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for PipelineFlags { + type Type = Self; } -impl<'a> FromValue<'a> for PipelineFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for PipelineFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for PipelineFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for PipelineFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -118,20 +126,29 @@ impl StaticType for TrackType { } } -impl<'a> FromValueOptional<'a> for TrackType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for TrackType { + type Type = Self; } -impl<'a> FromValue<'a> for TrackType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for TrackType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for TrackType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for TrackType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-editing-services/src/auto/group.rs b/gstreamer-editing-services/src/auto/group.rs index 31b6fbbfd..4c7539c98 100644 --- a/gstreamer-editing-services/src/auto/group.rs +++ b/gstreamer-editing-services/src/auto/group.rs @@ -12,6 +12,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -94,7 +95,6 @@ impl> GroupExt for O { value .get() .expect("Return Value for property `duration` getter") - .unwrap() } } @@ -103,7 +103,7 @@ impl> GroupExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"duration\0".as_ptr() as *const _, - glib::Value::from(&duration).to_glib_none().0, + duration.to_value().to_glib_none().0, ); } } @@ -119,7 +119,6 @@ impl> GroupExt for O { value .get() .expect("Return Value for property `in-point` getter") - .unwrap() } } @@ -128,7 +127,7 @@ impl> GroupExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"in-point\0".as_ptr() as *const _, - glib::Value::from(&in_point).to_glib_none().0, + in_point.to_value().to_glib_none().0, ); } } @@ -144,7 +143,6 @@ impl> GroupExt for O { value .get() .expect("Return Value for property `max-duration` getter") - .unwrap() } } @@ -153,7 +151,7 @@ impl> GroupExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"max-duration\0".as_ptr() as *const _, - glib::Value::from(&max_duration).to_glib_none().0, + max_duration.to_value().to_glib_none().0, ); } } @@ -169,7 +167,6 @@ impl> GroupExt for O { value .get() .expect("Return Value for property `priority` getter") - .unwrap() } } @@ -178,7 +175,7 @@ impl> GroupExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"priority\0".as_ptr() as *const _, - glib::Value::from(&priority).to_glib_none().0, + priority.to_value().to_glib_none().0, ); } } @@ -194,7 +191,6 @@ impl> GroupExt for O { value .get() .expect("Return Value for property `start` getter") - .unwrap() } } @@ -203,7 +199,7 @@ impl> GroupExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"start\0".as_ptr() as *const _, - glib::Value::from(&start).to_glib_none().0, + start.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-editing-services/src/auto/pipeline.rs b/gstreamer-editing-services/src/auto/pipeline.rs index 5ac20a215..acc5b8ead 100644 --- a/gstreamer-editing-services/src/auto/pipeline.rs +++ b/gstreamer-editing-services/src/auto/pipeline.rs @@ -11,6 +11,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; use std::ptr; @@ -265,7 +266,7 @@ impl> GESPipelineExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"audio-filter\0".as_ptr() as *const _, - glib::Value::from(audio_filter).to_glib_none().0, + audio_filter.to_value().to_glib_none().0, ); } } @@ -289,7 +290,7 @@ impl> GESPipelineExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"audio-sink\0".as_ptr() as *const _, - glib::Value::from(audio_sink).to_glib_none().0, + audio_sink.to_value().to_glib_none().0, ); } } @@ -327,7 +328,7 @@ impl> GESPipelineExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"video-filter\0".as_ptr() as *const _, - glib::Value::from(video_filter).to_glib_none().0, + video_filter.to_value().to_glib_none().0, ); } } @@ -351,7 +352,7 @@ impl> GESPipelineExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"video-sink\0".as_ptr() as *const _, - glib::Value::from(video_sink).to_glib_none().0, + video_sink.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-editing-services/src/auto/timeline_element.rs b/gstreamer-editing-services/src/auto/timeline_element.rs index 74bf03362..86976c28d 100644 --- a/gstreamer-editing-services/src/auto/timeline_element.rs +++ b/gstreamer-editing-services/src/auto/timeline_element.rs @@ -21,6 +21,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] @@ -605,7 +606,6 @@ impl> TimelineElementExt for O { value .get() .expect("Return Value for property `in-point` getter") - .unwrap() } } @@ -614,7 +614,7 @@ impl> TimelineElementExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"in-point\0".as_ptr() as *const _, - glib::Value::from(&in_point).to_glib_none().0, + in_point.to_value().to_glib_none().0, ); } } @@ -630,7 +630,6 @@ impl> TimelineElementExt for O { value .get() .expect("Return Value for property `serialize` getter") - .unwrap() } } @@ -639,7 +638,7 @@ impl> TimelineElementExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"serialize\0".as_ptr() as *const _, - glib::Value::from(&serialize).to_glib_none().0, + serialize.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-editing-services/src/auto/track.rs b/gstreamer-editing-services/src/auto/track.rs index 89a43eba6..91131288a 100644 --- a/gstreamer-editing-services/src/auto/track.rs +++ b/gstreamer-editing-services/src/auto/track.rs @@ -12,6 +12,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; #[cfg(any(feature = "v1_18", feature = "dox"))] @@ -281,7 +282,6 @@ impl> GESTrackExt for O { value .get() .expect("Return Value for property `duration` getter") - .unwrap() } } @@ -306,7 +306,7 @@ impl> GESTrackExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"id\0".as_ptr() as *const _, - glib::Value::from(id).to_glib_none().0, + id.to_value().to_glib_none().0, ); } } @@ -336,7 +336,6 @@ impl> GESTrackExt for O { value .get() .expect("Return Value for property `track-type` getter") - .unwrap() } } diff --git a/gstreamer-editing-services/src/auto/transition_clip.rs b/gstreamer-editing-services/src/auto/transition_clip.rs index 644fd0828..6f7118662 100644 --- a/gstreamer-editing-services/src/auto/transition_clip.rs +++ b/gstreamer-editing-services/src/auto/transition_clip.rs @@ -16,6 +16,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -66,7 +67,6 @@ impl> TransitionClipExt for O { value .get() .expect("Return Value for property `vtype` getter") - .unwrap() } } @@ -75,7 +75,7 @@ impl> TransitionClipExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"vtype\0".as_ptr() as *const _, - glib::Value::from(&vtype).to_glib_none().0, + vtype.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-editing-services/src/auto/uri_clip_asset.rs b/gstreamer-editing-services/src/auto/uri_clip_asset.rs index cfc6c6246..ae65df0ce 100644 --- a/gstreamer-editing-services/src/auto/uri_clip_asset.rs +++ b/gstreamer-editing-services/src/auto/uri_clip_asset.rs @@ -13,6 +13,7 @@ use glib::translate::*; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; use std::ptr; @@ -143,7 +144,7 @@ impl> UriClipAssetExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"duration\0".as_ptr() as *const _, - glib::Value::from(&duration).to_glib_none().0, + duration.to_value().to_glib_none().0, ); } } @@ -161,7 +162,6 @@ impl> UriClipAssetExt for O { value .get() .expect("Return Value for property `is-nested-timeline` getter") - .unwrap() } } diff --git a/gstreamer-editing-services/src/auto/versions.txt b/gstreamer-editing-services/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-editing-services/src/auto/versions.txt +++ b/gstreamer-editing-services/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-editing-services/sys/build.rs b/gstreamer-editing-services/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-editing-services/sys/build.rs +++ b/gstreamer-editing-services/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-editing-services/sys/src/lib.rs b/gstreamer-editing-services/sys/src/lib.rs index 78cb7b27b..4f2b9a9cc 100644 --- a/gstreamer-editing-services/sys/src/lib.rs +++ b/gstreamer-editing-services/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-editing-services/sys/tests/abi.rs b/gstreamer-editing-services/sys/tests/abi.rs index 0f03ff9a3..805592e07 100644 --- a/gstreamer-editing-services/sys/tests/abi.rs +++ b/gstreamer-editing-services/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-editing-services/sys/tests/constant.c b/gstreamer-editing-services/sys/tests/constant.c index 435713eae..d91abe499 100644 --- a/gstreamer-editing-services/sys/tests/constant.c +++ b/gstreamer-editing-services/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-editing-services/sys/tests/layout.c b/gstreamer-editing-services/sys/tests/layout.c index 6ee879621..74b080f98 100644 --- a/gstreamer-editing-services/sys/tests/layout.c +++ b/gstreamer-editing-services/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/egl/src/auto/versions.txt b/gstreamer-gl/egl/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-gl/egl/src/auto/versions.txt +++ b/gstreamer-gl/egl/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-gl/egl/sys/build.rs b/gstreamer-gl/egl/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-gl/egl/sys/build.rs +++ b/gstreamer-gl/egl/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/egl/sys/src/lib.rs b/gstreamer-gl/egl/sys/src/lib.rs index 2e52be0d6..c65377516 100644 --- a/gstreamer-gl/egl/sys/src/lib.rs +++ b/gstreamer-gl/egl/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/egl/sys/tests/abi.rs b/gstreamer-gl/egl/sys/tests/abi.rs index e0d5c1b8f..caa49336c 100644 --- a/gstreamer-gl/egl/sys/tests/abi.rs +++ b/gstreamer-gl/egl/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/egl/sys/tests/constant.c b/gstreamer-gl/egl/sys/tests/constant.c index 82b69b3b6..1316da381 100644 --- a/gstreamer-gl/egl/sys/tests/constant.c +++ b/gstreamer-gl/egl/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/egl/sys/tests/layout.c b/gstreamer-gl/egl/sys/tests/layout.c index 2fdc42137..5c146018b 100644 --- a/gstreamer-gl/egl/sys/tests/layout.c +++ b/gstreamer-gl/egl/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/src/auto/enums.rs b/gstreamer-gl/src/auto/enums.rs index 0758f54f1..7481c9741 100644 --- a/gstreamer-gl/src/auto/enums.rs +++ b/gstreamer-gl/src/auto/enums.rs @@ -9,8 +9,7 @@ use glib::error::ErrorDomain; use glib::object::IsA; use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::Quark; use glib::StaticType; use glib::Type; @@ -100,21 +99,30 @@ impl StaticType for GLContextError { } } -impl<'a> FromValueOptional<'a> for GLContextError { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for GLContextError { + type Type = Self; } -impl<'a> FromValue<'a> for GLContextError { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for GLContextError { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for GLContextError { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for GLContextError { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -285,21 +293,30 @@ impl StaticType for GLFormat { } } -impl<'a> FromValueOptional<'a> for GLFormat { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for GLFormat { + type Type = Self; } -impl<'a> FromValue<'a> for GLFormat { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for GLFormat { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for GLFormat { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for GLFormat { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -350,21 +367,30 @@ impl StaticType for GLQueryType { } } -impl<'a> FromValueOptional<'a> for GLQueryType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for GLQueryType { + type Type = Self; } -impl<'a> FromValue<'a> for GLQueryType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for GLQueryType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for GLQueryType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for GLQueryType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -437,21 +463,30 @@ impl StaticType for GLSLError { } } -impl<'a> FromValueOptional<'a> for GLSLError { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for GLSLError { + type Type = Self; } -impl<'a> FromValue<'a> for GLSLError { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for GLSLError { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for GLSLError { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for GLSLError { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -604,21 +639,30 @@ impl StaticType for GLSLVersion { } } -impl<'a> FromValueOptional<'a> for GLSLVersion { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for GLSLVersion { + type Type = Self; } -impl<'a> FromValue<'a> for GLSLVersion { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for GLSLVersion { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for GLSLVersion { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for GLSLVersion { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -673,21 +717,30 @@ impl StaticType for GLStereoDownmix { } } -impl<'a> FromValueOptional<'a> for GLStereoDownmix { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for GLStereoDownmix { + type Type = Self; } -impl<'a> FromValue<'a> for GLStereoDownmix { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for GLStereoDownmix { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for GLStereoDownmix { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for GLStereoDownmix { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -778,21 +831,30 @@ impl StaticType for GLTextureTarget { } } -impl<'a> FromValueOptional<'a> for GLTextureTarget { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for GLTextureTarget { + type Type = Self; } -impl<'a> FromValue<'a> for GLTextureTarget { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for GLTextureTarget { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for GLTextureTarget { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for GLTextureTarget { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -851,21 +913,30 @@ impl StaticType for GLUploadReturn { } } -impl<'a> FromValueOptional<'a> for GLUploadReturn { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for GLUploadReturn { + type Type = Self; } -impl<'a> FromValue<'a> for GLUploadReturn { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for GLUploadReturn { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for GLUploadReturn { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for GLUploadReturn { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -938,20 +1009,29 @@ impl StaticType for GLWindowError { } } -impl<'a> FromValueOptional<'a> for GLWindowError { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for GLWindowError { + type Type = Self; } -impl<'a> FromValue<'a> for GLWindowError { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for GLWindowError { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for GLWindowError { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for GLWindowError { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-gl/src/auto/flags.rs b/gstreamer-gl/src/auto/flags.rs index c81165c53..474dcedd8 100644 --- a/gstreamer-gl/src/auto/flags.rs +++ b/gstreamer-gl/src/auto/flags.rs @@ -6,8 +6,7 @@ use bitflags::bitflags; use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; use std::fmt; @@ -65,21 +64,30 @@ impl StaticType for GLAPI { } } -impl<'a> FromValueOptional<'a> for GLAPI { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for GLAPI { + type Type = Self; } -impl<'a> FromValue<'a> for GLAPI { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for GLAPI { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for GLAPI { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for GLAPI { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -122,21 +130,30 @@ impl StaticType for GLDisplayType { } } -impl<'a> FromValueOptional<'a> for GLDisplayType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for GLDisplayType { + type Type = Self; } -impl<'a> FromValue<'a> for GLDisplayType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for GLDisplayType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for GLDisplayType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for GLDisplayType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -198,21 +215,30 @@ impl StaticType for GLPlatform { } } -impl<'a> FromValueOptional<'a> for GLPlatform { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for GLPlatform { + type Type = Self; } -impl<'a> FromValue<'a> for GLPlatform { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for GLPlatform { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for GLPlatform { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for GLPlatform { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -261,20 +287,29 @@ impl StaticType for GLSLProfile { } } -impl<'a> FromValueOptional<'a> for GLSLProfile { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for GLSLProfile { + type Type = Self; } -impl<'a> FromValue<'a> for GLSLProfile { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for GLSLProfile { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for GLSLProfile { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for GLSLProfile { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-gl/src/auto/gl_base_filter.rs b/gstreamer-gl/src/auto/gl_base_filter.rs index f65ceba3c..4f42a7da1 100644 --- a/gstreamer-gl/src/auto/gl_base_filter.rs +++ b/gstreamer-gl/src/auto/gl_base_filter.rs @@ -10,6 +10,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; diff --git a/gstreamer-gl/src/auto/gl_overlay_compositor.rs b/gstreamer-gl/src/auto/gl_overlay_compositor.rs index 20df98d17..05c331631 100644 --- a/gstreamer-gl/src/auto/gl_overlay_compositor.rs +++ b/gstreamer-gl/src/auto/gl_overlay_compositor.rs @@ -20,6 +20,9 @@ use glib::translate::*; use glib::StaticType; #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +use glib::ToValue; +#[cfg(any(feature = "v1_16", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] use std::boxed::Box as Box_; #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] @@ -72,7 +75,6 @@ impl GLOverlayCompositor { value .get() .expect("Return Value for property `yinvert` getter") - .unwrap() } } @@ -84,7 +86,7 @@ impl GLOverlayCompositor { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"yinvert\0".as_ptr() as *const _, - glib::Value::from(&yinvert).to_glib_none().0, + yinvert.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-gl/src/auto/gl_view_convert.rs b/gstreamer-gl/src/auto/gl_view_convert.rs index df747e2ec..3a6cc8dcf 100644 --- a/gstreamer-gl/src/auto/gl_view_convert.rs +++ b/gstreamer-gl/src/auto/gl_view_convert.rs @@ -11,6 +11,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -103,7 +104,6 @@ impl GLViewConvert { value .get() .expect("Return Value for property `downmix-mode` getter") - .unwrap() } } @@ -113,7 +113,7 @@ impl GLViewConvert { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"downmix-mode\0".as_ptr() as *const _, - glib::Value::from(&downmix_mode).to_glib_none().0, + downmix_mode.to_value().to_glib_none().0, ); } } @@ -132,7 +132,6 @@ impl GLViewConvert { value .get() .expect("Return Value for property `input-flags-override` getter") - .unwrap() } } @@ -142,7 +141,7 @@ impl GLViewConvert { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"input-flags-override\0".as_ptr() as *const _, - glib::Value::from(&input_flags_override).to_glib_none().0, + input_flags_override.to_value().to_glib_none().0, ); } } @@ -161,7 +160,6 @@ impl GLViewConvert { value .get() .expect("Return Value for property `input-mode-override` getter") - .unwrap() } } @@ -171,7 +169,7 @@ impl GLViewConvert { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"input-mode-override\0".as_ptr() as *const _, - glib::Value::from(&input_mode_override).to_glib_none().0, + input_mode_override.to_value().to_glib_none().0, ); } } @@ -190,7 +188,6 @@ impl GLViewConvert { value .get() .expect("Return Value for property `output-flags-override` getter") - .unwrap() } } @@ -200,7 +197,7 @@ impl GLViewConvert { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"output-flags-override\0".as_ptr() as *const _, - glib::Value::from(&output_flags_override).to_glib_none().0, + output_flags_override.to_value().to_glib_none().0, ); } } @@ -219,7 +216,6 @@ impl GLViewConvert { value .get() .expect("Return Value for property `output-mode-override` getter") - .unwrap() } } @@ -229,7 +225,7 @@ impl GLViewConvert { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"output-mode-override\0".as_ptr() as *const _, - glib::Value::from(&output_mode_override).to_glib_none().0, + output_mode_override.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-gl/src/auto/versions.txt b/gstreamer-gl/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-gl/src/auto/versions.txt +++ b/gstreamer-gl/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-gl/sys/build.rs b/gstreamer-gl/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-gl/sys/build.rs +++ b/gstreamer-gl/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/sys/src/lib.rs b/gstreamer-gl/sys/src/lib.rs index 2602453c0..b6ca5642a 100644 --- a/gstreamer-gl/sys/src/lib.rs +++ b/gstreamer-gl/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/sys/tests/abi.rs b/gstreamer-gl/sys/tests/abi.rs index 6ccd33c0b..9cb16b164 100644 --- a/gstreamer-gl/sys/tests/abi.rs +++ b/gstreamer-gl/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/sys/tests/constant.c b/gstreamer-gl/sys/tests/constant.c index b9b8c385d..4cf5fca06 100644 --- a/gstreamer-gl/sys/tests/constant.c +++ b/gstreamer-gl/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/sys/tests/layout.c b/gstreamer-gl/sys/tests/layout.c index b6c65f8bd..0b918a6c5 100644 --- a/gstreamer-gl/sys/tests/layout.c +++ b/gstreamer-gl/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/wayland/src/auto/versions.txt b/gstreamer-gl/wayland/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-gl/wayland/src/auto/versions.txt +++ b/gstreamer-gl/wayland/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-gl/wayland/sys/build.rs b/gstreamer-gl/wayland/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-gl/wayland/sys/build.rs +++ b/gstreamer-gl/wayland/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/wayland/sys/src/lib.rs b/gstreamer-gl/wayland/sys/src/lib.rs index b1f70048c..994fdc92a 100644 --- a/gstreamer-gl/wayland/sys/src/lib.rs +++ b/gstreamer-gl/wayland/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/wayland/sys/tests/abi.rs b/gstreamer-gl/wayland/sys/tests/abi.rs index 3e0a1e328..e9d710747 100644 --- a/gstreamer-gl/wayland/sys/tests/abi.rs +++ b/gstreamer-gl/wayland/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/wayland/sys/tests/constant.c b/gstreamer-gl/wayland/sys/tests/constant.c index c6a623122..b16aaa884 100644 --- a/gstreamer-gl/wayland/sys/tests/constant.c +++ b/gstreamer-gl/wayland/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/wayland/sys/tests/layout.c b/gstreamer-gl/wayland/sys/tests/layout.c index cb8a751c1..b9d6a67e8 100644 --- a/gstreamer-gl/wayland/sys/tests/layout.c +++ b/gstreamer-gl/wayland/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/x11/src/auto/versions.txt b/gstreamer-gl/x11/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-gl/x11/src/auto/versions.txt +++ b/gstreamer-gl/x11/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-gl/x11/sys/build.rs b/gstreamer-gl/x11/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-gl/x11/sys/build.rs +++ b/gstreamer-gl/x11/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/x11/sys/src/lib.rs b/gstreamer-gl/x11/sys/src/lib.rs index 4d16e88e9..c5efaf57c 100644 --- a/gstreamer-gl/x11/sys/src/lib.rs +++ b/gstreamer-gl/x11/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/x11/sys/tests/abi.rs b/gstreamer-gl/x11/sys/tests/abi.rs index e51c96f86..53c3a7b2b 100644 --- a/gstreamer-gl/x11/sys/tests/abi.rs +++ b/gstreamer-gl/x11/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/x11/sys/tests/constant.c b/gstreamer-gl/x11/sys/tests/constant.c index c6a623122..b16aaa884 100644 --- a/gstreamer-gl/x11/sys/tests/constant.c +++ b/gstreamer-gl/x11/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-gl/x11/sys/tests/layout.c b/gstreamer-gl/x11/sys/tests/layout.c index edc69fc6c..55188a010 100644 --- a/gstreamer-gl/x11/sys/tests/layout.c +++ b/gstreamer-gl/x11/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-mpegts/sys/build.rs b/gstreamer-mpegts/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-mpegts/sys/build.rs +++ b/gstreamer-mpegts/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-mpegts/sys/src/lib.rs b/gstreamer-mpegts/sys/src/lib.rs index 993d8a444..09491ab99 100644 --- a/gstreamer-mpegts/sys/src/lib.rs +++ b/gstreamer-mpegts/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-mpegts/sys/tests/abi.rs b/gstreamer-mpegts/sys/tests/abi.rs index 1aff65f3d..30e945ba6 100644 --- a/gstreamer-mpegts/sys/tests/abi.rs +++ b/gstreamer-mpegts/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-mpegts/sys/tests/constant.c b/gstreamer-mpegts/sys/tests/constant.c index e77a0e7c7..c574f9ca6 100644 --- a/gstreamer-mpegts/sys/tests/constant.c +++ b/gstreamer-mpegts/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-mpegts/sys/tests/layout.c b/gstreamer-mpegts/sys/tests/layout.c index e2d36610b..f3a563e90 100644 --- a/gstreamer-mpegts/sys/tests/layout.c +++ b/gstreamer-mpegts/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-net/src/auto/net_client_clock.rs b/gstreamer-net/src/auto/net_client_clock.rs index 3c8c500db..eaa742b99 100644 --- a/gstreamer-net/src/auto/net_client_clock.rs +++ b/gstreamer-net/src/auto/net_client_clock.rs @@ -9,6 +9,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -42,7 +43,7 @@ impl NetClientClock { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"address\0".as_ptr() as *const _, - glib::Value::from(address).to_glib_none().0, + address.to_value().to_glib_none().0, ); } } @@ -59,7 +60,6 @@ impl NetClientClock { value .get() .expect("Return Value for property `base-time` getter") - .unwrap() } } @@ -82,7 +82,7 @@ impl NetClientClock { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"bus\0".as_ptr() as *const _, - glib::Value::from(bus).to_glib_none().0, + bus.to_value().to_glib_none().0, ); } } @@ -114,7 +114,6 @@ impl NetClientClock { value .get() .expect("Return Value for property `minimum-update-interval` getter") - .unwrap() } } @@ -124,7 +123,7 @@ impl NetClientClock { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"minimum-update-interval\0".as_ptr() as *const _, - glib::Value::from(&minimum_update_interval).to_glib_none().0, + minimum_update_interval.to_value().to_glib_none().0, ); } } @@ -141,7 +140,6 @@ impl NetClientClock { value .get() .expect("Return Value for property `port` getter") - .unwrap() } } @@ -151,7 +149,7 @@ impl NetClientClock { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"port\0".as_ptr() as *const _, - glib::Value::from(&port).to_glib_none().0, + port.to_value().to_glib_none().0, ); } } @@ -168,7 +166,6 @@ impl NetClientClock { value .get() .expect("Return Value for property `qos-dscp` getter") - .unwrap() } } @@ -178,7 +175,7 @@ impl NetClientClock { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"qos-dscp\0".as_ptr() as *const _, - glib::Value::from(&qos_dscp).to_glib_none().0, + qos_dscp.to_value().to_glib_none().0, ); } } @@ -195,7 +192,6 @@ impl NetClientClock { value .get() .expect("Return Value for property `round-trip-limit` getter") - .unwrap() } } @@ -205,7 +201,7 @@ impl NetClientClock { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"round-trip-limit\0".as_ptr() as *const _, - glib::Value::from(&round_trip_limit).to_glib_none().0, + round_trip_limit.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-net/src/auto/net_time_provider.rs b/gstreamer-net/src/auto/net_time_provider.rs index 240137ffc..576f991c4 100644 --- a/gstreamer-net/src/auto/net_time_provider.rs +++ b/gstreamer-net/src/auto/net_time_provider.rs @@ -8,6 +8,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -32,7 +33,6 @@ impl NetTimeProvider { value .get() .expect("Return Value for property `active` getter") - .unwrap() } } @@ -42,7 +42,7 @@ impl NetTimeProvider { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"active\0".as_ptr() as *const _, - glib::Value::from(&active).to_glib_none().0, + active.to_value().to_glib_none().0, ); } } @@ -89,7 +89,6 @@ impl NetTimeProvider { value .get() .expect("Return Value for property `port` getter") - .unwrap() } } @@ -105,7 +104,6 @@ impl NetTimeProvider { value .get() .expect("Return Value for property `qos-dscp` getter") - .unwrap() } } @@ -115,7 +113,7 @@ impl NetTimeProvider { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"qos-dscp\0".as_ptr() as *const _, - glib::Value::from(&qos_dscp).to_glib_none().0, + qos_dscp.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-net/src/auto/ptp_clock.rs b/gstreamer-net/src/auto/ptp_clock.rs index 0638f6bc3..b39de9509 100644 --- a/gstreamer-net/src/auto/ptp_clock.rs +++ b/gstreamer-net/src/auto/ptp_clock.rs @@ -8,6 +8,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -32,7 +33,6 @@ impl PtpClock { value .get() .expect("Return Value for property `domain` getter") - .unwrap() } } @@ -48,7 +48,6 @@ impl PtpClock { value .get() .expect("Return Value for property `grandmaster-clock-id` getter") - .unwrap() } } @@ -79,7 +78,6 @@ impl PtpClock { value .get() .expect("Return Value for property `master-clock-id` getter") - .unwrap() } } diff --git a/gstreamer-net/src/auto/versions.txt b/gstreamer-net/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-net/src/auto/versions.txt +++ b/gstreamer-net/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-net/sys/build.rs b/gstreamer-net/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-net/sys/build.rs +++ b/gstreamer-net/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-net/sys/src/lib.rs b/gstreamer-net/sys/src/lib.rs index b4e816628..7621f6eb3 100644 --- a/gstreamer-net/sys/src/lib.rs +++ b/gstreamer-net/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-net/sys/tests/abi.rs b/gstreamer-net/sys/tests/abi.rs index 776056a31..0d8124f42 100644 --- a/gstreamer-net/sys/tests/abi.rs +++ b/gstreamer-net/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-net/sys/tests/constant.c b/gstreamer-net/sys/tests/constant.c index ab02e6148..51d52bba2 100644 --- a/gstreamer-net/sys/tests/constant.c +++ b/gstreamer-net/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-net/sys/tests/layout.c b/gstreamer-net/sys/tests/layout.c index 9964020bf..ff0f4f626 100644 --- a/gstreamer-net/sys/tests/layout.c +++ b/gstreamer-net/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-pbutils/src/auto/discoverer.rs b/gstreamer-pbutils/src/auto/discoverer.rs index f811e4f82..a2edd6495 100644 --- a/gstreamer-pbutils/src/auto/discoverer.rs +++ b/gstreamer-pbutils/src/auto/discoverer.rs @@ -11,6 +11,9 @@ use glib::translate::*; #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] use glib::StaticType; +#[cfg(any(feature = "v1_16", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; use std::ptr; @@ -93,7 +96,6 @@ impl Discoverer { value .get() .expect("Return Value for property `use-cache` getter") - .unwrap() } } @@ -105,7 +107,7 @@ impl Discoverer { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"use-cache\0".as_ptr() as *const _, - glib::Value::from(&use_cache).to_glib_none().0, + use_cache.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-pbutils/src/auto/enums.rs b/gstreamer-pbutils/src/auto/enums.rs index 16bf4823c..af28e1bc8 100644 --- a/gstreamer-pbutils/src/auto/enums.rs +++ b/gstreamer-pbutils/src/auto/enums.rs @@ -5,8 +5,7 @@ use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; @@ -69,20 +68,29 @@ impl StaticType for DiscovererResult { } } -impl<'a> FromValueOptional<'a> for DiscovererResult { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for DiscovererResult { + type Type = Self; } -impl<'a> FromValue<'a> for DiscovererResult { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for DiscovererResult { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for DiscovererResult { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for DiscovererResult { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-pbutils/src/auto/flags.rs b/gstreamer-pbutils/src/auto/flags.rs index b16df563a..74d4f56c2 100644 --- a/gstreamer-pbutils/src/auto/flags.rs +++ b/gstreamer-pbutils/src/auto/flags.rs @@ -6,8 +6,7 @@ use bitflags::bitflags; use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; @@ -42,20 +41,29 @@ impl StaticType for DiscovererSerializeFlags { } } -impl<'a> FromValueOptional<'a> for DiscovererSerializeFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for DiscovererSerializeFlags { + type Type = Self; } -impl<'a> FromValue<'a> for DiscovererSerializeFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for DiscovererSerializeFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for DiscovererSerializeFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for DiscovererSerializeFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-pbutils/src/auto/versions.txt b/gstreamer-pbutils/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-pbutils/src/auto/versions.txt +++ b/gstreamer-pbutils/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-pbutils/sys/build.rs b/gstreamer-pbutils/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-pbutils/sys/build.rs +++ b/gstreamer-pbutils/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-pbutils/sys/src/lib.rs b/gstreamer-pbutils/sys/src/lib.rs index becb647c4..2a2bf2fcc 100644 --- a/gstreamer-pbutils/sys/src/lib.rs +++ b/gstreamer-pbutils/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-pbutils/sys/tests/abi.rs b/gstreamer-pbutils/sys/tests/abi.rs index 06db109b3..3915fdc45 100644 --- a/gstreamer-pbutils/sys/tests/abi.rs +++ b/gstreamer-pbutils/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-pbutils/sys/tests/constant.c b/gstreamer-pbutils/sys/tests/constant.c index 72e11bf1d..0da5dbef4 100644 --- a/gstreamer-pbutils/sys/tests/constant.c +++ b/gstreamer-pbutils/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-pbutils/sys/tests/layout.c b/gstreamer-pbutils/sys/tests/layout.c index ea9a3df69..8b052a699 100644 --- a/gstreamer-pbutils/sys/tests/layout.c +++ b/gstreamer-pbutils/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-player/src/auto/enums.rs b/gstreamer-player/src/auto/enums.rs index 6c4342104..aaa7fe456 100644 --- a/gstreamer-player/src/auto/enums.rs +++ b/gstreamer-player/src/auto/enums.rs @@ -6,8 +6,7 @@ use glib::error::ErrorDomain; use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::Quark; use glib::StaticType; use glib::Type; @@ -71,21 +70,30 @@ impl StaticType for PlayerColorBalanceType { } } -impl<'a> FromValueOptional<'a> for PlayerColorBalanceType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for PlayerColorBalanceType { + type Type = Self; } -impl<'a> FromValue<'a> for PlayerColorBalanceType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for PlayerColorBalanceType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for PlayerColorBalanceType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for PlayerColorBalanceType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -156,21 +164,30 @@ impl StaticType for PlayerError { } } -impl<'a> FromValueOptional<'a> for PlayerError { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for PlayerError { + type Type = Self; } -impl<'a> FromValue<'a> for PlayerError { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for PlayerError { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for PlayerError { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for PlayerError { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -282,20 +299,29 @@ impl StaticType for PlayerState { } } -impl<'a> FromValueOptional<'a> for PlayerState { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for PlayerState { + type Type = Self; } -impl<'a> FromValue<'a> for PlayerState { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for PlayerState { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for PlayerState { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for PlayerState { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-player/src/auto/player.rs b/gstreamer-player/src/auto/player.rs index 4ca6ce836..86b77bbeb 100644 --- a/gstreamer-player/src/auto/player.rs +++ b/gstreamer-player/src/auto/player.rs @@ -16,6 +16,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -345,7 +346,7 @@ impl Player { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"suburi\0".as_ptr() as *const _, - glib::Value::from(suburi).to_glib_none().0, + suburi.to_value().to_glib_none().0, ); } } @@ -364,7 +365,6 @@ impl Player { value .get() .expect("Return Value for property `video-multiview-flags` getter") - .unwrap() } } @@ -374,7 +374,7 @@ impl Player { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"video-multiview-flags\0".as_ptr() as *const _, - glib::Value::from(&video_multiview_flags).to_glib_none().0, + video_multiview_flags.to_value().to_glib_none().0, ); } } @@ -393,7 +393,6 @@ impl Player { value .get() .expect("Return Value for property `video-multiview-mode` getter") - .unwrap() } } @@ -406,7 +405,7 @@ impl Player { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"video-multiview-mode\0".as_ptr() as *const _, - glib::Value::from(&video_multiview_mode).to_glib_none().0, + video_multiview_mode.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-player/src/auto/player_gmain_context_signal_dispatcher.rs b/gstreamer-player/src/auto/player_gmain_context_signal_dispatcher.rs index 9a81c2d16..10611482d 100644 --- a/gstreamer-player/src/auto/player_gmain_context_signal_dispatcher.rs +++ b/gstreamer-player/src/auto/player_gmain_context_signal_dispatcher.rs @@ -7,6 +7,7 @@ use crate::PlayerSignalDispatcher; use glib::object::ObjectType as ObjectType_; use glib::translate::*; use glib::StaticType; +use glib::ToValue; glib::wrapper! { pub struct PlayerGMainContextSignalDispatcher(Object) @implements PlayerSignalDispatcher; diff --git a/gstreamer-player/src/auto/player_video_overlay_video_renderer.rs b/gstreamer-player/src/auto/player_video_overlay_video_renderer.rs index 3fe6c5a53..24d9e1e2f 100644 --- a/gstreamer-player/src/auto/player_video_overlay_video_renderer.rs +++ b/gstreamer-player/src/auto/player_video_overlay_video_renderer.rs @@ -10,6 +10,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem; use std::mem::transmute; @@ -96,7 +97,7 @@ impl PlayerVideoOverlayVideoRenderer { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"video-sink\0".as_ptr() as *const _, - glib::Value::from(video_sink).to_glib_none().0, + video_sink.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-player/src/auto/versions.txt b/gstreamer-player/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-player/src/auto/versions.txt +++ b/gstreamer-player/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-player/sys/build.rs b/gstreamer-player/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-player/sys/build.rs +++ b/gstreamer-player/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-player/sys/src/lib.rs b/gstreamer-player/sys/src/lib.rs index ea1534416..a1443fca2 100644 --- a/gstreamer-player/sys/src/lib.rs +++ b/gstreamer-player/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-player/sys/tests/abi.rs b/gstreamer-player/sys/tests/abi.rs index a2860735f..67582dad6 100644 --- a/gstreamer-player/sys/tests/abi.rs +++ b/gstreamer-player/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-player/sys/tests/constant.c b/gstreamer-player/sys/tests/constant.c index 5f49b7f3d..9ef04c102 100644 --- a/gstreamer-player/sys/tests/constant.c +++ b/gstreamer-player/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-player/sys/tests/layout.c b/gstreamer-player/sys/tests/layout.c index c7103f1a1..077305dac 100644 --- a/gstreamer-player/sys/tests/layout.c +++ b/gstreamer-player/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-rtp/src/auto/enums.rs b/gstreamer-rtp/src/auto/enums.rs index 86749e501..21d54908c 100644 --- a/gstreamer-rtp/src/auto/enums.rs +++ b/gstreamer-rtp/src/auto/enums.rs @@ -5,8 +5,7 @@ use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; @@ -81,21 +80,30 @@ impl StaticType for RTCPFBType { } } -impl<'a> FromValueOptional<'a> for RTCPFBType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTCPFBType { + type Type = Self; } -impl<'a> FromValue<'a> for RTCPFBType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTCPFBType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTCPFBType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTCPFBType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -174,21 +182,30 @@ impl StaticType for RTCPSDESType { } } -impl<'a> FromValueOptional<'a> for RTCPSDESType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTCPSDESType { + type Type = Self; } -impl<'a> FromValue<'a> for RTCPSDESType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTCPSDESType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTCPSDESType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTCPSDESType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -263,21 +280,30 @@ impl StaticType for RTCPType { } } -impl<'a> FromValueOptional<'a> for RTCPType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTCPType { + type Type = Self; } -impl<'a> FromValue<'a> for RTCPType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTCPType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTCPType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTCPType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -358,25 +384,34 @@ impl StaticType for RTCPXRType { #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl<'a> FromValueOptional<'a> for RTCPXRType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTCPXRType { + type Type = Self; } #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl<'a> FromValue<'a> for RTCPXRType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTCPXRType { + type Checker = glib::value::GenericValueTypeChecker; + + 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(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl SetValue for RTCPXRType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTCPXRType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -519,21 +554,30 @@ impl StaticType for RTPPayload { } } -impl<'a> FromValueOptional<'a> for RTPPayload { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTPPayload { + type Type = Self; } -impl<'a> FromValue<'a> for RTPPayload { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTPPayload { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTPPayload { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTPPayload { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -592,20 +636,29 @@ impl StaticType for RTPProfile { } } -impl<'a> FromValueOptional<'a> for RTPProfile { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTPProfile { + type Type = Self; } -impl<'a> FromValue<'a> for RTPProfile { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTPProfile { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTPProfile { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTPProfile { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-rtp/src/auto/flags.rs b/gstreamer-rtp/src/auto/flags.rs index 3ad9e7b27..31c65f622 100644 --- a/gstreamer-rtp/src/auto/flags.rs +++ b/gstreamer-rtp/src/auto/flags.rs @@ -6,8 +6,7 @@ use bitflags::bitflags; use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; @@ -51,25 +50,34 @@ impl StaticType for RTPBufferFlags { #[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] -impl<'a> FromValueOptional<'a> for RTPBufferFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTPBufferFlags { + type Type = Self; } #[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] -impl<'a> FromValue<'a> for RTPBufferFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTPBufferFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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)) } } #[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] -impl SetValue for RTPBufferFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTPBufferFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -102,20 +110,29 @@ impl StaticType for RTPBufferMapFlags { } } -impl<'a> FromValueOptional<'a> for RTPBufferMapFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTPBufferMapFlags { + type Type = Self; } -impl<'a> FromValue<'a> for RTPBufferMapFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTPBufferMapFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTPBufferMapFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTPBufferMapFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-rtp/src/auto/versions.txt b/gstreamer-rtp/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-rtp/src/auto/versions.txt +++ b/gstreamer-rtp/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-rtp/sys/build.rs b/gstreamer-rtp/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-rtp/sys/build.rs +++ b/gstreamer-rtp/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-rtp/sys/src/lib.rs b/gstreamer-rtp/sys/src/lib.rs index 7fc36b10d..e9baddb4a 100644 --- a/gstreamer-rtp/sys/src/lib.rs +++ b/gstreamer-rtp/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-rtp/sys/tests/abi.rs b/gstreamer-rtp/sys/tests/abi.rs index ed009747b..8f883d9c2 100644 --- a/gstreamer-rtp/sys/tests/abi.rs +++ b/gstreamer-rtp/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-rtp/sys/tests/constant.c b/gstreamer-rtp/sys/tests/constant.c index 57183185d..0189dd536 100644 --- a/gstreamer-rtp/sys/tests/constant.c +++ b/gstreamer-rtp/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-rtp/sys/tests/layout.c b/gstreamer-rtp/sys/tests/layout.c index b564a0d1e..6fd43a0f1 100644 --- a/gstreamer-rtp/sys/tests/layout.c +++ b/gstreamer-rtp/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-rtsp-server/src/auto/enums.rs b/gstreamer-rtsp-server/src/auto/enums.rs index c59a296fd..f25a5065b 100644 --- a/gstreamer-rtsp-server/src/auto/enums.rs +++ b/gstreamer-rtsp-server/src/auto/enums.rs @@ -5,8 +5,7 @@ use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; @@ -202,21 +201,30 @@ impl StaticType for RTSPPublishClockMode { } } -impl<'a> FromValueOptional<'a> for RTSPPublishClockMode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTSPPublishClockMode { + type Type = Self; } -impl<'a> FromValue<'a> for RTSPPublishClockMode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTSPPublishClockMode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTSPPublishClockMode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTSPPublishClockMode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -267,21 +275,30 @@ impl StaticType for RTSPSuspendMode { } } -impl<'a> FromValueOptional<'a> for RTSPSuspendMode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTSPSuspendMode { + type Type = Self; } -impl<'a> FromValue<'a> for RTSPSuspendMode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTSPSuspendMode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTSPSuspendMode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTSPSuspendMode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-rtsp-server/src/auto/flags.rs b/gstreamer-rtsp-server/src/auto/flags.rs index bfefcb120..3b54f83af 100644 --- a/gstreamer-rtsp-server/src/auto/flags.rs +++ b/gstreamer-rtsp-server/src/auto/flags.rs @@ -6,8 +6,7 @@ use bitflags::bitflags; use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; @@ -68,20 +67,29 @@ impl StaticType for RTSPTransportMode { } } -impl<'a> FromValueOptional<'a> for RTSPTransportMode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTSPTransportMode { + type Type = Self; } -impl<'a> FromValue<'a> for RTSPTransportMode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTSPTransportMode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTSPTransportMode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTSPTransportMode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-rtsp-server/src/auto/rtsp_client.rs b/gstreamer-rtsp-server/src/auto/rtsp_client.rs index b8a9f3902..51d128f27 100644 --- a/gstreamer-rtsp-server/src/auto/rtsp_client.rs +++ b/gstreamer-rtsp-server/src/auto/rtsp_client.rs @@ -19,6 +19,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -485,7 +486,6 @@ impl> RTSPClientExt for O { value .get() .expect("Return Value for property `drop-backlog` getter") - .unwrap() } } @@ -494,7 +494,7 @@ impl> RTSPClientExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"drop-backlog\0".as_ptr() as *const _, - glib::Value::from(&drop_backlog).to_glib_none().0, + drop_backlog.to_value().to_glib_none().0, ); } } @@ -510,7 +510,6 @@ impl> RTSPClientExt for O { value .get() .expect("Return Value for property `post-session-timeout` getter") - .unwrap() } } @@ -519,7 +518,7 @@ impl> RTSPClientExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"post-session-timeout\0".as_ptr() as *const _, - glib::Value::from(&post_session_timeout).to_glib_none().0, + post_session_timeout.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-rtsp-server/src/auto/rtsp_media.rs b/gstreamer-rtsp-server/src/auto/rtsp_media.rs index 3107a8319..c6536ae78 100644 --- a/gstreamer-rtsp-server/src/auto/rtsp_media.rs +++ b/gstreamer-rtsp-server/src/auto/rtsp_media.rs @@ -17,6 +17,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] @@ -992,7 +993,6 @@ impl> RTSPMediaExt for O { value .get() .expect("Return Value for property `bind-mcast-address` getter") - .unwrap() } } @@ -1001,7 +1001,7 @@ impl> RTSPMediaExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"bind-mcast-address\0".as_ptr() as *const _, - glib::Value::from(&bind_mcast_address).to_glib_none().0, + bind_mcast_address.to_value().to_glib_none().0, ); } } @@ -1017,7 +1017,6 @@ impl> RTSPMediaExt for O { value .get() .expect("Return Value for property `dscp-qos` getter") - .unwrap() } } @@ -1026,7 +1025,7 @@ impl> RTSPMediaExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"dscp-qos\0".as_ptr() as *const _, - glib::Value::from(&dscp_qos).to_glib_none().0, + dscp_qos.to_value().to_glib_none().0, ); } } @@ -1042,7 +1041,6 @@ impl> RTSPMediaExt for O { value .get() .expect("Return Value for property `max-mcast-ttl` getter") - .unwrap() } } @@ -1051,7 +1049,7 @@ impl> RTSPMediaExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"max-mcast-ttl\0".as_ptr() as *const _, - glib::Value::from(&max_mcast_ttl).to_glib_none().0, + max_mcast_ttl.to_value().to_glib_none().0, ); } } @@ -1061,7 +1059,7 @@ impl> RTSPMediaExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"time-provider\0".as_ptr() as *const _, - glib::Value::from(&time_provider).to_glib_none().0, + time_provider.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-rtsp-server/src/auto/rtsp_media_factory.rs b/gstreamer-rtsp-server/src/auto/rtsp_media_factory.rs index 0d88eb11c..083595558 100644 --- a/gstreamer-rtsp-server/src/auto/rtsp_media_factory.rs +++ b/gstreamer-rtsp-server/src/auto/rtsp_media_factory.rs @@ -14,6 +14,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -667,7 +668,6 @@ impl> RTSPMediaFactoryExt for O { value .get() .expect("Return Value for property `bind-mcast-address` getter") - .unwrap() } } @@ -676,7 +676,7 @@ impl> RTSPMediaFactoryExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"bind-mcast-address\0".as_ptr() as *const _, - glib::Value::from(&bind_mcast_address).to_glib_none().0, + bind_mcast_address.to_value().to_glib_none().0, ); } } @@ -692,7 +692,6 @@ impl> RTSPMediaFactoryExt for O { value .get() .expect("Return Value for property `dscp-qos` getter") - .unwrap() } } @@ -701,7 +700,7 @@ impl> RTSPMediaFactoryExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"dscp-qos\0".as_ptr() as *const _, - glib::Value::from(&dscp_qos).to_glib_none().0, + dscp_qos.to_value().to_glib_none().0, ); } } @@ -717,7 +716,6 @@ impl> RTSPMediaFactoryExt for O { value .get() .expect("Return Value for property `max-mcast-ttl` getter") - .unwrap() } } @@ -726,7 +724,7 @@ impl> RTSPMediaFactoryExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"max-mcast-ttl\0".as_ptr() as *const _, - glib::Value::from(&max_mcast_ttl).to_glib_none().0, + max_mcast_ttl.to_value().to_glib_none().0, ); } } @@ -742,7 +740,6 @@ impl> RTSPMediaFactoryExt for O { value .get() .expect("Return Value for property `stop-on-disconnect` getter") - .unwrap() } } diff --git a/gstreamer-rtsp-server/src/auto/rtsp_media_factory_uri.rs b/gstreamer-rtsp-server/src/auto/rtsp_media_factory_uri.rs index 38da585dd..10bc4b7e2 100644 --- a/gstreamer-rtsp-server/src/auto/rtsp_media_factory_uri.rs +++ b/gstreamer-rtsp-server/src/auto/rtsp_media_factory_uri.rs @@ -10,6 +10,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -93,7 +94,6 @@ impl> RTSPMediaFactoryURIExt for O { value .get() .expect("Return Value for property `use-gstpay` getter") - .unwrap() } } @@ -102,7 +102,7 @@ impl> RTSPMediaFactoryURIExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"use-gstpay\0".as_ptr() as *const _, - glib::Value::from(&use_gstpay).to_glib_none().0, + use_gstpay.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-rtsp-server/src/auto/rtsp_server.rs b/gstreamer-rtsp-server/src/auto/rtsp_server.rs index f0c7f766f..3ef1545c6 100644 --- a/gstreamer-rtsp-server/src/auto/rtsp_server.rs +++ b/gstreamer-rtsp-server/src/auto/rtsp_server.rs @@ -15,6 +15,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; use std::ptr; @@ -435,7 +436,6 @@ impl> RTSPServerExt for O { value .get() .expect("Return Value for property `content-length-limit` getter") - .unwrap() } } @@ -444,7 +444,7 @@ impl> RTSPServerExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"content-length-limit\0".as_ptr() as *const _, - glib::Value::from(&content_length_limit).to_glib_none().0, + content_length_limit.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-rtsp-server/src/auto/rtsp_session.rs b/gstreamer-rtsp-server/src/auto/rtsp_session.rs index 558e344c2..e22d8f54f 100644 --- a/gstreamer-rtsp-server/src/auto/rtsp_session.rs +++ b/gstreamer-rtsp-server/src/auto/rtsp_session.rs @@ -12,6 +12,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem; use std::mem::transmute; @@ -276,7 +277,6 @@ impl> RTSPSessionExt for O { value .get() .expect("Return Value for property `extra-timeout` getter") - .unwrap() } } @@ -285,7 +285,7 @@ impl> RTSPSessionExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"extra-timeout\0".as_ptr() as *const _, - glib::Value::from(&extra_timeout).to_glib_none().0, + extra_timeout.to_value().to_glib_none().0, ); } } @@ -301,7 +301,6 @@ impl> RTSPSessionExt for O { value .get() .expect("Return Value for property `timeout-always-visible` getter") - .unwrap() } } @@ -310,7 +309,7 @@ impl> RTSPSessionExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"timeout-always-visible\0".as_ptr() as *const _, - glib::Value::from(&timeout_always_visible).to_glib_none().0, + timeout_always_visible.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-rtsp-server/src/auto/versions.txt b/gstreamer-rtsp-server/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-rtsp-server/src/auto/versions.txt +++ b/gstreamer-rtsp-server/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-rtsp-server/sys/build.rs b/gstreamer-rtsp-server/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-rtsp-server/sys/build.rs +++ b/gstreamer-rtsp-server/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-rtsp-server/sys/src/lib.rs b/gstreamer-rtsp-server/sys/src/lib.rs index 1cc38de80..d06ba68a4 100644 --- a/gstreamer-rtsp-server/sys/src/lib.rs +++ b/gstreamer-rtsp-server/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-rtsp-server/sys/tests/abi.rs b/gstreamer-rtsp-server/sys/tests/abi.rs index 993114a40..0630d4902 100644 --- a/gstreamer-rtsp-server/sys/tests/abi.rs +++ b/gstreamer-rtsp-server/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-rtsp-server/sys/tests/constant.c b/gstreamer-rtsp-server/sys/tests/constant.c index 535d89c55..69372fd25 100644 --- a/gstreamer-rtsp-server/sys/tests/constant.c +++ b/gstreamer-rtsp-server/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-rtsp-server/sys/tests/layout.c b/gstreamer-rtsp-server/sys/tests/layout.c index b8aaa34b5..cdb4b1d00 100644 --- a/gstreamer-rtsp-server/sys/tests/layout.c +++ b/gstreamer-rtsp-server/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-rtsp/src/auto/enums.rs b/gstreamer-rtsp/src/auto/enums.rs index c568fa6e5..b08045805 100644 --- a/gstreamer-rtsp/src/auto/enums.rs +++ b/gstreamer-rtsp/src/auto/enums.rs @@ -5,8 +5,7 @@ use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; @@ -57,21 +56,30 @@ impl StaticType for RTSPAuthMethod { } } -impl<'a> FromValueOptional<'a> for RTSPAuthMethod { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTSPAuthMethod { + type Type = Self; } -impl<'a> FromValue<'a> for RTSPAuthMethod { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTSPAuthMethod { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTSPAuthMethod { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTSPAuthMethod { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -122,21 +130,30 @@ impl StaticType for RTSPFamily { } } -impl<'a> FromValueOptional<'a> for RTSPFamily { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTSPFamily { + type Type = Self; } -impl<'a> FromValue<'a> for RTSPFamily { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTSPFamily { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTSPFamily { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTSPFamily { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -535,21 +552,30 @@ impl StaticType for RTSPHeaderField { } } -impl<'a> FromValueOptional<'a> for RTSPHeaderField { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTSPHeaderField { + type Type = Self; } -impl<'a> FromValue<'a> for RTSPHeaderField { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTSPHeaderField { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTSPHeaderField { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTSPHeaderField { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -612,21 +638,30 @@ impl StaticType for RTSPMsgType { } } -impl<'a> FromValueOptional<'a> for RTSPMsgType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTSPMsgType { + type Type = Self; } -impl<'a> FromValue<'a> for RTSPMsgType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTSPMsgType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTSPMsgType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTSPMsgType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -685,21 +720,30 @@ impl StaticType for RTSPRangeUnit { } } -impl<'a> FromValueOptional<'a> for RTSPRangeUnit { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTSPRangeUnit { + type Type = Self; } -impl<'a> FromValue<'a> for RTSPRangeUnit { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTSPRangeUnit { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTSPRangeUnit { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTSPRangeUnit { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -810,21 +854,30 @@ impl StaticType for RTSPResult { } } -impl<'a> FromValueOptional<'a> for RTSPResult { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTSPResult { + type Type = Self; } -impl<'a> FromValue<'a> for RTSPResult { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTSPResult { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTSPResult { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTSPResult { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -887,21 +940,30 @@ impl StaticType for RTSPState { } } -impl<'a> FromValueOptional<'a> for RTSPState { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTSPState { + type Type = Self; } -impl<'a> FromValue<'a> for RTSPState { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTSPState { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTSPState { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTSPState { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1132,21 +1194,30 @@ impl StaticType for RTSPStatusCode { } } -impl<'a> FromValueOptional<'a> for RTSPStatusCode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTSPStatusCode { + type Type = Self; } -impl<'a> FromValue<'a> for RTSPStatusCode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTSPStatusCode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTSPStatusCode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTSPStatusCode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1205,20 +1276,29 @@ impl StaticType for RTSPTimeType { } } -impl<'a> FromValueOptional<'a> for RTSPTimeType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTSPTimeType { + type Type = Self; } -impl<'a> FromValue<'a> for RTSPTimeType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTSPTimeType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTSPTimeType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTSPTimeType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-rtsp/src/auto/flags.rs b/gstreamer-rtsp/src/auto/flags.rs index 46dc420a8..b18445079 100644 --- a/gstreamer-rtsp/src/auto/flags.rs +++ b/gstreamer-rtsp/src/auto/flags.rs @@ -6,8 +6,7 @@ use bitflags::bitflags; use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; @@ -41,21 +40,30 @@ impl StaticType for RTSPEvent { } } -impl<'a> FromValueOptional<'a> for RTSPEvent { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTSPEvent { + type Type = Self; } -impl<'a> FromValue<'a> for RTSPEvent { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTSPEvent { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTSPEvent { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTSPEvent { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -92,21 +100,30 @@ impl StaticType for RTSPLowerTrans { } } -impl<'a> FromValueOptional<'a> for RTSPLowerTrans { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTSPLowerTrans { + type Type = Self; } -impl<'a> FromValue<'a> for RTSPLowerTrans { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTSPLowerTrans { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTSPLowerTrans { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTSPLowerTrans { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -159,21 +176,30 @@ impl StaticType for RTSPMethod { } } -impl<'a> FromValueOptional<'a> for RTSPMethod { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTSPMethod { + type Type = Self; } -impl<'a> FromValue<'a> for RTSPMethod { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTSPMethod { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTSPMethod { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTSPMethod { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -209,21 +235,30 @@ impl StaticType for RTSPProfile { } } -impl<'a> FromValueOptional<'a> for RTSPProfile { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTSPProfile { + type Type = Self; } -impl<'a> FromValue<'a> for RTSPProfile { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTSPProfile { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTSPProfile { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTSPProfile { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -257,20 +292,29 @@ impl StaticType for RTSPTransMode { } } -impl<'a> FromValueOptional<'a> for RTSPTransMode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for RTSPTransMode { + type Type = Self; } -impl<'a> FromValue<'a> for RTSPTransMode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for RTSPTransMode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for RTSPTransMode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for RTSPTransMode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-rtsp/src/auto/versions.txt b/gstreamer-rtsp/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-rtsp/src/auto/versions.txt +++ b/gstreamer-rtsp/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-rtsp/sys/build.rs b/gstreamer-rtsp/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-rtsp/sys/build.rs +++ b/gstreamer-rtsp/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-rtsp/sys/src/lib.rs b/gstreamer-rtsp/sys/src/lib.rs index f45184b5e..52d32430c 100644 --- a/gstreamer-rtsp/sys/src/lib.rs +++ b/gstreamer-rtsp/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-rtsp/sys/tests/abi.rs b/gstreamer-rtsp/sys/tests/abi.rs index 56a3bd6fb..bc9d2f7a9 100644 --- a/gstreamer-rtsp/sys/tests/abi.rs +++ b/gstreamer-rtsp/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-rtsp/sys/tests/constant.c b/gstreamer-rtsp/sys/tests/constant.c index 3004b12cd..1a41ad8f1 100644 --- a/gstreamer-rtsp/sys/tests/constant.c +++ b/gstreamer-rtsp/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-rtsp/sys/tests/layout.c b/gstreamer-rtsp/sys/tests/layout.c index cf5965a6d..7e24cb06b 100644 --- a/gstreamer-rtsp/sys/tests/layout.c +++ b/gstreamer-rtsp/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-sdp/src/auto/versions.txt b/gstreamer-sdp/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-sdp/src/auto/versions.txt +++ b/gstreamer-sdp/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-sdp/sys/build.rs b/gstreamer-sdp/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-sdp/sys/build.rs +++ b/gstreamer-sdp/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-sdp/sys/src/lib.rs b/gstreamer-sdp/sys/src/lib.rs index 478267864..eb75de338 100644 --- a/gstreamer-sdp/sys/src/lib.rs +++ b/gstreamer-sdp/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-sdp/sys/tests/abi.rs b/gstreamer-sdp/sys/tests/abi.rs index 78ba248d7..a01877571 100644 --- a/gstreamer-sdp/sys/tests/abi.rs +++ b/gstreamer-sdp/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-sdp/sys/tests/constant.c b/gstreamer-sdp/sys/tests/constant.c index fcda9c47f..154359f5d 100644 --- a/gstreamer-sdp/sys/tests/constant.c +++ b/gstreamer-sdp/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-sdp/sys/tests/layout.c b/gstreamer-sdp/sys/tests/layout.c index ec95d6304..a59c57d97 100644 --- a/gstreamer-sdp/sys/tests/layout.c +++ b/gstreamer-sdp/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-tag/sys/build.rs b/gstreamer-tag/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-tag/sys/build.rs +++ b/gstreamer-tag/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-tag/sys/src/lib.rs b/gstreamer-tag/sys/src/lib.rs index b7cb99088..c97458652 100644 --- a/gstreamer-tag/sys/src/lib.rs +++ b/gstreamer-tag/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-tag/sys/tests/abi.rs b/gstreamer-tag/sys/tests/abi.rs index b175dccfd..5a05b0907 100644 --- a/gstreamer-tag/sys/tests/abi.rs +++ b/gstreamer-tag/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-tag/sys/tests/constant.c b/gstreamer-tag/sys/tests/constant.c index fcfc48221..c2d4d28a8 100644 --- a/gstreamer-tag/sys/tests/constant.c +++ b/gstreamer-tag/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-tag/sys/tests/layout.c b/gstreamer-tag/sys/tests/layout.c index 704e72f6d..6905aaa97 100644 --- a/gstreamer-tag/sys/tests/layout.c +++ b/gstreamer-tag/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-video/src/auto/enums.rs b/gstreamer-video/src/auto/enums.rs index e3683904f..95ef13a13 100644 --- a/gstreamer-video/src/auto/enums.rs +++ b/gstreamer-video/src/auto/enums.rs @@ -5,8 +5,7 @@ use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; use std::ffi::CStr; @@ -69,25 +68,34 @@ impl StaticType for VideoAFDSpec { #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -impl<'a> FromValueOptional<'a> for VideoAFDSpec { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoAFDSpec { + type Type = Self; } #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -impl<'a> FromValue<'a> for VideoAFDSpec { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoAFDSpec { + type Checker = glib::value::GenericValueTypeChecker; + + 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(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -impl SetValue for VideoAFDSpec { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoAFDSpec { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -180,25 +188,34 @@ impl StaticType for VideoAFDValue { #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -impl<'a> FromValueOptional<'a> for VideoAFDValue { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoAFDValue { + type Type = Self; } #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -impl<'a> FromValue<'a> for VideoAFDValue { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoAFDValue { + type Checker = glib::value::GenericValueTypeChecker; + + 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(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -impl SetValue for VideoAFDValue { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoAFDValue { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -249,21 +266,30 @@ impl StaticType for VideoAlphaMode { } } -impl<'a> FromValueOptional<'a> for VideoAlphaMode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoAlphaMode { + type Type = Self; } -impl<'a> FromValue<'a> for VideoAlphaMode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoAlphaMode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoAlphaMode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoAlphaMode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -348,25 +374,34 @@ impl StaticType for VideoCaptionType { #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl<'a> FromValueOptional<'a> for VideoCaptionType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoCaptionType { + type Type = Self; } #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl<'a> FromValue<'a> for VideoCaptionType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoCaptionType { + type Checker = glib::value::GenericValueTypeChecker; + + 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(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl SetValue for VideoCaptionType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoCaptionType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -421,21 +456,30 @@ impl StaticType for VideoChromaMode { } } -impl<'a> FromValueOptional<'a> for VideoChromaMode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoChromaMode { + type Type = Self; } -impl<'a> FromValue<'a> for VideoChromaMode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoChromaMode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoChromaMode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoChromaMode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -520,21 +564,30 @@ impl StaticType for VideoColorMatrix { } } -impl<'a> FromValueOptional<'a> for VideoColorMatrix { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoColorMatrix { + type Type = Self; } -impl<'a> FromValue<'a> for VideoColorMatrix { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoColorMatrix { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoColorMatrix { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoColorMatrix { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -664,21 +717,30 @@ impl StaticType for VideoColorPrimaries { } } -impl<'a> FromValueOptional<'a> for VideoColorPrimaries { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoColorPrimaries { + type Type = Self; } -impl<'a> FromValue<'a> for VideoColorPrimaries { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoColorPrimaries { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoColorPrimaries { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoColorPrimaries { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -737,21 +799,30 @@ impl StaticType for VideoDitherMethod { } } -impl<'a> FromValueOptional<'a> for VideoDitherMethod { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoDitherMethod { + type Type = Self; } -impl<'a> FromValue<'a> for VideoDitherMethod { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoDitherMethod { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoDitherMethod { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoDitherMethod { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -835,25 +906,34 @@ impl StaticType for VideoFieldOrder { #[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] -impl<'a> FromValueOptional<'a> for VideoFieldOrder { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoFieldOrder { + type Type = Self; } #[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] -impl<'a> FromValue<'a> for VideoFieldOrder { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoFieldOrder { + type Checker = glib::value::GenericValueTypeChecker; + + 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(any(feature = "v1_12", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] -impl SetValue for VideoFieldOrder { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoFieldOrder { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1472,21 +1552,30 @@ impl StaticType for VideoFormat { } } -impl<'a> FromValueOptional<'a> for VideoFormat { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoFormat { + type Type = Self; } -impl<'a> FromValue<'a> for VideoFormat { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoFormat { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoFormat { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoFormat { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1533,21 +1622,30 @@ impl StaticType for VideoGammaMode { } } -impl<'a> FromValueOptional<'a> for VideoGammaMode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoGammaMode { + type Type = Self; } -impl<'a> FromValue<'a> for VideoGammaMode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoGammaMode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoGammaMode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoGammaMode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1641,21 +1739,30 @@ impl StaticType for VideoInterlaceMode { } } -impl<'a> FromValueOptional<'a> for VideoInterlaceMode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoInterlaceMode { + type Type = Self; } -impl<'a> FromValue<'a> for VideoInterlaceMode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoInterlaceMode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoInterlaceMode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoInterlaceMode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1710,21 +1817,30 @@ impl StaticType for VideoMatrixMode { } } -impl<'a> FromValueOptional<'a> for VideoMatrixMode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoMatrixMode { + type Type = Self; } -impl<'a> FromValue<'a> for VideoMatrixMode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoMatrixMode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoMatrixMode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoMatrixMode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1815,21 +1931,30 @@ impl StaticType for VideoMultiviewFramePacking { } } -impl<'a> FromValueOptional<'a> for VideoMultiviewFramePacking { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoMultiviewFramePacking { + type Type = Self; } -impl<'a> FromValue<'a> for VideoMultiviewFramePacking { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoMultiviewFramePacking { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoMultiviewFramePacking { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoMultiviewFramePacking { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1944,21 +2069,30 @@ impl StaticType for VideoMultiviewMode { } } -impl<'a> FromValueOptional<'a> for VideoMultiviewMode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoMultiviewMode { + type Type = Self; } -impl<'a> FromValue<'a> for VideoMultiviewMode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoMultiviewMode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoMultiviewMode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoMultiviewMode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -2047,25 +2181,34 @@ impl StaticType for VideoOrientationMethod { #[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] -impl<'a> FromValueOptional<'a> for VideoOrientationMethod { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoOrientationMethod { + type Type = Self; } #[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] -impl<'a> FromValue<'a> for VideoOrientationMethod { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoOrientationMethod { + type Checker = glib::value::GenericValueTypeChecker; + + 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(any(feature = "v1_10", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] -impl SetValue for VideoOrientationMethod { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoOrientationMethod { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -2116,21 +2259,30 @@ impl StaticType for VideoPrimariesMode { } } -impl<'a> FromValueOptional<'a> for VideoPrimariesMode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoPrimariesMode { + type Type = Self; } -impl<'a> FromValue<'a> for VideoPrimariesMode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoPrimariesMode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoPrimariesMode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoPrimariesMode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -2189,21 +2341,30 @@ impl StaticType for VideoResamplerMethod { } } -impl<'a> FromValueOptional<'a> for VideoResamplerMethod { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoResamplerMethod { + type Type = Self; } -impl<'a> FromValue<'a> for VideoResamplerMethod { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoResamplerMethod { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoResamplerMethod { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoResamplerMethod { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -2258,21 +2419,30 @@ impl StaticType for VideoTileMode { } } -impl<'a> FromValueOptional<'a> for VideoTileMode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoTileMode { + type Type = Self; } -impl<'a> FromValue<'a> for VideoTileMode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoTileMode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoTileMode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoTileMode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -2428,20 +2598,29 @@ impl StaticType for VideoTransferFunction { } } -impl<'a> FromValueOptional<'a> for VideoTransferFunction { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoTransferFunction { + type Type = Self; } -impl<'a> FromValue<'a> for VideoTransferFunction { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoTransferFunction { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoTransferFunction { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoTransferFunction { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-video/src/auto/flags.rs b/gstreamer-video/src/auto/flags.rs index c04fa157e..d654694e3 100644 --- a/gstreamer-video/src/auto/flags.rs +++ b/gstreamer-video/src/auto/flags.rs @@ -6,8 +6,7 @@ use bitflags::bitflags; use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; @@ -54,21 +53,30 @@ impl StaticType for VideoBufferFlags { } } -impl<'a> FromValueOptional<'a> for VideoBufferFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoBufferFlags { + type Type = Self; } -impl<'a> FromValue<'a> for VideoBufferFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoBufferFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoBufferFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoBufferFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -108,21 +116,30 @@ impl StaticType for VideoChromaSite { } } -impl<'a> FromValueOptional<'a> for VideoChromaSite { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoChromaSite { + type Type = Self; } -impl<'a> FromValue<'a> for VideoChromaSite { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoChromaSite { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoChromaSite { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoChromaSite { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -182,21 +199,30 @@ impl StaticType for VideoFlags { } } -impl<'a> FromValueOptional<'a> for VideoFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoFlags { + type Type = Self; } -impl<'a> FromValue<'a> for VideoFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -237,21 +263,30 @@ impl StaticType for VideoFormatFlags { } } -impl<'a> FromValueOptional<'a> for VideoFormatFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoFormatFlags { + type Type = Self; } -impl<'a> FromValue<'a> for VideoFormatFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoFormatFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoFormatFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoFormatFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -291,21 +326,30 @@ impl StaticType for VideoFrameFlags { } } -impl<'a> FromValueOptional<'a> for VideoFrameFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoFrameFlags { + type Type = Self; } -impl<'a> FromValue<'a> for VideoFrameFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoFrameFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoFrameFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoFrameFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -344,21 +388,30 @@ impl StaticType for VideoMultiviewFlags { } } -impl<'a> FromValueOptional<'a> for VideoMultiviewFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoMultiviewFlags { + type Type = Self; } -impl<'a> FromValue<'a> for VideoMultiviewFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoMultiviewFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoMultiviewFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoMultiviewFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -396,25 +449,34 @@ impl StaticType for VideoOverlayFormatFlags { #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl<'a> FromValueOptional<'a> for VideoOverlayFormatFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoOverlayFormatFlags { + type Type = Self; } #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl<'a> FromValue<'a> for VideoOverlayFormatFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoOverlayFormatFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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)) } } #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl SetValue for VideoOverlayFormatFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoOverlayFormatFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -448,21 +510,30 @@ impl StaticType for VideoPackFlags { } } -impl<'a> FromValueOptional<'a> for VideoPackFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoPackFlags { + type Type = Self; } -impl<'a> FromValue<'a> for VideoPackFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoPackFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for VideoPackFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoPackFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -506,24 +577,33 @@ impl StaticType for VideoTimeCodeFlags { #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -impl<'a> FromValueOptional<'a> for VideoTimeCodeFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for VideoTimeCodeFlags { + type Type = Self; } #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -impl<'a> FromValue<'a> for VideoTimeCodeFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for VideoTimeCodeFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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)) } } #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -impl SetValue for VideoTimeCodeFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for VideoTimeCodeFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-video/src/auto/versions.txt b/gstreamer-video/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-video/src/auto/versions.txt +++ b/gstreamer-video/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-video/src/auto/video_decoder.rs b/gstreamer-video/src/auto/video_decoder.rs index 598fd8098..705d9883e 100644 --- a/gstreamer-video/src/auto/video_decoder.rs +++ b/gstreamer-video/src/auto/video_decoder.rs @@ -20,6 +20,9 @@ use glib::translate::*; use glib::StaticType; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +use glib::ToValue; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] use std::boxed::Box as Box_; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] @@ -252,10 +255,7 @@ impl> VideoDecoderExt for O { b"qos\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); - value - .get() - .expect("Return Value for property `qos` getter") - .unwrap() + value.get().expect("Return Value for property `qos` getter") } } @@ -266,7 +266,7 @@ impl> VideoDecoderExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"qos\0".as_ptr() as *const _, - glib::Value::from(&qos).to_glib_none().0, + qos.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-video/src/auto/video_encoder.rs b/gstreamer-video/src/auto/video_encoder.rs index 84aecdf92..88f211c11 100644 --- a/gstreamer-video/src/auto/video_encoder.rs +++ b/gstreamer-video/src/auto/video_encoder.rs @@ -12,6 +12,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -195,10 +196,7 @@ impl> VideoEncoderExt for O { b"qos\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); - value - .get() - .expect("Return Value for property `qos` getter") - .unwrap() + value.get().expect("Return Value for property `qos` getter") } } @@ -207,7 +205,7 @@ impl> VideoEncoderExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"qos\0".as_ptr() as *const _, - glib::Value::from(&qos).to_glib_none().0, + qos.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-video/src/auto/video_sink.rs b/gstreamer-video/src/auto/video_sink.rs index ab5e2d2d7..c67f88eae 100644 --- a/gstreamer-video/src/auto/video_sink.rs +++ b/gstreamer-video/src/auto/video_sink.rs @@ -9,6 +9,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -50,7 +51,6 @@ impl> VideoSinkExt for O { value .get() .expect("Return Value for property `show-preroll-frame` getter") - .unwrap() } } @@ -59,7 +59,7 @@ impl> VideoSinkExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"show-preroll-frame\0".as_ptr() as *const _, - glib::Value::from(&show_preroll_frame).to_glib_none().0, + show_preroll_frame.to_value().to_glib_none().0, ); } } diff --git a/gstreamer-video/sys/build.rs b/gstreamer-video/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-video/sys/build.rs +++ b/gstreamer-video/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-video/sys/src/lib.rs b/gstreamer-video/sys/src/lib.rs index 035b4dfc0..f4dc0d8a6 100644 --- a/gstreamer-video/sys/src/lib.rs +++ b/gstreamer-video/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-video/sys/tests/abi.rs b/gstreamer-video/sys/tests/abi.rs index 37ffcf509..029992193 100644 --- a/gstreamer-video/sys/tests/abi.rs +++ b/gstreamer-video/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-video/sys/tests/constant.c b/gstreamer-video/sys/tests/constant.c index 0305be822..3fee74eee 100644 --- a/gstreamer-video/sys/tests/constant.c +++ b/gstreamer-video/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-video/sys/tests/layout.c b/gstreamer-video/sys/tests/layout.c index 19c36ef42..bf8e7fb06 100644 --- a/gstreamer-video/sys/tests/layout.c +++ b/gstreamer-video/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-webrtc/src/auto/enums.rs b/gstreamer-webrtc/src/auto/enums.rs index e91ce419d..dcfa96276 100644 --- a/gstreamer-webrtc/src/auto/enums.rs +++ b/gstreamer-webrtc/src/auto/enums.rs @@ -5,8 +5,7 @@ use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; use std::ffi::CStr; @@ -73,25 +72,34 @@ impl StaticType for WebRTCBundlePolicy { #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl<'a> FromValueOptional<'a> for WebRTCBundlePolicy { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for WebRTCBundlePolicy { + type Type = Self; } #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl<'a> FromValue<'a> for WebRTCBundlePolicy { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for WebRTCBundlePolicy { + type Checker = glib::value::GenericValueTypeChecker; + + 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(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl SetValue for WebRTCBundlePolicy { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for WebRTCBundlePolicy { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -146,21 +154,30 @@ impl StaticType for WebRTCDTLSSetup { } } -impl<'a> FromValueOptional<'a> for WebRTCDTLSSetup { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for WebRTCDTLSSetup { + type Type = Self; } -impl<'a> FromValue<'a> for WebRTCDTLSSetup { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for WebRTCDTLSSetup { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for WebRTCDTLSSetup { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for WebRTCDTLSSetup { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -219,21 +236,30 @@ impl StaticType for WebRTCDTLSTransportState { } } -impl<'a> FromValueOptional<'a> for WebRTCDTLSTransportState { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for WebRTCDTLSTransportState { + type Type = Self; } -impl<'a> FromValue<'a> for WebRTCDTLSTransportState { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for WebRTCDTLSTransportState { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for WebRTCDTLSTransportState { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for WebRTCDTLSTransportState { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -302,25 +328,34 @@ impl StaticType for WebRTCDataChannelState { #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl<'a> FromValueOptional<'a> for WebRTCDataChannelState { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for WebRTCDataChannelState { + type Type = Self; } #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl<'a> FromValue<'a> for WebRTCDataChannelState { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for WebRTCDataChannelState { + type Checker = glib::value::GenericValueTypeChecker; + + 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(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl SetValue for WebRTCDataChannelState { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for WebRTCDataChannelState { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -377,25 +412,34 @@ impl StaticType for WebRTCFECType { #[cfg(any(feature = "v1_14_1", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14_1")))] -impl<'a> FromValueOptional<'a> for WebRTCFECType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for WebRTCFECType { + type Type = Self; } #[cfg(any(feature = "v1_14_1", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14_1")))] -impl<'a> FromValue<'a> for WebRTCFECType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for WebRTCFECType { + type Checker = glib::value::GenericValueTypeChecker; + + 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(any(feature = "v1_14_1", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14_1")))] -impl SetValue for WebRTCFECType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for WebRTCFECType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -442,21 +486,30 @@ impl StaticType for WebRTCICEComponent { } } -impl<'a> FromValueOptional<'a> for WebRTCICEComponent { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for WebRTCICEComponent { + type Type = Self; } -impl<'a> FromValue<'a> for WebRTCICEComponent { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for WebRTCICEComponent { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for WebRTCICEComponent { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for WebRTCICEComponent { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -525,21 +578,30 @@ impl StaticType for WebRTCICEConnectionState { } } -impl<'a> FromValueOptional<'a> for WebRTCICEConnectionState { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for WebRTCICEConnectionState { + type Type = Self; } -impl<'a> FromValue<'a> for WebRTCICEConnectionState { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for WebRTCICEConnectionState { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for WebRTCICEConnectionState { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for WebRTCICEConnectionState { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -590,21 +652,30 @@ impl StaticType for WebRTCICEGatheringState { } } -impl<'a> FromValueOptional<'a> for WebRTCICEGatheringState { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for WebRTCICEGatheringState { + type Type = Self; } -impl<'a> FromValue<'a> for WebRTCICEGatheringState { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for WebRTCICEGatheringState { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for WebRTCICEGatheringState { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for WebRTCICEGatheringState { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -651,21 +722,30 @@ impl StaticType for WebRTCICERole { } } -impl<'a> FromValueOptional<'a> for WebRTCICERole { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for WebRTCICERole { + type Type = Self; } -impl<'a> FromValue<'a> for WebRTCICERole { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for WebRTCICERole { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for WebRTCICERole { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for WebRTCICERole { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -722,25 +802,34 @@ impl StaticType for WebRTCICETransportPolicy { #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl<'a> FromValueOptional<'a> for WebRTCICETransportPolicy { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for WebRTCICETransportPolicy { + type Type = Self; } #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl<'a> FromValue<'a> for WebRTCICETransportPolicy { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for WebRTCICETransportPolicy { + type Checker = glib::value::GenericValueTypeChecker; + + 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(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl SetValue for WebRTCICETransportPolicy { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for WebRTCICETransportPolicy { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -807,21 +896,30 @@ impl StaticType for WebRTCPeerConnectionState { } } -impl<'a> FromValueOptional<'a> for WebRTCPeerConnectionState { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for WebRTCPeerConnectionState { + type Type = Self; } -impl<'a> FromValue<'a> for WebRTCPeerConnectionState { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for WebRTCPeerConnectionState { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for WebRTCPeerConnectionState { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for WebRTCPeerConnectionState { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -886,25 +984,34 @@ impl StaticType for WebRTCPriorityType { #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl<'a> FromValueOptional<'a> for WebRTCPriorityType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for WebRTCPriorityType { + type Type = Self; } #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl<'a> FromValue<'a> for WebRTCPriorityType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for WebRTCPriorityType { + type Checker = glib::value::GenericValueTypeChecker; + + 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(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl SetValue for WebRTCPriorityType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for WebRTCPriorityType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -971,21 +1078,30 @@ impl StaticType for WebRTCRTPTransceiverDirection { } } -impl<'a> FromValueOptional<'a> for WebRTCRTPTransceiverDirection { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for WebRTCRTPTransceiverDirection { + type Type = Self; } -impl<'a> FromValue<'a> for WebRTCRTPTransceiverDirection { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for WebRTCRTPTransceiverDirection { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for WebRTCRTPTransceiverDirection { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for WebRTCRTPTransceiverDirection { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1050,25 +1166,34 @@ impl StaticType for WebRTCSCTPTransportState { #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl<'a> FromValueOptional<'a> for WebRTCSCTPTransportState { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for WebRTCSCTPTransportState { + type Type = Self; } #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl<'a> FromValue<'a> for WebRTCSCTPTransportState { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for WebRTCSCTPTransportState { + type Checker = glib::value::GenericValueTypeChecker; + + 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(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] -impl SetValue for WebRTCSCTPTransportState { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for WebRTCSCTPTransportState { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1144,21 +1269,30 @@ impl StaticType for WebRTCSDPType { } } -impl<'a> FromValueOptional<'a> for WebRTCSDPType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for WebRTCSDPType { + type Type = Self; } -impl<'a> FromValue<'a> for WebRTCSDPType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for WebRTCSDPType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for WebRTCSDPType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for WebRTCSDPType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1229,21 +1363,30 @@ impl StaticType for WebRTCSignalingState { } } -impl<'a> FromValueOptional<'a> for WebRTCSignalingState { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for WebRTCSignalingState { + type Type = Self; } -impl<'a> FromValue<'a> for WebRTCSignalingState { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for WebRTCSignalingState { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for WebRTCSignalingState { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for WebRTCSignalingState { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1338,20 +1481,29 @@ impl StaticType for WebRTCStatsType { } } -impl<'a> FromValueOptional<'a> for WebRTCStatsType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for WebRTCStatsType { + type Type = Self; } -impl<'a> FromValue<'a> for WebRTCStatsType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for WebRTCStatsType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for WebRTCStatsType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for WebRTCStatsType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer-webrtc/src/auto/versions.txt b/gstreamer-webrtc/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer-webrtc/src/auto/versions.txt +++ b/gstreamer-webrtc/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer-webrtc/src/auto/web_rtc_data_channel.rs b/gstreamer-webrtc/src/auto/web_rtc_data_channel.rs index ba875322f..e8216cd6b 100644 --- a/gstreamer-webrtc/src/auto/web_rtc_data_channel.rs +++ b/gstreamer-webrtc/src/auto/web_rtc_data_channel.rs @@ -11,6 +11,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -97,7 +98,6 @@ impl WebRTCDataChannel { value .get() .expect("Return Value for property `buffered-amount` getter") - .unwrap() } } @@ -113,7 +113,6 @@ impl WebRTCDataChannel { value .get() .expect("Return Value for property `buffered-amount-low-threshold` getter") - .unwrap() } } @@ -123,9 +122,7 @@ impl WebRTCDataChannel { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"buffered-amount-low-threshold\0".as_ptr() as *const _, - glib::Value::from(&buffered_amount_low_threshold) - .to_glib_none() - .0, + buffered_amount_low_threshold.to_value().to_glib_none().0, ); } } @@ -139,10 +136,7 @@ impl WebRTCDataChannel { b"id\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); - value - .get() - .expect("Return Value for property `id` getter") - .unwrap() + value.get().expect("Return Value for property `id` getter") } } @@ -173,7 +167,6 @@ impl WebRTCDataChannel { value .get() .expect("Return Value for property `max-packet-lifetime` getter") - .unwrap() } } @@ -189,7 +182,6 @@ impl WebRTCDataChannel { value .get() .expect("Return Value for property `max-retransmits` getter") - .unwrap() } } @@ -205,7 +197,6 @@ impl WebRTCDataChannel { value .get() .expect("Return Value for property `negotiated` getter") - .unwrap() } } @@ -221,7 +212,6 @@ impl WebRTCDataChannel { value .get() .expect("Return Value for property `ordered` getter") - .unwrap() } } @@ -238,7 +228,6 @@ impl WebRTCDataChannel { value .get() .expect("Return Value for property `priority` getter") - .unwrap() } } @@ -270,7 +259,6 @@ impl WebRTCDataChannel { value .get() .expect("Return Value for property `ready-state` getter") - .unwrap() } } diff --git a/gstreamer-webrtc/src/auto/web_rtcdtls_transport.rs b/gstreamer-webrtc/src/auto/web_rtcdtls_transport.rs index 23949eaf3..e3130c50b 100644 --- a/gstreamer-webrtc/src/auto/web_rtcdtls_transport.rs +++ b/gstreamer-webrtc/src/auto/web_rtcdtls_transport.rs @@ -10,6 +10,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -64,7 +65,7 @@ impl WebRTCDTLSTransport { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"certificate\0".as_ptr() as *const _, - glib::Value::from(certificate).to_glib_none().0, + certificate.to_value().to_glib_none().0, ); } } @@ -81,7 +82,6 @@ impl WebRTCDTLSTransport { value .get() .expect("Return Value for property `client` getter") - .unwrap() } } @@ -91,7 +91,7 @@ impl WebRTCDTLSTransport { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"client\0".as_ptr() as *const _, - glib::Value::from(&client).to_glib_none().0, + client.to_value().to_glib_none().0, ); } } @@ -123,7 +123,6 @@ impl WebRTCDTLSTransport { value .get() .expect("Return Value for property `rtcp` getter") - .unwrap() } } @@ -139,7 +138,6 @@ impl WebRTCDTLSTransport { value .get() .expect("Return Value for property `session-id` getter") - .unwrap() } } @@ -156,7 +154,6 @@ impl WebRTCDTLSTransport { value .get() .expect("Return Value for property `state` getter") - .unwrap() } } diff --git a/gstreamer-webrtc/src/auto/web_rtcice_transport.rs b/gstreamer-webrtc/src/auto/web_rtcice_transport.rs index d07b495fb..86c82e0b4 100644 --- a/gstreamer-webrtc/src/auto/web_rtcice_transport.rs +++ b/gstreamer-webrtc/src/auto/web_rtcice_transport.rs @@ -11,6 +11,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -75,7 +76,6 @@ impl WebRTCICETransport { value .get() .expect("Return Value for property `component` getter") - .unwrap() } } @@ -92,7 +92,6 @@ impl WebRTCICETransport { value .get() .expect("Return Value for property `gathering-state` getter") - .unwrap() } } @@ -109,7 +108,6 @@ impl WebRTCICETransport { value .get() .expect("Return Value for property `state` getter") - .unwrap() } } diff --git a/gstreamer-webrtc/src/auto/web_rtcrtp_transceiver.rs b/gstreamer-webrtc/src/auto/web_rtcrtp_transceiver.rs index 864e101b6..5ac8640e8 100644 --- a/gstreamer-webrtc/src/auto/web_rtcrtp_transceiver.rs +++ b/gstreamer-webrtc/src/auto/web_rtcrtp_transceiver.rs @@ -17,6 +17,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] use std::boxed::Box as Box_; @@ -49,7 +50,6 @@ impl WebRTCRTPTransceiver { value .get() .expect("Return Value for property `direction` getter") - .unwrap() } } @@ -61,7 +61,7 @@ impl WebRTCRTPTransceiver { glib::gobject_ffi::g_object_set_property( self.as_ptr() as *mut glib::gobject_ffi::GObject, b"direction\0".as_ptr() as *const _, - glib::Value::from(&direction).to_glib_none().0, + direction.to_value().to_glib_none().0, ); } } @@ -78,7 +78,6 @@ impl WebRTCRTPTransceiver { value .get() .expect("Return Value for property `mlineindex` getter") - .unwrap() } } diff --git a/gstreamer-webrtc/sys/build.rs b/gstreamer-webrtc/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer-webrtc/sys/build.rs +++ b/gstreamer-webrtc/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-webrtc/sys/src/lib.rs b/gstreamer-webrtc/sys/src/lib.rs index dbad32e10..7f51f0bf2 100644 --- a/gstreamer-webrtc/sys/src/lib.rs +++ b/gstreamer-webrtc/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-webrtc/sys/tests/abi.rs b/gstreamer-webrtc/sys/tests/abi.rs index 0e9c62774..3243beecf 100644 --- a/gstreamer-webrtc/sys/tests/abi.rs +++ b/gstreamer-webrtc/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-webrtc/sys/tests/constant.c b/gstreamer-webrtc/sys/tests/constant.c index b74e36e17..0d08917e1 100644 --- a/gstreamer-webrtc/sys/tests/constant.c +++ b/gstreamer-webrtc/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer-webrtc/sys/tests/layout.c b/gstreamer-webrtc/sys/tests/layout.c index 493a6f619..91bdfb8d5 100644 --- a/gstreamer-webrtc/sys/tests/layout.c +++ b/gstreamer-webrtc/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer/src/auto/bin.rs b/gstreamer/src/auto/bin.rs index 4bee7aa68..fbb2ce8d6 100644 --- a/gstreamer/src/auto/bin.rs +++ b/gstreamer/src/auto/bin.rs @@ -17,6 +17,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -298,7 +299,6 @@ impl> GstBinExt for O { value .get() .expect("Return Value for property `async-handling` getter") - .unwrap() } } @@ -307,7 +307,7 @@ impl> GstBinExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"async-handling\0".as_ptr() as *const _, - glib::Value::from(&async_handling).to_glib_none().0, + async_handling.to_value().to_glib_none().0, ); } } @@ -323,7 +323,6 @@ impl> GstBinExt for O { value .get() .expect("Return Value for property `message-forward` getter") - .unwrap() } } @@ -332,7 +331,7 @@ impl> GstBinExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"message-forward\0".as_ptr() as *const _, - glib::Value::from(&message_forward).to_glib_none().0, + message_forward.to_value().to_glib_none().0, ); } } diff --git a/gstreamer/src/auto/clock.rs b/gstreamer/src/auto/clock.rs index 900c9ead2..088d887e8 100644 --- a/gstreamer/src/auto/clock.rs +++ b/gstreamer/src/auto/clock.rs @@ -11,6 +11,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem; use std::mem::transmute; @@ -405,7 +406,6 @@ impl> ClockExt for O { value .get() .expect("Return Value for property `window-size` getter") - .unwrap() } } @@ -414,7 +414,7 @@ impl> ClockExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"window-size\0".as_ptr() as *const _, - glib::Value::from(&window_size).to_glib_none().0, + window_size.to_value().to_glib_none().0, ); } } @@ -430,7 +430,6 @@ impl> ClockExt for O { value .get() .expect("Return Value for property `window-threshold` getter") - .unwrap() } } @@ -439,7 +438,7 @@ impl> ClockExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"window-threshold\0".as_ptr() as *const _, - glib::Value::from(&window_threshold).to_glib_none().0, + window_threshold.to_value().to_glib_none().0, ); } } diff --git a/gstreamer/src/auto/control_binding.rs b/gstreamer/src/auto/control_binding.rs index 813237d59..6720960d1 100644 --- a/gstreamer/src/auto/control_binding.rs +++ b/gstreamer/src/auto/control_binding.rs @@ -8,6 +8,7 @@ use crate::Object; use glib::object::IsA; use glib::translate::*; use glib::StaticType; +use glib::ToValue; glib::wrapper! { pub struct ControlBinding(Object) @extends Object; diff --git a/gstreamer/src/auto/device_monitor.rs b/gstreamer/src/auto/device_monitor.rs index d05889e24..297981a90 100644 --- a/gstreamer/src/auto/device_monitor.rs +++ b/gstreamer/src/auto/device_monitor.rs @@ -12,6 +12,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -130,7 +131,6 @@ impl> DeviceMonitorExt for O { value .get() .expect("Return Value for property `show-all` getter") - .unwrap() } } @@ -139,7 +139,7 @@ impl> DeviceMonitorExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"show-all\0".as_ptr() as *const _, - glib::Value::from(&show_all).to_glib_none().0, + show_all.to_value().to_glib_none().0, ); } } diff --git a/gstreamer/src/auto/enums.rs b/gstreamer/src/auto/enums.rs index 432b82e05..8b842b2c0 100644 --- a/gstreamer/src/auto/enums.rs +++ b/gstreamer/src/auto/enums.rs @@ -7,8 +7,7 @@ use crate::EventTypeFlags; use glib::error::ErrorDomain; use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::Quark; use glib::StaticType; use glib::Type; @@ -66,21 +65,30 @@ impl StaticType for BufferingMode { } } -impl<'a> FromValueOptional<'a> for BufferingMode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for BufferingMode { + type Type = Self; } -impl<'a> FromValue<'a> for BufferingMode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for BufferingMode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for BufferingMode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for BufferingMode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -131,21 +139,30 @@ impl StaticType for BusSyncReply { } } -impl<'a> FromValueOptional<'a> for BusSyncReply { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for BusSyncReply { + type Type = Self; } -impl<'a> FromValue<'a> for BusSyncReply { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for BusSyncReply { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for BusSyncReply { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for BusSyncReply { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -192,21 +209,30 @@ impl StaticType for CapsIntersectMode { } } -impl<'a> FromValueOptional<'a> for CapsIntersectMode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for CapsIntersectMode { + type Type = Self; } -impl<'a> FromValue<'a> for CapsIntersectMode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for CapsIntersectMode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for CapsIntersectMode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for CapsIntersectMode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -253,21 +279,30 @@ impl StaticType for ClockEntryType { } } -impl<'a> FromValueOptional<'a> for ClockEntryType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for ClockEntryType { + type Type = Self; } -impl<'a> FromValue<'a> for ClockEntryType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for ClockEntryType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for ClockEntryType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for ClockEntryType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -339,21 +374,30 @@ impl StaticType for ClockReturn { } } -impl<'a> FromValueOptional<'a> for ClockReturn { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for ClockReturn { + type Type = Self; } -impl<'a> FromValue<'a> for ClockReturn { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for ClockReturn { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for ClockReturn { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for ClockReturn { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -412,21 +456,30 @@ impl StaticType for ClockType { } } -impl<'a> FromValueOptional<'a> for ClockType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for ClockType { + type Type = Self; } -impl<'a> FromValue<'a> for ClockType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for ClockType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for ClockType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for ClockType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -559,21 +612,30 @@ impl StaticType for CoreError { } } -impl<'a> FromValueOptional<'a> for CoreError { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for CoreError { + type Type = Self; } -impl<'a> FromValue<'a> for CoreError { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for CoreError { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for CoreError { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for CoreError { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -673,21 +735,30 @@ impl StaticType for DebugLevel { } } -impl<'a> FromValueOptional<'a> for DebugLevel { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for DebugLevel { + type Type = Self; } -impl<'a> FromValue<'a> for DebugLevel { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for DebugLevel { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for DebugLevel { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for DebugLevel { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -903,21 +974,30 @@ impl StaticType for EventType { } } -impl<'a> FromValueOptional<'a> for EventType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for EventType { + type Type = Self; } -impl<'a> FromValue<'a> for EventType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for EventType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for EventType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for EventType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1009,21 +1089,30 @@ impl StaticType for FlowReturn { } } -impl<'a> FromValueOptional<'a> for FlowReturn { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for FlowReturn { + type Type = Self; } -impl<'a> FromValue<'a> for FlowReturn { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for FlowReturn { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for FlowReturn { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for FlowReturn { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1117,21 +1206,30 @@ impl StaticType for Format { } } -impl<'a> FromValueOptional<'a> for Format { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for Format { + type Type = Self; } -impl<'a> FromValue<'a> for Format { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for Format { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for Format { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for Format { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1224,21 +1322,30 @@ impl StaticType for LibraryError { } } -impl<'a> FromValueOptional<'a> for LibraryError { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for LibraryError { + type Type = Self; } -impl<'a> FromValue<'a> for LibraryError { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for LibraryError { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for LibraryError { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for LibraryError { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1289,21 +1396,30 @@ impl StaticType for PadDirection { } } -impl<'a> FromValueOptional<'a> for PadDirection { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for PadDirection { + type Type = Self; } -impl<'a> FromValue<'a> for PadDirection { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for PadDirection { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for PadDirection { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for PadDirection { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1371,21 +1487,30 @@ impl StaticType for PadLinkReturn { } } -impl<'a> FromValueOptional<'a> for PadLinkReturn { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for PadLinkReturn { + type Type = Self; } -impl<'a> FromValue<'a> for PadLinkReturn { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for PadLinkReturn { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for PadLinkReturn { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for PadLinkReturn { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1457,21 +1582,30 @@ impl StaticType for PadMode { } } -impl<'a> FromValueOptional<'a> for PadMode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for PadMode { + type Type = Self; } -impl<'a> FromValue<'a> for PadMode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for PadMode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for PadMode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for PadMode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1522,21 +1656,30 @@ impl StaticType for PadPresence { } } -impl<'a> FromValueOptional<'a> for PadPresence { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for PadPresence { + type Type = Self; } -impl<'a> FromValue<'a> for PadPresence { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for PadPresence { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for PadPresence { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for PadPresence { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1595,21 +1738,30 @@ impl StaticType for PadProbeReturn { } } -impl<'a> FromValueOptional<'a> for PadProbeReturn { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for PadProbeReturn { + type Type = Self; } -impl<'a> FromValue<'a> for PadProbeReturn { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for PadProbeReturn { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for PadProbeReturn { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for PadProbeReturn { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1707,21 +1859,30 @@ impl StaticType for ParseError { } } -impl<'a> FromValueOptional<'a> for ParseError { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for ParseError { + type Type = Self; } -impl<'a> FromValue<'a> for ParseError { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for ParseError { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for ParseError { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for ParseError { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1794,21 +1955,30 @@ impl StaticType for PluginError { } } -impl<'a> FromValueOptional<'a> for PluginError { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for PluginError { + type Type = Self; } -impl<'a> FromValue<'a> for PluginError { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for PluginError { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for PluginError { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for PluginError { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1867,21 +2037,30 @@ impl StaticType for ProgressType { } } -impl<'a> FromValueOptional<'a> for ProgressType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for ProgressType { + type Type = Self; } -impl<'a> FromValue<'a> for ProgressType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for ProgressType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for ProgressType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for ProgressType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1946,25 +2125,34 @@ impl StaticType for PromiseResult { #[cfg(any(feature = "v1_14", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] -impl<'a> FromValueOptional<'a> for PromiseResult { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for PromiseResult { + type Type = Self; } #[cfg(any(feature = "v1_14", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] -impl<'a> FromValue<'a> for PromiseResult { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for PromiseResult { + type Checker = glib::value::GenericValueTypeChecker; + + 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(any(feature = "v1_14", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] -impl SetValue for PromiseResult { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for PromiseResult { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -2015,21 +2203,30 @@ impl StaticType for QOSType { } } -impl<'a> FromValueOptional<'a> for QOSType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for QOSType { + type Type = Self; } -impl<'a> FromValue<'a> for QOSType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for QOSType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for QOSType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for QOSType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -2084,21 +2281,30 @@ impl StaticType for Rank { } } -impl<'a> FromValueOptional<'a> for Rank { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for Rank { + type Type = Self; } -impl<'a> FromValue<'a> for Rank { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for Rank { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for Rank { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for Rank { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -2236,21 +2442,30 @@ impl StaticType for ResourceError { } } -impl<'a> FromValueOptional<'a> for ResourceError { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for ResourceError { + type Type = Self; } -impl<'a> FromValue<'a> for ResourceError { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for ResourceError { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for ResourceError { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for ResourceError { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -2301,21 +2516,30 @@ impl StaticType for SeekType { } } -impl<'a> FromValueOptional<'a> for SeekType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for SeekType { + type Type = Self; } -impl<'a> FromValue<'a> for SeekType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for SeekType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for SeekType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for SeekType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -2374,21 +2598,30 @@ impl StaticType for State { } } -impl<'a> FromValueOptional<'a> for State { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for State { + type Type = Self; } -impl<'a> FromValue<'a> for State { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for State { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for State { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for State { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -2474,21 +2707,30 @@ impl StaticType for StateChange { } } -impl<'a> FromValueOptional<'a> for StateChange { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for StateChange { + type Type = Self; } -impl<'a> FromValue<'a> for StateChange { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for StateChange { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for StateChange { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for StateChange { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -2544,21 +2786,30 @@ impl StaticType for StateChangeReturn { } } -impl<'a> FromValueOptional<'a> for StateChangeReturn { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for StateChangeReturn { + type Type = Self; } -impl<'a> FromValue<'a> for StateChangeReturn { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for StateChangeReturn { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for StateChangeReturn { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for StateChangeReturn { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -2686,21 +2937,30 @@ impl StaticType for StreamError { } } -impl<'a> FromValueOptional<'a> for StreamError { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for StreamError { + type Type = Self; } -impl<'a> FromValue<'a> for StreamError { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for StreamError { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for StreamError { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for StreamError { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -2767,21 +3027,30 @@ impl StaticType for StreamStatusType { } } -impl<'a> FromValueOptional<'a> for StreamStatusType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for StreamStatusType { + type Type = Self; } -impl<'a> FromValue<'a> for StreamStatusType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for StreamStatusType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for StreamStatusType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for StreamStatusType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -2828,21 +3097,30 @@ impl StaticType for StructureChangeType { } } -impl<'a> FromValueOptional<'a> for StructureChangeType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for StructureChangeType { + type Type = Self; } -impl<'a> FromValue<'a> for StructureChangeType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for StructureChangeType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for StructureChangeType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for StructureChangeType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -2901,21 +3179,30 @@ impl StaticType for TagFlag { } } -impl<'a> FromValueOptional<'a> for TagFlag { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for TagFlag { + type Type = Self; } -impl<'a> FromValue<'a> for TagFlag { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for TagFlag { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for TagFlag { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for TagFlag { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -2986,21 +3273,30 @@ impl StaticType for TagMergeMode { } } -impl<'a> FromValueOptional<'a> for TagMergeMode { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for TagMergeMode { + type Type = Self; } -impl<'a> FromValue<'a> for TagMergeMode { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for TagMergeMode { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for TagMergeMode { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for TagMergeMode { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -3048,21 +3344,30 @@ impl StaticType for TagScope { } } -impl<'a> FromValueOptional<'a> for TagScope { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for TagScope { + type Type = Self; } -impl<'a> FromValue<'a> for TagScope { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for TagScope { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for TagScope { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for TagScope { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -3113,21 +3418,30 @@ impl StaticType for TaskState { } } -impl<'a> FromValueOptional<'a> for TaskState { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for TaskState { + type Type = Self; } -impl<'a> FromValue<'a> for TaskState { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for TaskState { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for TaskState { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for TaskState { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -3209,21 +3523,30 @@ impl StaticType for TocEntryType { } } -impl<'a> FromValueOptional<'a> for TocEntryType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for TocEntryType { + type Type = Self; } -impl<'a> FromValue<'a> for TocEntryType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for TocEntryType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for TocEntryType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for TocEntryType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -3279,21 +3602,30 @@ impl StaticType for TocLoopType { } } -impl<'a> FromValueOptional<'a> for TocLoopType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for TocLoopType { + type Type = Self; } -impl<'a> FromValue<'a> for TocLoopType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for TocLoopType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for TocLoopType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for TocLoopType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -3341,21 +3673,30 @@ impl StaticType for TocScope { } } -impl<'a> FromValueOptional<'a> for TocScope { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for TocScope { + type Type = Self; } -impl<'a> FromValue<'a> for TocScope { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for TocScope { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for TocScope { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for TocScope { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -3418,21 +3759,30 @@ impl StaticType for TypeFindProbability { } } -impl<'a> FromValueOptional<'a> for TypeFindProbability { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for TypeFindProbability { + type Type = Self; } -impl<'a> FromValue<'a> for TypeFindProbability { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for TypeFindProbability { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for TypeFindProbability { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for TypeFindProbability { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -3510,21 +3860,30 @@ impl StaticType for URIError { } } -impl<'a> FromValueOptional<'a> for URIError { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for URIError { + type Type = Self; } -impl<'a> FromValue<'a> for URIError { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for URIError { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for URIError { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for URIError { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -3575,20 +3934,29 @@ impl StaticType for URIType { } } -impl<'a> FromValueOptional<'a> for URIType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for URIType { + type Type = Self; } -impl<'a> FromValue<'a> for URIType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for URIType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for URIType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for URIType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer/src/auto/flags.rs b/gstreamer/src/auto/flags.rs index 687566bf1..fb0249bd0 100644 --- a/gstreamer/src/auto/flags.rs +++ b/gstreamer/src/auto/flags.rs @@ -6,8 +6,7 @@ use bitflags::bitflags; use glib::translate::*; use glib::value::FromValue; -use glib::value::FromValueOptional; -use glib::value::SetValue; +use glib::value::ToValue; use glib::StaticType; use glib::Type; #[cfg(any(feature = "v1_10", feature = "dox"))] @@ -49,21 +48,30 @@ impl StaticType for BinFlags { } } -impl<'a> FromValueOptional<'a> for BinFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for BinFlags { + type Type = Self; } -impl<'a> FromValue<'a> for BinFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for BinFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for BinFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for BinFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -101,21 +109,30 @@ impl StaticType for BufferCopyFlags { } } -impl<'a> FromValueOptional<'a> for BufferCopyFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for BufferCopyFlags { + type Type = Self; } -impl<'a> FromValue<'a> for BufferCopyFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for BufferCopyFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for BufferCopyFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for BufferCopyFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -163,21 +180,30 @@ impl StaticType for BufferFlags { } } -impl<'a> FromValueOptional<'a> for BufferFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for BufferFlags { + type Type = Self; } -impl<'a> FromValue<'a> for BufferFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for BufferFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for BufferFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for BufferFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -212,21 +238,30 @@ impl StaticType for BufferPoolAcquireFlags { } } -impl<'a> FromValueOptional<'a> for BufferPoolAcquireFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for BufferPoolAcquireFlags { + type Type = Self; } -impl<'a> FromValue<'a> for BufferPoolAcquireFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for BufferPoolAcquireFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for BufferPoolAcquireFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for BufferPoolAcquireFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -265,21 +300,30 @@ impl StaticType for ClockFlags { } } -impl<'a> FromValueOptional<'a> for ClockFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for ClockFlags { + type Type = Self; } -impl<'a> FromValue<'a> for ClockFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for ClockFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for ClockFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for ClockFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -329,21 +373,30 @@ impl StaticType for DebugColorFlags { } } -impl<'a> FromValueOptional<'a> for DebugColorFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for DebugColorFlags { + type Type = Self; } -impl<'a> FromValue<'a> for DebugColorFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for DebugColorFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for DebugColorFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for DebugColorFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -382,21 +435,30 @@ impl StaticType for DebugGraphDetails { } } -impl<'a> FromValueOptional<'a> for DebugGraphDetails { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for DebugGraphDetails { + type Type = Self; } -impl<'a> FromValue<'a> for DebugGraphDetails { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for DebugGraphDetails { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for DebugGraphDetails { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for DebugGraphDetails { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -434,21 +496,30 @@ impl StaticType for ElementFlags { } } -impl<'a> FromValueOptional<'a> for ElementFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for ElementFlags { + type Type = Self; } -impl<'a> FromValue<'a> for ElementFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for ElementFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for ElementFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for ElementFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -485,21 +556,30 @@ impl StaticType for EventTypeFlags { } } -impl<'a> FromValueOptional<'a> for EventTypeFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for EventTypeFlags { + type Type = Self; } -impl<'a> FromValue<'a> for EventTypeFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for EventTypeFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for EventTypeFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for EventTypeFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -537,21 +617,30 @@ impl StaticType for MemoryFlags { } } -impl<'a> FromValueOptional<'a> for MemoryFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for MemoryFlags { + type Type = Self; } -impl<'a> FromValue<'a> for MemoryFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for MemoryFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for MemoryFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for MemoryFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -586,21 +675,30 @@ impl StaticType for ObjectFlags { } } -impl<'a> FromValueOptional<'a> for ObjectFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for ObjectFlags { + type Type = Self; } -impl<'a> FromValue<'a> for ObjectFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for ObjectFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for ObjectFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for ObjectFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -645,21 +743,30 @@ impl StaticType for PadFlags { } } -impl<'a> FromValueOptional<'a> for PadFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for PadFlags { + type Type = Self; } -impl<'a> FromValue<'a> for PadFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for PadFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for PadFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for PadFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -696,21 +803,30 @@ impl StaticType for PadLinkCheck { } } -impl<'a> FromValueOptional<'a> for PadLinkCheck { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for PadLinkCheck { + type Type = Self; } -impl<'a> FromValue<'a> for PadLinkCheck { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for PadLinkCheck { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for PadLinkCheck { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for PadLinkCheck { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -763,21 +879,30 @@ impl StaticType for PadProbeType { } } -impl<'a> FromValueOptional<'a> for PadProbeType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for PadProbeType { + type Type = Self; } -impl<'a> FromValue<'a> for PadProbeType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for PadProbeType { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for PadProbeType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for PadProbeType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -814,21 +939,30 @@ impl StaticType for ParseFlags { } } -impl<'a> FromValueOptional<'a> for ParseFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for ParseFlags { + type Type = Self; } -impl<'a> FromValue<'a> for ParseFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for ParseFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for ParseFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for ParseFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -861,21 +995,30 @@ impl StaticType for PipelineFlags { } } -impl<'a> FromValueOptional<'a> for PipelineFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for PipelineFlags { + type Type = Self; } -impl<'a> FromValue<'a> for PipelineFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for PipelineFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for PipelineFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for PipelineFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -918,25 +1061,34 @@ impl StaticType for PluginAPIFlags { #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -impl<'a> FromValueOptional<'a> for PluginAPIFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for PluginAPIFlags { + type Type = Self; } #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -impl<'a> FromValue<'a> for PluginAPIFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for PluginAPIFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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)) } } #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -impl SetValue for PluginAPIFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for PluginAPIFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -973,21 +1125,30 @@ impl StaticType for PluginDependencyFlags { } } -impl<'a> FromValueOptional<'a> for PluginDependencyFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for PluginDependencyFlags { + type Type = Self; } -impl<'a> FromValue<'a> for PluginDependencyFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for PluginDependencyFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for PluginDependencyFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for PluginDependencyFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1021,21 +1182,30 @@ impl StaticType for PluginFlags { } } -impl<'a> FromValueOptional<'a> for PluginFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for PluginFlags { + type Type = Self; } -impl<'a> FromValue<'a> for PluginFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for PluginFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for PluginFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for PluginFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1070,21 +1240,30 @@ impl StaticType for SchedulingFlags { } } -impl<'a> FromValueOptional<'a> for SchedulingFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for SchedulingFlags { + type Type = Self; } -impl<'a> FromValue<'a> for SchedulingFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for SchedulingFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for SchedulingFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for SchedulingFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1133,21 +1312,30 @@ impl StaticType for SeekFlags { } } -impl<'a> FromValueOptional<'a> for SeekFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for SeekFlags { + type Type = Self; } -impl<'a> FromValue<'a> for SeekFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for SeekFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for SeekFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for SeekFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1189,21 +1377,30 @@ impl StaticType for SegmentFlags { } } -impl<'a> FromValueOptional<'a> for SegmentFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for SegmentFlags { + type Type = Self; } -impl<'a> FromValue<'a> for SegmentFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for SegmentFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for SegmentFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for SegmentFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1246,25 +1443,34 @@ impl StaticType for StackTraceFlags { #[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] -impl<'a> FromValueOptional<'a> for StackTraceFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for StackTraceFlags { + type Type = Self; } #[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] -impl<'a> FromValue<'a> for StackTraceFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for StackTraceFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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)) } } #[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] -impl SetValue for StackTraceFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for StackTraceFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1299,21 +1505,30 @@ impl StaticType for StreamFlags { } } -impl<'a> FromValueOptional<'a> for StreamFlags { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for StreamFlags { + type Type = Self; } -impl<'a> FromValue<'a> for StreamFlags { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for StreamFlags { + type Checker = glib::value::GenericValueTypeChecker; + + 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 SetValue for StreamFlags { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for StreamFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } @@ -1385,24 +1600,33 @@ impl StaticType for StreamType { #[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] -impl<'a> FromValueOptional<'a> for StreamType { - unsafe fn from_value_optional(value: &glib::Value) -> Option { - Some(FromValue::from_value(value)) - } +impl glib::value::ValueType for StreamType { + type Type = Self; } #[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] -impl<'a> FromValue<'a> for StreamType { - unsafe fn from_value(value: &glib::Value) -> Self { +unsafe impl<'a> FromValue<'a> for StreamType { + type Checker = glib::value::GenericValueTypeChecker; + + 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)) } } #[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] -impl SetValue for StreamType { - unsafe fn set_value(value: &mut glib::Value, this: &Self) { - glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) +impl ToValue for StreamType { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.to_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() } } diff --git a/gstreamer/src/auto/pad.rs b/gstreamer/src/auto/pad.rs index 55ae97bf1..6589721b8 100644 --- a/gstreamer/src/auto/pad.rs +++ b/gstreamer/src/auto/pad.rs @@ -26,6 +26,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; diff --git a/gstreamer/src/auto/pad_template.rs b/gstreamer/src/auto/pad_template.rs index c58962cc7..35ec03dbb 100644 --- a/gstreamer/src/auto/pad_template.rs +++ b/gstreamer/src/auto/pad_template.rs @@ -14,6 +14,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -115,7 +116,6 @@ impl PadTemplate { value .get() .expect("Return Value for property `direction` getter") - .unwrap() } } @@ -134,7 +134,6 @@ impl PadTemplate { value .get() .expect("Return Value for property `gtype` getter") - .unwrap() } } @@ -165,7 +164,6 @@ impl PadTemplate { value .get() .expect("Return Value for property `presence` getter") - .unwrap() } } diff --git a/gstreamer/src/auto/system_clock.rs b/gstreamer/src/auto/system_clock.rs index 322feee51..7d60724ae 100644 --- a/gstreamer/src/auto/system_clock.rs +++ b/gstreamer/src/auto/system_clock.rs @@ -12,6 +12,7 @@ use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; +use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; @@ -69,7 +70,6 @@ impl> SystemClockExt for O { value .get() .expect("Return Value for property `clock-type` getter") - .unwrap() } } @@ -78,7 +78,7 @@ impl> SystemClockExt for O { glib::gobject_ffi::g_object_set_property( self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"clock-type\0".as_ptr() as *const _, - glib::Value::from(&clock_type).to_glib_none().0, + clock_type.to_value().to_glib_none().0, ); } } diff --git a/gstreamer/src/auto/versions.txt b/gstreamer/src/auto/versions.txt index cb68ef35f..a08888cb1 100644 --- a/gstreamer/src/auto/versions.txt +++ b/gstreamer/src/auto/versions.txt @@ -1,3 +1,3 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) diff --git a/gstreamer/sys/build.rs b/gstreamer/sys/build.rs index 4a1611df2..7831eedbf 100644 --- a/gstreamer/sys/build.rs +++ b/gstreamer/sys/build.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer/sys/src/lib.rs b/gstreamer/sys/src/lib.rs index c4d219fe7..f2677808b 100644 --- a/gstreamer/sys/src/lib.rs +++ b/gstreamer/sys/src/lib.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer/sys/tests/abi.rs b/gstreamer/sys/tests/abi.rs index 3e1f21a36..fa94c103a 100644 --- a/gstreamer/sys/tests/abi.rs +++ b/gstreamer/sys/tests/abi.rs @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer/sys/tests/constant.c b/gstreamer/sys/tests/constant.c index 38858758c..2266197f9 100644 --- a/gstreamer/sys/tests/constant.c +++ b/gstreamer/sys/tests/constant.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT diff --git a/gstreamer/sys/tests/layout.c b/gstreamer/sys/tests/layout.c index bac32c38f..43de0cdae 100644 --- a/gstreamer/sys/tests/layout.c +++ b/gstreamer/sys/tests/layout.c @@ -1,4 +1,4 @@ -// Generated by gir (https://github.com/gtk-rs/gir @ a972bd6) +// Generated by gir (https://github.com/gtk-rs/gir @ a01a90f) // from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 208138a) // DO NOT EDIT