diff options
author | David Huang <d-huang@ti.com> | 2016-08-24 16:52:16 -0500 |
---|---|---|
committer | David Huang <d-huang@ti.com> | 2016-08-25 13:20:55 -0500 |
commit | 1c92d05a4758c978dcdcc50ba08aa5dc32a35c52 (patch) | |
tree | b90df0833a03c4138c5c804649d21b5f153a382f | |
parent | 74de7c09167a5ae73c50362a65c2b708d93584b1 (diff) | |
download | dra7xx-1c92d05a4758c978dcdcc50ba08aa5dc32a35c52.tar.gz |
dra7xx: camera: changes for Kernel 4.4
Change camera resolution and VPE output width. Also updated file dump code.
Now determine VPE output width programatically.
Change-Id: I0ff34e0f287cd8881f8b2ceceb50cda26ea86fdf
Signed-off-by: David Huang <d-huang@ti.com>
-rw-r--r-- | camera/OmxFrameDecoder.cpp | 2 | ||||
-rw-r--r-- | camera/V4LCameraAdapter/V4LCameraAdapter.cpp | 18 | ||||
-rw-r--r-- | camera/V4LCameraAdapter/V4LCapabilities.cpp | 6 | ||||
-rw-r--r-- | camera/inc/CameraHal.h | 2 |
4 files changed, 14 insertions, 14 deletions
diff --git a/camera/OmxFrameDecoder.cpp b/camera/OmxFrameDecoder.cpp index be794e5..c65aadd 100644 --- a/camera/OmxFrameDecoder.cpp +++ b/camera/OmxFrameDecoder.cpp @@ -1046,7 +1046,7 @@ bool OmxFrameDecoder::getPaddedDimensions(size_t &width, size_t &height) { case 480: { height = 576; - if (width == 640) { + if (width == 720) { width = 768; } break; diff --git a/camera/V4LCameraAdapter/V4LCameraAdapter.cpp b/camera/V4LCameraAdapter/V4LCameraAdapter.cpp index 3ece9ff..837a755 100644 --- a/camera/V4LCameraAdapter/V4LCameraAdapter.cpp +++ b/camera/V4LCameraAdapter/V4LCameraAdapter.cpp @@ -39,6 +39,7 @@ //#include <linux/videodev.h> #include <cutils/properties.h> #include "DecoderFactory.h" +#include <hal_public.h> #define UNLIKELY( exp ) (__builtin_expect( (exp) != 0, false )) static int mDebugFps = 0; @@ -1528,7 +1529,7 @@ status_t V4LCameraAdapter::returnBufferToV4L(int id) { int V4LCameraAdapter::previewThread() { status_t ret = NO_ERROR; - int width, height; + int width, height, alignedWidth; CameraFrame frame; void *y_uv[2]; int index = 0; @@ -1590,9 +1591,10 @@ int V4LCameraAdapter::previewThread() CameraBuffer *buffer = mPreviewBufs[index]; int retVal = 0; if (mPixelFormat == V4L2_PIX_FMT_YUYV) { - if (mDeinterlaceEnabled) - retVal = processFrame(fp, width, height, width, "yuyv", (void*)(*(buffer_handle_t*)(buffer->opaque)), width, height, PAGE_SIZE, "nv12", mDeinterlaceEnabled, 1, index, &in_index, &out_index); - else { + if (mDeinterlaceEnabled) { + alignedWidth = ALIGN(width, HW_ALIGN); + retVal = processFrame(fp, width, height, width, "yuyv", (void*)(*(buffer_handle_t*)(buffer->opaque)), alignedWidth, height, PAGE_SIZE, "nv12", mDeinterlaceEnabled, 1, index, &in_index, &out_index); + } else { convertYUV422ToNV12Tiler(reinterpret_cast<unsigned char*>(((CameraBuffer*)fp)->mapped), &(buffer->ycbcr), width, height); out_index = index; } @@ -1604,11 +1606,9 @@ int V4LCameraAdapter::previewThread() CAMHAL_LOGVB("##...index= %d.;camera buffer= 0x%x; mapped= 0x%x.",index, buffer, buffer->mapped); #ifdef SAVE_RAW_FRAMES - unsigned char* nv12_buff = (unsigned char*) malloc(width*height*3/2); - //Convert yuv422i to yuv420sp(NV12) & dump the frame to a file - convertYUV422ToNV12 ( (unsigned char*)fp, nv12_buff, width, height); - saveFile( nv12_buff, ((width*height)*3/2) ); - free (nv12_buff); + // Use this to dump frames to files. Choose one or the other, or else they will be trying to write to the same file. + saveFile( ((unsigned char*)mPreviewBufs[out_index]->mapped), ((width*height)*3/2) ); // Dump the VPE output +// saveFile( ((unsigned char*)((CameraBuffer*)fp)->mapped), ((width*height)*3/2) ); // Dump the VIP output #endif android::Mutex::Autolock lock(mSubscriberLock); diff --git a/camera/V4LCameraAdapter/V4LCapabilities.cpp b/camera/V4LCameraAdapter/V4LCapabilities.cpp index f7a2e02..e91776d 100644 --- a/camera/V4LCameraAdapter/V4LCapabilities.cpp +++ b/camera/V4LCameraAdapter/V4LCapabilities.cpp @@ -35,16 +35,16 @@ namespace Camera { #define ARRAY_SIZE(array) (sizeof((array)) / sizeof((array)[0])) #define MAX_RES_STRING_LENGTH 10 -#define DEFAULT_WIDTH 640 +#define DEFAULT_WIDTH 720 #define DEFAULT_HEIGHT 480 static const char PARAM_SEP[] = ","; //Camera defaults const char V4LCameraAdapter::DEFAULT_PICTURE_FORMAT[] = "jpeg"; -const char V4LCameraAdapter::DEFAULT_PICTURE_SIZE[] = "640x480"; +const char V4LCameraAdapter::DEFAULT_PICTURE_SIZE[] = "720x480"; const char V4LCameraAdapter::DEFAULT_PREVIEW_FORMAT[] = "yuv420sp"; -const char V4LCameraAdapter::DEFAULT_PREVIEW_SIZE[] = "640x480"; +const char V4LCameraAdapter::DEFAULT_PREVIEW_SIZE[] = "720x480"; const char V4LCameraAdapter::DEFAULT_NUM_PREV_BUFS[] = "6"; const char V4LCameraAdapter::DEFAULT_FRAMERATE[] = "30"; const char V4LCameraAdapter::DEFAULT_FOCUS_MODE[] = "infinity"; diff --git a/camera/inc/CameraHal.h b/camera/inc/CameraHal.h index 1af7857..bd9af65 100644 --- a/camera/inc/CameraHal.h +++ b/camera/inc/CameraHal.h @@ -67,7 +67,7 @@ extern "C" { #define HAL_PIXEL_FORMAT_TI_Y16 0x104 #define HAL_PIXEL_FORMAT_TI_UYVY 0x105 -#define MIN_WIDTH 640 +#define MIN_WIDTH 720 #define MIN_HEIGHT 480 #define PICTURE_WIDTH 3264 /* 5mp - 2560. 8mp - 3280 */ /* Make sure it is a multiple of 16. */ #define PICTURE_HEIGHT 2448 /* 5mp - 2048. 8mp - 2464 */ /* Make sure it is a multiple of 16. */ |