libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
videoportref.h
Go to the documentation of this file.
1
8#pragma once
9
10
11#include <promeki/config.h>
12#if PROMEKI_ENABLE_CORE
13#include <promeki/datatype.h>
14#include <promeki/enums.h>
15#include <promeki/error.h>
16#include <promeki/namespace.h>
17#include <promeki/result.h>
18#include <promeki/sharedptr.h>
19#include <promeki/string.h>
20
21PROMEKI_NAMESPACE_BEGIN
22
23class DataStream;
24
63class VideoPortRef {
64 public:
65 PROMEKI_DATATYPE(VideoPortRef, DataTypeVideoPortRef, 1)
66
67
73 VideoPortRef();
74
83 VideoPortRef(VideoConnectorKind kind, int index);
84
92 bool isValid() const;
93
95 VideoConnectorKind kind() const;
96
98 int index() const;
99
101 void setKind(VideoConnectorKind kind);
102
104 void setIndex(int index);
105
117 String toString() const;
118
129 static Result<VideoPortRef> fromString(const String &s);
130
132 bool operator==(const VideoPortRef &other) const;
133
135 bool operator!=(const VideoPortRef &other) const { return !(*this == other); }
136
145 bool operator<(const VideoPortRef &other) const;
146
155 Error writeToStream(DataStream &s) const;
156
161 template <uint32_t V> static Result<VideoPortRef> readFromStream(DataStream &s);
162
174 struct Impl {
175 PROMEKI_SHARED_FINAL(Impl)
176
177 VideoConnectorKind kind = VideoConnectorKind::Auto;
178 int index = 0;
179 };
180
181 private:
182 SharedPtr<Impl> _d;
183};
184
185PROMEKI_NAMESPACE_END
186
187#endif // PROMEKI_ENABLE_CORE