{"id":417,"url":"https://patchwork.libcamera.org/api/1.1/patches/417/?format=json","web_url":"https://patchwork.libcamera.org/patch/417/","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":"<20190127005206.20901-1-niklas.soderlund@ragnatech.se>","date":"2019-01-27T00:52:06","name":"[libcamera-devel] libcamera: pipeline: uvcvideo: add warning if no default video device is found","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"5cd52397c8714ba2dd82596b79b4921b24237406","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/1.1/people/5/?format=json","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/417/mbox/","series":[{"id":145,"url":"https://patchwork.libcamera.org/api/1.1/series/145/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=145","date":"2019-01-27T00:52:06","name":"[libcamera-devel] libcamera: pipeline: uvcvideo: add warning if no default video device is found","version":1,"mbox":"https://patchwork.libcamera.org/series/145/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/417/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/417/checks/","tags":{},"headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6587260B1B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 27 Jan 2019 01:52:15 +0100 (CET)","from bismarck.berto.se (unknown [89.233.230.99])\n\tby bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid c503f79b-21cd-11e9-9adf-005056917a89;\n\tSun, 27 Jan 2019 01:52:09 +0100 (CET)"],"X-Halon-ID":"c503f79b-21cd-11e9-9adf-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":"Sun, 27 Jan 2019 01:52:06 +0100","Message-Id":"<20190127005206.20901-1-niklas.soderlund@ragnatech.se>","X-Mailer":"git-send-email 2.20.1","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] libcamera: pipeline: uvcvideo: add\n\twarning if no default video device is found","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":"Sun, 27 Jan 2019 00:52:15 -0000"},"content":"If for any reason a default video device is not found in the media graph\nthe creation of the UVC pipeline silently failed. This is not optimal\nwhen debugging problems with the pipeline, add a warning to notify the\nuser of the issue.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/libcamera/pipeline/uvcvideo.cpp | 6 ++++++\n 1 file changed, 6 insertions(+)","diff":"diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp\nindex c51e8bc1f2c2bf25..4ae179d24709c856 100644\n--- a/src/libcamera/pipeline/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo.cpp\n@@ -8,12 +8,15 @@\n #include <libcamera/camera.h>\n \n #include \"device_enumerator.h\"\n+#include \"log.h\"\n #include \"media_device.h\"\n #include \"pipeline_handler.h\"\n #include \"v4l2_device.h\"\n \n namespace libcamera {\n \n+LOG_DEFINE_CATEGORY(UVC)\n+\n class PipelineHandlerUVC : public PipelineHandler\n {\n public:\n@@ -60,6 +63,9 @@ bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator)\n \t}\n \n \tif (!video_ || video_->open()) {\n+\t\tif (!video_)\n+\t\t\tLOG(UVC, Warning) << \"Could not find a default video device\";\n+\n \t\tmedia_->release();\n \t\treturn false;\n \t}\n","prefixes":["libcamera-devel"]}