what is multi-planar buffers in v4l2

本文介绍 V4L2 API 中用于处理不连续内存缓冲区中视频帧的多平面缓冲区机制,包括多平面格式、相关 API 调用及结构的变化。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Some devices require data for each input or output video frame to be placed in discontiguous memory buffers. In such cases, one video frame has to be addressed using more than one memory address, i.e. one pointer per “plane”. A plane is a sub-buffer of the current frame. For examples of such formats see Image Formats.

Initially, V4L2 API did not support multi-planar buffers and a set of extensions has been introduced to handle them. Those extensions constitute what is being referred to as the “multi-planar API”.

Some of the V4L2 API calls and structures are interpreted differently, depending on whether single- or multi-planar API is being used. An application can choose whether to use one or the other by passing a corresponding buffer type to its ioctl calls. Multi-planar versions of buffer types are suffixed with an _MPLANE string. For a list of available multi-planar buffer types see enum v4l2_buf_type.

1.12.1. Multi-planar formats

Multi-planar API introduces new multi-planar formats. Those formats use a separate set of FourCC codes. It is important to distinguish between the multi-planar API and a multi-planar format. Multi-planar API calls can handle all single-planar formats as well (as long as they are passed in multi-planar API structures), while the single-planar API cannot handle multi-planar formats.

1.12.2. Calls that distinguish between single and multi-planar APIs

VIDIOC_QUERYCAP
Two additional multi-planar capabilities are added. They can be set together with non-multi-planar ones for devices that handle both single- and multi-planar formats.
VIDIOC_G_FMTVIDIOC_S_FMTVIDIOC_TRY_FMT
New structures for describing multi-planar formats are added: struct  v4l2_pix_format_mplane and struct  v4l2_plane_pix_format. Drivers may define new multi-planar formats, which have distinct FourCC codes from the existing single-planar ones.
VIDIOC_QBUFVIDIOC_DQBUFVIDIOC_QUERYBUF
A new struct  v4l2_plane structure for describing planes is added. Arrays of this structure are passed in the new  m.planesfield of struct  v4l2_buffer.
VIDIOC_REQBUFS
Will allocate multi-planar buffers as requested.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值