summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2013-08-26 20:12:36 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2013-08-26 20:12:36 +0800
commitfa8bb6c5acb3491d2550091621e8cd504e233c39 (patch)
treefebfde37ae37930766fdc05e00bed23028401b45
parent0786f4eda53260ac7e2032e04510ae84fe6c717e (diff)
downloadcommon-linaro_android_jb.tar.gz
libcamera: enable mTimestampFn in previewlinaro_android_jb
but the recording still not work, need more work on that. Change-Id: I84507266fe3b286c749055c8b44fcd5561034fb8 Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--libcamera/CameraHardware.cpp9
-rw-r--r--libcamera/CameraHardware.h9
2 files changed, 7 insertions, 11 deletions
diff --git a/libcamera/CameraHardware.cpp b/libcamera/CameraHardware.cpp
index e88529e..68cb84c 100644
--- a/libcamera/CameraHardware.cpp
+++ b/libcamera/CameraHardware.cpp
@@ -26,8 +26,9 @@
#include <sys/mman.h>
#include <cutils/native_handle.h>
#include <hal_public.h>
+#include <ui/Rect.h>
#include <ui/GraphicBufferMapper.h>
-#include <gui/ISurfaceTexture.h>
+//#include <gui/ISurfaceTexture.h>
#define MAX_VIDEONODES 20
#define MIN_WIDTH 320
#define MIN_HEIGHT 240
@@ -200,6 +201,10 @@ int CameraHardware::previewThread()
if( 0 == mapper.lock((buffer_handle_t)*hndl2hndl,CAMHAL_GRALLOC_USAGE, bounds, &dst)) {
// Get preview frame
tempbuf=camera.GrabPreviewFrame();
+ if (tempbuf == NULL){
+ ALOGW("Failed to get the available frame");
+ return -1;
+ }
convertYUYVtoRGB565((unsigned char *)tempbuf,(unsigned char *)dst, width, height);
mapper.unlock((buffer_handle_t)*hndl2hndl);
mNativeWindow->enqueue_buffer(mNativeWindow,(buffer_handle_t*) hndl2hndl);
@@ -208,7 +213,7 @@ int CameraHardware::previewThread()
yuyv422_to_yuv420sp((unsigned char *)tempbuf,(unsigned char *) picture->data, width, height);
if ((mMsgEnabled & CAMERA_MSG_VIDEO_FRAME ) && mRecordRunning ) {
nsecs_t timeStamp = systemTime(SYSTEM_TIME_MONOTONIC);
- //mTimestampFn(timeStamp, CAMERA_MSG_VIDEO_FRAME,mRecordBuffer, mUser);
+ mTimestampFn(timeStamp, CAMERA_MSG_VIDEO_FRAME, picture, 0, mUser);
}
mDataFn(CAMERA_MSG_PREVIEW_FRAME,picture,0,NULL,mUser);
picture->release(picture);
diff --git a/libcamera/CameraHardware.h b/libcamera/CameraHardware.h
index b523668..3391383 100644
--- a/libcamera/CameraHardware.h
+++ b/libcamera/CameraHardware.h
@@ -21,12 +21,7 @@
#ifndef ANDROID_HARDWARE_CAMERA_HARDWARE_H
#define ANDROID_HARDWARE_CAMERA_HARDWARE_H
-#include <utils/threads.h>
-#include <binder/MemoryBase.h>
-#include <binder/MemoryHeapBase.h>
-#include <utils/threads.h>
-#include <utils/threads.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
@@ -42,14 +37,10 @@
#include <linux/videodev2.h>
#include "binder/MemoryBase.h"
#include "binder/MemoryHeapBase.h"
-#include <utils/threads.h>
#include <camera/CameraParameters.h>
#include <hardware/camera.h>
-#include <sys/ioctl.h>
-#include <utils/threads.h>
#include <binder/MemoryBase.h>
#include <binder/MemoryHeapBase.h>
-#include <utils/threads.h>
#include "V4L2Camera.h"
#include <hardware/camera.h>