[v2,4/4] libcamera: pipeline: simple: Use MediaLink string helper
diff mbox series

Message ID 20240911211816.73763-5-kieran.bingham@ideasonboard.com
State Accepted
Commit 66c9b157e95b108b38f1ac2f13b827fafef74602
Headers show
Series
  • MediaLink: Provide a string representation
Related show

Commit Message

Kieran Bingham Sept. 11, 2024, 9:18 p.m. UTC
Replace the open-coded implementation of a link representation
with the operator<< overload string representation to simplify
the code and unify appearance of reporting MediaLinks.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/libcamera/pipeline/simple/simple.cpp | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Laurent Pinchart Sept. 11, 2024, 10:25 p.m. UTC | #1
On Wed, Sep 11, 2024 at 11:18:16PM +0200, Kieran Bingham wrote:
> Replace the open-coded implementation of a link representation
> with the operator<< overload string representation to simplify
> the code and unify appearance of reporting MediaLinks.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

You don't need to sign your patch twice :-)

> ---
>  src/libcamera/pipeline/simple/simple.cpp | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
> index 1e7ec7d97255..2d205e9925ef 100644
> --- a/src/libcamera/pipeline/simple/simple.cpp
> +++ b/src/libcamera/pipeline/simple/simple.cpp
> @@ -774,11 +774,8 @@ int SimpleCameraData::setupFormats(V4L2SubdeviceFormat *format,
>  		}
>  
>  		LOG(SimplePipeline, Debug)
> -			<< "Link '" << source->entity()->name()
> -			<< "':" << source->index()
> -			<< " -> '" << sink->entity()->name()
> -			<< "':" << sink->index()
> -			<< " configured with format " << *format;
> +			<< "Link " << *link << ": configured with format "
> +			<< *format;
>  	}
>  
>  	return 0;
Stefan Klug Sept. 12, 2024, 9:02 a.m. UTC | #2
Hi Kieran,


On Wed, Sep 11, 2024 at 11:18:16PM +0200, Kieran Bingham wrote:
> Replace the open-coded implementation of a link representation
> with the operator<< overload string representation to simplify
> the code and unify appearance of reporting MediaLinks.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> 

Regards,
Stefan

> ---
>  src/libcamera/pipeline/simple/simple.cpp | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
> index 1e7ec7d97255..2d205e9925ef 100644
> --- a/src/libcamera/pipeline/simple/simple.cpp
> +++ b/src/libcamera/pipeline/simple/simple.cpp
> @@ -774,11 +774,8 @@ int SimpleCameraData::setupFormats(V4L2SubdeviceFormat *format,
>  		}
>  
>  		LOG(SimplePipeline, Debug)
> -			<< "Link '" << source->entity()->name()
> -			<< "':" << source->index()
> -			<< " -> '" << sink->entity()->name()
> -			<< "':" << sink->index()
> -			<< " configured with format " << *format;
> +			<< "Link " << *link << ": configured with format "
> +			<< *format;
>  	}
>  
>  	return 0;
> -- 
> 2.46.0
>

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
index 1e7ec7d97255..2d205e9925ef 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -774,11 +774,8 @@  int SimpleCameraData::setupFormats(V4L2SubdeviceFormat *format,
 		}
 
 		LOG(SimplePipeline, Debug)
-			<< "Link '" << source->entity()->name()
-			<< "':" << source->index()
-			<< " -> '" << sink->entity()->name()
-			<< "':" << sink->index()
-			<< " configured with format " << *format;
+			<< "Link " << *link << ": configured with format "
+			<< *format;
 	}
 
 	return 0;