summaryrefslogtreecommitdiffstats
path: root/camera/inc
diff options
context:
space:
mode:
authorAnu Sundararajan <sanuradha@ti.com>2012-07-26 14:02:03 -0500
committerDaniel Levin <dendy@ti.com>2012-11-26 20:05:28 +0200
commitc9735fd8d9c3952d80f44b8e7ccf5dcf6cf30814 (patch)
tree42d021849ab583f4fa44e886cd37ba9fce8f7eb8 /camera/inc
parent1dda2fe4dcf2b15c728c275a7da869a305f72174 (diff)
downloadhardware_ti_omap4-c9735fd8d9c3952d80f44b8e7ccf5dcf6cf30814.zip
hardware_ti_omap4-c9735fd8d9c3952d80f44b8e7ccf5dcf6cf30814.tar.gz
hardware_ti_omap4-c9735fd8d9c3952d80f44b8e7ccf5dcf6cf30814.tar.bz2
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 <saravanan.s@ti.com> Signed-off-by: Andriy Chepurnyy <x0155536@ti.com> Signed-off-by: Anu Sundararajan <sanuradha@ti.com>
Diffstat (limited to 'camera/inc')
-rwxr-xr-x[-rw-r--r--]camera/inc/V4LCameraAdapter/V4LCameraAdapter.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/camera/inc/V4LCameraAdapter/V4LCameraAdapter.h b/camera/inc/V4LCameraAdapter/V4LCameraAdapter.h
index bc99a6c..e9c910c 100644..100755
--- 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<CameraBuffer *, int> mPreviewBufs;
+ CameraBuffer *mPreviewBufs[NB_BUFFER];
android::KeyedVector<CameraBuffer *, int> 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