{"id":3321,"url":"https://patchwork.libcamera.org/api/patches/3321/?format=json","web_url":"https://patchwork.libcamera.org/patch/3321/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20200325122825.GA16172@kaaira-HP-Pavilion-Notebook>","date":"2020-03-25T12:28:25","name":"[libcamera-devel] libcamera: v4l2PixelFormat: replace hex with 4CC","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"dce221bc60f354cddbef75e1dce2767e3fc3bde1","submitter":{"id":39,"url":"https://patchwork.libcamera.org/api/people/39/?format=json","name":"Kaaira Gupta","email":"kgupta@es.iitr.ac.in"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/3321/mbox/","series":[{"id":775,"url":"https://patchwork.libcamera.org/api/series/775/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=775","date":"2020-03-25T12:28:25","name":"[libcamera-devel] libcamera: v4l2PixelFormat: replace hex with 4CC","version":1,"mbox":"https://patchwork.libcamera.org/series/775/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/3321/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/3321/checks/","tags":{},"headers":{"Return-Path":"<kgupta@es.iitr.ac.in>","Received":["from mail-pg1-x541.google.com (mail-pg1-x541.google.com\n\t[IPv6:2607:f8b0:4864:20::541])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5525460413\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 25 Mar 2020 13:28:35 +0100 (CET)","by mail-pg1-x541.google.com with SMTP id d37so573664pgl.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 25 Mar 2020 05:28:35 -0700 (PDT)","from kaaira-HP-Pavilion-Notebook ([103.113.213.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tk20sm2322913pgn.62.2020.03.25.05.28.30\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 25 Mar 2020 05:28:32 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=es-iitr-ac-in.20150623.gappssmtp.com\n\theader.i=@es-iitr-ac-in.20150623.gappssmtp.com header.b=\"QFrlnhgW\"; \n\tdkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=es-iitr-ac-in.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:mime-version:content-disposition\n\t:user-agent; bh=Q6I9UawXoamBhb1sEmaI1zjI4rJkcZrpgEsh/JoXrDE=;\n\tb=QFrlnhgWdWBw3VzLTA0eCWW8OI6ThYzNUdiIP4r5xTd9jjYSWdRZxraECMGdc1e9Cz\n\tQk98u2N0NZJFjYA3cJhqdEwTdXzz+u4RoiEwibW66dBora7sRd5aYFTSrRZa0zenS6m4\n\tm6LmvhSJGF+dZgVmWGVpvRfgLwykUn2lwHKb0hsyBtKn29b+oEJz9Tu3rX77hyfi+6LH\n\tHln3xb49CfyUXDoFvq2s20S16bhsO/6LzoRAv0TzrQM585hr6VB1K4u29RGEvoCcVvAF\n\tHOePk3YdmEs/Zy1/t2d7vn9Ij1trPTmAHN/+dpqctYstzNUuXMv/VEzQlR6uIBHt5OQE\n\tYyEw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version\n\t:content-disposition:user-agent;\n\tbh=Q6I9UawXoamBhb1sEmaI1zjI4rJkcZrpgEsh/JoXrDE=;\n\tb=NMkYNfC+Ngm/z3tmlVsJD3VsqHzA+twkr6sgzoM4IdHNheZNXfhH4qTt8dL0jhRV8j\n\tIFDz0PoOc6R+yQF+GjCPIStTEbPTZFAl/zHoThEY64r54Eyybr4sBR/TSOQh6Q6dqHWT\n\tbBDrfdLWyKIIvFs3HJ0yt0jBty/f88uOLRoMQL//MUoS/85Wbk5nWpn78Rpz7WFIlenz\n\tyEBnZz9wfcLDqrv5jlMS4ycjYVO1rjEZWpCbWyh200nxX0zStxPiRySw2ncMmoO1UFfD\n\tSG8myRex/gSEs/ilE0uTKaDRC7q/S95kp5pqCmHtl71BuPE/5eq7/VIn3jyYvq8E2na2\n\tzD7A==","X-Gm-Message-State":"ANhLgQ3ewQ0a1zo9YUZigxfepIil6Xj4YQIMNI5Wntu72WQEuWPqOT7H\n\tA5QyKGfHVEvu1kFNj7vSdH0dO0npBt3qbw==","X-Google-Smtp-Source":"ADFU+vua6pB7f4kWlSRq+2FC/jVEaEx+ycAIyQYCgpj7PDAZ11dLR+XWlxO93+VfjZN4/U2GclSuIg==","X-Received":"by 2002:a65:558a:: with SMTP id j10mr2842834pgs.13.1585139313537;\n\tWed, 25 Mar 2020 05:28:33 -0700 (PDT)","Date":"Wed, 25 Mar 2020 17:58:25 +0530","From":"Kaaira Gupta <kgupta@es.iitr.ac.in>","To":"libcamera-devel@lists.libcamera.org,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tHelen Koike <helen.koike@collabora.com>,\n\tVaishali Thakkar <vthakkar@vaishalithakkar.in>","Cc":"kgupta@es.iitr.ac.in","Message-ID":"<20200325122825.GA16172@kaaira-HP-Pavilion-Notebook>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","User-Agent":"Mutt/1.9.4 (2018-02-28)","Subject":"[libcamera-devel] [PATCH] libcamera: v4l2PixelFormat: replace hex\n\twith 4CC","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":"Wed, 25 Mar 2020 12:28:35 -0000"},"content":"Print 4CC characters instead of the hex value in toString() as they are\nmore informative.\n\nSigned-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>\n---\n src/libcamera/v4l2_videodevice.cpp | 12 +++++++++---\n 1 file changed, 9 insertions(+), 3 deletions(-)","diff":"diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex b778181..ea8ee50 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -336,9 +336,15 @@ bool V4L2BufferCache::Entry::operator==(const FrameBuffer &buffer) const\n  */\n std::string V4L2PixelFormat::toString() const\n {\n-\tchar str[11];\n-\tsnprintf(str, 11, \"0x%08x\", fourcc_);\n-\treturn str;\n+\tstd::stringstream ss;\n+\tss << static_cast<char>(fourcc_ & 0x7f)\n+\t   << static_cast<char>((fourcc_ >> 8) & 0x7f)\n+\t   << static_cast<char>((fourcc_ >> 16) & 0x7f)\n+\t   << static_cast<char>((fourcc_ >> 24) & 0x7f);\n+\n+\tif (fourcc_ & (1 << 31))\n+\t\tss << \"-BE\";\n+\treturn ss.str();\n }\n \n /**\n","prefixes":["libcamera-devel"]}