Commit graph

17 commits

Author SHA1 Message Date
Guillaume Gomez fb56af8d84 Update from_glib calls and put them in unsafe blocks 2020-12-08 15:50:15 +01:00
Marijn Suijten 2447664df6 Replace Result<(), fmt::Error> with fmt::Result 2020-12-07 12:09:39 +01:00
Sebastian Dröge 9d9522016b gstreamer: Update manual code to 2018 edition 2020-11-22 19:15:20 +02:00
François Laignel ae9d97dfca ClockTime & opt Formats: fix PartialOrd impl, remove Ord and add min & max
- `PartialOrd` was returning `true` for expressions such as
  - `ClockTime::none() < ClockTime::from_seconds(1)`.
  - `ClockTime::from_seconds(1) > ClockTime::none()`.
- Remove `Ord` because `ClockTime` is not a total order due to
  `ClockTime::none()`. See test `not_ord`.

This also applies to others `Format(Option<{u32,u64}>)` types.
2020-10-20 23:40:18 +02:00
François Laignel 9efe39ff81 ClockTime: add staturating_{add,sub} and ops tests 2020-10-20 23:40:18 +02:00
Sebastian Dröge 4778d05238 gstreamer/clock_time: Add From/TryFrom impls to convert between ClockTime and std::time::Duration 2020-10-01 11:00:21 +03:00
Guillaume Gomez c07fe14191 gstreamer*: Add missing init checks 2020-04-12 17:25:54 +03:00
Sebastian Dröge e7898c1b24 Update manual code 2019-04-15 19:19:19 +03:00
Sebastian Dröge 8c39da4e5b Update to Rust 1.31 linter-specific attributes 2019-03-04 15:16:01 +02: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
François Laignel 138a0fb18c ClockTime: serde impl 2018-07-30 23:18:30 +03:00
Sebastian Dröge 694bcaa697 Fix all clippy warnings
Or silence the ones we don't care about.
2018-07-20 10:28:20 +03:00
Sebastian Dröge 298cb754c9 Fix precision handling in ClockTime Display impl 2017-12-10 12:31:41 +02:00
Sebastian Dröge c99928d030 Change FormatValue related API to be more convenient to use
FormatValue is now renamed to GenericFormattedValue and the API slightly
changed. In addition there is now a FormattedValue trait, and a
SpecificFormattedValue trait plus types for Bytes, Buffers and the
existing ClockTime.

This allows to create functions like
  Pad::query_duration<F: SpecificFormattedValue>() -> Option<F>
and doesn't require the caller to unwrap the generic value anymore,
which is completely unneeded in these cases.

In addition, Segment became FormattedSegment<T> with API to
upcast/downcast between the specific formatted values and the generic
formatted value. This greatly simplifies usage of Segments.
2017-12-09 19:45:18 +02:00
Sebastian Dröge e6da3554ee Use ClockTime for the Duration tag
And implement the Value traits for ClockTime
2017-12-05 22:54:03 +02:00
Sebastian Dröge d5b2f5900c Add API for converting ClockTime to/from mseconds, useconds, nseconds 2017-11-11 12:44:58 +01:00
Sebastian Dröge c39c0c7264 Implement ClockTime as ClockTime(Option<u64>)
And also implement a FormatValue type that holds a value together with
its format to make usage of the positions/durations/seek positions/etc
more convenient and safe.

Fixes https://github.com/sdroege/gstreamer-rs/issues/3
2017-11-11 11:57:29 +01:00