Commit graph

6 commits

Author SHA1 Message Date
Guillaume Desmottes e75391139c fix typos in comments
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1246>
2023-04-07 17:09:48 +02:00
Sebastian Dröge f235dc987d Inline various trivial functions
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1177>
2023-01-11 11:33:54 +02:00
Edward Hervey 77fd187986 format: Add Signed<T> <=> signed integer conversions
Co-authored-by: Sebastian Dröge <sebastian@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1149>
2022-11-16 16:32:24 +02:00
François Laignel 04b6710f84 format/Other: use u64 internally instead of i64 2022-10-09 20:00:38 +02:00
François Laignel 57d8d46ab6 gst/format: fix some ops and add others
Some operations were implemented on types that wouldn't result in
the expected physical unit. E.g.:

- `ClockTime / ClockTime` results in a unit-less factor.
- `u64 / ClockTime` would result in a `1 / ClockTime`. Since we don't
  use any `Frequency` type, this operation is removed. Users should
  use the `ClockTime` accessors to compute the expected value.

This commit also adds:

- multiplications with integers as the left hand side operands.
- `Partial{Eq,Ord} for `Signed<T>` with `T` as left hand side operand.
- `opt_add` / `opt_sub` for `Signed<T>` with `T` as left or right hand
   side operands.
- missing tests for `Partial{Eq,Ord}` and `OptionOrd`.

This implementation can interfere with unrelated code and was removed:

- `Signed<usize>.` `PartialOrd` makes existing code computing the len
  of slices needing type annotation because the len is later used in
  a comparison for which the compiler is unable to determine if
  the len is `Signed<usize>` or `usize`.
2022-10-01 13:15:11 +02:00
François Laignel eb4d997f0a gst/format: shuffle types and traits 2022-10-01 00:49:42 +02:00