[libcamera-devel,05/14] libcamera: converter: Add queueBuffer() helper
diff mbox series

Message ID 20220908184850.1874303-6-xavier.roumegue@oss.nxp.com
State Changes Requested
Headers show
Series
  • Add dw100 dewarper support to simple/rkisp1 pipeline
Related show

Commit Message

Xavier Roumegue Sept. 8, 2022, 6:48 p.m. UTC
Signed-off-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>
---
 include/libcamera/internal/converter.h | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Jacopo Mondi Sept. 14, 2022, 10:52 a.m. UTC | #1
We usually don't allow commits without a message, even more in this
case where it would be good explain why the helper is, well, helpful
:)

On Thu, Sep 08, 2022 at 08:48:41PM +0200, Xavier Roumegue via libcamera-devel wrote:
> Signed-off-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>
> ---
>  include/libcamera/internal/converter.h | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/include/libcamera/internal/converter.h b/include/libcamera/internal/converter.h
> index e2237c57..ea1deab0 100644
> --- a/include/libcamera/internal/converter.h
> +++ b/include/libcamera/internal/converter.h
> @@ -55,6 +55,12 @@ public:
>  	virtual int queueBuffers(FrameBuffer *input,
>  				 const std::map<unsigned int, FrameBuffer *> &outputs) = 0;
>
> +	int queueBuffer(FrameBuffer *input, FrameBuffer *output)

Does it need documentation ?

> +	{
> +		std::map<unsigned int, FrameBuffer *> _output = { { 0, output } };
> +		return queueBuffers(input, _output);
> +	}
> +
>  	std::string deviceNode_;
>  	Signal<FrameBuffer *> inputBufferReady;
>  	Signal<FrameBuffer *> outputBufferReady;
> --
> 2.37.3
>
Laurent Pinchart Oct. 3, 2022, 10:10 p.m. UTC | #2
On Wed, Sep 14, 2022 at 12:52:07PM +0200, Jacopo Mondi via libcamera-devel wrote:
> We usually don't allow commits without a message, even more in this
> case where it would be good explain why the helper is, well, helpful
> :)

I can't disagree :-)

> On Thu, Sep 08, 2022 at 08:48:41PM +0200, Xavier Roumegue via libcamera-devel wrote:
> > Signed-off-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>
> > ---
> >  include/libcamera/internal/converter.h | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/include/libcamera/internal/converter.h b/include/libcamera/internal/converter.h
> > index e2237c57..ea1deab0 100644
> > --- a/include/libcamera/internal/converter.h
> > +++ b/include/libcamera/internal/converter.h
> > @@ -55,6 +55,12 @@ public:
> >  	virtual int queueBuffers(FrameBuffer *input,
> >  				 const std::map<unsigned int, FrameBuffer *> &outputs) = 0;
> >
> > +	int queueBuffer(FrameBuffer *input, FrameBuffer *output)
> 
> Does it need documentation ?

Patch 04/14 also requires documentation, I think Xavier wanted a first
review of the overall API in order to avoid spending time writing
documentation that would then need to be rewritten. I assume
documentation will come in v2 or v3.

> > +	{
> > +		std::map<unsigned int, FrameBuffer *> _output = { { 0, output } };
> > +		return queueBuffers(input, _output);
> > +	}
> > +
> >  	std::string deviceNode_;
> >  	Signal<FrameBuffer *> inputBufferReady;
> >  	Signal<FrameBuffer *> outputBufferReady;

Patch
diff mbox series

diff --git a/include/libcamera/internal/converter.h b/include/libcamera/internal/converter.h
index e2237c57..ea1deab0 100644
--- a/include/libcamera/internal/converter.h
+++ b/include/libcamera/internal/converter.h
@@ -55,6 +55,12 @@  public:
 	virtual int queueBuffers(FrameBuffer *input,
 				 const std::map<unsigned int, FrameBuffer *> &outputs) = 0;
 
+	int queueBuffer(FrameBuffer *input, FrameBuffer *output)
+	{
+		std::map<unsigned int, FrameBuffer *> _output = { { 0, output } };
+		return queueBuffers(input, _output);
+	}
+
 	std::string deviceNode_;
 	Signal<FrameBuffer *> inputBufferReady;
 	Signal<FrameBuffer *> outputBufferReady;