libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
videoreferenceconfig.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>
21
22PROMEKI_NAMESPACE_BEGIN
23
24class DataStream;
25
70class VideoReferenceConfig {
71 public:
72 PROMEKI_DATATYPE(VideoReferenceConfig, DataTypeVideoReferenceConfig, 1)
73
74
81 VideoReferenceConfig();
82
91 VideoReferenceConfig(VideoReferenceSource source,
92 VideoReferenceRateFamily family = VideoReferenceRateFamily::Auto);
93
101 bool isValid() const;
102
104 VideoReferenceSource source() const;
105
107 VideoReferenceRateFamily family() const;
108
116 VideoPortRef signalPort() const;
117
119 void setSource(VideoReferenceSource source);
120
122 void setFamily(VideoReferenceRateFamily family);
123
125 void setSignalPort(VideoPortRef signalPort);
126
132 String toString() const;
133
144 static Result<VideoReferenceConfig> fromString(const String &s);
145
147 bool operator==(const VideoReferenceConfig &other) const;
148
150 bool operator!=(const VideoReferenceConfig &other) const { return !(*this == other); }
151
156 Error writeToStream(DataStream &s) const;
157
162 template <uint32_t V> static Result<VideoReferenceConfig> readFromStream(DataStream &s);
163
168 struct Impl {
169 PROMEKI_SHARED_FINAL(Impl)
170
171 VideoReferenceSource source = VideoReferenceSource::FreeRun;
172 VideoReferenceRateFamily family = VideoReferenceRateFamily::Auto;
173 VideoPortRef signalPort;
174 };
175
176 private:
177 SharedPtr<Impl> _d;
178};
179
180PROMEKI_NAMESPACE_END
181
182#endif // PROMEKI_ENABLE_CORE