129 #include "../base/bytes.h"
150 enum Format : uint8_t {
162 kFormatBgr888Packed = 10,
163 kFormatRgb888Packed = 11,
164 kFormatRgb888Planar = 12,
174 enum Stream : uint8_t {
240 bool operator>>(Bytes& bytes)
const noexcept;
248 [[nodiscard]]
static bool check_valid(
const Bytes& bytes) noexcept;
262 [[nodiscard]]
bool is_valid()
const noexcept;
270 bool shallow_copy(
const CameraFrame& target) noexcept;
278 bool deep_copy(
const CameraFrame& target) noexcept;
294 bool create(
size_t size) noexcept;
299 void clear() noexcept;
308 bool shallow_copy(uint8_t* data,
size_t size) noexcept;
317 bool deep_copy(uint8_t* data,
size_t size) noexcept;
326 bool fill_data(uint8_t* data,
size_t size) noexcept;
333 [[nodiscard]] uint32_t channel()
const noexcept;
340 [[nodiscard]] uint32_t width()
const noexcept;
347 [[nodiscard]] uint32_t height()
const noexcept;
354 [[nodiscard]] uint32_t freq()
const noexcept;
361 [[nodiscard]] Format format()
const noexcept;
368 [[nodiscard]] Stream stream()
const noexcept;
375 [[nodiscard]]
const uint8_t* data()
const noexcept;
382 [[nodiscard]]
size_t size()
const noexcept;
389 [[nodiscard]]
bool is_owner()
const noexcept;
396 void set_channel(uint32_t channel) noexcept;
403 void set_width(uint32_t width) noexcept;
410 void set_height(uint32_t height) noexcept;
417 void set_freq(uint32_t freq) noexcept;
424 void set_format(Format format) noexcept;
431 void set_stream(Stream stream) noexcept;
438 uint32_t& get_reserved() noexcept {
return reserved_buf_; }
442 static constexpr
bool kZerocopyTypes{
true};
445 uint8_t* data_{
nullptr};
447 uint32_t channel_{0};
451 Format format_{kFormatUnknown};
452 Stream stream_{kStreamUnknown};
453 bool is_owner_{
false};
454 uint32_t reserved_buf_{0};
456 static constexpr uint32_t kMagicNumberBegin{0x98B7F15A};
457 static constexpr uint32_t kMagicNumberEnd{0x98B7F15F};
constexpr bool is_valid() noexcept
Definition: name_detector.h:382
size_t get_serialized_size(const T &src) noexcept
Returns a serialised-size hint for src with explicit codec tag.
Definition: serializer-inl.h:298
VLINK_EXPORT std::ostream & operator<<(std::ostream &ostream, const BasePtr &status) noexcept
Writes the human-readable description of status to ostream.
struct VLINK_EXPORT_AND_ALIGNED(8) AudioFrame final
Definition: audio_frame.h:140
80-byte POD container holding one camera / video frame plus image-format metadata.