Connects an output port to an input port in a media pipeline. More...
#include <medialink.h>
Public Types | |
| using | Ptr = SharedPtr< MediaLink > |
| Shared pointer type for MediaLink. | |
| using | List = promeki::List< MediaLink > |
| Plain value list of MediaLink objects. | |
| using | PtrList = promeki::List< Ptr > |
| List of shared pointers to MediaLink. | |
Public Member Functions | |
| MediaLink ()=default | |
| Constructs an empty (disconnected) link. | |
| MediaLink (MediaPort::Ptr source, MediaPort::Ptr sink) | |
| Constructs a link between the given source and sink ports. | |
| const MediaPort::Ptr & | source () const |
| Returns the source (output) port. | |
| const MediaPort::Ptr & | sink () const |
| Returns the sink (input) port. | |
| MediaNode * | sourceNode () const |
| Returns the node that owns the source port, or nullptr. | |
| MediaNode * | sinkNode () const |
| Returns the node that owns the sink port, or nullptr. | |
| Error | deliver (Frame::Ptr frame) const |
| Delivers a frame from the source to the sink node's input queue. | |
| bool | isValid () const |
| Returns true if the source and sink ports are compatible. | |
Connects an output port to an input port in a media pipeline.
MediaLink delivers frames from a source node's output port to a sink node's input queue. When the source port is a Frame port and the sink port is an Image or Audio port, the link extracts the relevant sub-frame data automatically.
MediaLink does not buffer — the buffering is in the sink node's input queue (see MediaNode).
|
inline |
Constructs a link between the given source and sink ports.
| source | The output port. |
| sink | The input port. |
| Error MediaLink::deliver | ( | Frame::Ptr | frame | ) | const |
Delivers a frame from the source to the sink node's input queue.
Handles Frame-to-Image and Frame-to-Audio extraction if the source and sink port types differ.
| frame | The frame to deliver. |
| bool MediaLink::isValid | ( | ) | const |
Returns true if the source and sink ports are compatible.