mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-23 00:25:07 +03:00
android: camera_hal_manager: Set camera module callbacks
camera_module_callbacks are invoked to inform the framework about the events occurring module-wide. Allow to set these callbacks in camera_hal_manager as this will be used to integration camera hotplug support via camera_module_callbacks::camera_device_status_change in subsequent commit. Signed-off-by: Umang Jain <email@uajain.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
76809320bb
commit
7197fd9d67
3 changed files with 10 additions and 0 deletions
|
@ -34,6 +34,8 @@ static int hal_get_camera_info(int id, struct camera_info *info)
|
||||||
|
|
||||||
static int hal_set_callbacks(const camera_module_callbacks_t *callbacks)
|
static int hal_set_callbacks(const camera_module_callbacks_t *callbacks)
|
||||||
{
|
{
|
||||||
|
cameraManager.setCallbacks(callbacks);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -120,3 +120,8 @@ int CameraHalManager::getCameraInfo(unsigned int id, struct camera_info *info)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CameraHalManager::setCallbacks(const camera_module_callbacks_t *callbacks)
|
||||||
|
{
|
||||||
|
callbacks_ = callbacks;
|
||||||
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include <hardware/camera_common.h>
|
||||||
#include <hardware/hardware.h>
|
#include <hardware/hardware.h>
|
||||||
#include <system/camera_metadata.h>
|
#include <system/camera_metadata.h>
|
||||||
|
|
||||||
|
@ -29,10 +30,12 @@ public:
|
||||||
|
|
||||||
unsigned int numCameras() const;
|
unsigned int numCameras() const;
|
||||||
int getCameraInfo(unsigned int id, struct camera_info *info);
|
int getCameraInfo(unsigned int id, struct camera_info *info);
|
||||||
|
void setCallbacks(const camera_module_callbacks_t *callbacks);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
libcamera::CameraManager *cameraManager_;
|
libcamera::CameraManager *cameraManager_;
|
||||||
|
|
||||||
|
const camera_module_callbacks_t *callbacks_;
|
||||||
std::vector<std::unique_ptr<CameraDevice>> cameras_;
|
std::vector<std::unique_ptr<CameraDevice>> cameras_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue