Skip to main content

Module pad

Module pad 

Source
Expand description

An implementation of Pads to run asynchronous processings.

PadSink & PadSrc provide an asynchronous API to ease the development of Elements in the threadshare GStreamer plugins framework.

The diagram below shows how the PadSrc & PadSink and the related structs integrate in ts Elements.

Note: PadSrc & PadSink only support gst::PadMode::Push at the moment.

   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓          ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                   Element A               ┃          ┃          Element B
                                           ┃          ┃
                ╭─────────────────╮        ┃          ┃       ╭──────────────────╮
                │     PadSrc      │        ┃          ┃       │      PadSink     │
                │     Handler     │        ┃          ┃       │      Handler     │
                │─────────────────│        ┃          ┃       │──────────────────│
                │ - src_activate* │     ╭──┸──╮    ╭──┸──╮    │ - sink_activate* │
                │ - src_event*    │<────│     │<╌╌╌│     │───>│ - sink_chain*    │
                │ - src_query     │<────│ gst │    │ gst │───>│ - sink_event*    │
                ╰─────────────────╯     │     │    │     │───>│ - sink_query     │
                         │              │ Pad │    │ Pad │    ╰──────────────────╯
                         │           ╭─>│     │╌╌╌>│     │─╮            │
                         │           │  ╰──┰──╯    ╰──┰──╯ ╰───────╮    │
     ╭─────────╮    ╭────────╮ push* │     ┃          ┃          ╭─────────╮
     │ Task ↺  │───>│ PadSrc │───────╯     ┃          ┃          │ PadSink │
     ╰─────────╯    ╰────────╯             ┃          ┃          ╰─────────╯
   ━━━━━━━│━━━━━━━━━━━━━━│━━━━━━━━━━━━━━━━━┛          ┗━━━━━━━━━━━━━━━│━━━━━━━━━━━━
          ╰──────────────┴───────────────────╮      ╭─────────────────╯
                                          ╭────────────╮
                                          │  Context ↺ │
                                          ╰────────────╯

Asynchronous operations for both PadSrc in Element A and PadSink in Element B run on the same Context, which can also be shared by other Elements or instances of the same Elements in multiple Pipelines.

Element A & Element B can also be linked to non-threadshare Elements in which case, they operate in a regular synchronous way.

Note that only operations on the streaming thread (serialized events, buffers, serialized queries) are handled from the PadContext and asynchronously, everything else operates blocking.

Structs§

PadSink
The PadSink which Elements must own.
PadSinkInner
PadSinkRef
A PadSink to be used in handlers functions and Futures.
PadSinkWeak
A PadSink which can be moved in Handlers functions and Futures.
PadSrc
The PadSrc which Elements must own.
PadSrcInner
PadSrcRef
A PadSrc to be used in Handlers functions and Futures.
PadSrcWeak
A PadSrc which can be moved in handlers functions and Futures.

Traits§

PadSinkHandler
A trait to define handlers for PadSink callbacks.
PadSrcHandler
A trait to define handlers for PadSrc callbacks.