nx_cloud_storage_sdk  1.0
Cloud Storage SDK
data.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2 
3 #pragma once
4 
5 #include <chrono>
6 #include <limits>
7 #include <optional>
8 #include <string>
9 #include <vector>
10 
11 #include <camera/camera_plugin.h>
12 #include <nx/kit/json.h>
13 #include <nx/sdk/cloud_storage/i_media_data_packet.h>
14 #include <nx/sdk/cloud_storage/i_plugin.h>
15 #include <nx/sdk/i_device_info.h>
16 
17 namespace nx::sdk::cloud_storage {
18 
19 template<typename T>
21 {
22  static ValueOrError<T> makeValue(T t)
23  {
24  ValueOrError<T> result;
25  result.v = std::move(t);
26  return result;
27  }
28 
29  static ValueOrError<T> makeError(std::string s)
30  {
31  ValueOrError<T> result;
32  result.e = std::move(s);
33  return result;
34  }
35 
36  operator bool() const
37  {
38  return (bool) v;
39  }
40 
41  T value() const
42  {
43  return *v;
44  }
45 
46  std::string error() const
47  {
48  return *e;
49  }
50 
51 private:
52  std::optional<T> v;
53  std::optional<std::string> e;
54 
55  ValueOrError() = default;
56 };
57 
65 {
66  PluginManifest(const char* jsonStr) noexcept(false);
67  PluginManifest(const nx::kit::Json& json) noexcept(false);
69  const std::string& id,
70  const std::string& name,
71  const std::string& description,
72  const std::string& version,
73  const std::string& vendor);
74 
75  static ValueOrError<PluginManifest> fromJson(const char* jsonStr) noexcept;
76  static ValueOrError<PluginManifest> fromJson(const nx::kit::Json& json) noexcept;
77 
78  PluginManifest() = default;
79 
80  template<typename T>
81  PluginManifest(const T&) = delete;
82 
83  bool operator==(const PluginManifest&) const;
84 
85  // Plugin identificator. This is what will be displayed int the storage type field in
86  // the storage dialog.
87  std::string id;
88  // Full plugin name ('Stub Cloud Storage plugin', for example)
89  std::string name;
90  // Brief plugin description.
91  std::string description;
92  std::string version;
93  std::string vendor;
94 
95  nx::kit::Json to_json() const;
96 };
97 
98 struct TimePeriod
99 {
100  TimePeriod(const char* jsonStr) noexcept(false);
101  TimePeriod(const nx::kit::Json& json) noexcept(false);
102  TimePeriod(std::chrono::milliseconds startTimestamp, std::chrono::milliseconds duration);
103  TimePeriod() = default;
104 
105  static ValueOrError<TimePeriod> fromJson(const char* jsonStr) noexcept;
106  static ValueOrError<TimePeriod> fromJson(const nx::kit::Json& json) noexcept;
107 
108  template<typename T>
109  TimePeriod(const T&) = delete;
110 
111  std::chrono::milliseconds startTimestamp{-1};
112  std::chrono::milliseconds duration{-1};
113 
114  bool isInfinite() const;
115  bool contains(std::chrono::milliseconds timestamp) const;
116  bool isNull() const;
117  bool intersects(const TimePeriod& other) const;
118  std::optional<std::chrono::milliseconds> endTimestamp() const;
119 
120  nx::kit::Json to_json() const;
121  bool operator<(const TimePeriod& other) const;
122  bool operator==(const TimePeriod& other) const;
123 };
124 
125 using TimePeriodList = std::vector<TimePeriod>;
126 nx::kit::Json timePeriodListToJson(const TimePeriodList& timePeriods);
127 TimePeriodList timePeriodListFromJson(const char* data);
128 
130 {
131  KeyValuePair(const char* jsonStr) noexcept(false);
132  KeyValuePair(const nx::kit::Json& json) noexcept(false);
133  KeyValuePair() = default;
134  KeyValuePair(const std::string& name, const std::string& value);
135 
136  static ValueOrError<KeyValuePair> fromJson(const char* jsonStr) noexcept;
137  static ValueOrError<KeyValuePair> fromJson(const nx::kit::Json& json) noexcept;
138 
139  template<typename T>
140  KeyValuePair(const T&) = delete;
141 
142  bool operator==(const KeyValuePair&) const;
143 
144  nx::kit::Json to_json() const;
145 
146  std::string name;
147  std::string value;
148 };
149 
150 nx::kit::Json keyValuePairsToJson(const std::vector<KeyValuePair>& keyValuePairList);
151 
153 
154 // Device description object. Consists of key-value pairs of the device attributes.
156 {
157  DeviceDescription() = default;
158  DeviceDescription(const char* jsonData) noexcept(false);
159  DeviceDescription(const nx::kit::Json& json) noexcept(false);
161 
162  static ValueOrError<DeviceDescription> fromJson(const char* jsonStr) noexcept;
163  static ValueOrError<DeviceDescription> fromJson(const nx::kit::Json& json) noexcept;
164 
165  template<typename T>
166  DeviceDescription(const T&) = delete;
167 
168  bool operator==(const DeviceDescription&) const;
169 
170  std::vector<DeviceParameter> parameters;
171 
172  const char* getParamValue(const std::string& key) const;
173  nx::kit::Json to_json() const;
174  std::optional<std::string> deviceId() const;
175 };
176 
177 std::string deviceId(nx::sdk::cloud_storage::IDeviceAgent* deviceAgent);
178 int toStreamIndex(nxcip::MediaStreamQuality quality);
179 std::string toString(sdk::cloud_storage::MetadataType metadataType);
180 
181 // Bookmark object passed to the plugin when bookmark is saved. And the same object
182 // should be returned to the Server when queried back if it matches against the filter.
183 // Plugin should keep bookmarks as is, without any changes.
184 struct Bookmark
185 {
186  Bookmark(const char* jsonData) noexcept(false);
187  Bookmark(const nx::kit::Json& json) noexcept(false);
188  Bookmark() = default;
189 
190  static ValueOrError<Bookmark> fromJson(const char* jsonStr) noexcept;
191  static ValueOrError<Bookmark> fromJson(const nx::kit::Json& json) noexcept;
192 
193  template<typename T>
194  Bookmark(const T&) = delete;
195 
196  bool operator==(const Bookmark&) const;
197 
198  nx::kit::Json to_json() const;
199 
200  // Bookmark unique id.
201  std::string id;
202  // User that created this bookmark id.
203  std::string creatorId;
204  std::chrono::milliseconds creationTimestamp{};
205  std::string name;
206  std::string description;
207  std::chrono::milliseconds timeout = std::chrono::milliseconds(-1);
208  std::chrono::milliseconds startTimestamp;
209  std::chrono::milliseconds duration{};
210  std::vector<std::string> tags;
211  std::string deviceId;
212 };
213 
214 using BookmarkList = std::vector<Bookmark>;
215 
216 BookmarkList bookmarkListFromJson(const char* data);
217 
218 enum class SortOrder
219 {
220  ascending,
221  descending,
222 };
223 
224 std::string sortOrderToString(SortOrder order);
225 SortOrder sortOrderFromString(const std::string& s);
226 
227 // This filter will be passed to the plugin when bookmarks are queried by Server.
228 // For processing example refer to the 'nx/sdk/cloud_storage/algorithm.cpp'
230 {
231  enum class SortColumn
232  {
233  name,
234  startTime,
235  duration,
236  creationTime,
237  tags,
238  description,
239  };
240 
241  BookmarkFilter(const char* jsonData) noexcept(false);
242  BookmarkFilter(const nx::kit::Json& json) noexcept(false);
243  BookmarkFilter() = default;
244 
245  static ValueOrError<BookmarkFilter> fromJson(const char* jsonStr) noexcept;
246  static ValueOrError<BookmarkFilter> fromJson(const nx::kit::Json& json) noexcept;
247 
248  template<typename T>
249  BookmarkFilter(const T&) = delete;
250 
251  bool operator==(const BookmarkFilter&) const;
252 
253  nx::kit::Json to_json() const;
254 
255  static std::string sortColumnToString(SortColumn column);
256  static SortColumn sortColumnFromString(const std::string& s);
257 
258  std::optional<std::string> id;
259  std::optional<std::chrono::milliseconds> startTimestamp;
260  std::optional<std::chrono::milliseconds> endTimestamp;
261  // Arbitrary text to search for within bookmark name or tag.
262  std::optional<std::string> text;
263  std::optional<int> limit;
264  SortOrder order = SortOrder::ascending;
265  SortColumn column = SortColumn::startTime;
266  // Minimum bookmark duration time.
267  std::optional<std::chrono::milliseconds> minVisibleLength;
268  std::vector<std::string> deviceIds;
269  std::optional<std::chrono::milliseconds> creationStartTimestamp;
270  std::optional<std::chrono::milliseconds> creationEndTimestamp;
271 };
272 
273 // Motion object passed to the plugin when bookmark is saved. And the same object
274 // should be returned to the Server when queried back if it matches against the filter.
275 // Plugin should keep motion as is, without any changes.
276 struct Motion
277 {
278  Motion() = default;
279  Motion(const char* jsonData) noexcept(false);
280  Motion(const nx::kit::Json& json) noexcept(false);
281 
282  static ValueOrError<Motion> fromJson(const char* jsonStr) noexcept;
283  static ValueOrError<Motion> fromJson(const nx::kit::Json& json) noexcept;
284 
285  template<typename T>
286  Motion(const T&) = delete;
287 
288  bool operator==(const Motion&) const;
289 
290  int channel = 0;
291  std::chrono::milliseconds startTimestamp;
292  std::chrono::milliseconds duration{};
293  std::string deviceId;
294  // Binary motion mask data. Encoded in base64.
295  // This mask covers the frame as a 44x32 cells grid. Every non zero bit in the mask means
296  // that motion was detected in that cell. So, the bit mask size is 44*32=1408 bits = 176 bytes
297  // before encoding to base64. The mask is rotated by 90 degree. The very first bit of the mask
298  // is the top-left corner bit. The next bit is for 1-st column, 2-nd row e.t.c.
299  std::string dataBase64;
300 
301  nx::kit::Json to_json() const;
302 };
303 
304 struct Rect
305 {
306  Rect(const char* jsonData) noexcept(false);
307  Rect(const nx::kit::Json& json) noexcept(false);
308  Rect(double x, double y, double w, double h);
309  Rect() = default;
310 
311  static ValueOrError<Rect> fromJson(const char* jsonStr) noexcept;
312  static ValueOrError<Rect> fromJson(const nx::kit::Json& json) noexcept;
313 
314  template<typename T>
315  Rect(const T&) = delete;
316 
317  bool operator==(const Rect&) const;
318 
319  nx::kit::Json to_json() const;
320 
321  double x = 0;
322  double y = 0;
323  double w = 0;
324  double h = 0;
325 
326  bool isEmpty() const;
327  bool intersectsWith(const Rect& other) const;
328  double left() const;
329  double top() const;
330  double right() const;
331  double bottom() const;
332 
333 private:
334  bool isInside(double x, double y) const;
335 };
336 
337 // This filter will be passed to the plugin when motion is queried by Server.
338 // For processing example refer to the 'nx/sdk/cloud_storage/algorithm.cpp'
340 {
341  MotionFilter() = default;
342  MotionFilter(const char* jsonData) noexcept(false);
343  MotionFilter(const nx::kit::Json& json) noexcept(false);
344 
345  static ValueOrError<MotionFilter> fromJson(const char* jsonStr) noexcept;
346  static ValueOrError<MotionFilter> fromJson(const nx::kit::Json& json) noexcept;
347 
348  template<typename T>
349  MotionFilter(const T&) = delete;
350 
351  bool operator==(const MotionFilter&) const;
352 
353  nx::kit::Json to_json() const;
354 
355  std::vector<std::string> deviceIds;
356  TimePeriod timePeriod;
357 
358  // Regions of screen which should be matched against the motion data.
359  // Motion matches if motion.data intersected with any of rectangles in regions contains at
360  // least one cell of motion i.e. the corresponding bit in the motion.data is set to 1.
361  std::vector<Rect> regions;
362  // Maximum number of objects to return.
363  std::optional<int> limit;
364 
366  SortOrder order = SortOrder::descending;
367 
368  // If distance between two time periods less than this value, then those periods must be merged
369  // ignoring the gap.
370  std::chrono::milliseconds detailLevel;
371 };
372 
373 using Attribute = KeyValuePair;
374 using Attributes = std::vector<KeyValuePair>;
375 
377 {
378  ObjectRegion() = default;
379  ObjectRegion(const nx::kit::Json & json) noexcept(false);
380  ObjectRegion(const char* jsonData) noexcept(false);
381 
382  static ValueOrError<ObjectRegion> fromJson(const char* jsonStr) noexcept;
383  static ValueOrError<ObjectRegion> fromJson(const nx::kit::Json& json) noexcept;
384 
385  template<typename T>
386  ObjectRegion(const T&) = delete;
387 
388  bool operator==(const ObjectRegion&) const;
389 
390  nx::kit::Json to_json() const;
391 
392  // Binary mask of the bounding box grid. It has the same binary structure as motion data.
393  std::string boundingBoxGridBase64;
394 };
395 
396 // The image/thumbnail that represent the object track metadata. This information describes the
397 // image from the media archive (a part of the video frame for track thumbnail). This information
398 // is used by Server in case if the best shot image for the track is not uploaded explicitly.
399 // BestShot is NULL if its rect is empty.
400 struct BestShot
401 {
402  BestShot() = default;
403  BestShot(const nx::kit::Json& json) noexcept(false);
404  BestShot(const char* jsonData) noexcept(false);
405 
406  static ValueOrError<BestShot> fromJson(const char* jsonStr) noexcept;
407  static ValueOrError<BestShot> fromJson(const nx::kit::Json& json) noexcept;
408 
409  template<typename T>
410  BestShot(const T&) = delete;
411 
412  bool operator==(const BestShot&) const;
413 
414  nx::kit::Json to_json() const;
415  bool isNull() const;
416 
417  std::chrono::microseconds timestamp{};
418  Rect rect;
419  int streamIndex = -1;
420 };
421 
423 {
424  ObjectTrack() = default;
425  ObjectTrack(const nx::kit::Json & json) noexcept(false);
426  ObjectTrack(const char* jsonData) noexcept(false);
427 
428  static ValueOrError<ObjectTrack> fromJson(const char* jsonStr) noexcept;
429  static ValueOrError<ObjectTrack> fromJson(const nx::kit::Json& json) noexcept;
430 
431  template<typename T>
432  ObjectTrack(const T&) = delete;
433 
434  bool operator==(const ObjectTrack&) const;
435 
436  nx::kit::Json to_json() const;
437 
438  std::string id;
439  // Device that this object track was collected from id.
440  std::string deviceId;
441  // Object category (vehicle, person, e.t.c.). The string of the type must be compared
442  // starting from the beginning. For example, object track may have a 'human.head' type.
443  // This object track should be found if the filter.text contains 'human' object type.
444  std::string objectTypeId;
445  // A list of the object track attributes. Each attribute in the list consists of a name
446  // and a value. For example 'color,red','hasBag,true' e.t.c. Attribute value may also contain a
447  // numeric range. For example: 'speed, [10..50]'.
448  Attributes attributes;
449  // Object track start time.
450  std::chrono::microseconds firstAppearanceTimestamp{};
451  // Object track end time.
452  std::chrono::microseconds lastAppearanceTimestamp{};
453  // Object track coordinates. See ObjectRegion description for more details.
454  ObjectRegion objectPosition;
455  // An analytics plugin id that provided data.
456  std::string analyticsEngineId;
457  BestShot bestShot;
458 };
459 
460 // BestShot image associated with the given ObjectTrack.
462 {
463  BestShotImage() = default;
464  BestShotImage(const nx::kit::Json& json) noexcept(false);
465  BestShotImage(const char* jsonData) noexcept(false);
466 
467  static ValueOrError<BestShotImage> fromJson(const char* jsonStr) noexcept;
468  static ValueOrError<BestShotImage> fromJson(const nx::kit::Json& json) noexcept;
469 
470  template<typename T>
471  BestShotImage(const T&) = delete;
472 
473  bool operator==(const BestShotImage&) const;
474 
475  nx::kit::Json to_json() const;
476 
477  std::string objectTrackId;
478  // Human-readable image format name.
479  std::string format;
480  // Base64 encoded image data.
481  std::string data64;
482 };
483 
484 using AnalyticsLookupResult = std::vector<ObjectTrack>;
485 
486 AnalyticsLookupResult analyticsLookupResultFromJson(const char* data);
487 
488 // Helper struct representing a range border point.
490 {
491  RangePoint() = default;
492  RangePoint(const nx::kit::Json& json) noexcept(false);
493  RangePoint(const char* jsonData) noexcept(false);
494 
495  static ValueOrError<RangePoint> fromJson(const char* jsonStr) noexcept;
496  static ValueOrError<RangePoint> fromJson(const nx::kit::Json& json) noexcept;
497 
498  template<typename T>
499  RangePoint(const T&) = delete;
500 
501  RangePoint(float value, bool inclusive);
502 
503  bool operator==(const RangePoint&) const;
504 
505  nx::kit::Json to_json() const;
506 
507  float value = 0.0;
508  bool inclusive = false;
509 };
510 
511 // Numeric range representation. Used as one of the possible search conditions while querying
512 // object tracks filtered by attributes.
514 {
515  NumericRange() = default;
516  NumericRange(const nx::kit::Json& json) noexcept(false);
517  NumericRange(const char* jsonData) noexcept(false);
518 
519  static ValueOrError<NumericRange> fromJson(const char* jsonStr) noexcept;
520  static ValueOrError<NumericRange> fromJson(const nx::kit::Json& json) noexcept;
521 
522  template<typename T>
523  NumericRange(const T&) = delete;
524 
525  bool operator==(const NumericRange&) const;
526 
527  NumericRange(float value): from(RangePoint{value, true}), to(RangePoint{value, true}) {}
528 
529  NumericRange(std::optional<RangePoint> from, std::optional<RangePoint> to):
530  from(std::move(from)), to(std::move(to))
531  {
532  }
533 
534  static std::optional<NumericRange> fromString(const std::string& s);
535 
536  nx::kit::Json to_json() const;
537 
538  bool intersects(const NumericRange& range) const;
539  bool hasRange(const NumericRange& range) const;
540 
541  std::optional<RangePoint> from;
542  std::optional<RangePoint> to;
543 };
544 
545 // A search condition representation specifying how exactly to filter queried object tracks
546 // by their attributes.
547 // Multiple condition match results are joined using AND logic. So for object track to be included
548 // in the result its attributes (any of them) should match every condition present in the Filter.
549 // I.e. bool objectTrackMatch = atLeastOneAttrMatch(condition_1) && ... && atLeastOneAttrMatch(condition_N)
551 {
552  AttributeSearchCondition() = default;
553  AttributeSearchCondition(const nx::kit::Json& json) noexcept(false);
554  AttributeSearchCondition(const char* jsonData) noexcept(false);
555 
556  static ValueOrError<AttributeSearchCondition> fromJson(const char* jsonStr) noexcept;
557  static ValueOrError<AttributeSearchCondition> fromJson(const nx::kit::Json& json) noexcept;
558 
559  template<typename T>
560  AttributeSearchCondition(const T&) = delete;
561 
562  bool operator==(const AttributeSearchCondition&) const;
563 
564  nx::kit::Json to_json() const;
565 
566  // All search types except 'textMatch' assume that ObjectTrack attribute name matches
567  // the condition name only if the match starts from the beginning and lasts till the end
568  // or the point separator.
569  // For example, let one of the ObjectTrack attribute equals to 'car.color=blue'. Then the
570  // Search conditions with the following names should match: 'car', 'car.color'. But not the
571  // 'ca', 'car.co', 'carxx' or 'car.colov'.
572  // In case of the 'textMatch' for the attribute to match search condition it's enough that
573  // either attribute name or value contain AttributeSearchCondition::text. Condition name and
574  // value should be ignored in this case.
575  // 'numericRangeMatch' assumes that the attribute value contains valid NumericRange and
576  // it intersects AttributeSearchCondition::range.
577  enum class Type
578  {
579  attributePresenceCheck,
580  attributeValueMatch,
581  textMatch,
582  numericRangeMatch,
583  };
584 
585  static std::string typeToString(Type type);
586  static Type typeFromString(const std::string& s);
587 
588  Type type;
589  std::string name;
590  std::string value;
591  std::string text;
592 
593  // If it is set to true than the ObjectTrack should be included in the result only if it does not
594  // match the given condition.
595  bool isNegative = false;
596 
597  // If it is set to true than value should be matched from begining.
598  bool matchesFromStart = false;
599 
600  // If it is set to true than value should be matched till end.
601  bool matchesTillEnd = false;
602 
603  // Used when type == numericRangeMatch. Object track attribute value should contain numeric range
604  // value and it should intersect the given condition value for the Object track to be included in the result.
605  NumericRange range;
606 };
607 
608 // Filter used to search for object tracks.
610 {
611  AnalyticsFilter() = default;
612  AnalyticsFilter(const char* jsonData) noexcept(false);
613  AnalyticsFilter(const nx::kit::Json& json) noexcept(false);
614 
615  static ValueOrError<AnalyticsFilter> fromJson(const char* jsonStr) noexcept;
616  static ValueOrError<AnalyticsFilter> fromJson(const nx::kit::Json& json) noexcept;
617 
618  template<typename T>
619  AnalyticsFilter(const T&) = delete;
620 
621  bool operator==(const AnalyticsFilter&) const;
622 
623  nx::kit::Json to_json() const;
624 
625  enum Option
626  {
627  none = 0x0,
628  ignoreTextFilter = 0x1,
629  ignoreBoundingBox = 0x2,
630  ignoreTimePeriod = 0x4,
631  };
632 
633  static std::string optionsToString(int options);
634  static int optionsFromString(const std::string& s);
635 
636  // If empty, any device is a match.
637  std::vector<std::string> deviceIds;
638  // See ObjectTrack.objectTypeId for explanation. If empty, any objectTrack.objectTypeId
639  // is a match.
640  std::vector<std::string> objectTypeIds;
641  // If empty, any objectTrackId is a match.
642  std::optional<std::string> objectTrackId;
643  // If not null only object tracks with firstAppearanceTimestamp within this period should
644  // match.
645  TimePeriod timePeriod;
646  // Bounding box area to search within. Search should be done similarly to motion data.
647  std::optional<Rect> boundingBox;
648  std::optional<int> maxObjectTracksToSelect;
649  std::vector<AttributeSearchCondition> attributeSearchConditions;
650 
652  SortOrder order = SortOrder::descending;
653 
654  std::optional<std::string> analyticsEngineId;
655  int options = Option::none;
656  std::chrono::milliseconds detailLevel{};
657 };
658 
660 {
661  CodecInfoData();
662  CodecInfoData(const char* jsonData) noexcept(false);
663  CodecInfoData(const nx::kit::Json& json) noexcept(false);
665 
666  static ValueOrError<CodecInfoData> fromJson(const char* jsonStr) noexcept;
667  static ValueOrError<CodecInfoData> fromJson(const nx::kit::Json& json) noexcept;
668 
669  template<typename T>
670  CodecInfoData(const T&) = delete;
671 
672  bool operator==(const CodecInfoData&) const;
673 
674  nxcip::CompressionType compressionType = nxcip::CompressionType::AV_CODEC_ID_NONE;
675  nxcip::PixelFormat pixelFormat = nxcip::PixelFormat::AV_PIX_FMT_YUV420P;
676  nxcip::MediaType mediaType = nxcip::MediaType::AVMEDIA_TYPE_UNKNOWN;
677  int width = -1;
678  int height = -1;
679  int64_t codecTag = -1;
680  int64_t bitRate = -1;
681  int channels = -1;
682  int frameSize = -1;
683  int blockAlign = -1;
684  int sampleRate = -1;
685  nxcip::SampleFormat sampleFormat = nxcip::SampleFormat::AV_SAMPLE_FMT_NONE;
686  int bitsPerCodedSample = -1;
687  int64_t channelLayout = -1;
688  std::string extradataBase64;
689  int channelNumber = -1;
690 
691  nx::kit::Json to_json() const;
692 };
693 
694 IDeviceInfo* deviceInfo(const DeviceDescription& deviceDescription);
695 
696 class MediaPacket;
697 
699 {
700  MediaPacketData(const IMediaDataPacket* mediaPacket, std::chrono::milliseconds startTime);
701  MediaPacketData() = default;
702 
703  std::vector<uint8_t> data;
704  int dataSize = 0;
705  nxcip::CompressionType compressionType = nxcip::CompressionType::AV_CODEC_ID_NONE;
706  nxcip::UsecUTCTimestamp timestampUs = 0;
707  IMediaDataPacket::Type type = IMediaDataPacket::Type::unknown;
708  int channelNumber = -1;
709  bool isKeyFrame = false;
710  std::vector<uint8_t> encryptionData;
711 };
712 
714 {
715  CloudDeviceReportEntry() = default;
716  CloudDeviceReportEntry(const char* jsonData) noexcept(false);
717  CloudDeviceReportEntry(const nx::kit::Json& json) noexcept(false);
718 
719  static ValueOrError<CloudDeviceReportEntry> fromJson(const char* jsonStr) noexcept;
720  static ValueOrError<CloudDeviceReportEntry> fromJson(const nx::kit::Json& json) noexcept;
721 
722  std::string id;
723  std::string serviceId;
724 
725  bool operator==(const CloudDeviceReportEntry& other) const;
726  nx::kit::Json to_json() const;
727 };
728 
729 using CloudDeviceEntryList = std::vector<CloudDeviceReportEntry>;
730 
732 {
733  CloudDeviceReport() = default;
734  CloudDeviceReport(const char* jsonData) noexcept(false);
735  CloudDeviceReport(const nx::kit::Json& json) noexcept(false);
736 
737  static ValueOrError<CloudDeviceReport> fromJson(const char* jsonStr) noexcept;
738  static ValueOrError<CloudDeviceReport> fromJson(const nx::kit::Json& json) noexcept;
739 
740  std::string cloudSystemId;
741  CloudDeviceEntryList devices;
742 
743  bool operator==(const CloudDeviceReport& other) const;
744  nx::kit::Json to_json() const;
745 };
746 
747 } // nx::sdk::namespace cloud_storage
Definition: i_codec_info.h:15
Definition: data.h:276
Definition: i_media_data_packet.h:16
Definition: json.cpp:80
Definition: data.h:184
MediaType
Definition: camera_plugin_types.h:65
SortOrder order
Definition: data.h:366
Definition: data.h:713
Definition: i_device_info.h:13
Definition: i_device_agent.h:21
SortOrder order
Definition: data.h:652
Definition: data.h:304
Definition: algorithm.cpp:8
PixelFormat
Definition: camera_plugin_types.h:39
MediaStreamQuality
Definition: camera_plugin.h:1177
SampleFormat
Definition: camera_plugin_types.h:76
Definition: data.h:400