[{"id":1574,"web_url":"https://patchwork.libcamera.org/comment/1574/","msgid":"<20190511031346.GG12768@pendragon.ideasonboard.com>","date":"2019-05-11T03:13:46","subject":"Re: [libcamera-devel] [PATCH v2 02/11] libcamera: media_device:\n\tOpen and close media device inside populate()","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, May 08, 2019 at 05:18:22PM +0200, Niklas Söderlund wrote:\n> Remove the need for the caller to open and close the media device when\n> populating the MediaDevice. This is done as an effort to make the usage\n> of the MediaDevice less error prone and the interface stricter.\n> \n> The rework also revealed and fixes a potential memory leak in\n> MediaDevice::populate() where resources would not be deleted if the\n> second MEDIA_IOC_G_TOPOLOGY would fail.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  src/libcamera/device_enumerator.cpp           |  8 +------\n>  src/libcamera/media_device.cpp                | 12 +++++++++--\n>  test/media_device/media_device_print_test.cpp |  6 ------\n>  test/pipeline/ipu3/ipu3_pipeline_test.cpp     |  5 -----\n>  test/v4l2_device/v4l2_device_test.cpp         |  5 -----\n>  test/v4l2_subdevice/v4l2_subdevice_test.cpp   | 21 +------------------\n>  6 files changed, 12 insertions(+), 45 deletions(-)\n> \n> diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp\n> index 259eec41776e2ec4..6fcbae76b64e3774 100644\n> --- a/src/libcamera/device_enumerator.cpp\n> +++ b/src/libcamera/device_enumerator.cpp\n> @@ -207,11 +207,7 @@ int DeviceEnumerator::addDevice(const std::string &deviceNode)\n>  {\n>  \tstd::shared_ptr<MediaDevice> media = std::make_shared<MediaDevice>(deviceNode);\n>  \n> -\tint ret = media->open();\n> -\tif (ret < 0)\n> -\t\treturn ret;\n> -\n> -\tret = media->populate();\n> +\tint ret = media->populate();\n>  \tif (ret < 0) {\n>  \t\tLOG(DeviceEnumerator, Info)\n>  \t\t\t<< \"Unable to populate media device \" << deviceNode\n> @@ -238,8 +234,6 @@ int DeviceEnumerator::addDevice(const std::string &deviceNode)\n>  \t\t\treturn ret;\n>  \t}\n>  \n> -\tmedia->close();\n> -\n>  \tLOG(DeviceEnumerator, Debug)\n>  \t\t<< \"Added device \" << deviceNode << \": \" << media->driver();\n>  \n> diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp\n> index 449571fb4b78fb94..4b3b8f1fa3e6aaad 100644\n> --- a/src/libcamera/media_device.cpp\n> +++ b/src/libcamera/media_device.cpp\n> @@ -221,6 +221,10 @@ int MediaDevice::populate()\n>  \n>  \tclear();\n>  \n> +\tret = open();\n> +\tif (ret)\n> +\t\treturn ret;\n> +\n>  \t/*\n>  \t * Keep calling G_TOPOLOGY until the version number stays stable.\n>  \t */\n> @@ -237,8 +241,9 @@ int MediaDevice::populate()\n>  \t\t\tLOG(MediaDevice, Error)\n>  \t\t\t\t<< \"Failed to enumerate topology: \"\n>  \t\t\t\t<< strerror(-ret);\n> -\t\t\treturn ret;\n> +\t\t\tgoto done;\n>  \t\t}\n> +\t\tret = 0;\n\nthe ioctl() call is supposed to return 0 on success, so this isn't\nstrictly needed. If you want to play safe I would move this assignment\njust before the done: label.\n\n>  \n>  \t\tif (version == topology.topology_version)\n>  \t\t\tbreak;\n> @@ -262,6 +267,9 @@ int MediaDevice::populate()\n>  \t    populateLinks(topology))\n>  \t\tvalid_ = true;\n>  \n> +done:\n> +\tclose();\n> +\n>  \tdelete[] ents;\n>  \tdelete[] interfaces;\n>  \tdelete[] pads;\n> @@ -272,7 +280,7 @@ int MediaDevice::populate()\n>  \t\treturn -EINVAL;\n>  \t}\n>  \n> -\treturn 0;\n> +\treturn ret;\n>  }\n>  \n>  /**\n> diff --git a/test/media_device/media_device_print_test.cpp b/test/media_device/media_device_print_test.cpp\n> index 3eef973939201b27..ceffd538e13fca73 100644\n> --- a/test/media_device/media_device_print_test.cpp\n> +++ b/test/media_device/media_device_print_test.cpp\n> @@ -124,10 +124,6 @@ int MediaDevicePrintTest::testMediaDevice(const string deviceNode)\n>  \n>  \tdev.close();\n>  \n> -\tret = dev.open();\n> -\tif (ret)\n> -\t\treturn ret;\n> -\n>  \tret = dev.populate();\n>  \tif (ret)\n>  \t\treturn ret;\n> @@ -135,8 +131,6 @@ int MediaDevicePrintTest::testMediaDevice(const string deviceNode)\n>  \t/* Print out the media graph. */\n>  \tprintMediaGraph(dev, cerr);\n>  \n> -\tdev.close();\n> -\n>  \treturn 0;\n>  }\n>  \n> diff --git a/test/pipeline/ipu3/ipu3_pipeline_test.cpp b/test/pipeline/ipu3/ipu3_pipeline_test.cpp\n> index 953f0233cde485cb..1d4cc4d4950b8391 100644\n> --- a/test/pipeline/ipu3/ipu3_pipeline_test.cpp\n> +++ b/test/pipeline/ipu3/ipu3_pipeline_test.cpp\n> @@ -71,11 +71,6 @@ int IPU3PipelineTest::init()\n>  \t\treturn TestSkip;\n>  \t}\n>  \n> -\tif (cio2->open()) {\n> -\t\tcerr << \"Failed to open media device \" << cio2->deviceNode() << endl;\n> -\t\treturn TestFail;\n> -\t}\n> -\n>  \t/*\n>  \t * Camera sensor are connected to the CIO2 unit.\n>  \t * Count how many sensors are connected in the system\n> diff --git a/test/v4l2_device/v4l2_device_test.cpp b/test/v4l2_device/v4l2_device_test.cpp\n> index 90e5f7a3ee0c0f2f..833038d56ea4631d 100644\n> --- a/test/v4l2_device/v4l2_device_test.cpp\n> +++ b/test/v4l2_device/v4l2_device_test.cpp\n> @@ -46,9 +46,6 @@ int V4L2DeviceTest::init()\n>  \tif (!media_)\n>  \t\treturn TestSkip;\n>  \n> -\tif (!media_->acquire())\n> -\t\treturn TestSkip;\n> -\n\nIs this related to this patch ? The commit message doesn't mention the\nremoval of acquire() and release() calls.\n\n>  \tMediaEntity *entity = media_->getEntityByName(\"vivid-000-vid-cap\");\n>  \tif (!entity)\n>  \t\treturn TestSkip;\n> @@ -62,8 +59,6 @@ int V4L2DeviceTest::init()\n>  \n>  void V4L2DeviceTest::cleanup()\n>  {\n> -\tmedia_->release();\n> -\n>  \tcapture_->streamOff();\n>  \tcapture_->releaseBuffers();\n>  \tcapture_->close();\n> diff --git a/test/v4l2_subdevice/v4l2_subdevice_test.cpp b/test/v4l2_subdevice/v4l2_subdevice_test.cpp\n> index 4e16ab6cf3e5f874..562a638cb28ebfb2 100644\n> --- a/test/v4l2_subdevice/v4l2_subdevice_test.cpp\n> +++ b/test/v4l2_subdevice/v4l2_subdevice_test.cpp\n> @@ -45,33 +45,16 @@ int V4L2SubdeviceTest::init()\n>  \t\treturn TestSkip;\n>  \t}\n>  \n> -\tif (!media_->acquire()) {\n> -\t\tcerr << \"Unable to acquire media device \"\n> -\t\t     << media_->deviceNode() << endl;\n> -\t\treturn TestSkip;\n> -\t}\n> -\n> -\tint ret = media_->open();\n> -\tif (ret) {\n> -\t\tcerr << \"Unable to open media device: \" << media_->deviceNode()\n> -\t\t     << \": \" << strerror(ret) << endl;\n> -\t\tmedia_->release();\n> -\t\treturn TestSkip;\n> -\t}\n> -\n>  \tMediaEntity *videoEntity = media_->getEntityByName(\"Scaler\");\n>  \tif (!videoEntity) {\n>  \t\tcerr << \"Unable to find media entity 'Scaler'\" << endl;\n> -\t\tmedia_->release();\n>  \t\treturn TestFail;\n>  \t}\n>  \n>  \tscaler_ = new V4L2Subdevice(videoEntity);\n> -\tret = scaler_->open();\n> -\tif (ret) {\n> +\tif (scaler_->open()) {\n>  \t\tcerr << \"Unable to open video subdevice \"\n>  \t\t     << scaler_->entity()->deviceNode() << endl;\n> -\t\tmedia_->release();\n>  \t\treturn TestSkip;\n>  \t}\n>  \n> @@ -80,7 +63,5 @@ int V4L2SubdeviceTest::init()\n>  \n>  void V4L2SubdeviceTest::cleanup()\n>  {\n> -\tmedia_->release();\n> -\n>  \tdelete scaler_;\n>  }","headers":{"Return-Path":"<laurent.pinchart@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 3472A60E4D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 11 May 2019 05:14:03 +0200 (CEST)","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 8FCAB2DF;\n\tSat, 11 May 2019 05:14:02 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1557544442;\n\tbh=dS1rnvf49QujkFEDLBL7OoQ4jifYgZ2E87aaHticjZg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=pYY5ywvmhWi47eIOD7EImfhCHZSnsgY2QR5otNvPL5qw0h7rvzzZL64oBeTqPEs3R\n\tr57JThVpLrGEhUp3QQyTYucJ1v0uiwrg4h7Cvgad6tPPQ7yXjLy3DdjaURNMcavqdd\n\ti7lvBVFzYzg0jlNA1EzVbmEc89xNslWLYg4ZhrU8=","Date":"Sat, 11 May 2019 06:13:46 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190511031346.GG12768@pendragon.ideasonboard.com>","References":"<20190508151831.12274-1-niklas.soderlund@ragnatech.se>\n\t<20190508151831.12274-3-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190508151831.12274-3-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v2 02/11] libcamera: media_device:\n\tOpen and close media device inside populate()","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":"Sat, 11 May 2019 03:14:03 -0000"}},{"id":1577,"web_url":"https://patchwork.libcamera.org/comment/1577/","msgid":"<20190511084522.GG28561@bigcity.dyn.berto.se>","date":"2019-05-11T08:45:22","subject":"Re: [libcamera-devel] [PATCH v2 02/11] libcamera: media_device:\n\tOpen and close media device inside populate()","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your feedback.\n\nOn 2019-05-11 06:13:46 +0300, Laurent Pinchart wrote:\n> Hi Niklas,\n> \n> Thank you for the patch.\n> \n> On Wed, May 08, 2019 at 05:18:22PM +0200, Niklas Söderlund wrote:\n> > Remove the need for the caller to open and close the media device when\n> > populating the MediaDevice. This is done as an effort to make the usage\n> > of the MediaDevice less error prone and the interface stricter.\n> > \n> > The rework also revealed and fixes a potential memory leak in\n> > MediaDevice::populate() where resources would not be deleted if the\n> > second MEDIA_IOC_G_TOPOLOGY would fail.\n> > \n> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > ---\n> >  src/libcamera/device_enumerator.cpp           |  8 +------\n> >  src/libcamera/media_device.cpp                | 12 +++++++++--\n> >  test/media_device/media_device_print_test.cpp |  6 ------\n> >  test/pipeline/ipu3/ipu3_pipeline_test.cpp     |  5 -----\n> >  test/v4l2_device/v4l2_device_test.cpp         |  5 -----\n> >  test/v4l2_subdevice/v4l2_subdevice_test.cpp   | 21 +------------------\n> >  6 files changed, 12 insertions(+), 45 deletions(-)\n> > \n> > diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp\n> > index 259eec41776e2ec4..6fcbae76b64e3774 100644\n> > --- a/src/libcamera/device_enumerator.cpp\n> > +++ b/src/libcamera/device_enumerator.cpp\n> > @@ -207,11 +207,7 @@ int DeviceEnumerator::addDevice(const std::string &deviceNode)\n> >  {\n> >  \tstd::shared_ptr<MediaDevice> media = std::make_shared<MediaDevice>(deviceNode);\n> >  \n> > -\tint ret = media->open();\n> > -\tif (ret < 0)\n> > -\t\treturn ret;\n> > -\n> > -\tret = media->populate();\n> > +\tint ret = media->populate();\n> >  \tif (ret < 0) {\n> >  \t\tLOG(DeviceEnumerator, Info)\n> >  \t\t\t<< \"Unable to populate media device \" << deviceNode\n> > @@ -238,8 +234,6 @@ int DeviceEnumerator::addDevice(const std::string &deviceNode)\n> >  \t\t\treturn ret;\n> >  \t}\n> >  \n> > -\tmedia->close();\n> > -\n> >  \tLOG(DeviceEnumerator, Debug)\n> >  \t\t<< \"Added device \" << deviceNode << \": \" << media->driver();\n> >  \n> > diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp\n> > index 449571fb4b78fb94..4b3b8f1fa3e6aaad 100644\n> > --- a/src/libcamera/media_device.cpp\n> > +++ b/src/libcamera/media_device.cpp\n> > @@ -221,6 +221,10 @@ int MediaDevice::populate()\n> >  \n> >  \tclear();\n> >  \n> > +\tret = open();\n> > +\tif (ret)\n> > +\t\treturn ret;\n> > +\n> >  \t/*\n> >  \t * Keep calling G_TOPOLOGY until the version number stays stable.\n> >  \t */\n> > @@ -237,8 +241,9 @@ int MediaDevice::populate()\n> >  \t\t\tLOG(MediaDevice, Error)\n> >  \t\t\t\t<< \"Failed to enumerate topology: \"\n> >  \t\t\t\t<< strerror(-ret);\n> > -\t\t\treturn ret;\n> > +\t\t\tgoto done;\n> >  \t\t}\n> > +\t\tret = 0;\n> \n> the ioctl() call is supposed to return 0 on success, so this isn't\n> strictly needed. If you want to play safe I would move this assignment\n> just before the done: label.\n\nMy documentation states that ioctl() shall return a value other then -1 \non success, the check we have are\n\n    ret = ioctl();\n    if (ret < 0) {\n        ... error ...\n    }\n\nI added the ret = 0 here to illustrate that we \"mark\" the ioctl() OK. I \ndo not feel strongly about this and will move it to just before the done \nlabel in the next version.\n\n> \n> >  \n> >  \t\tif (version == topology.topology_version)\n> >  \t\t\tbreak;\n> > @@ -262,6 +267,9 @@ int MediaDevice::populate()\n> >  \t    populateLinks(topology))\n> >  \t\tvalid_ = true;\n> >  \n> > +done:\n> > +\tclose();\n> > +\n> >  \tdelete[] ents;\n> >  \tdelete[] interfaces;\n> >  \tdelete[] pads;\n> > @@ -272,7 +280,7 @@ int MediaDevice::populate()\n> >  \t\treturn -EINVAL;\n> >  \t}\n> >  \n> > -\treturn 0;\n> > +\treturn ret;\n> >  }\n> >  \n> >  /**\n> > diff --git a/test/media_device/media_device_print_test.cpp b/test/media_device/media_device_print_test.cpp\n> > index 3eef973939201b27..ceffd538e13fca73 100644\n> > --- a/test/media_device/media_device_print_test.cpp\n> > +++ b/test/media_device/media_device_print_test.cpp\n> > @@ -124,10 +124,6 @@ int MediaDevicePrintTest::testMediaDevice(const string deviceNode)\n> >  \n> >  \tdev.close();\n> >  \n> > -\tret = dev.open();\n> > -\tif (ret)\n> > -\t\treturn ret;\n> > -\n> >  \tret = dev.populate();\n> >  \tif (ret)\n> >  \t\treturn ret;\n> > @@ -135,8 +131,6 @@ int MediaDevicePrintTest::testMediaDevice(const string deviceNode)\n> >  \t/* Print out the media graph. */\n> >  \tprintMediaGraph(dev, cerr);\n> >  \n> > -\tdev.close();\n> > -\n> >  \treturn 0;\n> >  }\n> >  \n> > diff --git a/test/pipeline/ipu3/ipu3_pipeline_test.cpp b/test/pipeline/ipu3/ipu3_pipeline_test.cpp\n> > index 953f0233cde485cb..1d4cc4d4950b8391 100644\n> > --- a/test/pipeline/ipu3/ipu3_pipeline_test.cpp\n> > +++ b/test/pipeline/ipu3/ipu3_pipeline_test.cpp\n> > @@ -71,11 +71,6 @@ int IPU3PipelineTest::init()\n> >  \t\treturn TestSkip;\n> >  \t}\n> >  \n> > -\tif (cio2->open()) {\n> > -\t\tcerr << \"Failed to open media device \" << cio2->deviceNode() << endl;\n> > -\t\treturn TestFail;\n> > -\t}\n> > -\n> >  \t/*\n> >  \t * Camera sensor are connected to the CIO2 unit.\n> >  \t * Count how many sensors are connected in the system\n> > diff --git a/test/v4l2_device/v4l2_device_test.cpp b/test/v4l2_device/v4l2_device_test.cpp\n> > index 90e5f7a3ee0c0f2f..833038d56ea4631d 100644\n> > --- a/test/v4l2_device/v4l2_device_test.cpp\n> > +++ b/test/v4l2_device/v4l2_device_test.cpp\n> > @@ -46,9 +46,6 @@ int V4L2DeviceTest::init()\n> >  \tif (!media_)\n> >  \t\treturn TestSkip;\n> >  \n> > -\tif (!media_->acquire())\n> > -\t\treturn TestSkip;\n> > -\n> \n> Is this related to this patch ? The commit message doesn't mention the\n> removal of acquire() and release() calls.\n\nYou are correct. This was found when removing the open() and close() and \nsomehow was added to this patch, will break this out to it's own patch \nor maybe even merge with 1/11.\n\n> \n> >  \tMediaEntity *entity = media_->getEntityByName(\"vivid-000-vid-cap\");\n> >  \tif (!entity)\n> >  \t\treturn TestSkip;\n> > @@ -62,8 +59,6 @@ int V4L2DeviceTest::init()\n> >  \n> >  void V4L2DeviceTest::cleanup()\n> >  {\n> > -\tmedia_->release();\n> > -\n> >  \tcapture_->streamOff();\n> >  \tcapture_->releaseBuffers();\n> >  \tcapture_->close();\n> > diff --git a/test/v4l2_subdevice/v4l2_subdevice_test.cpp b/test/v4l2_subdevice/v4l2_subdevice_test.cpp\n> > index 4e16ab6cf3e5f874..562a638cb28ebfb2 100644\n> > --- a/test/v4l2_subdevice/v4l2_subdevice_test.cpp\n> > +++ b/test/v4l2_subdevice/v4l2_subdevice_test.cpp\n> > @@ -45,33 +45,16 @@ int V4L2SubdeviceTest::init()\n> >  \t\treturn TestSkip;\n> >  \t}\n> >  \n> > -\tif (!media_->acquire()) {\n> > -\t\tcerr << \"Unable to acquire media device \"\n> > -\t\t     << media_->deviceNode() << endl;\n> > -\t\treturn TestSkip;\n> > -\t}\n> > -\n> > -\tint ret = media_->open();\n> > -\tif (ret) {\n> > -\t\tcerr << \"Unable to open media device: \" << media_->deviceNode()\n> > -\t\t     << \": \" << strerror(ret) << endl;\n> > -\t\tmedia_->release();\n> > -\t\treturn TestSkip;\n> > -\t}\n> > -\n> >  \tMediaEntity *videoEntity = media_->getEntityByName(\"Scaler\");\n> >  \tif (!videoEntity) {\n> >  \t\tcerr << \"Unable to find media entity 'Scaler'\" << endl;\n> > -\t\tmedia_->release();\n> >  \t\treturn TestFail;\n> >  \t}\n> >  \n> >  \tscaler_ = new V4L2Subdevice(videoEntity);\n> > -\tret = scaler_->open();\n> > -\tif (ret) {\n> > +\tif (scaler_->open()) {\n> >  \t\tcerr << \"Unable to open video subdevice \"\n> >  \t\t     << scaler_->entity()->deviceNode() << endl;\n> > -\t\tmedia_->release();\n> >  \t\treturn TestSkip;\n> >  \t}\n> >  \n> > @@ -80,7 +63,5 @@ int V4L2SubdeviceTest::init()\n> >  \n> >  void V4L2SubdeviceTest::cleanup()\n> >  {\n> > -\tmedia_->release();\n> > -\n> >  \tdelete scaler_;\n> >  }\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lj1-x244.google.com (mail-lj1-x244.google.com\n\t[IPv6:2a00:1450:4864:20::244])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 73C0260E4E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 11 May 2019 10:45:26 +0200 (CEST)","by mail-lj1-x244.google.com with SMTP id h19so572020ljj.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 11 May 2019 01:45:26 -0700 (PDT)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\tf9sm1965317ljf.69.2019.05.11.01.45.22\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tSat, 11 May 2019 01:45:24 -0700 (PDT)"],"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=5LSwcwQySkHLTIM2vb894fxV6Mt6PGPHTWNZRFxH0yA=;\n\tb=SSaxtfhdLh2GBc2Gbylkjk8UlvSv7C+ZEC+53uxGAtlq1tyijPRsREuy5Hj8tC5fej\n\tRnocYetn9qD+O2KGw6Uzr5WtIIUKDe5+goDZJ5QwGZKPasBOLfQg0w5yiT9sS2GgzaoO\n\tbvXKM5E6cIuwHBjDQEMV2uNyjDEDmfFUVwJtGVgA/C6Ofd+4YyGmGj/9MbM10aB0Q8u2\n\touUO0NJepWAPLvtDyyzBOjkJgUovhfMSiqQGX0xMLiIWoUWMnBoHxKCR525uFik466Uw\n\thl6xtHZSINXdD3bLOSeLOyaQE3C+3jkP1JPR+z4uERrJN3QIrW1lSecsI6uNSrMhLDQC\n\tHciQ==","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=5LSwcwQySkHLTIM2vb894fxV6Mt6PGPHTWNZRFxH0yA=;\n\tb=sUuQRCMvIsWwpPlxsri/QDk8WesF21aGlqim8GKs/9TEI9yXNgDui4Csg9UU/Dfzjb\n\t+WcNyrxosz0EpZqUM4ssVnJ+RXa/pAm7Her0Xuw7DVVcIn/WbEYlrU8Zwvq+JMQ54j3i\n\t5QxWVU1C7AF7gdo1SJTspWwHKwel0s479YMK2P0W28QNCdEtJgIL25VGRBc2HCcbPDsE\n\ti+SL9PsYJijhb9Tb0HM2bmi4qGGkOYEFMssqtxoH2hgLLKYwRz0ru0Obf3N5SDOts0e6\n\tlb9JLqHDg1BGC8GeM5R9E23WWlIXYjCLMoNZ8UBfCGr+SBlFMJPkwNR+cEczK4Xw0HeK\n\te4Zw==","X-Gm-Message-State":"APjAAAWI/1dNOuMqPFwbLq16E9XeXQHv6ptYrbFaX+O3z5FQabbGBIUD\n\t7mBbuNkiIc0/IAvmpDZYD2q3qA==","X-Google-Smtp-Source":"APXvYqwENTPnR5G/KJ4WbaHODp2WhFxTVwtGQ/eUKzTtinbKz637o+FvPBjv1RmcDs+VnBdfPA3aug==","X-Received":"by 2002:a2e:9241:: with SMTP id v1mr8262874ljg.6.1557564325590; \n\tSat, 11 May 2019 01:45:25 -0700 (PDT)","Date":"Sat, 11 May 2019 10:45:22 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190511084522.GG28561@bigcity.dyn.berto.se>","References":"<20190508151831.12274-1-niklas.soderlund@ragnatech.se>\n\t<20190508151831.12274-3-niklas.soderlund@ragnatech.se>\n\t<20190511031346.GG12768@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190511031346.GG12768@pendragon.ideasonboard.com>","User-Agent":"Mutt/1.11.3 (2019-02-01)","Subject":"Re: [libcamera-devel] [PATCH v2 02/11] libcamera: media_device:\n\tOpen and close media device inside populate()","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":"Sat, 11 May 2019 08:45:26 -0000"}}]