diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-07-23 04:39:44 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-08-16 23:57:28 +0300 |
commit | aae303c5aad15b44b4ac2b208b866ad21a27c300 (patch) | |
tree | 4ef773f1c1b490af854aed61a792eeb891df0f61 | |
parent | fb1bcb9c382953e328f4ce69a9258bfc994a8b6f (diff) |
libcamera: pipeline: uvcvideo: Migrate to Camera::Private
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@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r-- | src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp index f2d2b670..b6b1fd35 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,9 +471,8 @@ bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator) std::set<Stream *> streams{ &data->stream_ }; std::shared_ptr<Camera> camera = - Camera::create(std::make_unique<Camera::Private>(this), id, - streams); - registerCamera(std::move(camera), std::move(data)); + Camera::create(std::move(data), id, streams); + registerCamera(std::move(camera), nullptr); /* Enable hot-unplug notifications. */ hotplugMediaDevice(media); @@ -669,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) |