summaryrefslogtreecommitdiffstats
path: root/camera/ICameraService.cpp
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2014-02-21 10:51:38 -0800
committerRuben Brunk <rubenbrunk@google.com>2014-03-13 12:09:22 -0700
commitd1176ef16677b6c94fb893edb6a864cdccc0b190 (patch)
tree8cc18e17c4e32633d20e8c2b7fc9e397cc1791ac /camera/ICameraService.cpp
parent3a005b3b19b750afe24577ae322aff4602ca2740 (diff)
downloadframeworks_av-d1176ef16677b6c94fb893edb6a864cdccc0b190.zip
frameworks_av-d1176ef16677b6c94fb893edb6a864cdccc0b190.tar.gz
frameworks_av-d1176ef16677b6c94fb893edb6a864cdccc0b190.tar.bz2
camera3: Pass vendor tags through binder.
Bug: 12134423 - Adds a class for parceling vendor tag definitions. - Passes vendor tag definitions to clients of the camera service. - Switches over to new vendor tag mechanism when reading from HAL. Change-Id: Icef3fe9e67160767bdb8244ac49c85b68b497123
Diffstat (limited to 'camera/ICameraService.cpp')
-rw-r--r--camera/ICameraService.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/camera/ICameraService.cpp b/camera/ICameraService.cpp
index 5fc89fb..ef6c0f4 100644
--- a/camera/ICameraService.cpp
+++ b/camera/ICameraService.cpp
@@ -17,6 +17,7 @@
#define LOG_TAG "BpCameraService"
#include <utils/Log.h>
+#include <utils/Errors.h>
#include <stdint.h>
#include <sys/types.h>
@@ -34,6 +35,7 @@
#include <camera/camera2/ICameraDeviceUser.h>
#include <camera/camera2/ICameraDeviceCallbacks.h>
#include <camera/CameraMetadata.h>
+#include <camera/VendorTagDescriptor.h>
namespace android {
@@ -143,6 +145,24 @@ public:
return result;
}
+ // Get enumeration and description of vendor tags for camera
+ virtual status_t getCameraVendorTagDescriptor(/*out*/sp<VendorTagDescriptor>& desc) {
+ Parcel data, reply;
+ data.writeInterfaceToken(ICameraService::getInterfaceDescriptor());
+ remote()->transact(BnCameraService::GET_CAMERA_VENDOR_TAG_DESCRIPTOR, data, &reply);
+
+ if (readExceptionCode(reply)) return -EPROTO;
+ status_t result = reply.readInt32();
+
+ if (reply.readInt32() != 0) {
+ sp<VendorTagDescriptor> d;
+ if (VendorTagDescriptor::createFromParcel(&reply, /*out*/d) == OK) {
+ desc = d;
+ }
+ }
+ return result;
+ }
+
// connect to camera service (android.hardware.Camera)
virtual status_t connect(const sp<ICameraClient>& cameraClient, int cameraId,
const String16 &clientPackageName, int clientUid,
@@ -275,6 +295,22 @@ status_t BnCameraService::onTransact(
info.writeToParcel(reply);
return NO_ERROR;
} break;
+ case GET_CAMERA_VENDOR_TAG_DESCRIPTOR: {
+ CHECK_INTERFACE(ICameraService, data, reply);
+ sp<VendorTagDescriptor> d;
+ status_t result = getCameraVendorTagDescriptor(d);
+ reply->writeNoException();
+ reply->writeInt32(result);
+
+ // out-variables are after exception and return value
+ reply->writeInt32(1); // means the parcelable is included
+ if (d == NULL) {
+ reply->writeInt32(0);
+ } else {
+ d->writeToParcel(reply);
+ }
+ return NO_ERROR;
+ } break;
case CONNECT: {
CHECK_INTERFACE(ICameraService, data, reply);
sp<ICameraClient> cameraClient =