[{"id":727,"web_url":"https://patchwork.libcamera.org/comment/727/","msgid":"<20190201000417.GA23060@pendragon.ideasonboard.com>","date":"2019-02-01T00:04:17","subject":"Re: [libcamera-devel] [PATCH v6 5/6] libcamera: pipeline: extend\n\tpipelines to support stream configuration","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 Thu, Jan 31, 2019 at 07:18:52PM +0100, Niklas Söderlund wrote:\n> All streams which are to be used for capture need to be configured at\n> the same time. This allows the pipeline handler to take any dependencies\n> between the different streams and their configuration into account when\n> setting up the hardware.\n> \n> Extend the pipeline API and all pipeline implementations with two new\n> functions, one to read a default configuration and one to set a new\n> configuration. Both functions operate on a group of streams which the\n> pipeline handler should consider when performing the operations.\n> \n> In the current implemented pipelines this is rather easy as they only\n> have one stream each per camera. Furthermore as there is yet no way for\n> the pipeline handlers to interact with the hardware all they do is\n> return a null format, log that a default configuration have been\n\ns/have been/has been/\n\n> requested and log that a new configuration has been set. Future work\n> based on more components are needed to make the pipelines return a good\n> default format and actually interact with the hardware.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/libcamera/include/pipeline_handler.h |  7 +++++\n>  src/libcamera/pipeline/ipu3/ipu3.cpp     | 36 ++++++++++++++++++++++++\n>  src/libcamera/pipeline/uvcvideo.cpp      | 32 +++++++++++++++++++++\n>  src/libcamera/pipeline/vimc.cpp          | 35 +++++++++++++++++++++++\n>  src/libcamera/pipeline_handler.cpp       | 34 ++++++++++++++++++++++\n>  5 files changed, 144 insertions(+)\n> \n> diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\n> index 080997e22e545e01..b4321f0fa0f765be 100644\n> --- a/src/libcamera/include/pipeline_handler.h\n> +++ b/src/libcamera/include/pipeline_handler.h\n> @@ -18,6 +18,8 @@ class Camera;\n>  class CameraManager;\n>  class DeviceEnumerator;\n>  class MediaDevice;\n> +class Stream;\n> +class StreamConfiguration;\n>  \n>  class CameraData\n>  {\n> @@ -38,6 +40,11 @@ public:\n>  \tPipelineHandler(CameraManager *manager);\n>  \tvirtual ~PipelineHandler();\n>  \n> +\tvirtual std::map<Stream *, StreamConfiguration>\n> +\tstreamConfiguration(Camera *camera, std::vector<Stream *> &streams) = 0;\n> +\tvirtual int configureStreams(Camera *camera,\n> +\t\t\t\t     std::map<Stream *, StreamConfiguration> &config) = 0;\n> +\n>  \tvirtual bool match(DeviceEnumerator *enumerator) = 0;\n>  \n>  protected:\n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 52844da78419943d..7823bbb55d9bde16 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -28,6 +28,12 @@ public:\n>  \tPipelineHandlerIPU3(CameraManager *manager);\n>  \t~PipelineHandlerIPU3();\n>  \n> +\tstd::map<Stream *, StreamConfiguration>\n> +\tstreamConfiguration(Camera *camera,\n> +\t\t\t    std::vector<Stream *> &streams) override;\n> +\tint configureStreams(Camera *camera,\n> +\t\t\t     std::map<Stream *, StreamConfiguration> &config) override;\n> +\n>  \tbool match(DeviceEnumerator *enumerator);\n>  \n>  private:\n> @@ -68,6 +74,36 @@ PipelineHandlerIPU3::~PipelineHandlerIPU3()\n>  \t\timgu_->release();\n>  }\n>  \n> +std::map<Stream *, StreamConfiguration>\n> +PipelineHandlerIPU3::streamConfiguration(Camera *camera,\n> +\t\t\t\t\t std::vector<Stream *> &streams)\n> +{\n> +\tIPU3CameraData *data = cameraData(camera);\n> +\n> +\tstd::map<Stream *, StreamConfiguration> configs;\n> +\n> +\tStreamConfiguration config{};\n> +\n> +\tLOG(IPU3, Info) << \"TODO: Return a good default format\";\n> +\n> +\tconfigs[&data->stream_] = config;\n> +\n> +\treturn configs;\n> +}\n> +\n> +int PipelineHandlerIPU3::configureStreams(Camera *camera,\n> +\t\t\t\t\t  std::map<Stream *, StreamConfiguration> &config)\n> +{\n> +\tIPU3CameraData *data = cameraData(camera);\n> +\n> +\tStreamConfiguration *cfg = &config[&data->stream_];\n> +\n> +\tLOG(IPU3, Info) << \"TODO: Configure the camera for resolution \"\n> +\t\t\t<< cfg->width << \"x\" << cfg->height;\n> +\n> +\treturn 0;\n> +}\n> +\n>  bool PipelineHandlerIPU3::match(DeviceEnumerator *enumerator)\n>  {\n>  \tDeviceMatch cio2_dm(\"ipu3-cio2\");\n> diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp\n> index d2d3a1edf6a9f53a..821e4c2189caabd0 100644\n> --- a/src/libcamera/pipeline/uvcvideo.cpp\n> +++ b/src/libcamera/pipeline/uvcvideo.cpp\n> @@ -24,6 +24,12 @@ public:\n>  \tPipelineHandlerUVC(CameraManager *manager);\n>  \t~PipelineHandlerUVC();\n>  \n> +\tstd::map<Stream *, StreamConfiguration>\n> +\tstreamConfiguration(Camera *camera,\n> +\t\t\t    std::vector<Stream *> &streams) override;\n> +\tint configureStreams(Camera *camera,\n> +\t\t\t     std::map<Stream *, StreamConfiguration> &config) override;\n> +\n>  \tbool match(DeviceEnumerator *enumerator);\n>  \n>  private:\n> @@ -46,6 +52,32 @@ PipelineHandlerUVC::~PipelineHandlerUVC()\n>  \t\tmedia_->release();\n>  }\n>  \n> +std::map<Stream *, StreamConfiguration>\n> +PipelineHandlerUVC::streamConfiguration(Camera *camera,\n> +\t\t\t\t\tstd::vector<Stream *> &streams)\n> +{\n> +\tstd::map<Stream *, StreamConfiguration> configs;\n> +\n> +\tStreamConfiguration config{};\n> +\n> +\tLOG(UVC, Info) << \"TODO: Return a good default format\";\n> +\n> +\tconfigs[&stream_] = config;\n> +\n> +\treturn configs;\n> +}\n> +\n> +int PipelineHandlerUVC::configureStreams(Camera *camera,\n> +\t\t\t\t\t std::map<Stream *, StreamConfiguration> &config)\n> +{\n> +\tStreamConfiguration *cfg = &config[&stream_];\n> +\n> +\tLOG(UVC, Info) << \"TODO: Configure the camera for resolution \"\n> +\t\t       << cfg->width << \"x\" << cfg->height;\n> +\n> +\treturn 0;\n> +}\n> +\n>  bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator)\n>  {\n>  \tDeviceMatch dm(\"uvcvideo\");\n> diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\n> index 9e1cf11a20c7a7e3..6ed069edec550a61 100644\n> --- a/src/libcamera/pipeline/vimc.cpp\n> +++ b/src/libcamera/pipeline/vimc.cpp\n> @@ -9,17 +9,26 @@\n>  #include <libcamera/stream.h>\n>  \n>  #include \"device_enumerator.h\"\n> +#include \"log.h\"\n>  #include \"media_device.h\"\n>  #include \"pipeline_handler.h\"\n>  \n>  namespace libcamera {\n>  \n> +LOG_DEFINE_CATEGORY(VIMC)\n> +\n>  class PipeHandlerVimc : public PipelineHandler\n>  {\n>  public:\n>  \tPipeHandlerVimc(CameraManager *manager);\n>  \t~PipeHandlerVimc();\n>  \n> +\tstd::map<Stream *, StreamConfiguration>\n> +\tstreamConfiguration(Camera *camera,\n> +\t\t\t    std::vector<Stream *> &streams) override;\n> +\tint configureStreams(Camera *camera,\n> +\t\t\t     std::map<Stream *, StreamConfiguration> &config) override;\n> +\n>  \tbool match(DeviceEnumerator *enumerator);\n>  \n>  private:\n> @@ -38,6 +47,32 @@ PipeHandlerVimc::~PipeHandlerVimc()\n>  \t\tmedia_->release();\n>  }\n>  \n> +std::map<Stream *, StreamConfiguration>\n> +PipeHandlerVimc::streamConfiguration(Camera *camera,\n> +\t\t\t\t     std::vector<Stream *> &streams)\n> +{\n> +\tstd::map<Stream *, StreamConfiguration> configs;\n> +\n> +\tStreamConfiguration config{};\n> +\n> +\tLOG(VIMC, Info) << \"TODO: Return a good default format\";\n> +\n> +\tconfigs[&stream_] = config;\n> +\n> +\treturn configs;\n> +}\n> +\n> +int PipeHandlerVimc::configureStreams(Camera *camera,\n> +\t\t\t\t      std::map<Stream *, StreamConfiguration> &config)\n> +{\n> +\tStreamConfiguration *cfg = &config[&stream_];\n> +\n> +\tLOG(VIMC, Info) << \"TODO: Configure the camera for resolution \"\n> +\t\t\t<< cfg->width << \"x\" << cfg->height;\n> +\n> +\treturn 0;\n> +}\n> +\n>  bool PipeHandlerVimc::match(DeviceEnumerator *enumerator)\n>  {\n>  \tDeviceMatch dm(\"vimc\");\n> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> index 1c8640799f714686..3a560e10c442717f 100644\n> --- a/src/libcamera/pipeline_handler.cpp\n> +++ b/src/libcamera/pipeline_handler.cpp\n> @@ -75,6 +75,40 @@ PipelineHandler::~PipelineHandler()\n>  {\n>  };\n>  \n> +\n> +/**\n> + * \\fn PipelineHandler::streamConfiguration()\n> + * \\brief Retrieve a group of stream configurations for a specified camera\n> + * \\param[in] camera The camera to fetch default configuration from\n> + * \\param[in] streams An array of streams to fetch information about\n> + *\n> + * Retrieve the species camera's default configuration for a specified group of\n> + * streams. The caller shall populate the \\a streams array with the streams it\n> + * wish to fetch the configuration from. The map of streams and configuration\n> + * returned can then be examined by the caller to learn about the defualt\n> + * parameters for the specified streams.\n> + *\n> + * The intended companion to this is \\a configureStreams() which can be used to\n> + * change the group of streams parameters.\n> + *\n> + * \\return A map of successfully retrieved streams and configurations or an\n> + * empty map on error.\n> + */\n> +\n> +/**\n> + * \\fn PipelineHandler::configureStreams()\n> + * \\brief Configure a group of streams for capture\n> + * \\param[in] camera The camera to configure\n> + * \\param[in] config A map of stream configurations to apply\n> + *\n> + * Configure the specified group of streams for \\a camera according to the\n> + * configuration specified in \\a configs. The intended caller of this interface\n> + * is the Camera class which will receive configuration to apply from the\n> + * application.\n> + *\n> + * \\return 0 on success or a negative error code on error.\n> + */\n> +\n>  /**\n>   * \\fn PipelineHandler::match(DeviceEnumerator *enumerator)\n>   * \\brief Match media devices and create camera instances","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 044BA60DB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  1 Feb 2019 01:04:26 +0100 (CET)","from pendragon.ideasonboard.com (85-76-34-136-nat.elisa-mobile.fi\n\t[85.76.34.136])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8BEB641;\n\tFri,  1 Feb 2019 01:04:21 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1548979464;\n\tbh=4rPrNmElGGUef7oZlJmPe8YBt+156ronzNJX2L5rowY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=KeoMaW4Ce7XXkJ5QpOAc7J+JYzr687BIpsEIGQzK4tnDAuOJ/RK2p3WEtHqtxLCy2\n\tC7f28gI8REsoQlpnEKtEk3SQMpNomqqVULEpG38SddI1xEa7vuoihWJi4KDLvtPBf3\n\t5wI/PZZ5Rt5f/Toy/8zqQBaObKx6GgVvzd2QNROk=","Date":"Fri, 1 Feb 2019 02:04:17 +0200","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":"<20190201000417.GA23060@pendragon.ideasonboard.com>","References":"<20190131181853.23739-1-niklas.soderlund@ragnatech.se>\n\t<20190131181853.23739-6-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":"<20190131181853.23739-6-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v6 5/6] libcamera: pipeline: extend\n\tpipelines to support stream configuration","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":"Fri, 01 Feb 2019 00:04:26 -0000"}},{"id":731,"web_url":"https://patchwork.libcamera.org/comment/731/","msgid":"<20190201072042.GK19527@bigcity.dyn.berto.se>","date":"2019-02-01T07:20:42","subject":"Re: [libcamera-devel] [PATCH v6 5/6] libcamera: pipeline: extend\n\tpipelines to support stream configuration","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nOn 2019-02-01 02:04:17 +0200, Laurent Pinchart wrote:\n> Hi Niklas,\n> \n> Thank you for the patch.\n> \n> On Thu, Jan 31, 2019 at 07:18:52PM +0100, Niklas Söderlund wrote:\n> > All streams which are to be used for capture need to be configured at\n> > the same time. This allows the pipeline handler to take any dependencies\n> > between the different streams and their configuration into account when\n> > setting up the hardware.\n> > \n> > Extend the pipeline API and all pipeline implementations with two new\n> > functions, one to read a default configuration and one to set a new\n> > configuration. Both functions operate on a group of streams which the\n> > pipeline handler should consider when performing the operations.\n> > \n> > In the current implemented pipelines this is rather easy as they only\n> > have one stream each per camera. Furthermore as there is yet no way for\n> > the pipeline handlers to interact with the hardware all they do is\n> > return a null format, log that a default configuration have been\n> \n> s/have been/has been/\n> \n> > requested and log that a new configuration has been set. Future work\n> > based on more components are needed to make the pipelines return a good\n> > default format and actually interact with the hardware.\n> > \n> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nThanks for all your hard work in reviewing this series which I just \npushed to master.\n\n> \n> > ---\n> >  src/libcamera/include/pipeline_handler.h |  7 +++++\n> >  src/libcamera/pipeline/ipu3/ipu3.cpp     | 36 ++++++++++++++++++++++++\n> >  src/libcamera/pipeline/uvcvideo.cpp      | 32 +++++++++++++++++++++\n> >  src/libcamera/pipeline/vimc.cpp          | 35 +++++++++++++++++++++++\n> >  src/libcamera/pipeline_handler.cpp       | 34 ++++++++++++++++++++++\n> >  5 files changed, 144 insertions(+)\n> > \n> > diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\n> > index 080997e22e545e01..b4321f0fa0f765be 100644\n> > --- a/src/libcamera/include/pipeline_handler.h\n> > +++ b/src/libcamera/include/pipeline_handler.h\n> > @@ -18,6 +18,8 @@ class Camera;\n> >  class CameraManager;\n> >  class DeviceEnumerator;\n> >  class MediaDevice;\n> > +class Stream;\n> > +class StreamConfiguration;\n> >  \n> >  class CameraData\n> >  {\n> > @@ -38,6 +40,11 @@ public:\n> >  \tPipelineHandler(CameraManager *manager);\n> >  \tvirtual ~PipelineHandler();\n> >  \n> > +\tvirtual std::map<Stream *, StreamConfiguration>\n> > +\tstreamConfiguration(Camera *camera, std::vector<Stream *> &streams) = 0;\n> > +\tvirtual int configureStreams(Camera *camera,\n> > +\t\t\t\t     std::map<Stream *, StreamConfiguration> &config) = 0;\n> > +\n> >  \tvirtual bool match(DeviceEnumerator *enumerator) = 0;\n> >  \n> >  protected:\n> > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > index 52844da78419943d..7823bbb55d9bde16 100644\n> > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > @@ -28,6 +28,12 @@ public:\n> >  \tPipelineHandlerIPU3(CameraManager *manager);\n> >  \t~PipelineHandlerIPU3();\n> >  \n> > +\tstd::map<Stream *, StreamConfiguration>\n> > +\tstreamConfiguration(Camera *camera,\n> > +\t\t\t    std::vector<Stream *> &streams) override;\n> > +\tint configureStreams(Camera *camera,\n> > +\t\t\t     std::map<Stream *, StreamConfiguration> &config) override;\n> > +\n> >  \tbool match(DeviceEnumerator *enumerator);\n> >  \n> >  private:\n> > @@ -68,6 +74,36 @@ PipelineHandlerIPU3::~PipelineHandlerIPU3()\n> >  \t\timgu_->release();\n> >  }\n> >  \n> > +std::map<Stream *, StreamConfiguration>\n> > +PipelineHandlerIPU3::streamConfiguration(Camera *camera,\n> > +\t\t\t\t\t std::vector<Stream *> &streams)\n> > +{\n> > +\tIPU3CameraData *data = cameraData(camera);\n> > +\n> > +\tstd::map<Stream *, StreamConfiguration> configs;\n> > +\n> > +\tStreamConfiguration config{};\n> > +\n> > +\tLOG(IPU3, Info) << \"TODO: Return a good default format\";\n> > +\n> > +\tconfigs[&data->stream_] = config;\n> > +\n> > +\treturn configs;\n> > +}\n> > +\n> > +int PipelineHandlerIPU3::configureStreams(Camera *camera,\n> > +\t\t\t\t\t  std::map<Stream *, StreamConfiguration> &config)\n> > +{\n> > +\tIPU3CameraData *data = cameraData(camera);\n> > +\n> > +\tStreamConfiguration *cfg = &config[&data->stream_];\n> > +\n> > +\tLOG(IPU3, Info) << \"TODO: Configure the camera for resolution \"\n> > +\t\t\t<< cfg->width << \"x\" << cfg->height;\n> > +\n> > +\treturn 0;\n> > +}\n> > +\n> >  bool PipelineHandlerIPU3::match(DeviceEnumerator *enumerator)\n> >  {\n> >  \tDeviceMatch cio2_dm(\"ipu3-cio2\");\n> > diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp\n> > index d2d3a1edf6a9f53a..821e4c2189caabd0 100644\n> > --- a/src/libcamera/pipeline/uvcvideo.cpp\n> > +++ b/src/libcamera/pipeline/uvcvideo.cpp\n> > @@ -24,6 +24,12 @@ public:\n> >  \tPipelineHandlerUVC(CameraManager *manager);\n> >  \t~PipelineHandlerUVC();\n> >  \n> > +\tstd::map<Stream *, StreamConfiguration>\n> > +\tstreamConfiguration(Camera *camera,\n> > +\t\t\t    std::vector<Stream *> &streams) override;\n> > +\tint configureStreams(Camera *camera,\n> > +\t\t\t     std::map<Stream *, StreamConfiguration> &config) override;\n> > +\n> >  \tbool match(DeviceEnumerator *enumerator);\n> >  \n> >  private:\n> > @@ -46,6 +52,32 @@ PipelineHandlerUVC::~PipelineHandlerUVC()\n> >  \t\tmedia_->release();\n> >  }\n> >  \n> > +std::map<Stream *, StreamConfiguration>\n> > +PipelineHandlerUVC::streamConfiguration(Camera *camera,\n> > +\t\t\t\t\tstd::vector<Stream *> &streams)\n> > +{\n> > +\tstd::map<Stream *, StreamConfiguration> configs;\n> > +\n> > +\tStreamConfiguration config{};\n> > +\n> > +\tLOG(UVC, Info) << \"TODO: Return a good default format\";\n> > +\n> > +\tconfigs[&stream_] = config;\n> > +\n> > +\treturn configs;\n> > +}\n> > +\n> > +int PipelineHandlerUVC::configureStreams(Camera *camera,\n> > +\t\t\t\t\t std::map<Stream *, StreamConfiguration> &config)\n> > +{\n> > +\tStreamConfiguration *cfg = &config[&stream_];\n> > +\n> > +\tLOG(UVC, Info) << \"TODO: Configure the camera for resolution \"\n> > +\t\t       << cfg->width << \"x\" << cfg->height;\n> > +\n> > +\treturn 0;\n> > +}\n> > +\n> >  bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator)\n> >  {\n> >  \tDeviceMatch dm(\"uvcvideo\");\n> > diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\n> > index 9e1cf11a20c7a7e3..6ed069edec550a61 100644\n> > --- a/src/libcamera/pipeline/vimc.cpp\n> > +++ b/src/libcamera/pipeline/vimc.cpp\n> > @@ -9,17 +9,26 @@\n> >  #include <libcamera/stream.h>\n> >  \n> >  #include \"device_enumerator.h\"\n> > +#include \"log.h\"\n> >  #include \"media_device.h\"\n> >  #include \"pipeline_handler.h\"\n> >  \n> >  namespace libcamera {\n> >  \n> > +LOG_DEFINE_CATEGORY(VIMC)\n> > +\n> >  class PipeHandlerVimc : public PipelineHandler\n> >  {\n> >  public:\n> >  \tPipeHandlerVimc(CameraManager *manager);\n> >  \t~PipeHandlerVimc();\n> >  \n> > +\tstd::map<Stream *, StreamConfiguration>\n> > +\tstreamConfiguration(Camera *camera,\n> > +\t\t\t    std::vector<Stream *> &streams) override;\n> > +\tint configureStreams(Camera *camera,\n> > +\t\t\t     std::map<Stream *, StreamConfiguration> &config) override;\n> > +\n> >  \tbool match(DeviceEnumerator *enumerator);\n> >  \n> >  private:\n> > @@ -38,6 +47,32 @@ PipeHandlerVimc::~PipeHandlerVimc()\n> >  \t\tmedia_->release();\n> >  }\n> >  \n> > +std::map<Stream *, StreamConfiguration>\n> > +PipeHandlerVimc::streamConfiguration(Camera *camera,\n> > +\t\t\t\t     std::vector<Stream *> &streams)\n> > +{\n> > +\tstd::map<Stream *, StreamConfiguration> configs;\n> > +\n> > +\tStreamConfiguration config{};\n> > +\n> > +\tLOG(VIMC, Info) << \"TODO: Return a good default format\";\n> > +\n> > +\tconfigs[&stream_] = config;\n> > +\n> > +\treturn configs;\n> > +}\n> > +\n> > +int PipeHandlerVimc::configureStreams(Camera *camera,\n> > +\t\t\t\t      std::map<Stream *, StreamConfiguration> &config)\n> > +{\n> > +\tStreamConfiguration *cfg = &config[&stream_];\n> > +\n> > +\tLOG(VIMC, Info) << \"TODO: Configure the camera for resolution \"\n> > +\t\t\t<< cfg->width << \"x\" << cfg->height;\n> > +\n> > +\treturn 0;\n> > +}\n> > +\n> >  bool PipeHandlerVimc::match(DeviceEnumerator *enumerator)\n> >  {\n> >  \tDeviceMatch dm(\"vimc\");\n> > diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> > index 1c8640799f714686..3a560e10c442717f 100644\n> > --- a/src/libcamera/pipeline_handler.cpp\n> > +++ b/src/libcamera/pipeline_handler.cpp\n> > @@ -75,6 +75,40 @@ PipelineHandler::~PipelineHandler()\n> >  {\n> >  };\n> >  \n> > +\n> > +/**\n> > + * \\fn PipelineHandler::streamConfiguration()\n> > + * \\brief Retrieve a group of stream configurations for a specified camera\n> > + * \\param[in] camera The camera to fetch default configuration from\n> > + * \\param[in] streams An array of streams to fetch information about\n> > + *\n> > + * Retrieve the species camera's default configuration for a specified group of\n> > + * streams. The caller shall populate the \\a streams array with the streams it\n> > + * wish to fetch the configuration from. The map of streams and configuration\n> > + * returned can then be examined by the caller to learn about the defualt\n> > + * parameters for the specified streams.\n> > + *\n> > + * The intended companion to this is \\a configureStreams() which can be used to\n> > + * change the group of streams parameters.\n> > + *\n> > + * \\return A map of successfully retrieved streams and configurations or an\n> > + * empty map on error.\n> > + */\n> > +\n> > +/**\n> > + * \\fn PipelineHandler::configureStreams()\n> > + * \\brief Configure a group of streams for capture\n> > + * \\param[in] camera The camera to configure\n> > + * \\param[in] config A map of stream configurations to apply\n> > + *\n> > + * Configure the specified group of streams for \\a camera according to the\n> > + * configuration specified in \\a configs. The intended caller of this interface\n> > + * is the Camera class which will receive configuration to apply from the\n> > + * application.\n> > + *\n> > + * \\return 0 on success or a negative error code on error.\n> > + */\n> > +\n> >  /**\n> >   * \\fn PipelineHandler::match(DeviceEnumerator *enumerator)\n> >   * \\brief Match media devices and create camera instances\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","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 39A0A60B1B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  1 Feb 2019 08:20:45 +0100 (CET)","by mail-lf1-x143.google.com with SMTP id i26so4318769lfc.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 31 Jan 2019 23:20:45 -0800 (PST)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\tc203sm1231055lfe.95.2019.01.31.23.20.43\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tThu, 31 Jan 2019 23:20:43 -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=hOO6wA//AeZvdKjUM7blNhjk+4DUXWXfomBTyYf5jm0=;\n\tb=k3SjByZHmtknZrkKrmxnL5xfyOij96aNNzy8J8R/eh01NW4vOJZTHmh1DKmcEkh7rY\n\t/sRxKHJ33m40LpA0XrO+xp+mJY80Wg1ujlddWLJzN3O/orj7xcJIqgDRROxgpPf7/VH9\n\tdKSvLwFYKxEy6aIf5oTawluolCIgXODcPQsMIQD6DbmcIj0j69LtvRoU52YCzqEHVxao\n\t54o/67PD+bm0e2Ol3VvNWjFVfdeu01aFS4FtJtEbKNv1H+csrD+YACRqzgH2XL6PGYel\n\tQUeVbg1KS9sfbKL+aO8HgrD0/ILXoEeygrovF006J0IxguMB9KzzpyFyD3CHnEV2lWut\n\tk2Ww==","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=hOO6wA//AeZvdKjUM7blNhjk+4DUXWXfomBTyYf5jm0=;\n\tb=T1E4eRKRaK7vK99EAFL/gzPKMZE8dM4aWKOJQrPYPQfmRFHi4yrJTYIxMN4KCvqs/a\n\tfuhEgct0AfF5N0I/KENFPa/STa3hFXYno+LJikEq6pHDjdfkp1COwpVfNavbFOZ4By4f\n\tAY7akd7JlapLusLL3ietYpi5FNrr3K0JVI8TNpLL58eiOzyCNbd71467MgPd9GJvcD4c\n\t+P+covcw3Q44pNIz7u8tIYc5aDqSQx0XLbE2sH/TgCMsE67iSfAzNeHXbDjv0XiQWng/\n\txP7gyhSBfUQEswesWyUbkJ7NYrngRmClihr1mDSYcLpHlGT0JGzApVuWGbBM5zGw6RLV\n\thwVw==","X-Gm-Message-State":"AJcUukfn9f6tIeOuK3HPer7PpeEKaCmGc89PyTNgKlmVDW0+Ykco+n9p\n\tnwGdntFH/IAur5F8852eQ56dRQ==","X-Google-Smtp-Source":"ALg8bN7Lm3GjzuQPiredFeN6mG3PgQ9q765ZPLX/3hk9K6wFkK5xwA8u6KHqxL5jINIT+YjJm7bPOw==","X-Received":"by 2002:a19:5510:: with SMTP id\n\tn16mr22881962lfe.68.1549005644121; \n\tThu, 31 Jan 2019 23:20:44 -0800 (PST)","Date":"Fri, 1 Feb 2019 08:20:42 +0100","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":"<20190201072042.GK19527@bigcity.dyn.berto.se>","References":"<20190131181853.23739-1-niklas.soderlund@ragnatech.se>\n\t<20190131181853.23739-6-niklas.soderlund@ragnatech.se>\n\t<20190201000417.GA23060@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":"<20190201000417.GA23060@pendragon.ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v6 5/6] libcamera: pipeline: extend\n\tpipelines to support stream configuration","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":"Fri, 01 Feb 2019 07:20:45 -0000"}}]