[{"id":530,"web_url":"https://patchwork.libcamera.org/comment/530/","msgid":"<20190123141936.GO4127@bigcity.dyn.berto.se>","date":"2019-01-23T14:19:36","subject":"Re: [libcamera-devel] [PATCH v2] libcamera: v4l2device: Obtain\n\tdevice capabilities","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Kieran,\n\nThanks for your work.\n\nOn 2019-01-23 13:45:30 +0000, Kieran Bingham wrote:\n> The capabilities structure from the kernel can return capabilities of the\n> driver, or potentially more specific device capabilities.\n> \n> Handle this with an inline function 'device_caps()' to return the device\n> specific capabilities when available, or fall back to the driver capabilities\n> otherwise.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nI like device_caps() better then caps() :-)\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/libcamera/include/v4l2_device.h | 12 +++++++++---\n>  src/libcamera/v4l2_device.cpp       |  7 +++++++\n>  2 files changed, 16 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\n> index b92e1f1c96c3..cb3601ca070c 100644\n> --- a/src/libcamera/include/v4l2_device.h\n> +++ b/src/libcamera/include/v4l2_device.h\n> @@ -26,10 +26,16 @@ struct V4L2Capability final : v4l2_capability {\n>  \t{\n>  \t\treturn reinterpret_cast<const char *>(v4l2_capability::bus_info);\n>  \t}\n> +\tunsigned int device_caps() const\n> +\t{\n> +\t\treturn capabilities & V4L2_CAP_DEVICE_CAPS\n> +\t\t\t\t    ? v4l2_capability::device_caps\n> +\t\t\t\t    : v4l2_capability::capabilities;\n> +\t}\n>  \n> -\tbool isCapture() const { return capabilities & V4L2_CAP_VIDEO_CAPTURE; }\n> -\tbool isOutput() const { return capabilities & V4L2_CAP_VIDEO_OUTPUT; }\n> -\tbool hasStreaming() const { return capabilities & V4L2_CAP_STREAMING; }\n> +\tbool isCapture() const { return device_caps() & V4L2_CAP_VIDEO_CAPTURE; }\n> +\tbool isOutput() const { return device_caps() & V4L2_CAP_VIDEO_OUTPUT; }\n> +\tbool hasStreaming() const { return device_caps() & V4L2_CAP_STREAMING; }\n>  };\n>  \n>  class MediaEntity;\n> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> index 2b17fa1eb0e8..0ce2b187f2f0 100644\n> --- a/src/libcamera/v4l2_device.cpp\n> +++ b/src/libcamera/v4l2_device.cpp\n> @@ -49,6 +49,13 @@ LOG_DEFINE_CATEGORY(V4L2)\n>   * \\return The string containing the device location\n>   */\n>  \n> +/**\n> + * \\fn unsigned int V4L2Capability::device_caps()\n> + * \\brief Retrieve the capabilities of the device\n> + * \\return The device specific capabilities if V4L2_CAP_DEVICE_CAPS is set or\n> + * \t   driver capabilities otherwise\n> + */\n> +\n>  /**\n>   * \\fn bool V4L2Capability::isCapture()\n>   * \\brief Identify if the device is capable of capturing video\n> -- \n> 2.19.1\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x143.google.com (mail-lf1-x143.google.com\n\t[IPv6:2a00:1450:4864:20::143])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CDF1A60C7D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Jan 2019 15:19:38 +0100 (CET)","by mail-lf1-x143.google.com with SMTP id i26so1731700lfc.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Jan 2019 06:19:38 -0800 (PST)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\tu79-v6sm577899lje.36.2019.01.23.06.19.36\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 23 Jan 2019 06:19:37 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=XtqDRFCnHB/7Zfx/jMjE6XoKYJfqaaC/hHUwxMjvmrU=;\n\tb=w5qdoIdVW5vIuULJ1JJILJDI2Lbmd+DcABMbM1x0pffy66gblKilCWwEpQ2crlRMsS\n\t+PlAV6la8nrU1hrmnW2TkJvSGSG4y7nCmqJ/J5yRP/Wmgoz+pWv5Jnsql0w5VfpjP/+D\n\tYoxL+oLpA8Td82r+xXZnVF6CfJxOzEe555xlxk15BDCKgy2T59N+U8DPZ4opnQKypsAq\n\tVGXGWhakSKsgy1umwOlgZmVJT96k6K626YdsFaQCJ4SOJRwvDu8/LjaR/ICVx1Xb4ToX\n\tqk7pOwz+oTqhvJm9xMgE2cnV1h32GWDRyIMoRVacWRT4e2dGAHQlCgkaHMmb5A2qeaPL\n\tiUnA==","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:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=XtqDRFCnHB/7Zfx/jMjE6XoKYJfqaaC/hHUwxMjvmrU=;\n\tb=l9iURntADQ7H2uvOdHDxHa/oTUdt/+QyCpLfOwCCh/FEX/9Vfuv1w4p+s7FDYrng1H\n\tRGL6mYRdtC+z9iF2KmdFjAtmXl+lVo34RLVlVYbCRfXifYmhJeFxP+3yIHGca2nxnq+3\n\tlq8k3xGFxqfpSgBE5mRn+ON5/WXkRcMfyyfpuzsDR9G4/AZvpRyZq/17KOGgsjRvYhfb\n\tRc9rZiKx1qwuFN3WP5Pu/DMvRRudU7zXt31u1SN1aJ0BUrOZZg0tf5S/1UoaTCVWkCc6\n\tJH0rrP2jgdBwFak/ei+xmvPAK2EYARjS0VNqiF/r2R7Z2vFyiOgR/2R06/n7MkaPWvbH\n\tLTUw==","X-Gm-Message-State":"AJcUukes+i7XtHlaLRC3GQ/6s3u6tEJZ2VDcPU2EL6yEaAyQHno8kP7E\n\tS7WeOxlGtTkwIZNp9jjmcTzYpg==","X-Google-Smtp-Source":"ALg8bN4GinWkqI8/47mX8fAgh70W7+ALhjrkph3izBXZ+GnpYH6dm7cB372xpqH7dmdkdjdYNjINKw==","X-Received":"by 2002:a19:10a4:: with SMTP id 36mr1969792lfq.60.1548253177831; \n\tWed, 23 Jan 2019 06:19:37 -0800 (PST)","Date":"Wed, 23 Jan 2019 15:19:36 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Message-ID":"<20190123141936.GO4127@bigcity.dyn.berto.se>","References":"<20190123134530.26993-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190123134530.26993-1-kieran.bingham@ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v2] libcamera: v4l2device: Obtain\n\tdevice capabilities","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":"Wed, 23 Jan 2019 14:19:39 -0000"}},{"id":531,"web_url":"https://patchwork.libcamera.org/comment/531/","msgid":"<7906d04e-1772-a987-d7fb-f57e7dd665f8@ideasonboard.com>","date":"2019-01-23T14:21:33","subject":"Re: [libcamera-devel] [PATCH v2] libcamera: v4l2device: Obtain\n\tdevice capabilities","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Niklas,\n\nOn 23/01/2019 14:19, Niklas Söderlund wrote:\n> Hi Kieran,\n> \n> Thanks for your work.\n> \n> On 2019-01-23 13:45:30 +0000, Kieran Bingham wrote:\n>> The capabilities structure from the kernel can return capabilities of the\n>> driver, or potentially more specific device capabilities.\n>>\n>> Handle this with an inline function 'device_caps()' to return the device\n>> specific capabilities when available, or fall back to the driver capabilities\n>> otherwise.\n>>\n>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> I like device_caps() better then caps() :-)\n\nThanks,\n\nI won't push this until I hear that Jacopo is aware of it as it will\nforce a rebase for his patches.\n\n--\nKieran\n\n\n> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> \n>> ---\n>>  src/libcamera/include/v4l2_device.h | 12 +++++++++---\n>>  src/libcamera/v4l2_device.cpp       |  7 +++++++\n>>  2 files changed, 16 insertions(+), 3 deletions(-)\n>>\n>> diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\n>> index b92e1f1c96c3..cb3601ca070c 100644\n>> --- a/src/libcamera/include/v4l2_device.h\n>> +++ b/src/libcamera/include/v4l2_device.h\n>> @@ -26,10 +26,16 @@ struct V4L2Capability final : v4l2_capability {\n>>  \t{\n>>  \t\treturn reinterpret_cast<const char *>(v4l2_capability::bus_info);\n>>  \t}\n>> +\tunsigned int device_caps() const\n>> +\t{\n>> +\t\treturn capabilities & V4L2_CAP_DEVICE_CAPS\n>> +\t\t\t\t    ? v4l2_capability::device_caps\n>> +\t\t\t\t    : v4l2_capability::capabilities;\n>> +\t}\n>>  \n>> -\tbool isCapture() const { return capabilities & V4L2_CAP_VIDEO_CAPTURE; }\n>> -\tbool isOutput() const { return capabilities & V4L2_CAP_VIDEO_OUTPUT; }\n>> -\tbool hasStreaming() const { return capabilities & V4L2_CAP_STREAMING; }\n>> +\tbool isCapture() const { return device_caps() & V4L2_CAP_VIDEO_CAPTURE; }\n>> +\tbool isOutput() const { return device_caps() & V4L2_CAP_VIDEO_OUTPUT; }\n>> +\tbool hasStreaming() const { return device_caps() & V4L2_CAP_STREAMING; }\n>>  };\n>>  \n>>  class MediaEntity;\n>> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n>> index 2b17fa1eb0e8..0ce2b187f2f0 100644\n>> --- a/src/libcamera/v4l2_device.cpp\n>> +++ b/src/libcamera/v4l2_device.cpp\n>> @@ -49,6 +49,13 @@ LOG_DEFINE_CATEGORY(V4L2)\n>>   * \\return The string containing the device location\n>>   */\n>>  \n>> +/**\n>> + * \\fn unsigned int V4L2Capability::device_caps()\n>> + * \\brief Retrieve the capabilities of the device\n>> + * \\return The device specific capabilities if V4L2_CAP_DEVICE_CAPS is set or\n>> + * \t   driver capabilities otherwise\n>> + */\n>> +\n>>  /**\n>>   * \\fn bool V4L2Capability::isCapture()\n>>   * \\brief Identify if the device is capable of capturing video\n>> -- \n>> 2.19.1\n>>\n>> _______________________________________________\n>> libcamera-devel mailing list\n>> libcamera-devel@lists.libcamera.org\n>> https://lists.libcamera.org/listinfo/libcamera-devel\n>","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 1A5B360C7D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Jan 2019 15:21:37 +0100 (CET)","from [192.168.0.21]\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 4A38E23D;\n\tWed, 23 Jan 2019 15:21:36 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1548253296;\n\tbh=tn7dwPj7tuQU2N6oDQ5xYsUxfO5WAipFk6jMlf3sRAA=;\n\th=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=c2y5IiEIjucxOzPQ8jwxaHGIwJp2ZrUchjWAMOfKZnYv+VonjdEH1Ks6agaibqwjY\n\ty/Ls3knKVLIZFiJAV5qyq7H2Vqjh9/gleVrejH8yIhtrCbi4/SV3psa2D5p5Pbl+HH\n\tI6X0eWudqktQn7iAR6uBrDV2Q3j+tOf2O+AToqnA=","Reply-To":"kieran.bingham@ideasonboard.com","To":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>,\n\tJacopo Mondi <jacopo@jmondi.org>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","References":"<20190123134530.26993-1-kieran.bingham@ideasonboard.com>\n\t<20190123141936.GO4127@bigcity.dyn.berto.se>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC\n\trRanWfelwQThCHckbobWiQJfK9n7rYNcPMq9B8e9F020LFH7Kj6YmO95ewJGgLm+idg1Kb3C\n\tpotzWkXc1xmPzcQ1fvQMOfMwdS+4SNw4rY9f07Xb2K99rjMwZVDgESKIzhsDB5GY465sCsiQ\n\tcSAZRxqE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K1kTAm2RTFg+w9oOp2Xjqfhds2PAhFFvrHQg1XfQR/UF/SjeUmaOmLSczM0s6XMeO\n\tVcE77UFtJ/+hLo4PRFKm5X1Pcar6g5m4xGqa+Xfzi9tRkwC29KMCoQOag1BhHChgqYaUH3yo\n\tUzaPwT/fY75iVI+yD0ih/e6j8qYvP8pvGwMQfrmN9YB0zB39YzCSdaUaNrWGD3iCBxg6lwSO\n\tLKeRhxxfiXCIYEf3vwOsP3YMx2JkD5doseXmWBGW1U0T/oJF+DVfKB6mv5UfsTzpVhJRgee7\n\t4jkjqFq4qsUGxcvF2xtRkfHFpZDbRgRlVmiWkqDkT4qMA+4q1y/dWwshSKi/uwVZNycuLsz+\n\t+OD8xPNCsMTqeUkAKfbD8xW4LCay3r/dD2ckoxRxtMD9eOAyu5wYzo/ydIPTh1QEj9SYyvp8\n\tO0g6CpxEwyHUQtF5oh15O018z3ZLztFJKR3RD42VKVsrnNDKnoY0f4U0z7eJv2NeF8xHMuiU\n\tRCIzqxX1GVYaNkKTnb/Qja8hnYnkUzY1Lc+OtwiGmXTwYsPZjjAaDX35J/RSKAoy5wGo/YFA\n\tJxB1gWThL4kOTbsqqXj9GLcyOImkW0lJGGR3o/fV91Zh63S5TKnf2YGGGzxki+ADdxVQAm+Q\n\tsbsRB8KNNvVXBOVNwko86rQqF9drZuw=","Organization":"Ideas on Board","Message-ID":"<7906d04e-1772-a987-d7fb-f57e7dd665f8@ideasonboard.com>","Date":"Wed, 23 Jan 2019 14:21:33 +0000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.2.1","MIME-Version":"1.0","In-Reply-To":"<20190123141936.GO4127@bigcity.dyn.berto.se>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH v2] libcamera: v4l2device: Obtain\n\tdevice capabilities","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":"Wed, 23 Jan 2019 14:21:37 -0000"}},{"id":533,"web_url":"https://patchwork.libcamera.org/comment/533/","msgid":"<20190123142903.o7eq7v36xhopzvos@uno.localdomain>","date":"2019-01-23T14:29:03","subject":"Re: [libcamera-devel] [PATCH v2] libcamera: v4l2device: Obtain\n\tdevice capabilities","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi,\n\nOn Wed, Jan 23, 2019 at 02:21:33PM +0000, Kieran Bingham wrote:\n> Hi Niklas,\n>\n> On 23/01/2019 14:19, Niklas Söderlund wrote:\n> > Hi Kieran,\n> >\n> > Thanks for your work.\n> >\n> > On 2019-01-23 13:45:30 +0000, Kieran Bingham wrote:\n> >> The capabilities structure from the kernel can return capabilities of the\n> >> driver, or potentially more specific device capabilities.\n> >>\n> >> Handle this with an inline function 'device_caps()' to return the device\n> >> specific capabilities when available, or fall back to the driver capabilities\n> >> otherwise.\n> >>\n> >> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> >\n> > I like device_caps() better then caps() :-)\n>\n> Thanks,\n>\n> I won't push this until I hear that Jacopo is aware of it as it will\n> force a rebase for his patches.\n\nAs 'device_caps' are a very specific type of capabilities, I like\ncaps() better than device_caps(). That said, please go ahead and push\nand thanks for waiting.\n\nThanks\n  j\n\n\n>\n> --\n> Kieran\n>\n>\n> > Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> >\n> >> ---\n> >>  src/libcamera/include/v4l2_device.h | 12 +++++++++---\n> >>  src/libcamera/v4l2_device.cpp       |  7 +++++++\n> >>  2 files changed, 16 insertions(+), 3 deletions(-)\n> >>\n> >> diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\n> >> index b92e1f1c96c3..cb3601ca070c 100644\n> >> --- a/src/libcamera/include/v4l2_device.h\n> >> +++ b/src/libcamera/include/v4l2_device.h\n> >> @@ -26,10 +26,16 @@ struct V4L2Capability final : v4l2_capability {\n> >>  \t{\n> >>  \t\treturn reinterpret_cast<const char *>(v4l2_capability::bus_info);\n> >>  \t}\n> >> +\tunsigned int device_caps() const\n> >> +\t{\n> >> +\t\treturn capabilities & V4L2_CAP_DEVICE_CAPS\n> >> +\t\t\t\t    ? v4l2_capability::device_caps\n> >> +\t\t\t\t    : v4l2_capability::capabilities;\n> >> +\t}\n> >>\n> >> -\tbool isCapture() const { return capabilities & V4L2_CAP_VIDEO_CAPTURE; }\n> >> -\tbool isOutput() const { return capabilities & V4L2_CAP_VIDEO_OUTPUT; }\n> >> -\tbool hasStreaming() const { return capabilities & V4L2_CAP_STREAMING; }\n> >> +\tbool isCapture() const { return device_caps() & V4L2_CAP_VIDEO_CAPTURE; }\n> >> +\tbool isOutput() const { return device_caps() & V4L2_CAP_VIDEO_OUTPUT; }\n> >> +\tbool hasStreaming() const { return device_caps() & V4L2_CAP_STREAMING; }\n> >>  };\n> >>\n> >>  class MediaEntity;\n> >> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> >> index 2b17fa1eb0e8..0ce2b187f2f0 100644\n> >> --- a/src/libcamera/v4l2_device.cpp\n> >> +++ b/src/libcamera/v4l2_device.cpp\n> >> @@ -49,6 +49,13 @@ LOG_DEFINE_CATEGORY(V4L2)\n> >>   * \\return The string containing the device location\n> >>   */\n> >>\n> >> +/**\n> >> + * \\fn unsigned int V4L2Capability::device_caps()\n> >> + * \\brief Retrieve the capabilities of the device\n> >> + * \\return The device specific capabilities if V4L2_CAP_DEVICE_CAPS is set or\n> >> + * \t   driver capabilities otherwise\n> >> + */\n> >> +\n> >>  /**\n> >>   * \\fn bool V4L2Capability::isCapture()\n> >>   * \\brief Identify if the device is capable of capturing video\n> >> --\n> >> 2.19.1\n> >>\n> >> _______________________________________________\n> >> libcamera-devel mailing list\n> >> libcamera-devel@lists.libcamera.org\n> >> https://lists.libcamera.org/listinfo/libcamera-devel\n> >\n>\n> --\n> Regards\n> --\n> Kieran","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net\n\t[217.70.183.194])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3842060C7D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Jan 2019 15:28:51 +0100 (CET)","from uno.localdomain (unknown [37.176.170.194])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 70E3B40012;\n\tWed, 23 Jan 2019 14:28:50 +0000 (UTC)"],"X-Originating-IP":"37.176.170.194","Date":"Wed, 23 Jan 2019 15:29:03 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>,\n\tLibCamera Devel <libcamera-devel@lists.libcamera.org>","Message-ID":"<20190123142903.o7eq7v36xhopzvos@uno.localdomain>","References":"<20190123134530.26993-1-kieran.bingham@ideasonboard.com>\n\t<20190123141936.GO4127@bigcity.dyn.berto.se>\n\t<7906d04e-1772-a987-d7fb-f57e7dd665f8@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"t6eg43j6hbjz3z7l\"","Content-Disposition":"inline","In-Reply-To":"<7906d04e-1772-a987-d7fb-f57e7dd665f8@ideasonboard.com>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH v2] libcamera: v4l2device: Obtain\n\tdevice capabilities","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":"Wed, 23 Jan 2019 14:28:51 -0000"}},{"id":534,"web_url":"https://patchwork.libcamera.org/comment/534/","msgid":"<687baff1-d985-d992-8b8a-6f414442c403@ideasonboard.com>","date":"2019-01-23T14:35:05","subject":"Re: [libcamera-devel] [PATCH v2] libcamera: v4l2device: Obtain\n\tdevice capabilities","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"On 23/01/2019 14:29, Jacopo Mondi wrote:\n> Hi,\n>>> I like device_caps() better then caps() :-)\n>>\n>> Thanks,\n>>\n>> I won't push this until I hear that Jacopo is aware of it as it will\n>> force a rebase for his patches.\n> \n> As 'device_caps' are a very specific type of capabilities, I like\n> caps() better than device_caps(). That said, please go ahead and push\n> and thanks for waiting.\n\nDone.\n\n--\nKieran","headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D9B8F60B2D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Jan 2019 15:35:08 +0100 (CET)","from [192.168.0.21]\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 3612823D;\n\tWed, 23 Jan 2019 15:35:08 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1548254108;\n\tbh=NuckH1Tr+J97p1z5seoB9ZtWr1hu601452cTsOZfdv0=;\n\th=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=gB9ZY2bcuu1R2zrp7rWQtrjI/qBgZlnHRqGa6NB2WFajEa5KR05qDq5eGnj3vZ8p+\n\tl5cF4gfXQL2ITVpKgBy9DbPl+xsdW+nuxeMR0aspH1+XTqQLbGQ050+1JXVvQcjmyL\n\tE/Q12ErCfJ3l2I0WmRK4WecSu7HqffspVJa4/CQQ=","Reply-To":"kieran.bingham@ideasonboard.com","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>,\n\tLibCamera Devel <libcamera-devel@lists.libcamera.org>","References":"<20190123134530.26993-1-kieran.bingham@ideasonboard.com>\n\t<20190123141936.GO4127@bigcity.dyn.berto.se>\n\t<7906d04e-1772-a987-d7fb-f57e7dd665f8@ideasonboard.com>\n\t<20190123142903.o7eq7v36xhopzvos@uno.localdomain>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC\n\trRanWfelwQThCHckbobWiQJfK9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qIMPph/G/jwZcdS6Hkyt/esHPuHNwX4guqTbVEuRqbDzDI\n\t2DJO5FbxABEBAAGJAiUEGAEKAA8CGwwFAlnDlGsFCQeA/gIACgkQoR5GchCkYf1yYRAAq+Yo\n\tnbf9DGdK1kTAm2RTFg+w9oOp2Xjqfhds2PAhFFvrHQg1XfQR/UF/SjeUmaOmLSczM0s6XMeO\n\tVcE77UFtJ/+hLo4PRFKm5X1Pcar6g5m4xGqa+Xfzi9tRkwC29KMCoQOag1BhHChgqYaUH3yo\n\tUzaPwT/fY75iVI+yD0ih/e6j8qYvP8pvGwMQfrmN9YB0zB39YzCSdaUaNrWGD3iCBxg6lwSO\n\tLKeRhxxfiXCIYEf3vwOsP3YMx2JkD5doseXmWBGW1U0T/oJF+DVfKB6mv5UfsTzpVhJRgee7\n\t4jkjqFq4qsUGxcvF2xtRkfHFpZDbRgRlVmiWkqDkT4qMA+4q1y/dWwshSKi/uwVZNycuLsz+\n\t+OD8xPNCsMTqeUkAKfbD8xW4LCay3r/dD2ckoxRxtMD9eOAyu5wYzo/ydIPTh1QEj9SYyvp8\n\tO0g6CpxEwyHUQtF5oh15O018z3ZLztFJKR3RD42VKVsrnNDKnoY0f4U0z7eJv2NeF8xHMuiU\n\tRCIzqxX1GVYaNkKTnb/Qja8hnYnkUzY1Lc+OtwiGmXTwYsPZjjAaDX35J/RSKAoy5wGo/YFA\n\tJxB1gWThL4kOTbsqqXj9GLcyOImkW0lJGGR3o/fV91Zh63S5TKnf2YGGGzxki+ADdxVQAm+Q\n\tsbsRB8KNNvVXBOVNwko86rQqF9drZuw=","Organization":"Ideas on Board","Message-ID":"<687baff1-d985-d992-8b8a-6f414442c403@ideasonboard.com>","Date":"Wed, 23 Jan 2019 14:35:05 +0000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.2.1","MIME-Version":"1.0","In-Reply-To":"<20190123142903.o7eq7v36xhopzvos@uno.localdomain>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v2] libcamera: v4l2device: Obtain\n\tdevice capabilities","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":"Wed, 23 Jan 2019 14:35:09 -0000"}},{"id":541,"web_url":"https://patchwork.libcamera.org/comment/541/","msgid":"<20190123160909.GD31885@pendragon.ideasonboard.com>","date":"2019-01-23T16:09:09","subject":"Re: [libcamera-devel] [PATCH v2] libcamera: v4l2device: Obtain\n\tdevice capabilities","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Wed, Jan 23, 2019 at 01:45:30PM +0000, Kieran Bingham wrote:\n> The capabilities structure from the kernel can return capabilities of the\n> driver, or potentially more specific device capabilities.\n> \n> Handle this with an inline function 'device_caps()' to return the device\n> specific capabilities when available, or fall back to the driver capabilities\n> otherwise.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  src/libcamera/include/v4l2_device.h | 12 +++++++++---\n>  src/libcamera/v4l2_device.cpp       |  7 +++++++\n>  2 files changed, 16 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\n> index b92e1f1c96c3..cb3601ca070c 100644\n> --- a/src/libcamera/include/v4l2_device.h\n> +++ b/src/libcamera/include/v4l2_device.h\n> @@ -26,10 +26,16 @@ struct V4L2Capability final : v4l2_capability {\n>  \t{\n>  \t\treturn reinterpret_cast<const char *>(v4l2_capability::bus_info);\n>  \t}\n> +\tunsigned int device_caps() const\n> +\t{\n> +\t\treturn capabilities & V4L2_CAP_DEVICE_CAPS\n> +\t\t\t\t    ? v4l2_capability::device_caps\n> +\t\t\t\t    : v4l2_capability::capabilities;\n> +\t}\n>  \n> -\tbool isCapture() const { return capabilities & V4L2_CAP_VIDEO_CAPTURE; }\n> -\tbool isOutput() const { return capabilities & V4L2_CAP_VIDEO_OUTPUT; }\n> -\tbool hasStreaming() const { return capabilities & V4L2_CAP_STREAMING; }\n> +\tbool isCapture() const { return device_caps() & V4L2_CAP_VIDEO_CAPTURE; }\n> +\tbool isOutput() const { return device_caps() & V4L2_CAP_VIDEO_OUTPUT; }\n> +\tbool hasStreaming() const { return device_caps() & V4L2_CAP_STREAMING; }\n\nWe're probably reaching the limit of what inline functions should do. If\nanother layer of indirection is needed we may want to de-inline some of\nthe functions. It's fine for now.\n\n>  };\n>  \n>  class MediaEntity;\n> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> index 2b17fa1eb0e8..0ce2b187f2f0 100644\n> --- a/src/libcamera/v4l2_device.cpp\n> +++ b/src/libcamera/v4l2_device.cpp\n> @@ -49,6 +49,13 @@ LOG_DEFINE_CATEGORY(V4L2)\n>   * \\return The string containing the device location\n>   */\n>  \n> +/**\n> + * \\fn unsigned int V4L2Capability::device_caps()\n> + * \\brief Retrieve the capabilities of the device\n> + * \\return The device specific capabilities if V4L2_CAP_DEVICE_CAPS is set or\n> + * \t   driver capabilities otherwise\n\nNo need for special indentation here. This doesn't require a fix in a\nfollow-up patch, but you could fix it if you touch this code later.\n\n> + */\n> +\n>  /**\n>   * \\fn bool V4L2Capability::isCapture()\n>   * \\brief Identify if the device is capable of capturing video","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2F77D60B2D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Jan 2019 17:09:11 +0100 (CET)","from pendragon.ideasonboard.com\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8B7A723D;\n\tWed, 23 Jan 2019 17:09:10 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1548259750;\n\tbh=rQPZsxs0sUKpqyeYWxQBh+OOF0Gr/9V67D9UyXfxu/8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=EEB7/3t25PVwR5nQdqq+l9vg7DOcK76KuHPkLa5Z0yOyGPWQ80m4JJz0D/MNN3lq3\n\tvKJKX/iBAwo9E0akbaadva8Y+3e9F690/VH/Ev59fTICV3idvKVKxavUbUiOKyNOX7\n\t/StwCuA/MoI8q+ogQZBg8NH/bLNmVolzfefHPbIs=","Date":"Wed, 23 Jan 2019 18:09:09 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Message-ID":"<20190123160909.GD31885@pendragon.ideasonboard.com>","References":"<20190123134530.26993-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190123134530.26993-1-kieran.bingham@ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v2] libcamera: v4l2device: Obtain\n\tdevice capabilities","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":"Wed, 23 Jan 2019 16:09:11 -0000"}},{"id":542,"web_url":"https://patchwork.libcamera.org/comment/542/","msgid":"<20190123161001.GE31885@pendragon.ideasonboard.com>","date":"2019-01-23T16:10:01","subject":"Re: [libcamera-devel] [PATCH v2] libcamera: v4l2device: Obtain\n\tdevice capabilities","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Wed, Jan 23, 2019 at 06:09:09PM +0200, Laurent Pinchart wrote:\n> Hi Niklas,\n\nOr maybe Kieran. This clearly shows I should automate name extraction\nfrom the sender :-)\n\n> Thank you for the patch.\n> \n> On Wed, Jan 23, 2019 at 01:45:30PM +0000, Kieran Bingham wrote:\n> > The capabilities structure from the kernel can return capabilities of the\n> > driver, or potentially more specific device capabilities.\n> > \n> > Handle this with an inline function 'device_caps()' to return the device\n> > specific capabilities when available, or fall back to the driver capabilities\n> > otherwise.\n> > \n> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > ---\n> >  src/libcamera/include/v4l2_device.h | 12 +++++++++---\n> >  src/libcamera/v4l2_device.cpp       |  7 +++++++\n> >  2 files changed, 16 insertions(+), 3 deletions(-)\n> > \n> > diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\n> > index b92e1f1c96c3..cb3601ca070c 100644\n> > --- a/src/libcamera/include/v4l2_device.h\n> > +++ b/src/libcamera/include/v4l2_device.h\n> > @@ -26,10 +26,16 @@ struct V4L2Capability final : v4l2_capability {\n> >  \t{\n> >  \t\treturn reinterpret_cast<const char *>(v4l2_capability::bus_info);\n> >  \t}\n> > +\tunsigned int device_caps() const\n> > +\t{\n> > +\t\treturn capabilities & V4L2_CAP_DEVICE_CAPS\n> > +\t\t\t\t    ? v4l2_capability::device_caps\n> > +\t\t\t\t    : v4l2_capability::capabilities;\n> > +\t}\n> >  \n> > -\tbool isCapture() const { return capabilities & V4L2_CAP_VIDEO_CAPTURE; }\n> > -\tbool isOutput() const { return capabilities & V4L2_CAP_VIDEO_OUTPUT; }\n> > -\tbool hasStreaming() const { return capabilities & V4L2_CAP_STREAMING; }\n> > +\tbool isCapture() const { return device_caps() & V4L2_CAP_VIDEO_CAPTURE; }\n> > +\tbool isOutput() const { return device_caps() & V4L2_CAP_VIDEO_OUTPUT; }\n> > +\tbool hasStreaming() const { return device_caps() & V4L2_CAP_STREAMING; }\n> \n> We're probably reaching the limit of what inline functions should do. If\n> another layer of indirection is needed we may want to de-inline some of\n> the functions. It's fine for now.\n> \n> >  };\n> >  \n> >  class MediaEntity;\n> > diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> > index 2b17fa1eb0e8..0ce2b187f2f0 100644\n> > --- a/src/libcamera/v4l2_device.cpp\n> > +++ b/src/libcamera/v4l2_device.cpp\n> > @@ -49,6 +49,13 @@ LOG_DEFINE_CATEGORY(V4L2)\n> >   * \\return The string containing the device location\n> >   */\n> >  \n> > +/**\n> > + * \\fn unsigned int V4L2Capability::device_caps()\n> > + * \\brief Retrieve the capabilities of the device\n> > + * \\return The device specific capabilities if V4L2_CAP_DEVICE_CAPS is set or\n> > + * \t   driver capabilities otherwise\n> \n> No need for special indentation here. This doesn't require a fix in a\n> follow-up patch, but you could fix it if you touch this code later.\n> \n> > + */\n> > +\n> >  /**\n> >   * \\fn bool V4L2Capability::isCapture()\n> >   * \\brief Identify if the device is capable of capturing video","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7C73360B2D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Jan 2019 17:10:02 +0100 (CET)","from pendragon.ideasonboard.com\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1971623D;\n\tWed, 23 Jan 2019 17:10:02 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1548259802;\n\tbh=VGQCrquRdmY2MhRU0yKEQH3I40QOOLsL+BEXFlYPAH0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Rux8XxkkzHBIc+jOEI0W/RJTc9q9j3aPFnVJK/tqHsllfJmfHopgQurS1MN3g0/a+\n\tT3CukSZ2HT2EzV3e7FgScpFKaJEZj8YA4VMDCvCOkYXOaQYnRMD/7o4rPam3sqXDfK\n\tfI9E3xtt25NkuZb3F8F8hVo0pIHSkeGzRITtCgEg=","Date":"Wed, 23 Jan 2019 18:10:01 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Message-ID":"<20190123161001.GE31885@pendragon.ideasonboard.com>","References":"<20190123134530.26993-1-kieran.bingham@ideasonboard.com>\n\t<20190123160909.GD31885@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190123160909.GD31885@pendragon.ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v2] libcamera: v4l2device: Obtain\n\tdevice capabilities","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":"Wed, 23 Jan 2019 16:10:02 -0000"}}]