summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/CameraService.h
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2014-05-09 19:57:56 -0700
committerRuben Brunk <rubenbrunk@google.com>2014-05-21 18:14:41 -0700
commitb2119af7f4ced0ecfefd4c7388f86b4e3a3ea7d8 (patch)
treea97770362fc690d625a0383597cb057d48737876 /services/camera/libcameraservice/CameraService.h
parent7ac0039611ea7ea18f9545f96a8f5cb31dcdebe5 (diff)
downloadframeworks_av-b2119af7f4ced0ecfefd4c7388f86b4e3a3ea7d8.zip
frameworks_av-b2119af7f4ced0ecfefd4c7388f86b4e3a3ea7d8.tar.gz
frameworks_av-b2119af7f4ced0ecfefd4c7388f86b4e3a3ea7d8.tar.bz2
camera2: Update CameraService for HAL1 shim.
Updates the camera service to handle shim connections. Changes include: - Adds begin/end configure binder calls. - Adds cache for shim client static camera metadata. - Implements basic getCameraCharacteristic functionality for shim clients. Bug: 15116722 Bug: 15117269 Change-Id: I510c5888ca15f8e7d3b8ed1680ff1c7f8f514744
Diffstat (limited to 'services/camera/libcameraservice/CameraService.h')
-rw-r--r--services/camera/libcameraservice/CameraService.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index 76ea7be..ee39d52 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -18,6 +18,7 @@
#define ANDROID_SERVERS_CAMERA_CAMERASERVICE_H
#include <utils/Vector.h>
+#include <utils/KeyedVector.h>
#include <binder/AppOpsManager.h>
#include <binder/BinderService.h>
#include <binder/IAppOpsCallback.h>
@@ -32,6 +33,7 @@
#include <camera/camera2/ICameraDeviceCallbacks.h>
#include <camera/VendorTagDescriptor.h>
#include <camera/CaptureResult.h>
+#include <camera/CameraParameters.h>
#include <camera/ICameraServiceListener.h>
@@ -395,6 +397,43 @@ private:
bool isValidCameraId(int cameraId);
bool setUpVendorTags();
+
+ /**
+ * A mapping of camera ids to CameraParameters returned by that camera device.
+ *
+ * This cache is used to generate CameraCharacteristic metadata when using
+ * the HAL1 shim.
+ */
+ KeyedVector<int, CameraParameters> mShimParams;
+
+ /**
+ * Initialize and cache the metadata used by the HAL1 shim for a given cameraId.
+ *
+ * Returns OK on success, or a negative error code.
+ */
+ status_t initializeShimMetadata(int cameraId);
+
+ /**
+ * Generate the CameraCharacteristics metadata required by the Camera2 API
+ * from the available HAL1 CameraParameters and CameraInfo.
+ *
+ * Returns OK on success, or a negative error code.
+ */
+ status_t generateShimMetadata(int cameraId, /*out*/CameraMetadata* cameraInfo);
+
+ /**
+ * Connect a new camera client. This should only be used while holding the
+ * mutex for mServiceLock.
+ *
+ * Returns OK on success, or a negative error code.
+ */
+ status_t connectHelperLocked(const sp<ICameraClient>& cameraClient,
+ int cameraId,
+ const String16& clientPackageName,
+ int clientUid,
+ int callingPid,
+ /*out*/
+ sp<Client>& client);
};
} // namespace android