summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
authorKiran Kumar H N <hurlisal@quicinc.com>2010-02-26 15:54:43 -0800
committercyanogen <shade@chemlab.org>2010-09-22 10:08:26 -0400
commit57495aafa6ab172c2d2cfe32ca8a4fa57f98cb9b (patch)
tree9eff5310c507ce85decc08b12af1a43753beda30 /camera
parent302ee369aa6a044674bd70d11d1a8960c666d44b (diff)
downloadframeworks_base-57495aafa6ab172c2d2cfe32ca8a4fa57f98cb9b.zip
frameworks_base-57495aafa6ab172c2d2cfe32ca8a4fa57f98cb9b.tar.gz
frameworks_base-57495aafa6ab172c2d2cfe32ca8a4fa57f98cb9b.tar.bz2
Camera: Add support for getBufferInfo API
Add getBufferInfo() API which gets the recording buffer information from the HAL layer. The opencore uses this API to query the details of the recording buffers allocated by the HAL layer. Add getBufferInfo() to Stub Camera to avoid compilation error for generic/emulator builds.
Diffstat (limited to 'camera')
-rw-r--r--camera/libcameraservice/CameraHardwareStub.cpp9
-rw-r--r--camera/libcameraservice/CameraHardwareStub.h3
-rwxr-xr-xcamera/libcameraservice/CameraService.cpp15
-rw-r--r--camera/libcameraservice/CameraService.h5
4 files changed, 31 insertions, 1 deletions
diff --git a/camera/libcameraservice/CameraHardwareStub.cpp b/camera/libcameraservice/CameraHardwareStub.cpp
index 8b66389..db4f31a 100644
--- a/camera/libcameraservice/CameraHardwareStub.cpp
+++ b/camera/libcameraservice/CameraHardwareStub.cpp
@@ -1,6 +1,7 @@
/*
**
** Copyright 2008, The Android Open Source Project
+** Copyright (C) 2010, Code Aurora Forum. All rights reserved.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
@@ -399,4 +400,12 @@ extern "C" sp<CameraHardwareInterface> openCameraHardware()
return CameraHardwareStub::createInstance();
}
+status_t CameraHardwareStub::getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize) {
+ /* No Support for this API in STUB Camera. Just return NULL */
+ Frame = NULL;
+ if( alignedSize != NULL)
+ *alignedSize = 0;
+
+ return UNKNOWN_ERROR;
+}
}; // namespace android
diff --git a/camera/libcameraservice/CameraHardwareStub.h b/camera/libcameraservice/CameraHardwareStub.h
index 957813a4..5794d5a 100644
--- a/camera/libcameraservice/CameraHardwareStub.h
+++ b/camera/libcameraservice/CameraHardwareStub.h
@@ -1,6 +1,7 @@
/*
**
** Copyright 2008, The Android Open Source Project
+** Copyright (C) 2010, Code Aurora Forum. All rights reserved.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
@@ -59,6 +60,8 @@ public:
virtual CameraParameters getParameters() const;
virtual status_t sendCommand(int32_t command, int32_t arg1,
int32_t arg2);
+ virtual status_t getBufferInfo( sp<IMemory>& Frame, size_t *alignedSize);
+
virtual void release();
static sp<CameraHardwareInterface> createInstance();
diff --git a/camera/libcameraservice/CameraService.cpp b/camera/libcameraservice/CameraService.cpp
index 3cb3ce5..2b21460 100755
--- a/camera/libcameraservice/CameraService.cpp
+++ b/camera/libcameraservice/CameraService.cpp
@@ -1,6 +1,8 @@
/*
**
** Copyright (C) 2008, The Android Open Source Project
+** Copyright (C) 2008 HTC Inc.
+** Copyright (C) 2010, Code Aurora Forum. All rights reserved.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
@@ -598,7 +600,7 @@ status_t CameraService::Client::setOverlay()
// Surfaceflinger may hold onto the previous overlay reference for some
// time after we try to destroy it. retry a few times. In the future, we
// should make the destroy call block, or possibly specify that we can
- // wait in the createOverlay call if the previous overlay is in the
+ // wait in the createOverlay call if the previous overlay is in the
// process of being destroyed.
for (int retry = 0; retry < 50; ++retry) {
mOverlayRef = mSurface->createOverlay(w, h, OVERLAY_FORMAT_DEFAULT,
@@ -690,6 +692,17 @@ status_t CameraService::Client::startPreviewMode()
return ret;
}
+status_t CameraService::Client::getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize)
+{
+ LOGD(" getBufferInfo : E");
+ if (mHardware == NULL) {
+ LOGE("mHardware is NULL, returning.");
+ Frame = NULL;
+ return INVALID_OPERATION;
+ }
+ return mHardware->getBufferInfo(Frame, alignedSize);
+}
+
status_t CameraService::Client::startPreview()
{
LOGV("startPreview (pid %d)", getCallingPid());
diff --git a/camera/libcameraservice/CameraService.h b/camera/libcameraservice/CameraService.h
index f04f39c..1e88f45 100644
--- a/camera/libcameraservice/CameraService.h
+++ b/camera/libcameraservice/CameraService.h
@@ -1,6 +1,8 @@
/*
**
** Copyright (C) 2008, The Android Open Source Project
+** Copyright (C) 2008 HTC Inc.
+** Copyright (C) 2010, Code Aurora Forum. All rights reserved.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
@@ -84,6 +86,9 @@ private:
// preview are handled.
virtual void setPreviewCallbackFlag(int callback_flag);
+ // get the recording buffers information from HAL Layer.
+ virtual status_t getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize);
+
// start preview mode, must call setPreviewDisplay first
virtual status_t startPreview();