summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-10-07 08:11:26 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-10-07 08:11:26 -0700
commit51a7ac55e98dea42ccd2b358b114f0a761bbc63e (patch)
treee4b186a882d7648d280c53e8a9c46a4acd1c5a58 /include
parent7874f08d41f8bd02e2cd52d260ff7bfd80167477 (diff)
parenta9424e227d90eff8ac387c1810a642b33d22e2c7 (diff)
downloadframeworks_av-51a7ac55e98dea42ccd2b358b114f0a761bbc63e.zip
frameworks_av-51a7ac55e98dea42ccd2b358b114f0a761bbc63e.tar.gz
frameworks_av-51a7ac55e98dea42ccd2b358b114f0a761bbc63e.tar.bz2
Merge "0-memcpy video recording framework"
Diffstat (limited to 'include')
-rw-r--r--include/camera/CameraHardwareInterface.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/include/camera/CameraHardwareInterface.h b/include/camera/CameraHardwareInterface.h
index 3a77dd1..561a46d 100644
--- a/include/camera/CameraHardwareInterface.h
+++ b/include/camera/CameraHardwareInterface.h
@@ -21,6 +21,8 @@
#include <ui/egl/android_natives.h>
#include <utils/RefBase.h>
#include <surfaceflinger/ISurface.h>
+#include <ui/android_native_buffer.h>
+#include <ui/GraphicBuffer.h>
#include <camera/Camera.h>
#include <camera/CameraParameters.h>
@@ -47,6 +49,17 @@ typedef void (*data_callback)(int32_t msgType,
const sp<IMemory>& dataPtr,
void* user);
+#ifdef USE_GRAPHIC_VIDEO_BUFFERS
+/**
+ * Replace data_callback_timestamp. Once we are done, this
+ * should be renamed as data_callback_timestamp, and the existing
+ * data_callback_timestamp should be deleted.
+ */
+typedef void (*videobuffer_callback_timestamp)(nsecs_t timestamp,
+ int32_t msgType,
+ const sp<android_native_buffer_t>& buf,
+ void* user);
+#endif
typedef void (*data_callback_timestamp)(nsecs_t timestamp,
int32_t msgType,
const sp<IMemory>& dataPtr,
@@ -87,6 +100,46 @@ class CameraHardwareInterface : public virtual RefBase {
public:
virtual ~CameraHardwareInterface() { }
+#ifdef USE_GRAPHIC_VIDEO_BUFFERS
+ /**
+ * Replace existing setCallbacks() method. Once we are done, the
+ * videobuffer_callback_timestamp parameter will be renamed to
+ * data_callback_timestamp, but its signature will be the same
+ * as videobuffer_callback_timestamp, which will be renamed
+ * to data_callback_timestamp and the exiting data_callback_timestamp
+ * will be deleted.
+ */
+ virtual void setCallbacks(notify_callback notify_cb,
+ data_callback data_cb,
+ videobuffer_callback_timestamp data_cb_timestamp,
+ void* user) = 0;
+
+ /**
+ * Replace releaseRecordingFrame(). releaseRecordingFrame() should be
+ * changed so that it has the same signature of releaseVideoBuffer(),
+ * once we are done, and releaseVideoBuffer() will be deleted.
+ */
+ virtual void releaseVideoBuffer(const sp<android_native_buffer_t>& buf) = 0;
+
+ /**
+ * This method should be called after startRecording().
+ *
+ * @param nBuffers the total number of video buffers allocated by the camera
+ * hal
+ * @param buffers an array allocated by the camera hal to hold the pointers
+ * to the individual video buffers. The video buffers and the buffers array
+ * should NOT be modified/released by camera hal until stopRecording() is
+ * called and all outstanding video buffers previously sent out via
+ * CAMERA_MSG_VIDEO_FRAME have been released via releaseVideoBuffer().
+ * Camera hal client must not release the individual buffers and the buffers
+ * array.
+ * @return no error if OK.
+ */
+ virtual status_t getVideoBufferInfo(
+ sp<android_native_buffer_t>** buffers,
+ size_t *nBuffers) = 0;
+#endif
+
/** Set the ANativeWindow to which preview frames are sent */
virtual status_t setPreviewWindow(const sp<ANativeWindow>& buf) = 0;