{"id":2910,"url":"https://patchwork.libcamera.org/api/1.1/covers/2910/?format=json","web_url":"https://patchwork.libcamera.org/cover/2910/","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":"<20200228032913.497826-1-niklas.soderlund@ragnatech.se>","date":"2020-02-28T03:29:07","name":"[libcamera-devel,RFC,0/6] libcamera: PixelFormat: Turn into a class","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/1.1/people/5/?format=json","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"mbox":"https://patchwork.libcamera.org/cover/2910/mbox/","series":[{"id":694,"url":"https://patchwork.libcamera.org/api/1.1/series/694/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=694","date":"2020-02-28T03:29:07","name":"libcamera: PixelFormat: Turn into a class","version":1,"mbox":"https://patchwork.libcamera.org/series/694/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/2910/comments/","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net\n\t[195.74.38.228])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E659362714\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 Feb 2020 04:29:35 +0100 (CET)","from bismarck.berto.se (p4fca2392.dip0.t-ipconnect.de\n\t[79.202.35.146]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid 7f8e8fa9-59da-11ea-9f85-005056917a89;\n\tFri, 28 Feb 2020 04:29:34 +0100 (CET)"],"X-Halon-ID":"7f8e8fa9-59da-11ea-9f85-005056917a89","Authorized-sender":"niklas@soderlund.pp.se","From":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 28 Feb 2020 04:29:07 +0100","Message-Id":"<20200228032913.497826-1-niklas.soderlund@ragnatech.se>","X-Mailer":"git-send-email 2.25.1","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [RFC 0/6] libcamera: PixelFormat: Turn into a\n\tclass","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","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, 28 Feb 2020 03:29:36 -0000"},"content":"Hi,\n\nThis series replaces the PixelFormat definition of a unisgned int with a \nclass implementation that can translate between V4L2 and DRM fourccs in \naddition to adding support for DRM modifiers.\n\nAs an added bonus it makes it much stricter who can create a PixelFormat \nfrom a V4L2 fourcc which hopefully will remedy the confusion that exist \ntoday about with fourcc namespace the variable is in.\n\nPatch 1/6 and 2/6 lay the ground work by more tightly integrating the \nPixelFormat defined as unsigned int into libcamera. Patch  3/6 do the \nbig work and implements PixelFormat as a class.\n\nPatch 4/6 Adds some possible usability features that could be built \nontop to make fourcc more friends to end users by allowing printing and \nselecting them with friendly string names.\n\nPatch 5/6 and 6/6 do some cleanup removing functions that are now \nredundant since the large change in 3/6.\n\nI post this as a RFC as the design for modifiers for Bayer formats in \nDRM are still up in the air so their is no real world test-case to \nverify the design is the one we will end up with. The aim is to develop \nRAW buffer format enumeration on top of this series. Since this is an \nRFC as the upstream design is not yet finished documentation is also \nlacking.\n\nNiklas Söderlund (6):\n  libcamera: Use PixelFormat instead of unsigned int where appropriate\n  libcamera: formats: Turn ImageFormats into a template\n  libcamera: PixelFormat: Turn into a class\n  libcamera: PixelFormat: Add operations to operate on names\n  libcamera: v4l2_videodevice: Remove pixel format translators\n  v4l2: camera_proxy: Switch to PixelFormat\n\n include/libcamera/pixelformats.h         |  43 ++++++-\n src/cam/main.cpp                         |  11 +-\n src/libcamera/camera_sensor.cpp          |   2 +-\n src/libcamera/formats.cpp                |  22 +++-\n src/libcamera/include/formats.h          |  11 +-\n src/libcamera/include/v4l2_subdevice.h   |   2 +-\n src/libcamera/include/v4l2_videodevice.h |   6 +-\n src/libcamera/pipeline/ipu3/ipu3.cpp     |   8 +-\n src/libcamera/pipeline/rkisp1/rkisp1.cpp |  26 ++--\n src/libcamera/pipeline/uvcvideo.cpp      |  14 +--\n src/libcamera/pipeline/vimc.cpp          |  20 +--\n src/libcamera/pixelformats.cpp           | 148 +++++++++++++++++++++++\n src/libcamera/stream.cpp                 |   6 +-\n src/libcamera/v4l2_subdevice.cpp         |   4 +-\n src/libcamera/v4l2_videodevice.cpp       | 145 +---------------------\n src/qcam/format_converter.cpp            |   4 +-\n src/qcam/format_converter.h              |   6 +-\n src/qcam/viewfinder.cpp                  |   4 +-\n src/qcam/viewfinder.h                    |   6 +-\n src/v4l2/v4l2_camera_proxy.cpp           |  73 ++++-------\n src/v4l2/v4l2_camera_proxy.h             |   3 -\n test/camera/buffer_import.cpp            |   2 +-\n test/stream/stream_formats.cpp           |  33 +++--\n test/v4l2_subdevice/list_formats.cpp     |   2 +-\n 24 files changed, 321 insertions(+), 280 deletions(-)"}