{"id":475,"url":"https://patchwork.libcamera.org/api/1.1/patches/475/?format=json","web_url":"https://patchwork.libcamera.org/patch/475/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190201154248.15006-4-jacopo@jmondi.org>","date":"2019-02-01T15:42:44","name":"[libcamera-devel,3/7] libcamera: v4l2_device: Rename parameters to s/g_fmt","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"19ee5d6b1cd432e845ab4c99938560dd764c691a","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/475/mbox/","series":[{"id":162,"url":"https://patchwork.libcamera.org/api/1.1/series/162/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=162","date":"2019-02-01T15:42:41","name":"libcamera: v4l2_device: Address comments for s/g_fmt","version":1,"mbox":"https://patchwork.libcamera.org/series/162/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/475/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/475/checks/","tags":{},"headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n\t[217.70.183.201])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B962660DBB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  1 Feb 2019 16:42:40 +0100 (CET)","from uno.localdomain (unknown [91.183.179.147])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 63E351BF207;\n\tFri,  1 Feb 2019 15:42:40 +0000 (UTC)"],"X-Originating-IP":"91.183.179.147","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  1 Feb 2019 16:42:44 +0100","Message-Id":"<20190201154248.15006-4-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.20.1","In-Reply-To":"<20190201154248.15006-1-jacopo@jmondi.org>","References":"<20190201154248.15006-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 3/7] libcamera: v4l2_device: Rename\n\tparameters to s/g_fmt","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Fri, 01 Feb 2019 15:42:41 -0000"},"content":"Rename parameters to get and set format functions to expand 'fmt' to\n'format'.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/include/v4l2_device.h | 12 ++--\n src/libcamera/v4l2_device.cpp       | 96 ++++++++++++++---------------\n 2 files changed, 54 insertions(+), 54 deletions(-)","diff":"diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\nindex 70e3c00..e65a540 100644\n--- a/src/libcamera/include/v4l2_device.h\n+++ b/src/libcamera/include/v4l2_device.h\n@@ -86,15 +86,15 @@ public:\n \tconst char *deviceName() const { return caps_.card(); }\n \tconst char *busName() const { return caps_.bus_info(); }\n \n-\tint getFormat(V4L2DeviceFormat *fmt);\n-\tint setFormat(V4L2DeviceFormat *fmt);\n+\tint getFormat(V4L2DeviceFormat *format);\n+\tint setFormat(V4L2DeviceFormat *format);\n \n private:\n-\tint getFormatSingleplane(V4L2DeviceFormat *fmt);\n-\tint setFormatSingleplane(V4L2DeviceFormat *fmt);\n+\tint getFormatSingleplane(V4L2DeviceFormat *format);\n+\tint setFormatSingleplane(V4L2DeviceFormat *format);\n \n-\tint getFormatMultiplane(V4L2DeviceFormat *fmt);\n-\tint setFormatMultiplane(V4L2DeviceFormat *fmt);\n+\tint getFormatMultiplane(V4L2DeviceFormat *format);\n+\tint setFormatMultiplane(V4L2DeviceFormat *format);\n \n \tstd::string deviceNode_;\n \tint fd_;\ndiff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex 5ba89b9..8cf566c 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -282,58 +282,58 @@ void V4L2Device::close()\n  * \\brief Retrieve the image format set on the V4L2 device\n  * \\return 0 for success, a negative error code otherwise\n  */\n-int V4L2Device::getFormat(V4L2DeviceFormat *fmt)\n+int V4L2Device::getFormat(V4L2DeviceFormat *format)\n {\n-\treturn caps_.isMultiplanar() ? getFormatMultiplane(fmt) :\n-\t\t\t\t       getFormatSingleplane(fmt);\n+\treturn caps_.isMultiplanar() ? getFormatMultiplane(format) :\n+\t\t\t\t       getFormatSingleplane(format);\n }\n \n /**\n  * \\brief Configure an image format on the V4L2 device\n  * \\return 0 for success, a negative error code otherwise\n  */\n-int V4L2Device::setFormat(V4L2DeviceFormat *fmt)\n+int V4L2Device::setFormat(V4L2DeviceFormat *format)\n {\n-\treturn caps_.isMultiplanar() ? setFormatMultiplane(fmt) :\n-\t\t\t\t       setFormatSingleplane(fmt);\n+\treturn caps_.isMultiplanar() ? setFormatMultiplane(format) :\n+\t\t\t\t       setFormatSingleplane(format);\n }\n \n-int V4L2Device::getFormatSingleplane(V4L2DeviceFormat *fmt)\n+int V4L2Device::getFormatSingleplane(V4L2DeviceFormat *format)\n {\n-\tstruct v4l2_format v4l2Fmt;\n-\tstruct v4l2_pix_format *pix = &v4l2Fmt.fmt.pix;\n+\tstruct v4l2_format v4l2Format;\n+\tstruct v4l2_pix_format *pix = &v4l2Format.fmt.pix;\n \tint ret;\n \n-\tv4l2Fmt.type = bufferType_;\n-\tret = ioctl(fd_, VIDIOC_G_FMT, &v4l2Fmt);\n+\tv4l2Format.type = bufferType_;\n+\tret = ioctl(fd_, VIDIOC_G_FMT, &v4l2Format);\n \tif (ret) {\n \t\tret = -errno;\n \t\tLOG(Error) << \"Unable to get format: \" << strerror(-ret);\n \t\treturn ret;\n \t}\n \n-\tfmt->width = pix->width;\n-\tfmt->height = pix->height;\n-\tfmt->fourcc = pix->pixelformat;\n-\tfmt->planes = 1;\n-\tfmt->planesFmt[0].bpl = pix->bytesperline;\n-\tfmt->planesFmt[0].size = pix->sizeimage;\n+\tformat->width = pix->width;\n+\tformat->height = pix->height;\n+\tformat->fourcc = pix->pixelformat;\n+\tformat->planes = 1;\n+\tformat->planesFmt[0].bpl = pix->bytesperline;\n+\tformat->planesFmt[0].size = pix->sizeimage;\n \n \treturn 0;\n }\n \n-int V4L2Device::setFormatSingleplane(V4L2DeviceFormat *fmt)\n+int V4L2Device::setFormatSingleplane(V4L2DeviceFormat *format)\n {\n-\tstruct v4l2_format v4l2Fmt;\n-\tstruct v4l2_pix_format *pix = &v4l2Fmt.fmt.pix;\n+\tstruct v4l2_format v4l2Format;\n+\tstruct v4l2_pix_format *pix = &v4l2Format.fmt.pix;\n \tint ret;\n \n-\tv4l2Fmt.type = bufferType_;\n-\tpix->width = fmt->width;\n-\tpix->height = fmt->height;\n-\tpix->pixelformat = fmt->fourcc;\n+\tv4l2Format.type = bufferType_;\n+\tpix->width = format->width;\n+\tpix->height = format->height;\n+\tpix->pixelformat = format->fourcc;\n \n-\tret = ioctl(fd_, VIDIOC_S_FMT, &v4l2Fmt);\n+\tret = ioctl(fd_, VIDIOC_S_FMT, &v4l2Format);\n \tif (ret) {\n \t\tret = -errno;\n \t\tLOG(Error) << \"Unable to set format: \" << strerror(-ret);\n@@ -343,51 +343,51 @@ int V4L2Device::setFormatSingleplane(V4L2DeviceFormat *fmt)\n \treturn 0;\n }\n \n-int V4L2Device::getFormatMultiplane(V4L2DeviceFormat *fmt)\n+int V4L2Device::getFormatMultiplane(V4L2DeviceFormat *format)\n {\n-\tstruct v4l2_format v4l2Fmt;\n-\tstruct v4l2_pix_format_mplane *pix = &v4l2Fmt.fmt.pix_mp;\n+\tstruct v4l2_format v4l2Format;\n+\tstruct v4l2_pix_format_mplane *pix = &v4l2Format.fmt.pix_mp;\n \tint ret;\n \n-\tv4l2Fmt.type = bufferType_;\n-\tret = ioctl(fd_, VIDIOC_G_FMT, &v4l2Fmt);\n+\tv4l2Format.type = bufferType_;\n+\tret = ioctl(fd_, VIDIOC_G_FMT, &v4l2Format);\n \tif (ret) {\n \t\tret = -errno;\n \t\tLOG(Error) << \"Unable to get format: \" << strerror(-ret);\n \t\treturn ret;\n \t}\n \n-\tfmt->width = pix->width;\n-\tfmt->height = pix->height;\n-\tfmt->fourcc = pix->pixelformat;\n-\tfmt->planes = pix->num_planes;\n+\tformat->width = pix->width;\n+\tformat->height = pix->height;\n+\tformat->fourcc = pix->pixelformat;\n+\tformat->planes = pix->num_planes;\n \n-\tfor (unsigned int i = 0; i < fmt->planes; ++i) {\n-\t\tfmt->planesFmt[i].bpl = pix->plane_fmt[i].bytesperline;\n-\t\tfmt->planesFmt[i].size = pix->plane_fmt[i].sizeimage;\n+\tfor (unsigned int i = 0; i < format->planes; ++i) {\n+\t\tformat->planesFmt[i].bpl = pix->plane_fmt[i].bytesperline;\n+\t\tformat->planesFmt[i].size = pix->plane_fmt[i].sizeimage;\n \t}\n \n \treturn 0;\n }\n \n-int V4L2Device::setFormatMultiplane(V4L2DeviceFormat *fmt)\n+int V4L2Device::setFormatMultiplane(V4L2DeviceFormat *format)\n {\n-\tstruct v4l2_format v4l2Fmt;\n-\tstruct v4l2_pix_format_mplane *pix = &v4l2Fmt.fmt.pix_mp;\n+\tstruct v4l2_format v4l2Format;\n+\tstruct v4l2_pix_format_mplane *pix = &v4l2Format.fmt.pix_mp;\n \tint ret;\n \n-\tv4l2Fmt.type = bufferType_;\n-\tpix->width = fmt->width;\n-\tpix->height = fmt->height;\n-\tpix->pixelformat = fmt->fourcc;\n-\tpix->num_planes = fmt->planes;\n+\tv4l2Format.type = bufferType_;\n+\tpix->width = format->width;\n+\tpix->height = format->height;\n+\tpix->pixelformat = format->fourcc;\n+\tpix->num_planes = format->planes;\n \n \tfor (unsigned int i = 0; i < pix->num_planes; ++i) {\n-\t\tpix->plane_fmt[i].bytesperline = fmt->planesFmt[i].bpl;\n-\t\tpix->plane_fmt[i].sizeimage = fmt->planesFmt[i].size;\n+\t\tpix->plane_fmt[i].bytesperline = format->planesFmt[i].bpl;\n+\t\tpix->plane_fmt[i].sizeimage = format->planesFmt[i].size;\n \t}\n \n-\tret = ioctl(fd_, VIDIOC_S_FMT, &v4l2Fmt);\n+\tret = ioctl(fd_, VIDIOC_S_FMT, &v4l2Format);\n \tif (ret) {\n \t\tret = -errno;\n \t\tLOG(Error) << \"Unable to set format: \" << strerror(-ret);\n","prefixes":["libcamera-devel","3/7"]}