Describes a node's input or output connection point. More...
#include <mediaport.h>
Public Types | |
| enum | Direction { Input , Output } |
| Port direction. More... | |
| enum | MediaType { Frame , Image , Audio , Encoded } |
| Media type carried by this port. More... | |
| using | Ptr = SharedPtr< MediaPort > |
| Shared pointer type for MediaPort. | |
| using | List = promeki::List< MediaPort > |
| Plain value list of MediaPort objects. | |
| using | PtrList = promeki::List< Ptr > |
| List of shared pointers to MediaPort. | |
Public Member Functions | |
| MediaPort ()=default | |
| Constructs a default (unnamed, Frame/Input) port. | |
| MediaPort (const String &name, Direction direction, MediaType mediaType) | |
| Constructs a port with the given name, direction, and media type. | |
| const String & | name () const |
| Returns the port name. | |
| void | setName (const String &name) |
| Sets the port name. | |
| Direction | direction () const |
| Returns the port direction. | |
| MediaType | mediaType () const |
| Returns the media type carried by this port. | |
| const AudioDesc & | audioDesc () const |
| Returns the audio description. | |
| void | setAudioDesc (const AudioDesc &desc) |
| Sets the audio description. | |
| const VideoDesc & | videoDesc () const |
| Returns the video description. | |
| void | setVideoDesc (const VideoDesc &desc) |
| Sets the video description. | |
| const ImageDesc & | imageDesc () const |
| Returns the image description. | |
| void | setImageDesc (const ImageDesc &desc) |
| Sets the image description. | |
| const EncodedDesc & | encodedDesc () const |
| Returns the encoded description. | |
| void | setEncodedDesc (const EncodedDesc &desc) |
| Sets the encoded description. | |
| bool | isConnected () const |
| Returns true if this port is currently connected. | |
| void | setConnected (bool connected) |
| Sets the connected state of this port. | |
| MediaNode * | node () const |
| Returns the node that owns this port, or nullptr. | |
| void | setNode (MediaNode *node) |
| Sets the owning node. | |
| bool | isCompatible (const MediaPort &other) const |
| Tests whether this port is compatible with another port for connection. | |
Describes a node's input or output connection point.
Port types define what media a port carries. A Frame port carries the full Frame (image + audio + metadata). Image and Audio ports carry their respective sub-frame data plus metadata. This allows nodes to work at the level of abstraction they need.
Media type carried by this port.
Determines what kind of media data flows through the port and which descriptor fields are meaningful.
| Enumerator | |
|---|---|
| Frame | Full frame (image + audio + metadata). Described by VideoDesc + AudioDesc. |
| Image | |
| Audio | |
| Encoded | Compressed/encoded data + metadata. Described by EncodedDesc. |
Constructs a port with the given name, direction, and media type.
| name | Human-readable port name. |
| direction | Port direction (Input or Output). |
| mediaType | The type of media this port carries. |
|
inline |
Returns the encoded description.
Valid when mediaType is Encoded.
Tests whether this port is compatible with another port for connection.
Compatibility rules:
| other | The port to check compatibility with. |
Sets the audio description.
| desc | The audio format description. |
Sets the connected state of this port.
| connected | The new connected state. |
|
inline |
Sets the encoded description.
| desc | The encoded format description. |
Sets the image description.
| desc | The image format description. |
Sets the port name.
| name | The new port name. |
Sets the owning node.
| node | The node that owns this port. |
Sets the video description.
| desc | The video format description. |
Returns the video description.
Valid when mediaType is Frame.