Skip to content

ts/pad: slight `Pad{Sink,Src}Handler`s optimizations

This threadshare MR proposes 2 slight optimizations.

Don't pass self as ref in remaining handler traits functions

  • They are either unit types or Clone (in which case they are implemented as pointers).
  • Internally, we already use an owned version, so there's no need to get a reference.
  • It facilitates implementation if the handler must be moved into a closure or a Future.

Use gst::Pad in handlers trait functions instead of the Pad{Src,Sink}Ref wrappers

  • In practice, only the gst::Pad is useful in these functions. Some of these need a Pad{Src,Sink}Ref, but it's the one for the opposite stream direction. In those cases, it is accessed via the element's implementation.
  • It saves a few clones.
  • The implementations usually use the gst::Pad for logging. They no longer need to access it via pad.gst_pad().

Merge request reports

Loading