VLink 2.0.0
A high-performance communication middleware
载入中...
搜索中...
未找到
camera_frame.h 文件参考

Zero-copy camera image frame container for VLink transport. 更多...

#include <cstdint>
#include "../base/bytes.h"
#include "./header.h"
camera_frame.h 的引用(Include)关系图:

浏览该文件的源代码.

命名空间

函数

struct vlink::zerocopy::VLINK_EXPORT_AND_ALIGNED (8) CameraFrame final

详细描述

Zero-copy camera image frame container for VLink transport.

CameraFrame carries a single image frame – either uncompressed (YUV, RGB) or compressed (JPEG, H.264, H.265) – together with a Header for sequencing and timestamping. The struct is exactly 80 bytes on 64-bit platforms.

Pixel formats
Value Description
kFormatYuv420 Planar 4:2:0 (I420)
kFormatYuv422 Planar 4:2:2
kFormatYuv444 Planar 4:4:4
kFormatNv12 Semi-planar YUV 4:2:0 (Y + interleaved UV)
kFormatNv21 Semi-planar YUV 4:2:0 (Y + interleaved VU)
kFormatYuyv Packed YUYV 4:2:2
kFormatYvyu Packed YVYU 4:2:2
kFormatUyvy Packed UYVY 4:2:2
kFormatVyuy Packed VYUY 4:2:2
kFormatBgr888Packed Packed 24-bit BGR
kFormatRgb888Packed Packed 24-bit RGB
kFormatRgb888Planar Planar 24-bit RGB
kFormatJpeg JPEG compressed
kFormatH264 H.264 / AVC compressed
kFormatH265 H.265 / HEVC compressed
Video stream types
Value Description
kStreamI I-frame (key frame)
kStreamP P-frame (predicted)
kStreamB B-frame (bi-predicted)
Binary wire format
[ magic_begin (4) | CameraFrame struct (80) | pixel data (N) | magic_end (4) ]
Zero-copy camera image frame with format metadata and Header.
Usage
vlink::zerocopy::CameraFrame frame;
frame.set_width(1920);
frame.set_height(1080);
frame.set_format(vlink::zerocopy::CameraFrame::kFormatNv12);
frame.create(1920 * 1080 * 3 / 2);
// fill frame.data() ...
frame >> wire; // serialise
vlink::zerocopy::CameraFrame frame2;
frame2 << wire; // deserialise (zero-copy, borrows wire)
注解
  • 32-bit architectures emit a compile-time warning and are not supported.
  • After operator<<, the data pointer references memory inside the source Bytes object. The Bytes must outlive the CameraFrame.
  • fill_data is an alias for deep_copy(uint8_t*, size_t).