[2/5] libcamera: rkisp1: Create a request with a custom private class
diff mbox series

Message ID 20240221174015.52958-3-jacopo.mondi@ideasonboard.com
State Superseded
Headers show
Series
  • libcamera: Replace IPU3/RkISP1FrameInfo
Related show

Commit Message

Jacopo Mondi Feb. 21, 2024, 5:40 p.m. UTC
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
 src/libcamera/pipeline/rkisp1/rkisp1.cpp | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Comments

Dan Scally March 5, 2024, 11:41 a.m. UTC | #1
Hi Jacopo

On 21/02/2024 17:40, Jacopo Mondi wrote:
> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> ---

Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>

and

Tested-by: Daniel Scally <dan.scally@ideasonboard.com>

>   src/libcamera/pipeline/rkisp1/rkisp1.cpp | 19 +++++++++++++++++++
>   1 file changed, 19 insertions(+)
>
> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> index 586b46d64630..e981e60758f7 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> @@ -39,6 +39,7 @@
>   #include "libcamera/internal/ipa_manager.h"
>   #include "libcamera/internal/media_device.h"
>   #include "libcamera/internal/pipeline_handler.h"
> +#include "libcamera/internal/request.h"
>   #include "libcamera/internal/v4l2_subdevice.h"
>   #include "libcamera/internal/v4l2_videodevice.h"
>   
> @@ -83,6 +84,15 @@ private:
>   	std::map<unsigned int, RkISP1FrameInfo *> frameInfo_;
>   };
>   
> +class RkISP1Request : public Request::Private
> +{
> +public:
> +	RkISP1Request(Camera *camera)
> +		: Request::Private(camera)
> +	{
> +	}
> +};
> +
>   class RkISP1CameraData : public Camera::Private
>   {
>   public:
> @@ -157,6 +167,8 @@ public:
>   	int start(Camera *camera, const ControlList *controls) override;
>   	void stopDevice(Camera *camera) override;
>   
> +	std::unique_ptr<Request> createRequestDevice(Camera *camera,
> +						     uint64_t cookie) override;
>   	int queueRequestDevice(Camera *camera, Request *request) override;
>   
>   	bool match(DeviceEnumerator *enumerator) override;
> @@ -1020,6 +1032,13 @@ void PipelineHandlerRkISP1::stopDevice(Camera *camera)
>   	activeCamera_ = nullptr;
>   }
>   
> +std::unique_ptr<Request> PipelineHandlerRkISP1::createRequestDevice(Camera *camera,
> +								    uint64_t cookie)
> +{
> +	auto request = std::make_unique<RkISP1Request>(camera);
> +	return Request::create(std::move(request), cookie);
> +}
> +
>   int PipelineHandlerRkISP1::queueRequestDevice(Camera *camera, Request *request)
>   {
>   	RkISP1CameraData *data = cameraData(camera);
Stefan Klug March 6, 2024, 3:43 p.m. UTC | #2
Hi Jacopo,

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

Cheers,
Stefan

On Wed, Feb 21, 2024 at 06:40:10PM +0100, Jacopo Mondi wrote:
> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> ---
>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> index 586b46d64630..e981e60758f7 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> @@ -39,6 +39,7 @@
>  #include "libcamera/internal/ipa_manager.h"
>  #include "libcamera/internal/media_device.h"
>  #include "libcamera/internal/pipeline_handler.h"
> +#include "libcamera/internal/request.h"
>  #include "libcamera/internal/v4l2_subdevice.h"
>  #include "libcamera/internal/v4l2_videodevice.h"
>  
> @@ -83,6 +84,15 @@ private:
>  	std::map<unsigned int, RkISP1FrameInfo *> frameInfo_;
>  };
>  
> +class RkISP1Request : public Request::Private
> +{
> +public:
> +	RkISP1Request(Camera *camera)
> +		: Request::Private(camera)
> +	{
> +	}
> +};
> +
>  class RkISP1CameraData : public Camera::Private
>  {
>  public:
> @@ -157,6 +167,8 @@ public:
>  	int start(Camera *camera, const ControlList *controls) override;
>  	void stopDevice(Camera *camera) override;
>  
> +	std::unique_ptr<Request> createRequestDevice(Camera *camera,
> +						     uint64_t cookie) override;
>  	int queueRequestDevice(Camera *camera, Request *request) override;
>  
>  	bool match(DeviceEnumerator *enumerator) override;
> @@ -1020,6 +1032,13 @@ void PipelineHandlerRkISP1::stopDevice(Camera *camera)
>  	activeCamera_ = nullptr;
>  }
>  
> +std::unique_ptr<Request> PipelineHandlerRkISP1::createRequestDevice(Camera *camera,
> +								    uint64_t cookie)
> +{
> +	auto request = std::make_unique<RkISP1Request>(camera);
> +	return Request::create(std::move(request), cookie);
> +}
> +
>  int PipelineHandlerRkISP1::queueRequestDevice(Camera *camera, Request *request)
>  {
>  	RkISP1CameraData *data = cameraData(camera);
> -- 
> 2.43.0
>

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index 586b46d64630..e981e60758f7 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -39,6 +39,7 @@ 
 #include "libcamera/internal/ipa_manager.h"
 #include "libcamera/internal/media_device.h"
 #include "libcamera/internal/pipeline_handler.h"
+#include "libcamera/internal/request.h"
 #include "libcamera/internal/v4l2_subdevice.h"
 #include "libcamera/internal/v4l2_videodevice.h"
 
@@ -83,6 +84,15 @@  private:
 	std::map<unsigned int, RkISP1FrameInfo *> frameInfo_;
 };
 
+class RkISP1Request : public Request::Private
+{
+public:
+	RkISP1Request(Camera *camera)
+		: Request::Private(camera)
+	{
+	}
+};
+
 class RkISP1CameraData : public Camera::Private
 {
 public:
@@ -157,6 +167,8 @@  public:
 	int start(Camera *camera, const ControlList *controls) override;
 	void stopDevice(Camera *camera) override;
 
+	std::unique_ptr<Request> createRequestDevice(Camera *camera,
+						     uint64_t cookie) override;
 	int queueRequestDevice(Camera *camera, Request *request) override;
 
 	bool match(DeviceEnumerator *enumerator) override;
@@ -1020,6 +1032,13 @@  void PipelineHandlerRkISP1::stopDevice(Camera *camera)
 	activeCamera_ = nullptr;
 }
 
+std::unique_ptr<Request> PipelineHandlerRkISP1::createRequestDevice(Camera *camera,
+								    uint64_t cookie)
+{
+	auto request = std::make_unique<RkISP1Request>(camera);
+	return Request::create(std::move(request), cookie);
+}
+
 int PipelineHandlerRkISP1::queueRequestDevice(Camera *camera, Request *request)
 {
 	RkISP1CameraData *data = cameraData(camera);