[libcamera-devel] [PATCH] pipeline: simple: Fix an issue in breadth-first search

Phi-bang Nguyen pnguyen at baylibre.com
Tue Apr 13 12:12:24 CEST 2021


Hi Laurent,

Just a kind reminder to see if you have some feedback on the patch :-)

Thanks !

On Sun, Apr 4, 2021 at 11:04 PM Phi-Bang Nguyen <pnguyen at baylibre.com>
wrote:

> When seting up the pipeline, the latest entity in the queue is
> taken but the oldest one is poped. This is a mistake. Fix it.
>
> Fixes: 4671911df040 ("pipeline: simple: Use breadth-first search
> to setup media pipeline")
>
> Signed-off-by: Phi-Bang Nguyen <pnguyen at baylibre.com>
> ---
>  src/libcamera/pipeline/simple/simple.cpp | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/libcamera/pipeline/simple/simple.cpp
> b/src/libcamera/pipeline/simple/simple.cpp
> index f81a4d15..a2dbc336 100644
> --- a/src/libcamera/pipeline/simple/simple.cpp
> +++ b/src/libcamera/pipeline/simple/simple.cpp
> @@ -288,12 +288,12 @@
> SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,
>
>         /* Remember at each entity where we came from. */
>         std::unordered_map<MediaEntity *, Entity> parents;
> -       queue.push(sensor);
> -
>         MediaEntity *entity = nullptr;
>
> +       queue.push(sensor);
> +
>         while (!queue.empty()) {
> -               entity = queue.back();
> +               entity = queue.front();
>                 queue.pop();
>
>                 /* Found the capture device. */
> --
> 2.25.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20210413/3060e1da/attachment.htm>


More information about the libcamera-devel mailing list