From 48685c45bb333c3564596158e2e67267110c9277 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Fri, 8 May 2009 15:23:38 -0700 Subject: only export the GL entry-points, hide everything else. Conflicts: opengl/libagl/Android.mk opengl/libs/Android.mk opengl/libs/egl_impl.h --- opengl/include/GLES/glext.h | 8 ++++---- opengl/include/KHR/khrplatform.h | 2 ++ opengl/libagl/Android.mk | 2 ++ opengl/libs/Android.mk | 4 ++++ opengl/libs/egl_impl.h | 2 ++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/opengl/include/GLES/glext.h b/opengl/include/GLES/glext.h index 4c01871..3984333 100644 --- a/opengl/include/GLES/glext.h +++ b/opengl/include/GLES/glext.h @@ -603,13 +603,13 @@ typedef void (GL_APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, * dalvik extension functions *------------------------------------------------------------------------*/ #ifdef ANDROID -void glColorPointerBounds(GLint size, GLenum type, GLsizei stride, +GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLsizei count); -void glNormalPointerBounds(GLenum type, GLsizei stride, +GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride, const GLvoid *pointer, GLsizei count); -void glTexCoordPointerBounds(GLint size, GLenum type, +GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer, GLsizei count); -void glVertexPointerBounds(GLint size, GLenum type, +GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer, GLsizei count); #endif diff --git a/opengl/include/KHR/khrplatform.h b/opengl/include/KHR/khrplatform.h index 4cc27c5..1660bd7 100644 --- a/opengl/include/KHR/khrplatform.h +++ b/opengl/include/KHR/khrplatform.h @@ -91,6 +91,8 @@ # define KHRONOS_APICALL __declspec(dllimport) #elif defined (__SYMBIAN32__) # define KHRONOS_APICALL IMPORT_C +#elif defined(ANDROID) +# define KHRONOS_APICALL __attribute__((visibility("default"))) #else # define KHRONOS_APICALL #endif diff --git a/opengl/libagl/Android.mk b/opengl/libagl/Android.mk index 99efe4c..3ce0414 100644 --- a/opengl/libagl/Android.mk +++ b/opengl/libagl/Android.mk @@ -33,6 +33,8 @@ ifneq ($(TARGET_SIMULATOR),true) endif LOCAL_SHARED_LIBRARIES := libcutils libutils libpixelflinger +LOCAL_CFLAGS += -fvisibility=hidden + LOCAL_LDLIBS := -lpthread -ldl LOCAL_MODULE:= libagl diff --git a/opengl/libs/Android.mk b/opengl/libs/Android.mk index d636d73..5ba6b76 100644 --- a/opengl/libs/Android.mk +++ b/opengl/libs/Android.mk @@ -23,6 +23,8 @@ else LOCAL_CFLAGS += -I$(LOCAL_PATH)/../../../../bionic/libc/private endif +LOCAL_CFLAGS += -fvisibility=hidden + include $(BUILD_SHARED_LIBRARY) @@ -49,4 +51,6 @@ else LOCAL_CFLAGS += -I$(LOCAL_PATH)/../../../../bionic/libc/private endif +LOCAL_CFLAGS += -fvisibility=hidden + include $(BUILD_SHARED_LIBRARY) diff --git a/opengl/libs/egl_impl.h b/opengl/libs/egl_impl.h index 62ce3fc..312b176 100644 --- a/opengl/libs/egl_impl.h +++ b/opengl/libs/egl_impl.h @@ -20,6 +20,8 @@ #include #include +#include +#include // ---------------------------------------------------------------------------- namespace android { -- cgit v1.1 From 94aa09680a530353448bc9052cec9c6b205db8b4 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Fri, 8 May 2009 15:59:34 -0700 Subject: should fix the build. --- opengl/libs/EGL/gpu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opengl/libs/EGL/gpu.cpp b/opengl/libs/EGL/gpu.cpp index 3f9fd63..f9dc5f1 100644 --- a/opengl/libs/EGL/gpu.cpp +++ b/opengl/libs/EGL/gpu.cpp @@ -53,7 +53,7 @@ namespace android { static Mutex gRegionsLock; static request_gpu_t gRegions; static sp gSurfaceManager; -ISurfaceComposer* GLES_localSurfaceManager = 0; +GL_API ISurfaceComposer* GLES_localSurfaceManager = 0; extern egl_connection_t gEGLImpl[2]; -- cgit v1.1 From d373c6348a91595dd4c0b83ad256dbf30870fa5d Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Fri, 8 May 2009 15:35:17 -0700 Subject: remove the gl{Vertex|Color|TexCoord|Normal}PointerBounds() "extension" fro eglext.h --- opengl/include/GLES/glext.h | 15 --------------- opengl/libs/GLES_CM/gl.cpp | 11 +++++++++++ opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp | 13 +++++++++++++ opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp | 13 +++++++++++++ 4 files changed, 37 insertions(+), 15 deletions(-) diff --git a/opengl/include/GLES/glext.h b/opengl/include/GLES/glext.h index 3984333..a8fe2e9 100644 --- a/opengl/include/GLES/glext.h +++ b/opengl/include/GLES/glext.h @@ -599,21 +599,6 @@ typedef void (GL_APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, #define GL_EXT_texture_filter_anisotropic 1 #endif -/*------------------------------------------------------------------------* - * dalvik extension functions - *------------------------------------------------------------------------*/ -#ifdef ANDROID -GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride, - const GLvoid *ptr, GLsizei count); -GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride, - const GLvoid *pointer, GLsizei count); -GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type, - GLsizei stride, const GLvoid *pointer, GLsizei count); -GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type, - GLsizei stride, const GLvoid *pointer, GLsizei count); -#endif - - #ifdef __cplusplus } #endif diff --git a/opengl/libs/GLES_CM/gl.cpp b/opengl/libs/GLES_CM/gl.cpp index 0057168..384b59a 100644 --- a/opengl/libs/GLES_CM/gl.cpp +++ b/opengl/libs/GLES_CM/gl.cpp @@ -37,6 +37,17 @@ using namespace android; // extensions for the framework // ---------------------------------------------------------------------------- +extern "C" { +GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride, + const GLvoid *ptr, GLsizei count); +GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride, + const GLvoid *pointer, GLsizei count); +GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type, + GLsizei stride, const GLvoid *pointer, GLsizei count); +GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type, + GLsizei stride, const GLvoid *pointer, GLsizei count); +} + void glColorPointerBounds(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLsizei count) { glColorPointer(size, type, stride, ptr); diff --git a/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp index 7aa18b6..3948fd3 100644 --- a/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp +++ b/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp @@ -23,6 +23,19 @@ #include #include +/* special calls implemented in Android's GLES wrapper used to more + * efficiently bound-check passed arrays */ +extern "C" { +GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride, + const GLvoid *ptr, GLsizei count); +GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride, + const GLvoid *pointer, GLsizei count); +GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type, + GLsizei stride, const GLvoid *pointer, GLsizei count); +GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type, + GLsizei stride, const GLvoid *pointer, GLsizei count); +} + static int initialized = 0; static jclass nioAccessClass; diff --git a/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp b/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp index 8f174c7..11c6087 100644 --- a/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp +++ b/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp @@ -23,6 +23,19 @@ #include #include +/* special calls implemented in Android's GLES wrapper used to more + * efficiently bound-check passed arrays */ +extern "C" { +GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride, + const GLvoid *ptr, GLsizei count); +GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride, + const GLvoid *pointer, GLsizei count); +GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type, + GLsizei stride, const GLvoid *pointer, GLsizei count); +GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type, + GLsizei stride, const GLvoid *pointer, GLsizei count); +} + static int initialized = 0; static jclass nioAccessClass; -- cgit v1.1 From 93b94584edb1c59037319d9bbf84881ccff9f66a Mon Sep 17 00:00:00 2001 From: Dave Sparks Date: Thu, 7 May 2009 19:27:32 -0700 Subject: Modify camera framework to use new streamlined binder interface. This is the second half of bug 1837832. Modifies the camera client and camera service to use the new binder interface. Removes the old binder interface. There will be one more part to this change to surface the undefined callbacks to the Java layer so that partners can implement new features without having to touch the stack. --- camera/libcameraservice/CameraService.cpp | 16 ++-- include/ui/Camera.h | 26 ++++-- include/ui/ICameraClient.h | 24 ------ libs/ui/Camera.cpp | 118 +++++++++++++--------------- libs/ui/ICameraClient.cpp | 126 +----------------------------- 5 files changed, 81 insertions(+), 229 deletions(-) diff --git a/camera/libcameraservice/CameraService.cpp b/camera/libcameraservice/CameraService.cpp index 96ee502..f85ea9f 100644 --- a/camera/libcameraservice/CameraService.cpp +++ b/camera/libcameraservice/CameraService.cpp @@ -915,24 +915,24 @@ String8 CameraService::Client::getParameters() const void CameraService::Client::postAutoFocus(bool focused) { LOGV("postAutoFocus"); - mCameraClient->autoFocusCallback(focused); + mCameraClient->notifyCallback(CAMERA_MSG_FOCUS, (int32_t)focused, 0); } void CameraService::Client::postShutter() { - mCameraClient->shutterCallback(); + mCameraClient->notifyCallback(CAMERA_MSG_SHUTTER, 0, 0); } void CameraService::Client::postRaw(const sp& mem) { LOGD("postRaw"); - mCameraClient->rawCallback(mem); + mCameraClient->dataCallback(CAMERA_MSG_RAW_IMAGE, mem); } void CameraService::Client::postJpeg(const sp& mem) { LOGD("postJpeg"); - mCameraClient->jpegCallback(mem); + mCameraClient->dataCallback(CAMERA_MSG_COMPRESSED_IMAGE, mem); } void CameraService::Client::copyFrameAndPostCopiedFrame(sp heap, size_t offset, size_t size) @@ -960,7 +960,7 @@ void CameraService::Client::copyFrameAndPostCopiedFrame(sp heap, si LOGE("failed to allocate space for frame callback"); return; } - mCameraClient->previewCallback(frame); + mCameraClient->dataCallback(CAMERA_MSG_PREVIEW_FRAME, frame); } void CameraService::Client::postRecordingFrame(const sp& frame) @@ -970,7 +970,7 @@ void CameraService::Client::postRecordingFrame(const sp& frame) LOGW("frame is a null pointer"); return; } - mCameraClient->recordingCallback(frame); + mCameraClient->dataCallback(CAMERA_MSG_VIDEO_FRAME, frame); } void CameraService::Client::postPreviewFrame(const sp& mem) @@ -1004,7 +1004,7 @@ void CameraService::Client::postPreviewFrame(const sp& mem) copyFrameAndPostCopiedFrame(heap, offset, size); } else { LOGV("frame is directly sent out without copying"); - mCameraClient->previewCallback(mem); + mCameraClient->dataCallback(CAMERA_MSG_PREVIEW_FRAME, mem); } // Is this is one-shot only? @@ -1018,7 +1018,7 @@ void CameraService::Client::postPreviewFrame(const sp& mem) void CameraService::Client::postError(status_t error) { - mCameraClient->errorCallback(error); + mCameraClient->notifyCallback(CAMERA_MSG_ERROR, error, 0); } status_t CameraService::dump(int fd, const Vector& args) diff --git a/include/ui/Camera.h b/include/ui/Camera.h index 901c7a9..048bdd5 100644 --- a/include/ui/Camera.h +++ b/include/ui/Camera.h @@ -63,6 +63,23 @@ namespace android { #define FRAME_CALLBACK_FLAG_CAMERA 0x05 #define FRAME_CALLBACK_FLAG_BARCODE_SCANNER 0x07 +// msgType in notifyCallback function +enum { + CAMERA_MSG_ERROR, + CAMERA_MSG_SHUTTER, + CAMERA_MSG_FOCUS, + CAMERA_MSG_ZOOM +}; + +// msgType in dataCallback function +enum { + CAMERA_MSG_PREVIEW_FRAME, + CAMERA_MSG_VIDEO_FRAME, + CAMERA_MSG_POSTVIEW_FRAME, + CAMERA_MSG_RAW_IMAGE, + CAMERA_MSG_COMPRESSED_IMAGE +}; + class ICameraService; class ICamera; class Surface; @@ -136,15 +153,8 @@ public: void setAutoFocusCallback(autofocus_callback cb, void *cookie); // ICameraClient interface - virtual void shutterCallback(); - virtual void rawCallback(const sp& picture); - virtual void jpegCallback(const sp& picture); - virtual void previewCallback(const sp& frame); - virtual void errorCallback(status_t error); - virtual void autoFocusCallback(bool focused); - virtual void recordingCallback(const sp& frame); virtual void notifyCallback(int32_t msgType, int32_t ext, int32_t ext2); - virtual void dataCallback(int32_t msgType, const sp& frame); + virtual void dataCallback(int32_t msgType, const sp& dataPtr); sp remote(); diff --git a/include/ui/ICameraClient.h b/include/ui/ICameraClient.h index 1645ef8..c4bdd07 100644 --- a/include/ui/ICameraClient.h +++ b/include/ui/ICameraClient.h @@ -29,30 +29,6 @@ class ICameraClient: public IInterface public: DECLARE_META_INTERFACE(CameraClient); - // msgType in notifyCallback function - enum { - ERROR, - SHUTTER, - FOCUSED, - ZOOM - } notify_callback_message_type; - - // msgType in dataCallback function - enum { - PREVIEW, - RECORD, - POSTVIEW, - RAW, - COMPRESSED - } data_callback_message_type; - - virtual void shutterCallback() = 0; - virtual void rawCallback(const sp& picture) = 0; - virtual void jpegCallback(const sp& picture) = 0; - virtual void previewCallback(const sp& frame) = 0; - virtual void errorCallback(status_t error) = 0; - virtual void autoFocusCallback(bool focused) = 0; - virtual void recordingCallback(const sp& frame) = 0; virtual void notifyCallback(int32_t msgType, int32_t ext1, int32_t ext2) = 0; virtual void dataCallback(int32_t msgType, const sp& data) = 0; diff --git a/libs/ui/Camera.cpp b/libs/ui/Camera.cpp index ed4f3b8..6613700 100644 --- a/libs/ui/Camera.cpp +++ b/libs/ui/Camera.cpp @@ -337,76 +337,66 @@ void Camera::setErrorCallback(error_callback cb, void *cookie) mErrorCallbackCookie = cookie; } -void Camera::autoFocusCallback(bool focused) -{ - LOGV("autoFocusCallback"); - if (mAutoFocusCallback) { - mAutoFocusCallback(focused, mAutoFocusCallbackCookie); - } -} - -void Camera::shutterCallback() -{ - LOGV("shutterCallback"); - if (mShutterCallback) { - mShutterCallback(mShutterCallbackCookie); - } -} - -void Camera::rawCallback(const sp& picture) -{ - LOGV("rawCallback"); - if (mRawCallback) { - mRawCallback(picture, mRawCallbackCookie); - } -} - -// callback from camera service when image is ready -void Camera::jpegCallback(const sp& picture) -{ - LOGV("jpegCallback"); - if (mJpegCallback) { - mJpegCallback(picture, mJpegCallbackCookie); - } -} - -// callback from camera service when preview frame is ready -void Camera::previewCallback(const sp& frame) -{ - LOGV("frameCallback"); - if (mPreviewCallback) { - mPreviewCallback(frame, mPreviewCallbackCookie); - } -} - -// callback from camera service when a recording frame is ready -void Camera::recordingCallback(const sp& frame) -{ - LOGV("recordingCallback"); - if (mRecordingCallback) { - mRecordingCallback(frame, mRecordingCallbackCookie); - } -} - -// callback from camera service when an error occurs in preview or takePicture -void Camera::errorCallback(status_t error) -{ - LOGV("errorCallback"); - if (mErrorCallback) { - mErrorCallback(error, mErrorCallbackCookie); - } -} - // callback from camera service void Camera::notifyCallback(int32_t msgType, int32_t ext1, int32_t ext2) { - LOGV("notifyCallback"); + switch(msgType) { + case CAMERA_MSG_ERROR: + LOGV("errorCallback"); + if (mErrorCallback) { + mErrorCallback((status_t)ext1, mErrorCallbackCookie); + } + break; + case CAMERA_MSG_FOCUS: + LOGV("autoFocusCallback"); + if (mAutoFocusCallback) { + mAutoFocusCallback((bool)ext1, mAutoFocusCallbackCookie); + } + break; + case CAMERA_MSG_SHUTTER: + LOGV("shutterCallback"); + if (mShutterCallback) { + mShutterCallback(mShutterCallbackCookie); + } + break; + default: + LOGV("notifyCallback(%d, %d, %d)", msgType, ext1, ext2); + break; + } } -// callback from camera service when image is ready -void Camera::dataCallback(int32_t msgType, const sp& frame) +// callback from camera service when frame or image is ready +void Camera::dataCallback(int32_t msgType, const sp& dataPtr) { - LOGV("dataCallback"); + switch(msgType) { + case CAMERA_MSG_PREVIEW_FRAME: + LOGV("previewCallback"); + if (mPreviewCallback) { + mPreviewCallback(dataPtr, mPreviewCallbackCookie); + } + break; + case CAMERA_MSG_VIDEO_FRAME: + LOGV("recordingCallback"); + if (mRecordingCallback) { + mRecordingCallback(dataPtr, mRecordingCallbackCookie); + } + break; + case CAMERA_MSG_RAW_IMAGE: + LOGV("rawCallback"); + if (mRawCallback) { + mRawCallback(dataPtr, mRawCallbackCookie); + } + break; + case CAMERA_MSG_COMPRESSED_IMAGE: + LOGV("jpegCallback"); + if (mJpegCallback) { + mJpegCallback(dataPtr, mJpegCallbackCookie); + } + break; + default: + LOGV("dataCallback(%d, %p)", msgType, dataPtr.get()); + break; + } } void Camera::binderDied(const wp& who) { 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& 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& 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& 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& 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 picture = interface_cast(data.readStrongBinder()); - rawCallback(picture); - return NO_ERROR; - } break; - case JPEG_CALLBACK: { - LOGV("JPEG_CALLBACK"); - CHECK_INTERFACE(ICameraClient, data, reply); - sp picture = interface_cast(data.readStrongBinder()); - jpegCallback(picture); - return NO_ERROR; - } break; - case PREVIEW_CALLBACK: { - LOGV("PREVIEW_CALLBACK"); - CHECK_INTERFACE(ICameraClient, data, reply); - sp frame = interface_cast(data.readStrongBinder()); - previewCallback(frame); - return NO_ERROR; - } break; - case RECORDING_CALLBACK: { - LOGV("RECORDING_CALLBACK"); - CHECK_INTERFACE(ICameraClient, data, reply); - sp frame = interface_cast(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); -- cgit v1.1 -- cgit v1.1 -- cgit v1.1 From eccc8cfb2fc83e7f924016ef31e3a4a12e347e99 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 13 May 2009 00:19:22 -0700 Subject: should help fix the Simulator build. --- opengl/libs/EGL/egl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp index 5ed3ecc..25e31ee 100644 --- a/opengl/libs/EGL/egl.cpp +++ b/opengl/libs/EGL/egl.cpp @@ -164,8 +164,8 @@ static pthread_key_t gEGLThreadLocalStorageKey = -1; // ---------------------------------------------------------------------------- -gl_hooks_t gHooks[IMPL_NUM_IMPLEMENTATIONS]; -pthread_key_t gGLWrapperKey = -1; +EGLAPI gl_hooks_t gHooks[IMPL_NUM_IMPLEMENTATIONS]; +EGLAPI pthread_key_t gGLWrapperKey = -1; // ---------------------------------------------------------------------------- -- cgit v1.1 -- cgit v1.1 From c7bbc69ed501a7d194c1cbb9c41e2681d3004bd9 Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Wed, 13 May 2009 18:57:29 -0400 Subject: Get the backup calling through to the file backup helper. This includes some cleanup to make the parameters match between BackupService.onBackup and FileBackupHelper.performBackup. --- include/utils/backup_helpers.h | 2 +- libs/utils/file_backup_helper.cpp | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/include/utils/backup_helpers.h b/include/utils/backup_helpers.h index 61bee34..137c5f1 100644 --- a/include/utils/backup_helpers.h +++ b/include/utils/backup_helpers.h @@ -1,7 +1,7 @@ #ifndef _UTILS_BACKUP_HELPERS_H #define _UTILS_BACKUP_HELPERS_H -int back_up_files(int oldSnapshotFD, int newSnapshotFD, int oldDataStream, +int back_up_files(int oldSnapshotFD, int oldDataStream, int newSnapshotFD, char const* fileBase, char const* const* files, int fileCount); #define TEST_BACKUP_HELPERS 0 diff --git a/libs/utils/file_backup_helper.cpp b/libs/utils/file_backup_helper.cpp index 111f88d..453084a 100644 --- a/libs/utils/file_backup_helper.cpp +++ b/libs/utils/file_backup_helper.cpp @@ -24,6 +24,9 @@ using namespace android; #define MAGIC0 0x70616e53 // Snap #define MAGIC1 0x656c6946 // File +#define LOGP(x...) LOGD(x) +//#define LOGP(x...) printf(x) + struct SnapshotHeader { int magic0; int fileCount; @@ -159,14 +162,14 @@ write_snapshot_file(int fd, const KeyedVector& snapshot) static int write_delete_file(const String8& key) { - printf("write_delete_file %s\n", key.string()); + LOGP("write_delete_file %s\n", key.string()); return 0; } static int write_update_file(const String8& realFilename, const String8& key) { - printf("write_update_file %s (%s)\n", realFilename.string(), key.string()); + LOGP("write_update_file %s (%s)\n", realFilename.string(), key.string()); return 0; } @@ -195,7 +198,7 @@ compute_crc32(const String8& filename) } int -back_up_files(int oldSnapshotFD, int newSnapshotFD, int oldDataStream, +back_up_files(int oldSnapshotFD, int oldDataStream, int newSnapshotFD, char const* fileBase, char const* const* files, int fileCount) { int err; @@ -260,10 +263,10 @@ back_up_files(int oldSnapshotFD, int newSnapshotFD, int oldDataStream, const FileState& f = oldSnapshot.valueAt(n); const FileState& g = newSnapshot.valueAt(m); - printf("%s\n", q.string()); - printf(" new: modTime=%d,%d size=%-3d crc32=0x%08x\n", + LOGP("%s\n", q.string()); + LOGP(" new: modTime=%d,%d size=%-3d crc32=0x%08x\n", f.modTime_sec, f.modTime_nsec, f.size, f.crc32); - printf(" old: modTime=%d,%d size=%-3d crc32=0x%08x\n", + LOGP(" old: modTime=%d,%d size=%-3d crc32=0x%08x\n", g.modTime_sec, g.modTime_nsec, g.size, g.crc32); if (f.modTime_sec != g.modTime_sec || f.modTime_nsec != g.modTime_nsec || f.size != g.size || f.crc32 != g.crc32) { -- cgit v1.1 -- cgit v1.1 -- cgit v1.1 -- cgit v1.1