[libcamera-devel] [RFC PATCH 11/17] libcamera: pipeline: uvcvideo: Migrate to Camera::Private
Niklas Söderlund
niklas.soderlund at ragnatech.se
Sat Jul 24 09:25:47 CEST 2021
Hi Laurent,
Thanks for your work.
On 2021-07-23 07:00:30 +0300, Laurent Pinchart wrote:
> As part of the effort to remove the CameraData class, migrate the
> pipeline handler-specific camera data from CameraData to the
> Camera::Private class.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
> src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 17 ++++++++---------
> 1 file changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
> index 63cb1daaae22..bbeeda97a91a 100644
> --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
> +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
> @@ -33,11 +33,11 @@ namespace libcamera {
>
> LOG_DEFINE_CATEGORY(UVC)
>
> -class UVCCameraData : public CameraData
> +class UVCCameraData : public Camera::Private
> {
> public:
> UVCCameraData(PipelineHandler *pipe)
> - : CameraData(pipe)
> + : Camera::Private(pipe)
> {
> }
>
> @@ -87,10 +87,9 @@ private:
> const ControlValue &value);
> int processControls(UVCCameraData *data, Request *request);
>
> - UVCCameraData *cameraData(const Camera *camera)
> + UVCCameraData *cameraData(Camera *camera)
> {
> - return static_cast<UVCCameraData *>(
> - PipelineHandler::cameraData(camera));
> + return static_cast<UVCCameraData *>(camera->_d());
> }
> };
>
> @@ -472,8 +471,8 @@ bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator)
>
> std::set<Stream *> streams{ &data->stream_ };
> std::shared_ptr<Camera> camera =
> - Camera::create(new Camera::Private(this), id, streams);
> - registerCamera(std::move(camera), std::move(data));
> + Camera::create(data.release(), id, streams);
> + registerCamera(std::move(camera), nullptr);
>
> /* Enable hot-unplug notifications. */
> hotplugMediaDevice(media);
> @@ -668,8 +667,8 @@ void UVCCameraData::bufferReady(FrameBuffer *buffer)
> request->metadata().set(controls::SensorTimestamp,
> buffer->metadata().timestamp);
>
> - pipe_->completeBuffer(request, buffer);
> - pipe_->completeRequest(request);
> + pipe()->completeBuffer(request, buffer);
> + pipe()->completeRequest(request);
> }
>
> REGISTER_PIPELINE_HANDLER(PipelineHandlerUVC)
> --
> Regards,
>
> Laurent Pinchart
>
--
Regards,
Niklas Söderlund
More information about the libcamera-devel
mailing list