Loading services/camera/libcameraservice/CameraHardwareInterface.h +3 −1 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ typedef void (*notify_callback)(int32_t msgType, typedef void (*data_callback)(int32_t msgType, const sp<IMemory> &dataPtr, camera_frame_metadata_t *metadata, void* user); typedef void (*data_callback_timestamp)(nsecs_t timestamp, Loading Loading @@ -442,6 +443,7 @@ private: static void __data_cb(int32_t msg_type, const camera_memory_t *data, unsigned int index, camera_frame_metadata_t *metadata, void *user) { LOGV("%s", __FUNCTION__); Loading @@ -453,7 +455,7 @@ private: index, mem->mNumBufs); return; } __this->mDataCb(msg_type, mem->mBuffers[index], __this->mCbUser); __this->mDataCb(msg_type, mem->mBuffers[index], metadata, __this->mCbUser); } static void __data_cb_timestamp(nsecs_t timestamp, int32_t msg_type, Loading services/camera/libcameraservice/CameraHardwareStub.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -180,7 +180,7 @@ int CameraHardwareStub::previewThread() // Notify the client of a new frame. if (mMsgEnabled & CAMERA_MSG_PREVIEW_FRAME) mDataCb(CAMERA_MSG_PREVIEW_FRAME, buffer, mCallbackCookie); mDataCb(CAMERA_MSG_PREVIEW_FRAME, buffer, NULL, mCallbackCookie); // Advance the buffer pointer. mCurrentPreviewFrame = (mCurrentPreviewFrame + 1) % kBufferCount; Loading Loading @@ -290,14 +290,14 @@ int CameraHardwareStub::pictureThread() sp<MemoryBase> mem = new MemoryBase(mRawHeap, 0, w * h * 3 / 2); FakeCamera cam(w, h); cam.getNextFrameAsYuv420((uint8_t *)mRawHeap->base()); mDataCb(CAMERA_MSG_RAW_IMAGE, mem, mCallbackCookie); mDataCb(CAMERA_MSG_RAW_IMAGE, mem, NULL, mCallbackCookie); } if (mMsgEnabled & CAMERA_MSG_COMPRESSED_IMAGE) { sp<MemoryHeapBase> heap = new MemoryHeapBase(kCannedJpegSize); sp<MemoryBase> mem = new MemoryBase(heap, 0, kCannedJpegSize); memcpy(heap->base(), kCannedJpeg, kCannedJpegSize); mDataCb(CAMERA_MSG_COMPRESSED_IMAGE, mem, mCallbackCookie); mDataCb(CAMERA_MSG_COMPRESSED_IMAGE, mem, NULL, mCallbackCookie); } return NO_ERROR; } Loading services/camera/libcameraservice/CameraService.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -988,7 +988,7 @@ void CameraService::Client::notifyCallback(int32_t msgType, int32_t ext1, } void CameraService::Client::dataCallback(int32_t msgType, const sp<IMemory>& dataPtr, void* user) { const sp<IMemory>& dataPtr, camera_frame_metadata_t *metadata, void* user) { LOG2("dataCallback(%d)", msgType); sp<Client> client = getClientFromCookie(user); Loading services/camera/libcameraservice/CameraService.h +2 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,8 @@ private: // these are static callback functions static void notifyCallback(int32_t msgType, int32_t ext1, int32_t ext2, void* user); static void dataCallback(int32_t msgType, const sp<IMemory>& dataPtr, void* user); static void dataCallback(int32_t msgType, const sp<IMemory>& dataPtr, camera_frame_metadata_t *metadata, void* user); static void dataCallbackTimestamp(nsecs_t timestamp, int32_t msgType, const sp<IMemory>& dataPtr, void* user); // convert client from cookie static sp<Client> getClientFromCookie(void* user); Loading Loading
services/camera/libcameraservice/CameraHardwareInterface.h +3 −1 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ typedef void (*notify_callback)(int32_t msgType, typedef void (*data_callback)(int32_t msgType, const sp<IMemory> &dataPtr, camera_frame_metadata_t *metadata, void* user); typedef void (*data_callback_timestamp)(nsecs_t timestamp, Loading Loading @@ -442,6 +443,7 @@ private: static void __data_cb(int32_t msg_type, const camera_memory_t *data, unsigned int index, camera_frame_metadata_t *metadata, void *user) { LOGV("%s", __FUNCTION__); Loading @@ -453,7 +455,7 @@ private: index, mem->mNumBufs); return; } __this->mDataCb(msg_type, mem->mBuffers[index], __this->mCbUser); __this->mDataCb(msg_type, mem->mBuffers[index], metadata, __this->mCbUser); } static void __data_cb_timestamp(nsecs_t timestamp, int32_t msg_type, Loading
services/camera/libcameraservice/CameraHardwareStub.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -180,7 +180,7 @@ int CameraHardwareStub::previewThread() // Notify the client of a new frame. if (mMsgEnabled & CAMERA_MSG_PREVIEW_FRAME) mDataCb(CAMERA_MSG_PREVIEW_FRAME, buffer, mCallbackCookie); mDataCb(CAMERA_MSG_PREVIEW_FRAME, buffer, NULL, mCallbackCookie); // Advance the buffer pointer. mCurrentPreviewFrame = (mCurrentPreviewFrame + 1) % kBufferCount; Loading Loading @@ -290,14 +290,14 @@ int CameraHardwareStub::pictureThread() sp<MemoryBase> mem = new MemoryBase(mRawHeap, 0, w * h * 3 / 2); FakeCamera cam(w, h); cam.getNextFrameAsYuv420((uint8_t *)mRawHeap->base()); mDataCb(CAMERA_MSG_RAW_IMAGE, mem, mCallbackCookie); mDataCb(CAMERA_MSG_RAW_IMAGE, mem, NULL, mCallbackCookie); } if (mMsgEnabled & CAMERA_MSG_COMPRESSED_IMAGE) { sp<MemoryHeapBase> heap = new MemoryHeapBase(kCannedJpegSize); sp<MemoryBase> mem = new MemoryBase(heap, 0, kCannedJpegSize); memcpy(heap->base(), kCannedJpeg, kCannedJpegSize); mDataCb(CAMERA_MSG_COMPRESSED_IMAGE, mem, mCallbackCookie); mDataCb(CAMERA_MSG_COMPRESSED_IMAGE, mem, NULL, mCallbackCookie); } return NO_ERROR; } Loading
services/camera/libcameraservice/CameraService.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -988,7 +988,7 @@ void CameraService::Client::notifyCallback(int32_t msgType, int32_t ext1, } void CameraService::Client::dataCallback(int32_t msgType, const sp<IMemory>& dataPtr, void* user) { const sp<IMemory>& dataPtr, camera_frame_metadata_t *metadata, void* user) { LOG2("dataCallback(%d)", msgType); sp<Client> client = getClientFromCookie(user); Loading
services/camera/libcameraservice/CameraService.h +2 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,8 @@ private: // these are static callback functions static void notifyCallback(int32_t msgType, int32_t ext1, int32_t ext2, void* user); static void dataCallback(int32_t msgType, const sp<IMemory>& dataPtr, void* user); static void dataCallback(int32_t msgType, const sp<IMemory>& dataPtr, camera_frame_metadata_t *metadata, void* user); static void dataCallbackTimestamp(nsecs_t timestamp, int32_t msgType, const sp<IMemory>& dataPtr, void* user); // convert client from cookie static sp<Client> getClientFromCookie(void* user); Loading