{"id":1751,"url":"https://patchwork.libcamera.org/api/patches/1751/?format=json","web_url":"https://patchwork.libcamera.org/patch/1751/","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":"<20190808151221.24254-3-kieran.bingham@ideasonboard.com>","date":"2019-08-08T15:12:17","name":"[libcamera-devel,2/6] libcamera: v4l2_videodevice: Fix ordering of debug statement","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"58529767ff37e09de14b9d9d675203227c775eb1","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/1751/mbox/","series":[{"id":449,"url":"https://patchwork.libcamera.org/api/series/449/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=449","date":"2019-08-08T15:12:15","name":"V4L2 M2M Support (+RPi PoC)","version":1,"mbox":"https://patchwork.libcamera.org/series/449/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/1751/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/1751/checks/","tags":{},"headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AB4AF615FF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  8 Aug 2019 17:12:26 +0200 (CEST)","from localhost.localdomain\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3FE39737;\n\tThu,  8 Aug 2019 17:12:26 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1565277146;\n\tbh=6OcXaBu06vIo4/eSMUUCV+xbOCseODISKxS5nz5B62g=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=kGMQ4G3FB5h/bwpUJbp2HGlr4Vf2DWBvsodWBlQwilVjsJPHBeWmsmGr00a27dnHX\n\tgrjI5seyF0jQvi4jePDQx9sgPWILCSE37+y+dy90Qnyg06c3TQjidKi1OJfZzy73OX\n\ttsKsap8cf5w+JBBfLLZJ5KDEOcgiOW4tAgE0hmRU=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Date":"Thu,  8 Aug 2019 16:12:17 +0100","Message-Id":"<20190808151221.24254-3-kieran.bingham@ideasonboard.com>","X-Mailer":"git-send-email 2.20.1","In-Reply-To":"<20190808151221.24254-1-kieran.bingham@ideasonboard.com>","References":"<20190808151221.24254-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 2/6] libcamera: v4l2_videodevice: Fix\n\tordering of debug statement","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":"Thu, 08 Aug 2019 15:12:26 -0000"},"content":"The \"Opened device\" statement occurs before the buffertype_ is set.\n\nThis causes all devices to report that they are [out] devices at open()\nregardless of their type.\n\nAs the message operates in the past-tense, move the statement to the end\nof the function when all work has been completed.\n\nFixes: 04d5be7f76fe (\"libcamera: v4l2_device: Inherit from Loggable to\n                      print device node name\")\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/libcamera/v4l2_videodevice.cpp | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)","diff":"diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex c43d7cc557a0..81098dd70190 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -314,10 +314,6 @@ int V4L2VideoDevice::open()\n \t\treturn ret;\n \t}\n \n-\tLOG(V4L2, Debug)\n-\t\t<< \"Opened device \" << caps_.bus_info() << \": \"\n-\t\t<< caps_.driver() << \": \" << caps_.card();\n-\n \tif (!caps_.hasStreaming()) {\n \t\tLOG(V4L2, Error) << \"Device does not support streaming I/O\";\n \t\treturn -EINVAL;\n@@ -352,6 +348,10 @@ int V4L2VideoDevice::open()\n \tfdEvent_->activated.connect(this, &V4L2VideoDevice::bufferAvailable);\n \tfdEvent_->setEnabled(false);\n \n+\tLOG(V4L2, Debug)\n+\t\t<< \"Opened device \" << caps_.bus_info() << \": \"\n+\t\t<< caps_.driver() << \": \" << caps_.card();\n+\n \treturn 0;\n }\n \n","prefixes":["libcamera-devel","2/6"]}