Camera: HAL: Add support for getBufferInfo API at the HAL Layer.
Add getBufferInfo API which takes an IMemory variable as input and
updates it with the details of the recording buffer allocated
at the HAL layer.
Change-Id: Iad16c4a544f388ca47a5ee4fd656c5d27df6339a
diff --git a/QualcommCameraHardware.cpp b/QualcommCameraHardware.cpp
index 064346a..6ab9c23 100644
--- a/QualcommCameraHardware.cpp
+++ b/QualcommCameraHardware.cpp
@@ -4434,5 +4434,27 @@
}
return retVal;
}
+status_t QualcommCameraHardware::getBufferInfo(sp<IMemory>& Frame, size_t *alignedSize) {
+ status_t ret;
+ LOGV(" getBufferInfo : E ");
+ if( mRecordHeap != NULL) {
+ LOGV(" Setting valid buffer information ");
+ Frame = mRecordHeap->mBuffers[0];
+ if( alignedSize != NULL) {
+ *alignedSize = mRecordHeap->mAlignedBufferSize;
+ LOGV(" HAL : alignedSize = %d ", *alignedSize);
+ ret = NO_ERROR;
+ } else {
+ LOGE(" HAL : alignedSize is NULL. Cannot update alignedSize ");
+ ret = UNKNOWN_ERROR;
+ }
+ } else {
+ LOGE(" RecordHeap is null. Buffer information wont be updated ");
+ Frame = NULL;
+ ret = UNKNOWN_ERROR;
+ }
+ LOGV(" getBufferInfo : X ");
+ return ret;
+}
}; // namespace android
diff --git a/QualcommCameraHardware.h b/QualcommCameraHardware.h
index 408caa0..f2c5295 100644
--- a/QualcommCameraHardware.h
+++ b/QualcommCameraHardware.h
@@ -85,6 +85,7 @@
virtual status_t setParameters(const CameraParameters& params);
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();
virtual bool useOverlay();