libcamera: pipeline_handler: Store pipe and camera in CameraData
Extend the CameraData class with two member variables pipe_ and camera_ that store pointers to the pipeline handler and camera that the CameraData instance is related to. This will be used by pipeline handlers to access the camera and the pipeline in member methods of their CameraData derived classes. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
@@ -46,8 +46,8 @@ private:
|
||||
class UVCCameraData : public CameraData
|
||||
{
|
||||
public:
|
||||
UVCCameraData()
|
||||
: video_(nullptr)
|
||||
UVCCameraData(PipelineHandler *pipe)
|
||||
: CameraData(pipe), video_(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator)
|
||||
|
||||
media_->acquire();
|
||||
|
||||
std::unique_ptr<UVCCameraData> data = utils::make_unique<UVCCameraData>();
|
||||
std::unique_ptr<UVCCameraData> data = utils::make_unique<UVCCameraData>(this);
|
||||
|
||||
/* Locate and open the default video node. */
|
||||
for (MediaEntity *entity : media_->entities()) {
|
||||
|
||||
Reference in New Issue
Block a user