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
PadSinkwhichElements must own. - PadSink
Inner - PadSink
Ref - A
PadSinkto be used inhandlers functions andFutures. - PadSink
Weak - A
PadSinkwhich can be moved inHandlers functions andFutures. - PadSrc
- The
PadSrcwhichElements must own. - PadSrc
Inner - PadSrc
Ref - A
PadSrcto be used inHandlers functions andFutures. - PadSrc
Weak - A
PadSrcwhich can be moved inhandlers functions andFutures.
Traits§
- PadSink
Handler - A trait to define
handlers forPadSinkcallbacks. - PadSrc
Handler - A trait to define
handlers forPadSrccallbacks.