From c9735fd8d9c3952d80f44b8e7ccf5dcf6cf30814 Mon Sep 17 00:00:00 2001 From: Anu Sundararajan Date: Thu, 26 Jul 2012 14:02:03 -0500 Subject: CameraHal: V4LCameraAdapter: Add support for MJPEG USBCameras support higher resolutions(above VGA) in MJPEG format only. V4LCameraAdapter has been modified to use MJPEG as the default pixel format. The incoming jpeg frames are decoded(into NV12) using libjpeg and then sent for rendering. Change-Id: Ie7f62abd7a7fad3bc1f01e048fe8f17f67890301 Signed-off-by: Saravanan Solaiyappan Signed-off-by: Andriy Chepurnyy Signed-off-by: Anu Sundararajan --- camera/inc/V4LCameraAdapter/V4LCameraAdapter.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) mode change 100644 => 100755 camera/inc/V4LCameraAdapter/V4LCameraAdapter.h (limited to 'camera/inc') diff --git a/camera/inc/V4LCameraAdapter/V4LCameraAdapter.h b/camera/inc/V4LCameraAdapter/V4LCameraAdapter.h old mode 100644 new mode 100755 index bc99a6c..e9c910c --- a/camera/inc/V4LCameraAdapter/V4LCameraAdapter.h +++ b/camera/inc/V4LCameraAdapter/V4LCameraAdapter.h @@ -24,11 +24,14 @@ #include "CameraHal.h" #include "BaseCameraAdapter.h" #include "DebugUtils.h" +#include "Decoder_libjpeg.h" namespace Ti { namespace Camera { -#define DEFAULT_PIXEL_FORMAT V4L2_PIX_FMT_YUYV +//#define DEFAULT_PIXEL_FORMAT V4L2_PIX_FMT_YUYV +#define DEFAULT_PIXEL_FORMAT V4L2_PIX_FMT_MJPEG +#define DEFAULT_CAPTURE_FORMAT V4L2_PIX_FMT_YUYV #define NB_BUFFER 10 #define DEVICE "/dev/videoxx" @@ -153,7 +156,7 @@ private: //Used for calculation of the average frame rate during preview status_t recalculateFPS(); - char * GetFrame(int &index); + char * GetFrame(int &index, int &filledLen); int previewThread(); @@ -199,7 +202,7 @@ private: int mPreviewBufferCountQueueable; int mCaptureBufferCount; int mCaptureBufferCountQueueable; - android::KeyedVector mPreviewBufs; + CameraBuffer *mPreviewBufs[NB_BUFFER]; android::KeyedVector mCaptureBufs; mutable android::Mutex mPreviewBufsLock; mutable android::Mutex mCaptureBufsLock; @@ -230,6 +233,9 @@ private: int nQueued; int nDequeued; + Decoder_libjpeg jpgdecoder; + unsigned char *jpeg_with_dht_buffer[NB_BUFFER]; + unsigned int jpeg_with_dht_buffer_size; }; } // namespace Camera -- cgit v1.1