gstreamer: serde: Update for glib::FlagsClass API changes

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1253>
This commit is contained in:
Sebastian Dröge 2023-04-24 09:43:48 +03:00
parent b1577af7cf
commit 0585476687
5 changed files with 7 additions and 7 deletions

View file

@ -12,7 +12,7 @@ macro_rules! bitflags_serialize_impl {
where
S: serde::Serializer,
{
let class = FlagsClass::new(Self::static_type()).unwrap();
let class = FlagsClass::with_type(Self::static_type()).unwrap();
let this = self.to_value();
let mut handled = Self::empty().to_value();
@ -49,7 +49,7 @@ macro_rules! bitflags_serialize_impl {
let mut res = String::new();
static SORTED_VALUES: Lazy<Vec<(u32, String)>> = Lazy::new(|| {
let class = FlagsClass::new(<$type>::static_type()).unwrap();
let class = FlagsClass::with_type(<$type>::static_type()).unwrap();
let mut sorted_values: Vec<(u32, String)> =
class.values().iter()
.map(|f| (f.value(), f.nick().to_owned()))
@ -114,7 +114,7 @@ macro_rules! bitflags_deserialize_impl {
let mut gvalue = unsafe { glib::Value::from_type_unchecked(Self::Value::static_type()) };
let tokens = value.split('+');
let class = FlagsClass::new(Self::Value::static_type()).unwrap();
let class = FlagsClass::with_type(Self::Value::static_type()).unwrap();
for token in tokens {
gvalue = class.set_by_nick(gvalue, token).map_err(|_| {

View file

@ -114,7 +114,7 @@ fn tutorial_main() -> Result<(), Error> {
// Set flags to show Audio and Video but ignore Subtitles
let flags = playbin.property_value("flags");
let flags_class = FlagsClass::new(flags.type_()).unwrap();
let flags_class = FlagsClass::with_type(flags.type_()).unwrap();
let flags = flags_class
.builder_with_value(flags)

View file

@ -119,7 +119,7 @@ fn tutorial_main() -> Result<(), Error> {
// Set flags to show Audio, Video and Subtitles
let flags = playbin.property_value("flags");
let flags_class = FlagsClass::new(flags.type_()).unwrap();
let flags_class = FlagsClass::with_type(flags.type_()).unwrap();
let flags = flags_class
.builder_with_value(flags)

View file

@ -26,7 +26,7 @@ fn tutorial_main() -> Result<(), Error> {
// Set the download flag
let flags = pipeline.property_value("flags");
let flags_class = FlagsClass::new(flags.type_()).unwrap();
let flags_class = FlagsClass::with_type(flags.type_()).unwrap();
let flags = flags_class
.builder_with_value(flags)
.unwrap()

View file

@ -49,7 +49,7 @@ fn tutorial_main() -> Result<(), Error> {
// Set the visualization flag
let flags = pipeline.property_value("flags");
let flags_class = FlagsClass::new(flags.type_()).unwrap();
let flags_class = FlagsClass::with_type(flags.type_()).unwrap();
let flags = flags_class
.builder_with_value(flags)
.unwrap()