{"id":89,"url":"https://patchwork.libcamera.org/api/covers/89/?format=json","web_url":"https://patchwork.libcamera.org/cover/89/","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":"<20181224153721.8359-1-jacopo@jmondi.org>","date":"2018-12-24T15:37:17","name":"[libcamera-devel,v2,0/4] Add MediaDevice and associated MediaObject","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"mbox":"https://patchwork.libcamera.org/cover/89/mbox/","series":[{"id":39,"url":"https://patchwork.libcamera.org/api/series/39/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=39","date":"2018-12-24T15:37:17","name":"Add MediaDevice and associated MediaObject","version":2,"mbox":"https://patchwork.libcamera.org/series/39/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/89/comments/","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[217.70.183.199])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 63D8C60B2E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 Dec 2018 16:37:28 +0100 (CET)","from archlinux.homenet.telecomitalia.it\n\t(host54-51-dynamic.16-87-r.retail.telecomitalia.it [87.16.51.54])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay9-d.mail.gandi.net (Postfix) with ESMTPSA id A567CFF803;\n\tMon, 24 Dec 2018 15:37:27 +0000 (UTC)"],"X-Originating-IP":"87.16.51.54","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 24 Dec 2018 16:37:17 +0100","Message-Id":"<20181224153721.8359-1-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.20.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 0/4] Add MediaDevice and associated\n\tMediaObject","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":"Mon, 24 Dec 2018 15:37:28 -0000"},"content":"Hello,\n   this is v2 of MediaDevice and friends.\n\nv1 available for reference here:\nhttps://lists.libcamera.org/pipermail/libcamera-devel/2018-December/000120.html\n\nWhile reviewing Kieran's and Niklas' patches I noticed some comments I made\non their series actually applied on my v1, so here it is the outcome of\na small private self-review. I'm sure I have missed something anyhow...\n\nIt's mostly about using 'const' a lot more for values returned by reference\nby getter functions, a more extensive use of 'auto' keyboard to shorten\niterators declarations and a few cosmetic changes.\n\nBoth branches (v1 and v2) are available for comparison\n(jmondi/master/media_device_v1 and jmondi/master/media_device_v2) and a diff\nis collected here: https://paste.debian.net/1057251/\n\nOn top of the first two patches that were included in v1, I have added what\nI proposed in the review of Niklas' series: a MediaDeviceDesc object and a\nmatch function to be added to the MediaDevice. Niklas, what do you think\nabout this? Does this help clarifying the proposal I made in the review\ncomments? (those patches are now broken out to eases discussion and review,\nbut will be ideally squashed on the [02/04] later).\n\nI have some private tests for IPU3, and the matching code looks like the\nfollowing:\n\n\tMediaDeviceDesc cio2_desc(\"ipu3-cio2\");\n\tcio2_desc.addEntity(\"ipu3-csi2 0\");\n\tcio2_desc.addEntity(\"ipu3-cio2 0\");\n\tcio2_desc.addEntity(\"ipu3-csi2 1\");\n\tcio2_desc.addEntity(\"ipu3-cio2 1\");\n\tcio2_desc.addEntity(\"ipu3-csi2 2\");\n\tcio2_desc.addEntity(\"ipu3-cio2 2\");\n\tcio2_desc.addEntity(\"ipu3-csi2 3\");\n\tcio2_desc.addEntity(\"ipu3-cio2 3\");\n\tcio2_desc.addEntity(\"ov13858 2-0010\");\n\tcio2_desc.addEntity(\"ov5670 4-0036\");\n\n\tbool match = cio2.match(cio2_desc);\n\tif (match) {\n\t\tLOG(Info) << \"CIO2 matched\";\n\t} else {\n\t\tLOG(Error) << \"Cannot match CIO2 with the provided desc\";\n\t\treturn -1;\n\t}\n\nIf we adopt something like this, in place of cio2.match() we would have a\nMediaEnumerator, as proposed by Niklas, but the idea stays the same: is the\nMediaDevice that matches the MediaDeviceDesc, and the MediaEnumerator receives\na MediaDeviceDesc and tries it on all its open MediaDevices.\n\nThanks\n   j\n\nv1 -> v2:\n- diff collected here: https://paste.debian.net/1057251/\n- patches 3 and 4 are new, broken out for review, to be squashed later.\n\nJacopo Mondi (4):\n  libcamera: Add MediaObject class hierarchy\n  libcamera: Add MediaDevice class\n  libcamera: media device: Add MediaDeviceDesc\n  libcamera: media device: Add 'match()' method\n\n src/libcamera/include/media_device.h | 115 +++++\n src/libcamera/include/media_object.h | 117 +++++\n src/libcamera/media_device.cpp       | 615 +++++++++++++++++++++++++++\n src/libcamera/media_object.cpp       | 302 +++++++++++++\n src/libcamera/meson.build            |   2 +\n 5 files changed, 1151 insertions(+)\n create mode 100644 src/libcamera/include/media_device.h\n create mode 100644 src/libcamera/include/media_object.h\n create mode 100644 src/libcamera/media_device.cpp\n create mode 100644 src/libcamera/media_object.cpp\n\n--\n2.20.1"}