summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2011-07-28 05:30:59 +0800
committerWu-cheng Li <wuchengli@google.com>2011-07-29 07:14:38 +0800
commitff09ef8f18eed29bce50c7817df2fd52d2b50cf6 (patch)
treef02ccfe423ba130129a964b7e59e66ca2cae3469 /services
parenta3924af33a8005a0aeb20b97fd06e0c523b0d1af (diff)
downloadframeworks_av-ff09ef8f18eed29bce50c7817df2fd52d2b50cf6.zip
frameworks_av-ff09ef8f18eed29bce50c7817df2fd52d2b50cf6.tar.gz
frameworks_av-ff09ef8f18eed29bce50c7817df2fd52d2b50cf6.tar.bz2
Add frame metadata parameter to camera data_callback.
bug:4460717 Change-Id: Ib47d7d7df20af8155a719f3dabefe030893bfebc
Diffstat (limited to 'services')
-rw-r--r--services/camera/libcameraservice/CameraHardwareInterface.h4
-rw-r--r--services/camera/libcameraservice/CameraHardwareStub.cpp6
-rw-r--r--services/camera/libcameraservice/CameraService.cpp2
-rw-r--r--services/camera/libcameraservice/CameraService.h3
4 files changed, 9 insertions, 6 deletions
diff --git a/services/camera/libcameraservice/CameraHardwareInterface.h b/services/camera/libcameraservice/CameraHardwareInterface.h
index 09e88c4..31544b3 100644
--- a/services/camera/libcameraservice/CameraHardwareInterface.h
+++ b/services/camera/libcameraservice/CameraHardwareInterface.h
@@ -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,
@@ -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__);
@@ -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,
diff --git a/services/camera/libcameraservice/CameraHardwareStub.cpp b/services/camera/libcameraservice/CameraHardwareStub.cpp
index 07b5a37..863f19e 100644
--- a/services/camera/libcameraservice/CameraHardwareStub.cpp
+++ b/services/camera/libcameraservice/CameraHardwareStub.cpp
@@ -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;
@@ -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;
}
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 96b26e7..b03649e 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -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);
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index c5fefb8..af7f06e 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -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);