diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-05-11 10:00:49 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-05-11 10:00:49 -0700 |
commit | 70a16b408442ad1e665ee37ccdb8c88c8d3d74d6 (patch) | |
tree | 034ca892743cc233ef50bdc88b9f1f3bff9f4912 /libs/ui/ICameraClient.cpp | |
parent | f37b96299f62ab4e28e97eead72de2418de2cdf8 (diff) | |
parent | 3022a11c4c41afa9d39b4d0d9abd7e6bcb6b8472 (diff) | |
download | frameworks_base-70a16b408442ad1e665ee37ccdb8c88c8d3d74d6.zip frameworks_base-70a16b408442ad1e665ee37ccdb8c88c8d3d74d6.tar.gz frameworks_base-70a16b408442ad1e665ee37ccdb8c88c8d3d74d6.tar.bz2 |
am 3022a11: Merge change 1239 into donut
Merge commit '3022a11c4c41afa9d39b4d0d9abd7e6bcb6b8472'
* commit '3022a11c4c41afa9d39b4d0d9abd7e6bcb6b8472':
Modify camera framework to use new streamlined binder interface.
Diffstat (limited to 'libs/ui/ICameraClient.cpp')
-rw-r--r-- | libs/ui/ICameraClient.cpp | 126 |
1 files changed, 1 insertions, 125 deletions
diff --git a/libs/ui/ICameraClient.cpp b/libs/ui/ICameraClient.cpp index ae07b67..c6cf75c 100644 --- a/libs/ui/ICameraClient.cpp +++ b/libs/ui/ICameraClient.cpp @@ -25,14 +25,7 @@ namespace android { enum { - SHUTTER_CALLBACK = IBinder::FIRST_CALL_TRANSACTION, - RAW_CALLBACK, - JPEG_CALLBACK, - PREVIEW_CALLBACK, - ERROR_CALLBACK, - AUTOFOCUS_CALLBACK, - RECORDING_CALLBACK, - NOTIFY_CALLBACK, + NOTIFY_CALLBACK = IBinder::FIRST_CALL_TRANSACTION, DATA_CALLBACK, }; @@ -44,75 +37,6 @@ public: { } - // callback to let the app know the shutter has closed, ideal for playing the shutter sound - void shutterCallback() - { - LOGV("shutterCallback"); - Parcel data, reply; - data.writeInterfaceToken(ICameraClient::getInterfaceDescriptor()); - remote()->transact(SHUTTER_CALLBACK, data, &reply, IBinder::FLAG_ONEWAY); - } - - // callback from camera service to app with picture data - void rawCallback(const sp<IMemory>& picture) - { - LOGV("rawCallback"); - Parcel data, reply; - data.writeInterfaceToken(ICameraClient::getInterfaceDescriptor()); - data.writeStrongBinder(picture->asBinder()); - remote()->transact(RAW_CALLBACK, data, &reply, IBinder::FLAG_ONEWAY); - } - - // callback from camera service to app with picture data - void jpegCallback(const sp<IMemory>& picture) - { - LOGV("jpegCallback"); - Parcel data, reply; - data.writeInterfaceToken(ICameraClient::getInterfaceDescriptor()); - data.writeStrongBinder(picture->asBinder()); - remote()->transact(JPEG_CALLBACK, data, &reply, IBinder::FLAG_ONEWAY); - } - - // callback from camera service to app with preview frame data - void previewCallback(const sp<IMemory>& frame) - { - LOGV("previewCallback"); - Parcel data, reply; - data.writeInterfaceToken(ICameraClient::getInterfaceDescriptor()); - data.writeStrongBinder(frame->asBinder()); - remote()->transact(PREVIEW_CALLBACK, data, &reply, IBinder::FLAG_ONEWAY); - } - - // callback from camera service to app with recording frame data - void recordingCallback(const sp<IMemory>& frame) - { - LOGV("recordingCallback"); - Parcel data, reply; - data.writeInterfaceToken(ICameraClient::getInterfaceDescriptor()); - data.writeStrongBinder(frame->asBinder()); - remote()->transact(RECORDING_CALLBACK, data, &reply, IBinder::FLAG_ONEWAY); - } - - // callback from camera service to app to report error - void errorCallback(status_t error) - { - LOGV("errorCallback"); - Parcel data, reply; - data.writeInterfaceToken(ICameraClient::getInterfaceDescriptor()); - data.writeInt32(error); - remote()->transact(ERROR_CALLBACK, data, &reply, IBinder::FLAG_ONEWAY); - } - - // callback from camera service to app to report autofocus completion - void autoFocusCallback(bool focused) - { - LOGV("autoFocusCallback"); - Parcel data, reply; - data.writeInterfaceToken(ICameraClient::getInterfaceDescriptor()); - data.writeInt32(focused); - remote()->transact(AUTOFOCUS_CALLBACK, data, &reply, IBinder::FLAG_ONEWAY); - } - // generic callback from camera service to app void notifyCallback(int32_t msgType, int32_t ext1, int32_t ext2) { @@ -152,54 +76,6 @@ status_t BnCameraClient::onTransact( uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) { switch(code) { - case SHUTTER_CALLBACK: { - LOGV("SHUTTER_CALLBACK"); - CHECK_INTERFACE(ICameraClient, data, reply); - shutterCallback(); - return NO_ERROR; - } break; - case RAW_CALLBACK: { - LOGV("RAW_CALLBACK"); - CHECK_INTERFACE(ICameraClient, data, reply); - sp<IMemory> picture = interface_cast<IMemory>(data.readStrongBinder()); - rawCallback(picture); - return NO_ERROR; - } break; - case JPEG_CALLBACK: { - LOGV("JPEG_CALLBACK"); - CHECK_INTERFACE(ICameraClient, data, reply); - sp<IMemory> picture = interface_cast<IMemory>(data.readStrongBinder()); - jpegCallback(picture); - return NO_ERROR; - } break; - case PREVIEW_CALLBACK: { - LOGV("PREVIEW_CALLBACK"); - CHECK_INTERFACE(ICameraClient, data, reply); - sp<IMemory> frame = interface_cast<IMemory>(data.readStrongBinder()); - previewCallback(frame); - return NO_ERROR; - } break; - case RECORDING_CALLBACK: { - LOGV("RECORDING_CALLBACK"); - CHECK_INTERFACE(ICameraClient, data, reply); - sp<IMemory> frame = interface_cast<IMemory>(data.readStrongBinder()); - recordingCallback(frame); - return NO_ERROR; - } break; - case ERROR_CALLBACK: { - LOGV("ERROR_CALLBACK"); - CHECK_INTERFACE(ICameraClient, data, reply); - status_t error = data.readInt32(); - errorCallback(error); - return NO_ERROR; - } break; - case AUTOFOCUS_CALLBACK: { - LOGV("AUTOFOCUS_CALLBACK"); - CHECK_INTERFACE(ICameraClient, data, reply); - bool focused = (bool)data.readInt32(); - autoFocusCallback(focused); - return NO_ERROR; - } break; case NOTIFY_CALLBACK: { LOGV("NOTIFY_CALLBACK"); CHECK_INTERFACE(ICameraClient, data, reply); |