diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-06-24 13:54:09 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-06-24 13:54:09 -0700 |
commit | e193f7cd9eded002b5a74b8823be704c020be536 (patch) | |
tree | 791f958dac5fd75d89cdd4020df37b2bf408cb42 /include/ui | |
parent | 994c7d1fe2fe0cdf4ad0a888e1b82af5b58b255d (diff) | |
parent | e1a75447f5ec3e9d41cb2e5d039958680477b2c5 (diff) | |
download | frameworks_native-e193f7cd9eded002b5a74b8823be704c020be536.zip frameworks_native-e193f7cd9eded002b5a74b8823be704c020be536.tar.gz frameworks_native-e193f7cd9eded002b5a74b8823be704c020be536.tar.bz2 |
am 3d7b8d1a: Merge change 5158 into donut
Merge commit '3d7b8d1aa6a362292f56defbe8fb2d5653f79282'
* commit '3d7b8d1aa6a362292f56defbe8fb2d5653f79282':
Use a ref-counted callback interface for Camera.
Diffstat (limited to 'include/ui')
-rw-r--r-- | include/ui/Camera.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/ui/Camera.h b/include/ui/Camera.h index 048bdd5..bd4855c 100644 --- a/include/ui/Camera.h +++ b/include/ui/Camera.h @@ -86,6 +86,14 @@ class Surface; class Mutex; class String8; +// ref-counted object for callbacks +class CameraListener: virtual public RefBase +{ +public: + virtual void notify(int32_t msgType, int32_t ext1, int32_t ext2) = 0; + virtual void postData(int32_t msgType, const sp<IMemory>& dataPtr) = 0; +}; + typedef void (*shutter_callback)(void *cookie); typedef void (*frame_callback)(const sp<IMemory>& mem, void *cookie); typedef void (*autofocus_callback)(bool focused, void *cookie); @@ -152,6 +160,9 @@ public: void setErrorCallback(error_callback cb, void *cookie); void setAutoFocusCallback(autofocus_callback cb, void *cookie); + void setListener(const sp<CameraListener>& listener); + void setPreviewCallbackFlags(int preview_callback_flag); + // ICameraClient interface virtual void notifyCallback(int32_t msgType, int32_t ext, int32_t ext2); virtual void dataCallback(int32_t msgType, const sp<IMemory>& dataPtr); @@ -194,6 +205,8 @@ private: autofocus_callback mAutoFocusCallback; void *mAutoFocusCallbackCookie; + sp<CameraListener> mListener; + friend class DeathNotifier; static Mutex mLock; |