summaryrefslogtreecommitdiffstats
path: root/camera/CameraHal.cpp
diff options
context:
space:
mode:
authorGeorgi Georgiev <x0154504@ti.com>2012-01-13 10:40:26 +0200
committerDaniel Levin <dendy@ti.com>2012-07-25 08:55:42 -0500
commited547bad9097eeeb9c183e36a50cda3277587b61 (patch)
treee143ee0b4dc7c09fb52bd37baed81b2f3e15f27c /camera/CameraHal.cpp
parentba5d3ad38d977ce2cc252d3dc66aeae5bbdae50d (diff)
downloadhardware_ti_omap4-ed547bad9097eeeb9c183e36a50cda3277587b61.zip
hardware_ti_omap4-ed547bad9097eeeb9c183e36a50cda3277587b61.tar.gz
hardware_ti_omap4-ed547bad9097eeeb9c183e36a50cda3277587b61.tar.bz2
CameraHAL: Updated "RAW + JPEG"
This patch removes the check for all formats contains PIXEL_FORMAT_RAW_JPEG, for doing the RAW. The only ones dependencies are HQ mode and to create directo- ry "/data/misc/camera/RaW_PiCtUrEs". So, if we are on HQ mode and folder exists we'll get the RAW automaticly saved there.The name of RAWs is in format raw_HH_MM_SS_uSS. *Requirement: After creating raw directory a restart of CameraOMAP4 is needed. Signed-off-by: Daniel Levin <dendy@ti.com> Change-Id: I2667f5cacb4b426cd84b6e3e038d86917bfda0ee
Diffstat (limited to 'camera/CameraHal.cpp')
-rw-r--r--camera/CameraHal.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/camera/CameraHal.cpp b/camera/CameraHal.cpp
index 1a67939..68a623b 100644
--- a/camera/CameraHal.cpp
+++ b/camera/CameraHal.cpp
@@ -47,6 +47,14 @@ const int CameraHal::SW_SCALING_FPS_LIMIT = 15;
const uint32_t MessageNotifier::EVENT_BIT_FIELD_POSITION = 16;
const uint32_t MessageNotifier::FRAME_BIT_FIELD_POSITION = 0;
+#ifdef CAMERAHAL_USE_RAW_IMAGE_SAVING
+// HACK: Default path to directory where RAW images coming from video port will be saved to.
+// If directory not exists the saving is skipped and video port frame is ignored.
+// The directory name is choosed in so weird way to enable RAW images saving only when
+// directory has been created explicitly by user.
+extern const char * const kRawImagesOutputDirPath = "/data/misc/camera/RaW_PiCtUrEs";
+#endif
+
/******************************************************************************/
#if PPM_INSTRUMENTATION || PPM_INSTRUMENTATION_ABS
@@ -451,18 +459,20 @@ int CameraHal::setParameters(const CameraParameters& params)
}
}
- if ( 0 == strcmp (valstr, TICameraParameters::PIXEL_FORMAT_RAW) ) {
+ mRawCapture = false;
- mRawCapture = true; // RawCapture flag
+#ifdef CAMERAHAL_USE_RAW_IMAGE_SAVING
+ valstr = params.get(TICameraParameters::KEY_CAP_MODE);
+ if ( (!valstr || strcmp(valstr, TICameraParameters::HIGH_QUALITY_MODE) == 0) &&
+ access(kRawImagesOutputDirPath, F_OK) != -1 ) {
+ mRawCapture = true;
if ( (valstr = params.get(TICameraParameters::KEY_FILENAME_TIMESTAMP)) != NULL ) {
- CAMHAL_LOGEB("FILENAME TIMESTAMP Value = %s", valstr);
+ CAMHAL_LOGD("FILENAME TIMESTAMP Value = %s", valstr);
mParameters.set(TICameraParameters::KEY_FILENAME_TIMESTAMP, valstr);
}
-
- } else {
- mRawCapture = false;
}
+#endif
if ( (valstr = params.get(TICameraParameters::KEY_S3D_CAP_FRAME_LAYOUT)) != NULL )
{
@@ -2996,6 +3006,7 @@ CameraHal::~CameraHal()
}
freeImageBufs();
+ freeRawBufs();
/// Free the memory manager
mMemoryManager.clear();