Loading camera/CameraParameters.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -530,4 +530,8 @@ int CameraParameters::previewFormatToEnum(const char* format) { -1; } bool CameraParameters::isEmpty() const { return mMap.isEmpty(); } }; // namespace android include/camera/CameraParameters.h +3 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,9 @@ public: */ void getSupportedPreviewFormats(Vector<int>& formats) const; // Returns true if no keys are present bool isEmpty() const; // Parameter keys to communicate between camera application and driver. // The access (read/write, read only, or write only) is viewed from the // perspective of applications, not driver. Loading services/camera/libcameraservice/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ LOCAL_SRC_FILES:= \ device3/StatusTracker.cpp \ gui/RingBufferConsumer.cpp \ utils/CameraTraces.cpp \ utils/AutoConditionLock.cpp \ LOCAL_SHARED_LIBRARIES:= \ libui \ Loading services/camera/libcameraservice/CameraDeviceFactory.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ sp<CameraDeviceBase> CameraDeviceFactory::createDevice(int cameraId) { case CAMERA_DEVICE_API_VERSION_3_0: case CAMERA_DEVICE_API_VERSION_3_1: case CAMERA_DEVICE_API_VERSION_3_2: case CAMERA_DEVICE_API_VERSION_3_3: device = new Camera3Device(cameraId); break; default: Loading services/camera/libcameraservice/CameraFlashlight.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,20 @@ status_t CameraFlashlight::setTorchMode(const String8& cameraId, bool enabled) { status_t res = OK; Mutex::Autolock l(mLock); if (mOpenedCameraIds.indexOf(cameraId) != NAME_NOT_FOUND) { // This case is needed to avoid state corruption during the following call sequence: // CameraService::setTorchMode for camera ID 0 begins, does torch status checks // CameraService::connect for camera ID 0 begins, calls prepareDeviceOpen, ends // CameraService::setTorchMode for camera ID 0 continues, calls // CameraFlashlight::setTorchMode // TODO: Move torch status checks and state updates behind this CameraFlashlight lock // to avoid other similar race conditions. ALOGE("%s: Camera device %s is in use, cannot set torch mode.", __FUNCTION__, cameraId.string()); return -EBUSY; } if (mFlashControl == NULL) { if (enabled == false) { return OK; Loading Loading
camera/CameraParameters.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -530,4 +530,8 @@ int CameraParameters::previewFormatToEnum(const char* format) { -1; } bool CameraParameters::isEmpty() const { return mMap.isEmpty(); } }; // namespace android
include/camera/CameraParameters.h +3 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,9 @@ public: */ void getSupportedPreviewFormats(Vector<int>& formats) const; // Returns true if no keys are present bool isEmpty() const; // Parameter keys to communicate between camera application and driver. // The access (read/write, read only, or write only) is viewed from the // perspective of applications, not driver. Loading
services/camera/libcameraservice/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ LOCAL_SRC_FILES:= \ device3/StatusTracker.cpp \ gui/RingBufferConsumer.cpp \ utils/CameraTraces.cpp \ utils/AutoConditionLock.cpp \ LOCAL_SHARED_LIBRARIES:= \ libui \ Loading
services/camera/libcameraservice/CameraDeviceFactory.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ sp<CameraDeviceBase> CameraDeviceFactory::createDevice(int cameraId) { case CAMERA_DEVICE_API_VERSION_3_0: case CAMERA_DEVICE_API_VERSION_3_1: case CAMERA_DEVICE_API_VERSION_3_2: case CAMERA_DEVICE_API_VERSION_3_3: device = new Camera3Device(cameraId); break; default: Loading
services/camera/libcameraservice/CameraFlashlight.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,20 @@ status_t CameraFlashlight::setTorchMode(const String8& cameraId, bool enabled) { status_t res = OK; Mutex::Autolock l(mLock); if (mOpenedCameraIds.indexOf(cameraId) != NAME_NOT_FOUND) { // This case is needed to avoid state corruption during the following call sequence: // CameraService::setTorchMode for camera ID 0 begins, does torch status checks // CameraService::connect for camera ID 0 begins, calls prepareDeviceOpen, ends // CameraService::setTorchMode for camera ID 0 continues, calls // CameraFlashlight::setTorchMode // TODO: Move torch status checks and state updates behind this CameraFlashlight lock // to avoid other similar race conditions. ALOGE("%s: Camera device %s is in use, cannot set torch mode.", __FUNCTION__, cameraId.string()); return -EBUSY; } if (mFlashControl == NULL) { if (enabled == false) { return OK; Loading