Message ID | 20210920173752.1346190-5-umang.jain@ideasonboard.com |
---|---|
State | RFC |
Delegated to: | Umang Jain |
Headers | show |
Series |
|
Related | show |
Hi Umang, thank you for the patch. On Tue, Sep 21, 2021 at 2:38 AM Umang Jain <umang.jain@ideasonboard.com> wrote: > > Camera3RequestDescriptor is a utility structure that groups information > about a capture request. It can be and will be extended to preserve the > context of a capture overall. Since the context of a capture needs to > be shared among other classes (for e.g. CameraStream) having a private > definition of the struct doesn't help. Hence, de-scope the structure > so that it can be shared with other components (through references or > pointers). > > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> > --- > src/android/camera_device.cpp | 2 +- > src/android/camera_device.h | 29 +++++++++++++++-------------- > 2 files changed, 16 insertions(+), 15 deletions(-) > > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp > index cc078fe4..3d6a2bed 100644 > --- a/src/android/camera_device.cpp > +++ b/src/android/camera_device.cpp > @@ -220,7 +220,7 @@ bool validateCropRotate(const camera3_stream_configuration_t &streamList) > * later re-used at request complete time to notify the framework. > */ > > -CameraDevice::Camera3RequestDescriptor::Camera3RequestDescriptor( > +Camera3RequestDescriptor::Camera3RequestDescriptor( > Camera *camera, const camera3_capture_request_t *camera3Request) > { > frameNumber_ = camera3Request->frame_number; > diff --git a/src/android/camera_device.h b/src/android/camera_device.h > index 9c895b25..59d6cd39 100644 > --- a/src/android/camera_device.h > +++ b/src/android/camera_device.h > @@ -34,6 +34,21 @@ > #include "jpeg/encoder.h" > > struct CameraConfigData; > + > +struct Camera3RequestDescriptor { > + Camera3RequestDescriptor() = default; > + ~Camera3RequestDescriptor() = default; > + Camera3RequestDescriptor(libcamera::Camera *camera, > + const camera3_capture_request_t *camera3Request); > + Camera3RequestDescriptor &operator=(Camera3RequestDescriptor &&) = default; > + > + uint32_t frameNumber_ = 0; > + std::vector<camera3_stream_buffer_t> buffers_; > + std::vector<std::unique_ptr<libcamera::FrameBuffer>> frameBuffers_; > + CameraMetadata settings_; > + std::unique_ptr<CaptureRequest> request_; > +}; > + > class CameraDevice : protected libcamera::Loggable > { > public: > @@ -72,20 +87,6 @@ private: > > CameraDevice(unsigned int id, std::shared_ptr<libcamera::Camera> camera); > > - struct Camera3RequestDescriptor { > - Camera3RequestDescriptor() = default; > - ~Camera3RequestDescriptor() = default; > - Camera3RequestDescriptor(libcamera::Camera *camera, > - const camera3_capture_request_t *camera3Request); > - Camera3RequestDescriptor &operator=(Camera3RequestDescriptor &&) = default; > - > - uint32_t frameNumber_ = 0; > - std::vector<camera3_stream_buffer_t> buffers_; > - std::vector<std::unique_ptr<libcamera::FrameBuffer>> frameBuffers_; > - CameraMetadata settings_; > - std::unique_ptr<CaptureRequest> request_; > - }; > - > enum class State { > Stopped, > Flushing, > -- > 2.31.1 >
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index cc078fe4..3d6a2bed 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -220,7 +220,7 @@ bool validateCropRotate(const camera3_stream_configuration_t &streamList) * later re-used at request complete time to notify the framework. */ -CameraDevice::Camera3RequestDescriptor::Camera3RequestDescriptor( +Camera3RequestDescriptor::Camera3RequestDescriptor( Camera *camera, const camera3_capture_request_t *camera3Request) { frameNumber_ = camera3Request->frame_number; diff --git a/src/android/camera_device.h b/src/android/camera_device.h index 9c895b25..59d6cd39 100644 --- a/src/android/camera_device.h +++ b/src/android/camera_device.h @@ -34,6 +34,21 @@ #include "jpeg/encoder.h" struct CameraConfigData; + +struct Camera3RequestDescriptor { + Camera3RequestDescriptor() = default; + ~Camera3RequestDescriptor() = default; + Camera3RequestDescriptor(libcamera::Camera *camera, + const camera3_capture_request_t *camera3Request); + Camera3RequestDescriptor &operator=(Camera3RequestDescriptor &&) = default; + + uint32_t frameNumber_ = 0; + std::vector<camera3_stream_buffer_t> buffers_; + std::vector<std::unique_ptr<libcamera::FrameBuffer>> frameBuffers_; + CameraMetadata settings_; + std::unique_ptr<CaptureRequest> request_; +}; + class CameraDevice : protected libcamera::Loggable { public: @@ -72,20 +87,6 @@ private: CameraDevice(unsigned int id, std::shared_ptr<libcamera::Camera> camera); - struct Camera3RequestDescriptor { - Camera3RequestDescriptor() = default; - ~Camera3RequestDescriptor() = default; - Camera3RequestDescriptor(libcamera::Camera *camera, - const camera3_capture_request_t *camera3Request); - Camera3RequestDescriptor &operator=(Camera3RequestDescriptor &&) = default; - - uint32_t frameNumber_ = 0; - std::vector<camera3_stream_buffer_t> buffers_; - std::vector<std::unique_ptr<libcamera::FrameBuffer>> frameBuffers_; - CameraMetadata settings_; - std::unique_ptr<CaptureRequest> request_; - }; - enum class State { Stopped, Flushing,