diff options
author | Kiran Kumar H N <hurlisal@quicinc.com> | 2010-02-26 15:54:43 -0800 |
---|---|---|
committer | cyanogen <shade@chemlab.org> | 2010-09-22 10:08:26 -0400 |
commit | 57495aafa6ab172c2d2cfe32ca8a4fa57f98cb9b (patch) | |
tree | 9eff5310c507ce85decc08b12af1a43753beda30 /libs | |
parent | 302ee369aa6a044674bd70d11d1a8960c666d44b (diff) | |
download | frameworks_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 'libs')
-rw-r--r-- | libs/camera/Camera.cpp | 11 | ||||
-rw-r--r-- | libs/camera/ICamera.cpp | 27 |
2 files changed, 38 insertions, 0 deletions
diff --git a/libs/camera/Camera.cpp b/libs/camera/Camera.cpp index 30ee7c4..d90ac26 100644 --- a/libs/camera/Camera.cpp +++ b/libs/camera/Camera.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. @@ -174,6 +176,15 @@ status_t Camera::setPreviewDisplay(const sp<ISurface>& surface) } +status_t Camera::getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize) +{ + LOGV("getBufferInfo"); + sp <ICamera> c = mCamera; + if (c == 0) return NO_INIT; + return c->getBufferInfo(Frame, alignedSize); +} + + // start preview mode status_t Camera::startPreview() { diff --git a/libs/camera/ICamera.cpp b/libs/camera/ICamera.cpp index 13673b5..48ba361 100644 --- a/libs/camera/ICamera.cpp +++ b/libs/camera/ICamera.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. @@ -45,6 +46,7 @@ enum { STOP_RECORDING, RECORDING_ENABLED, RELEASE_RECORDING_FRAME, + GET_BUFFER_INFO, }; class BpCamera: public BpInterface<ICamera> @@ -86,6 +88,22 @@ public: remote()->transact(SET_PREVIEW_CALLBACK_FLAG, data, &reply); } + + // get the recording buffer information. + status_t getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize) + { + status_t ret; + LOGV("getBufferInfo"); + Parcel data, reply; + data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); + data.writeStrongBinder(Frame->asBinder()); + remote()->transact(GET_BUFFER_INFO, data, &reply); + ret = reply.readInt32(); + *alignedSize = reply.readInt32(); + return ret; + } + + // start preview mode, must call setPreviewDisplay first status_t startPreview() { @@ -269,6 +287,15 @@ status_t BnCamera::onTransact( setPreviewCallbackFlag(callback_flag); return NO_ERROR; } break; + case GET_BUFFER_INFO:{ + LOGV("GET_BUFFER_INFO"); + CHECK_INTERFACE(ICamera, data, reply); + sp<IMemory> Frame = interface_cast<IMemory>(data.readStrongBinder()); + size_t alignedSize; + reply->writeInt32(getBufferInfo(Frame, &alignedSize)); + reply->writeInt32(alignedSize); + return NO_ERROR; + } break; case START_PREVIEW: { LOGV("START_PREVIEW"); CHECK_INTERFACE(ICamera, data, reply); |