diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2019-02-01 09:58:59 +0100 |
---|---|---|
committer | Jacopo Mondi <jacopo@jmondi.org> | 2019-02-03 12:16:27 +0100 |
commit | a9f302dc050347b69dfacfbca4bc212250f6a89c (patch) | |
tree | da24a0c3c3607c68e1c0565398a9693aaeeafb2c /src | |
parent | 755644fe64996ef9c2c6c5919119fabc53389de5 (diff) |
libcamera: v4l2_device: Rename plane format fields
Rename the number of valid plane formats to 'planesCount' and the actual
per-plane size information array to 'planes'.
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/include/v4l2_device.h | 4 | ||||
-rw-r--r-- | src/libcamera/v4l2_device.cpp | 29 |
2 files changed, 16 insertions, 17 deletions
diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h index e65a540c..4ff48fba 100644 --- a/src/libcamera/include/v4l2_device.h +++ b/src/libcamera/include/v4l2_device.h @@ -63,8 +63,8 @@ public: struct { uint32_t size; uint32_t bpl; - } planesFmt[3]; - unsigned int planes; + } planes[3]; + unsigned int planesCount; }; class MediaEntity; diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 8cf566c5..0d4d60f5 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -92,7 +92,7 @@ LOG_DEFINE_CATEGORY(V4L2) * * Formats defined as 'single planar' by the V4L2 APIs are represented with * V4L2DeviceFormat instances with a single plane - * (V4L2DeviceFormat::planes = 1). Semi-planar and multiplanar formats use + * (V4L2DeviceFormat::planesCount = 1). Semi-planar and multiplanar formats use * 2 and 3 planes respectively. * * V4L2DeviceFormat defines the exchange format between components that @@ -120,19 +120,18 @@ LOG_DEFINE_CATEGORY(V4L2) */ /** - * \var V4L2DeviceFormat::planesFmt + * \var V4L2DeviceFormat::planes * \brief The per-plane size information * * Images are stored in memory in one or more data planes. Each data plane * has a specific size and line length, which could differ from the image * visible sizes to accommodate line or plane padding data. * - * Only the first V4L2DeviceFormat::planes entries are considered valid. - * + * Only the first \ref planesCount entries are considered valid. */ /** - * \var V4L2DeviceFormat::planes + * \var V4L2DeviceFormat::planesCount * \brief The number of valid data planes */ @@ -315,9 +314,9 @@ int V4L2Device::getFormatSingleplane(V4L2DeviceFormat *format) format->width = pix->width; format->height = pix->height; format->fourcc = pix->pixelformat; - format->planes = 1; - format->planesFmt[0].bpl = pix->bytesperline; - format->planesFmt[0].size = pix->sizeimage; + format->planesCount = 1; + format->planes[0].bpl = pix->bytesperline; + format->planes[0].size = pix->sizeimage; return 0; } @@ -360,11 +359,11 @@ int V4L2Device::getFormatMultiplane(V4L2DeviceFormat *format) format->width = pix->width; format->height = pix->height; format->fourcc = pix->pixelformat; - format->planes = pix->num_planes; + format->planesCount = pix->num_planes; - for (unsigned int i = 0; i < format->planes; ++i) { - format->planesFmt[i].bpl = pix->plane_fmt[i].bytesperline; - format->planesFmt[i].size = pix->plane_fmt[i].sizeimage; + for (unsigned int i = 0; i < format->planesCount; ++i) { + format->planes[i].bpl = pix->plane_fmt[i].bytesperline; + format->planes[i].size = pix->plane_fmt[i].sizeimage; } return 0; @@ -380,11 +379,11 @@ int V4L2Device::setFormatMultiplane(V4L2DeviceFormat *format) pix->width = format->width; pix->height = format->height; pix->pixelformat = format->fourcc; - pix->num_planes = format->planes; + pix->num_planes = format->planesCount; for (unsigned int i = 0; i < pix->num_planes; ++i) { - pix->plane_fmt[i].bytesperline = format->planesFmt[i].bpl; - pix->plane_fmt[i].sizeimage = format->planesFmt[i].size; + pix->plane_fmt[i].bytesperline = format->planes[i].bpl; + pix->plane_fmt[i].sizeimage = format->planes[i].size; } ret = ioctl(fd_, VIDIOC_S_FMT, &v4l2Format); |