diff options
author | Wu-cheng Li <wuchengli@google.com> | 2011-07-30 05:00:37 +0800 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2011-08-02 15:48:41 +0800 |
commit | 57c86189bc07d9ccb0fd044e66df736d0bf19639 (patch) | |
tree | 850a15dd5d48eb35aa993ceb27f3551a25622803 /camera/ICameraClient.cpp | |
parent | 40cdc56efa47580d89a93750cefecb8ccbaf9a72 (diff) | |
download | frameworks_av-57c86189bc07d9ccb0fd044e66df736d0bf19639.zip frameworks_av-57c86189bc07d9ccb0fd044e66df736d0bf19639.tar.gz frameworks_av-57c86189bc07d9ccb0fd044e66df736d0bf19639.tar.bz2 |
Pass camera frame metadata from camera service to Java.
bug:4460717
Change-Id: I2fae6e1dfca6b8f3a5ee5716fc7817f5417bf657
Diffstat (limited to 'camera/ICameraClient.cpp')
-rw-r--r-- | camera/ICameraClient.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/camera/ICameraClient.cpp b/camera/ICameraClient.cpp index cb3bd0c..183429a 100644 --- a/camera/ICameraClient.cpp +++ b/camera/ICameraClient.cpp @@ -51,13 +51,18 @@ public: } // generic data callback from camera service to app with image data - void dataCallback(int32_t msgType, const sp<IMemory>& imageData) + void dataCallback(int32_t msgType, const sp<IMemory>& imageData, + camera_frame_metadata_t *metadata) { LOGV("dataCallback"); Parcel data, reply; data.writeInterfaceToken(ICameraClient::getInterfaceDescriptor()); data.writeInt32(msgType); data.writeStrongBinder(imageData->asBinder()); + if (metadata) { + data.writeInt32(metadata->number_of_faces); + data.write(metadata->faces, sizeof(camera_face_t) * metadata->number_of_faces); + } remote()->transact(DATA_CALLBACK, data, &reply, IBinder::FLAG_ONEWAY); } @@ -96,7 +101,15 @@ status_t BnCameraClient::onTransact( CHECK_INTERFACE(ICameraClient, data, reply); int32_t msgType = data.readInt32(); sp<IMemory> imageData = interface_cast<IMemory>(data.readStrongBinder()); - dataCallback(msgType, imageData); + camera_frame_metadata_t *metadata = NULL; + if (data.dataAvail() > 0) { + metadata = new camera_frame_metadata_t; + metadata->number_of_faces = data.readInt32(); + metadata->faces = (camera_face_t *) data.readInplace( + sizeof(camera_face_t) * metadata->number_of_faces); + } + dataCallback(msgType, imageData, metadata); + if (metadata) delete metadata; return NO_ERROR; } break; case DATA_CALLBACK_TIMESTAMP: { |