Commit graph

39 commits

Author SHA1 Message Date
Sebastian Dröge f24b38470b Fix various new clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1203>
2023-01-25 10:18:33 +02:00
Sebastian Dröge 567ce0a3bf Group and merge imports in all manual code
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1182>
2023-01-04 13:25:17 +02:00
Sebastian Dröge b28664ccbd gstreamer: Fix serde serialization tests
ron serialization is now writing `1.0` instead of just `1`.
2022-06-24 11:13:06 +03:00
Vivienne Watermeier 1b22be2e15 Add De/Serialization for most bitflag types
Represents combinations of flags with a '+' separated string of nicks,
or an empty string for no flags set.

Note that most flag types will ignore any flags using multiple bits when
serializing, since in most cases these flags cover all used bits.
2022-05-06 09:05:52 +00:00
Sebastian Dröge 21d38e41d6 gstreamer: Rename DateTime constructors to replace the new_ prefix with from_ 2021-11-20 12:20:25 +02:00
Sebastian Dröge 3b28bccf03 Update for GLib constructor renames
See https://github.com/gtk-rs/gtk-rs-core/pull/384
2021-11-20 12:20:17 +02:00
Sebastian Dröge cc76442601 gstreamer: Update ron dev-dependency to 0.7 2021-10-23 10:40:24 +03:00
Guillaume Gomez e2264a3f3f Fix (new) clippy warnings 2021-08-03 10:08:32 +02:00
François Laignel 90bb458e64 Rework ClockTime & FormattedValues 2021-06-04 22:09:38 +02:00
Sebastian Dröge eda1d3d4a7 Update for Value trait refactoring 2021-04-25 14:45:08 +03:00
François Laignel 6ab9164dca fix-getters-calls 0.3.0 pass 2021-04-20 18:18:02 +02:00
François Laignel 53be8e5f58 fix-getters-{def,calls} pass 2021-04-13 17:54:40 +02:00
Sebastian Dröge a316d610eb gstreamer: Update for glib::Type API changes 2021-02-25 12:49:47 +02:00
Marijn Suijten 7ed20090d1 Fix clippy::field_reassign_with_defaults instead of ignoring it
Fixes: fc2d7fc4 ("ci: Add some more ignored lints to the clippy configuration")
2021-01-08 11:01:02 +01:00
Sebastian Dröge 03f928ee0c gstreamer/serde: Update for glib::Date API changes 2020-12-23 10:31:49 +02:00
Guillaume Gomez ff5a36561a Fix license header situation 2020-12-15 11:53:31 +01:00
Sebastian Dröge 9d9522016b gstreamer: Update manual code to 2018 edition 2020-11-22 19:15:20 +02:00
Sebastian Dröge ba719ac90c Update for glib changes in glib::Value handling 2020-10-20 13:50:35 +00:00
Sebastian Dröge 947ac8db5c Name functions returning a builder builder(), not new()
And also make the video event API more consistent with the normal event
API.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/269
2020-06-25 19:42:33 +03:00
Guillaume Gomez c07fe14191 gstreamer*: Add missing init checks 2020-04-12 17:25:54 +03:00
Sebastian Dröge 7dd0404927 gstreamer/datetime: new_from_g_date_time() can actually return NULL
See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/411
2020-03-22 14:01:32 +02:00
Sebastian Dröge 69be1ce2fc Fix various new clippy warnings from 1.40 2019-12-22 12:10:27 +02:00
Sebastian Dröge 8dcf3fec20 gstreamer: Change Sample constructor to the builder pattern
Simplifies construction of Samples considerably.
2019-10-23 09:55:56 +03:00
François Laignel 1367becfaf DateTime: manual impl for PartialOrd, PartialEq and Debug
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/217
2019-08-21 12:34:15 +02:00
François Laignel ced522ed08 Implement ser / de for Date Values, Structure fields and Tags 2019-08-19 15:51:42 +02:00
François Laignel c74eef374a Fix serde for Values with optional Types
Attention: these changes induce breaking changes for the serde
representation of some types.

Serialization of `Value`s used to rely on the `get` function
followed by an `unwrap`. This means that optional types couldn't
be serialized when they were `None`.

This commit distinguishes between the optional `Value` `Types` and
the ones that always return some value.

The `Value`s, `Structure` fields and `Tag`s with following types are
now represented as `Option`s:

- `Buffer`
- `DateTime`
- `Sample` (note: this type is used for `Tag` images)
- `String` (except for `Tag`s - see the comment in `tags_serde.rs`).

The representations for these `Type`s remain unchanged when they are
used in-place (not as part of a `Value`).

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/215
2019-08-19 15:34:24 +02:00
Sebastian Dröge e7898c1b24 Update manual code 2019-04-15 19:19:19 +03:00
François Laignel 9a01bd6202 TagList: handle scope in serde
These changes break compatibility for the serde representations of
`TagList` and `Toc`. Previous representation for the `TagList` was
a sequence. We now have to rely on a struct representation in order
to add `scope`.
2019-03-20 13:58:28 +00:00
Sebastian Dröge 005f436631 Buffer::from_slice() / from_mut_slice() can't possibly return None 2018-12-26 12:13:23 +01:00
Sebastian Dröge 6325e0fcce Fix build with ser_de feature enabled 2018-10-28 17:48:42 +00:00
Sebastian Dröge 9f8ec3b35b Rename TagList::iter_tag_list() to TagList::iter_generic() and ::iter_tag_list_simple() to ::iter()
It's the generic iterator for going over values, and the simple one is
the one you usually want.

Also rename iterator types, but those are internal anyway.
2018-10-28 17:30:25 +00:00
Sebastian Dröge fa29872863 Fix various clippy warnings in the serde code 2018-10-11 11:58:01 +03:00
Sebastian Dröge eb0a804a50 Run everything through latest rustfmt 2018-10-08 15:02:23 +03:00
François Laignel 3ed7257da9 DateTime: serde: use an enum 2018-07-30 23:18:30 +03:00
François Laignel 9fd5392a16 value: serde: use stringify for types 2018-07-30 23:18:30 +03:00
François Laignel 6bda3ef174 serde: add roundtrip tests
This allows making sure serialization and deserialization are in sync for
types with asymetrical implementations.
2018-07-30 23:18:30 +03:00
François Laignel ab9cd29bd6 serde: fmt pass
Note: clippy didn't raise any warning
2018-07-30 23:18:30 +03:00
François Laignel 23307a4795 Tags: ser/de: gather tags with the same name together 2018-07-30 23:18:30 +03:00
François Laignel 90b046fbcf serde: separate serde impl and tests from base module
+ fix erroneous `datetime` instead of `buffer` in `BufferRef::serialize`
+ remove ser/de for `Value`s with types `ULong` & `ILong`
2018-07-30 23:18:30 +03:00