From ed547bad9097eeeb9c183e36a50cda3277587b61 Mon Sep 17 00:00:00 2001 From: Georgi Georgiev Date: Fri, 13 Jan 2012 10:40:26 +0200 Subject: 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 Change-Id: I2667f5cacb4b426cd84b6e3e038d86917bfda0ee --- camera/CameraHal.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'camera/CameraHal.cpp') 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(); -- cgit v1.1