Skip to content

gst/format: module directory + ops fixes & additions

This MR introduces a directory module for the format related concepts and shuffles these concepts in subdirectories in order to help with readability and maintenance.

A new module level documentation aims at helping users understand format usage and discover available APIs and operations.

Writing the documentation and checking the generated pages helped me discover shortcomings.

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.

Non-regression on gst-plugins-rs checked in this branch.

Edited by François Laignel

Merge request reports

Loading