[libcamera-devel] [PATCH 24/30] libcamera: stream: Make FrameBuffer support mandatory

Jacopo Mondi jacopo at jmondi.org
Mon Dec 2 13:20:57 CET 2019


Hi Niklas,

On Wed, Nov 27, 2019 at 12:36:14AM +0100, Niklas Söderlund wrote:
> All pipelines now uses V4L2Streams, make using a sub-class of Stream
> which implements the FrameBuffer interface helpers mandatory. Remove the
> fallback implementations in the Stream base class to prevent the base
> class to be instantiated directly.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>

Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>

> ---
>  include/libcamera/stream.h | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h
> index 395148e45d342d92..a3c692c347340382 100644
> --- a/include/libcamera/stream.h
> +++ b/include/libcamera/stream.h
> @@ -7,7 +7,6 @@
>  #ifndef __LIBCAMERA_STREAM_H__
>  #define __LIBCAMERA_STREAM_H__
>
> -#include <errno.h>
>  #include <map>
>  #include <memory>
>  #include <string>
> @@ -89,13 +88,10 @@ protected:
>  	friend class Camera;
>
>  	virtual int allocateBuffers(const StreamConfiguration &config,
> -				    std::vector<FrameBuffer *> *buffers)
> -	{
> -		return -EINVAL;
> -	}
> -	virtual void releaseBuffers() { return; }
> -	virtual int start() { return -EINVAL; }
> -	virtual void stop() { return; }
> +				    std::vector<FrameBuffer *> *buffers) = 0;
> +	virtual void releaseBuffers() = 0;
> +	virtual int start() = 0;
> +	virtual void stop() = 0;
>
>  	int mapBuffer(const Buffer *buffer);
>  	void unmapBuffer(const Buffer *buffer);
> --
> 2.24.0
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20191202/d58dc752/attachment.sig>


More information about the libcamera-devel mailing list