summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZiyan <jaraidaniel@gmail.com>2016-01-03 14:22:39 +0100
committerDániel Járai <jaraidaniel@gmail.com>2016-01-03 06:58:26 -0800
commit3945c7a626f18a965f4df4b2a8eaffde5cc0aefd (patch)
tree45fc8c0fbb13458206d16a2237b3edac755eaaf1
parente0c5a929875a3f858926d7fec7e236d6db1006a3 (diff)
downloaddevice_samsung_tuna-3945c7a626f18a965f4df4b2a8eaffde5cc0aefd.zip
device_samsung_tuna-3945c7a626f18a965f4df4b2a8eaffde5cc0aefd.tar.gz
device_samsung_tuna-3945c7a626f18a965f4df4b2a8eaffde5cc0aefd.tar.bz2
camera: support tuna
Change-Id: Id19387b819b2e118234e415b6ea0e229e5e5ac6c
-rw-r--r--camera/CameraHal.cpp8
-rw-r--r--camera/OMXCameraAdapter/OMX3A.cpp8
-rw-r--r--camera/OMXCameraAdapter/OMXAlgo.cpp30
-rw-r--r--camera/OMXCameraAdapter/OMXCameraAdapter.cpp12
-rw-r--r--camera/OMXCameraAdapter/OMXCapabilities.cpp84
-rw-r--r--camera/OMXCameraAdapter/OMXCapture.cpp28
6 files changed, 158 insertions, 12 deletions
diff --git a/camera/CameraHal.cpp b/camera/CameraHal.cpp
index 7e7cf9d..ce59c84 100644
--- a/camera/CameraHal.cpp
+++ b/camera/CameraHal.cpp
@@ -2658,7 +2658,15 @@ status_t CameraHal::startRecording( )
// then we need to force default capture mode (as opposed to video mode)
if ( ((valstr = mParameters.get(android::CameraParameters::KEY_FOCUS_MODE)) != NULL) &&
(strcmp(valstr, android::CameraParameters::FOCUS_MODE_CONTINUOUS_PICTURE) == 0) ){
+#ifdef CAMERAHAL_TUNA
+ // workaround video recording stuck in FOCUS_MODE_CONTINUOUS_PICTURE
+ // introducing artifacts and breaking video snapshots on tuna
+ mParameters.set(android::CameraParameters::KEY_FOCUS_MODE,
+ android::CameraParameters::FOCUS_MODE_CONTINUOUS_VIDEO);
+ restartPreviewRequired = setVideoModeParameters(mParameters);
+#else
restartPreviewRequired = resetVideoModeParameters();
+#endif
}
// only need to check recording hint if preview restart is not already needed
diff --git a/camera/OMXCameraAdapter/OMX3A.cpp b/camera/OMXCameraAdapter/OMX3A.cpp
index 8e6437a..145efcc 100644
--- a/camera/OMXCameraAdapter/OMX3A.cpp
+++ b/camera/OMXCameraAdapter/OMX3A.cpp
@@ -387,7 +387,7 @@ status_t OMXCameraAdapter::setParameters3A(const android::CameraParameters &para
}
}
-#ifndef MOTOROLA_CAMERA
+#if !defined(MOTOROLA_CAMERA) && !defined(CAMERAHAL_TUNA)
// TI extensions for enable/disable algos
declareParameter3ABool(params, TICameraParameters::KEY_ALGO_EXTERNAL_GAMMA,
mParameters3A.AlgoExternalGamma, SetAlgoExternalGamma, "External Gamma");
@@ -411,7 +411,7 @@ status_t OMXCameraAdapter::setParameters3A(const android::CameraParameters &para
return ret;
}
-#ifndef MOTOROLA_CAMERA
+#if !defined(MOTOROLA_CAMERA) && !defined(CAMERAHAL_TUNA)
void OMXCameraAdapter::updateGammaTable(const char* gamma)
{
unsigned int plane = 0;
@@ -1852,7 +1852,7 @@ status_t OMXCameraAdapter::setParameter3ABool(const OMX_INDEXTYPE omx_idx,
return Utils::ErrorUtils::omxToAndroidError(eError);
}
-#ifndef MOTOROLA_CAMERA
+#if !defined(MOTOROLA_CAMERA) && !defined(CAMERAHAL_TUNA)
status_t OMXCameraAdapter::setAlgoExternalGamma(Gen3A_settings& Gen3A)
{
return setParameter3ABool((OMX_INDEXTYPE) OMX_TI_IndexConfigExternalGamma, Gen3A.AlgoExternalGamma, "External Gamma");
@@ -2098,7 +2098,7 @@ status_t OMXCameraAdapter::apply3Asettings( Gen3A_settings& Gen3A )
}
break;
-#ifndef MOTOROLA_CAMERA
+#if !defined(MOTOROLA_CAMERA) && !defined(CAMERAHAL_TUNA)
//TI extensions for enable/disable algos
case SetAlgoExternalGamma:
{
diff --git a/camera/OMXCameraAdapter/OMXAlgo.cpp b/camera/OMXCameraAdapter/OMXAlgo.cpp
index 72ce1f6..5adbf97 100644
--- a/camera/OMXCameraAdapter/OMXAlgo.cpp
+++ b/camera/OMXCameraAdapter/OMXAlgo.cpp
@@ -79,8 +79,13 @@ status_t OMXCameraAdapter::setParametersAlgo(const android::CameraParameters &pa
}
} else {
+#ifdef CAMERAHAL_TUNA
+ capMode = OMXCameraAdapter::HIGH_QUALITY_ZSL;
+ mCapabilitiesOpMode = MODE_ZEROSHUTTERLAG;
+#else
capMode = OMXCameraAdapter::HIGH_QUALITY;
mCapabilitiesOpMode = MODE_HIGH_QUALITY;
+#endif
}
if ( mSensorIndex == 2 ) {
@@ -638,6 +643,13 @@ status_t OMXCameraAdapter::setCaptureMode(OMXCameraAdapter::CaptureMode mode)
LOG_FUNCTION_NAME;
+#ifdef CAMERAHAL_TUNA
+ OMX_TI_PARAM_ZSLHISTORYLENTYPE zslHistoryLen;
+ OMX_INIT_STRUCT_PTR (&zslHistoryLen, OMX_TI_PARAM_ZSLHISTORYLENTYPE);
+ // ZSL has 4 buffers history by default
+ zslHistoryLen.nHistoryLen = 4;
+#endif
+
//CAC is disabled by default
OMX_INIT_STRUCT_PTR (&bCAC, OMX_CONFIG_BOOLEANTYPE);
OMX_INIT_STRUCT_PTR (&singlePrevMode, OMX_TI_CONFIG_SINGLEPREVIEWMODETYPE);
@@ -690,6 +702,19 @@ status_t OMXCameraAdapter::setCaptureMode(OMXCameraAdapter::CaptureMode mode)
if( NO_ERROR == ret )
{
+#ifdef CAMERAHAL_TUNA
+ if (!mIternalRecordingHint) {
+ eError = OMX_SetParameter(mCameraAdapterParameters.mHandleComp,
+ ( OMX_INDEXTYPE ) OMX_TI_IndexParamZslHistoryLen,
+ &zslHistoryLen);
+ if (OMX_ErrorNone != eError) {
+ CAMHAL_LOGEB("Error while configuring ZSL History len 0x%x", eError);
+ ret = Utils::ErrorUtils::omxToAndroidError(eError);
+ } else {
+ CAMHAL_LOGDA("ZSL History len configured successfully");
+ }
+ }
+#endif
eError = OMX_SetParameter(mCameraAdapterParameters.mHandleComp,
( OMX_INDEXTYPE ) OMX_IndexCameraOperatingMode,
&camMode);
@@ -704,6 +729,7 @@ status_t OMXCameraAdapter::setCaptureMode(OMXCameraAdapter::CaptureMode mode)
}
}
+#ifdef OMAP_ENHANCEMENT_CPCAM
if((NO_ERROR == ret) && (OMXCameraAdapter::CP_CAM == mode)) {
//Configure Single Preview Mode
eError = OMX_SetConfig(mCameraAdapterParameters.mHandleComp,
@@ -716,7 +742,7 @@ status_t OMXCameraAdapter::setCaptureMode(OMXCameraAdapter::CaptureMode mode)
CAMHAL_LOGDA("single preview mode configured successfully");
}
}
-
+#endif
if( NO_ERROR == ret )
{
@@ -1211,7 +1237,7 @@ status_t OMXCameraAdapter::setVFramerate(OMX_U32 minFrameRate, OMX_U32 maxFrameR
status_t OMXCameraAdapter::setMechanicalMisalignmentCorrection(const bool enable)
{
status_t ret = NO_ERROR;
-#ifndef MOTOROLA_CAMERA
+#if !defined(MOTOROLA_CAMERA) && !defined(CAMERAHAL_TUNA)
OMX_ERRORTYPE eError = OMX_ErrorNone;
OMX_TI_CONFIG_MM mm;
diff --git a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
index a52654a..9b8064b 100644
--- a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
+++ b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
@@ -131,7 +131,9 @@ status_t OMXCameraAdapter::initialize(CameraProperties::Properties* caps)
mComponentState = OMX_StateLoaded;
CAMHAL_LOGVB("OMX_GetHandle -0x%x sensor_index = %lu", eError, mSensorIndex);
+#ifndef CAMERAHAL_TUNA
initDccFileDataSave(&mCameraAdapterParameters.mHandleComp, mCameraAdapterParameters.mPrevPortIndex);
+#endif
eError = OMX_SendCommand(mCameraAdapterParameters.mHandleComp,
OMX_CommandPortDisable,
@@ -1020,7 +1022,7 @@ status_t OMXCameraAdapter::setupTunnel(uint32_t SliceHeight, uint32_t EncoderHan
CAMHAL_LOGEB("OMX_SetParameter OMX_IndexParamPortDefinition Error- %x", eError);
}
-#ifndef MOTOROLA_CAMERA
+#ifdef OMAP_ENHANCEMENT_VTC
//Slice Configuration
OMX_TI_PARAM_VTCSLICE VTCSlice;
OMX_INIT_STRUCT_PTR(&VTCSlice, OMX_TI_PARAM_VTCSLICE);
@@ -1204,6 +1206,7 @@ status_t OMXCameraAdapter::setFormat(OMX_U32 port, OMXCameraPortParameters &port
CAMHAL_LOGEB("Unsupported port index (%lu)", port);
}
+#ifdef OMAP_ENHANCEMENT_S3D
if (( mSensorIndex == OMX_TI_StereoSensor ) && (OMX_CAMERA_PORT_VIDEO_OUT_VIDEO != port)) {
ret = setS3DFrameLayout(port);
if ( NO_ERROR != ret )
@@ -1212,6 +1215,7 @@ status_t OMXCameraAdapter::setFormat(OMX_U32 port, OMXCameraPortParameters &port
return ret;
}
}
+#endif
eError = OMX_SetParameter(mCameraAdapterParameters.mHandleComp,
OMX_IndexParamPortDefinition, &portCheck);
@@ -2655,6 +2659,7 @@ status_t OMXCameraAdapter::printComponentVersion(OMX_HANDLETYPE handle)
return ret;
}
+#ifdef OMAP_ENHANCEMENT_S3D
status_t OMXCameraAdapter::setS3DFrameLayout(OMX_U32 port) const
{
OMX_ERRORTYPE eError = OMX_ErrorNone;
@@ -2709,6 +2714,7 @@ status_t OMXCameraAdapter::setS3DFrameLayout(OMX_U32 port) const
return NO_ERROR;
}
+#endif
status_t OMXCameraAdapter::autoFocus()
{
@@ -3585,7 +3591,9 @@ OMX_ERRORTYPE OMXCameraAdapter::OMXCameraAdapterFillBufferDone(OMX_IN OMX_HANDLE
}
}
+#ifndef CAMERAHAL_TUNA
sniffDccFileDataSave(pBuffHeader);
+#endif
stat |= advanceZoom();
@@ -4049,7 +4057,7 @@ status_t OMXCameraAdapter::setExtraData(bool enable, OMX_U32 nPortIndex, OMX_EXT
extraDataControl.nPortIndex = nPortIndex;
extraDataControl.eExtraDataType = eType;
#ifdef CAMERAHAL_TUNA
- extraDataControl.eCameraView = OMX_2D;
+ extraDataControl.eCameraView = OMX_2D_Prv;
#endif
if (enable) {
diff --git a/camera/OMXCameraAdapter/OMXCapabilities.cpp b/camera/OMXCameraAdapter/OMXCapabilities.cpp
index 72a2380..85ee85c 100644
--- a/camera/OMXCameraAdapter/OMXCapabilities.cpp
+++ b/camera/OMXCameraAdapter/OMXCapabilities.cpp
@@ -575,6 +575,7 @@ status_t OMXCameraAdapter::encodeSizeCap(OMX_TI_CAPRESTYPE &res,
return ret;
}
+#ifdef OMAP_ENHANCEMENT_S3D
status_t OMXCameraAdapter::encodeSizeCap3D(OMX_TI_CAPRESTYPE &res,
const CapResolution *cap,
size_t capCount,
@@ -607,6 +608,7 @@ status_t OMXCameraAdapter::encodeSizeCap3D(OMX_TI_CAPRESTYPE &res,
return ret;
}
+#endif
status_t OMXCameraAdapter::insertImageSizes(CameraProperties::Properties* params, OMX_TI_CAPTYPE &caps)
{
@@ -618,6 +620,7 @@ status_t OMXCameraAdapter::insertImageSizes(CameraProperties::Properties* params
LOG_FUNCTION_NAME;
+#ifdef OMAP_ENHANCEMENT_S3D
for ( unsigned int i = 0 ; i < caps.ulCapFrameLayoutCount; i++ ) {
if (caps.eCapFrameLayout[i] == OMX_TI_StereoFrameLayoutTopBottom)
{
@@ -633,6 +636,7 @@ status_t OMXCameraAdapter::insertImageSizes(CameraProperties::Properties* params
s3d_detected = 1;
}
}
+#endif
memset(supported, '\0', MAX_PROP_VALUE_LENGTH);
@@ -653,6 +657,7 @@ status_t OMXCameraAdapter::insertImageSizes(CameraProperties::Properties* params
params->set(CameraProperties::MAX_PICTURE_WIDTH, caps.tImageResRange.nWidthMax);
params->set(CameraProperties::MAX_PICTURE_HEIGHT, caps.tImageResRange.nHeightMax);
}
+#ifdef OMAP_ENHANCEMENT_S3D
else // 3d mode
{
if (s3d_tb_detected)
@@ -714,6 +719,7 @@ status_t OMXCameraAdapter::insertImageSizes(CameraProperties::Properties* params
params->set(CameraProperties::SUPPORTED_PICTURE_SUBSAMPLED_SIZES, supported);
}
}
+#endif
LOG_FUNCTION_NAME_EXIT;
@@ -730,6 +736,7 @@ status_t OMXCameraAdapter::insertPreviewSizes(CameraProperties::Properties* para
LOG_FUNCTION_NAME;
+#ifdef OMAP_ENHANCEMENT_S3D
for ( unsigned int i = 0 ; i < caps.ulPrvFrameLayoutCount; i++ ) {
if (caps.ePrvFrameLayout[i] == OMX_TI_StereoFrameLayoutTopBottom)
{
@@ -745,6 +752,7 @@ status_t OMXCameraAdapter::insertPreviewSizes(CameraProperties::Properties* para
s3d_detected = 1;
}
}
+#endif
memset(supported, '\0', MAX_PROP_VALUE_LENGTH);
@@ -762,12 +770,14 @@ status_t OMXCameraAdapter::insertPreviewSizes(CameraProperties::Properties* para
return ret;
}
+#ifndef CAMERAHAL_TUNA
/* Insert Portait Resolutions by verifying Potrait Capability Support */
ret = encodeSizeCap(caps.tRotatedPreviewResRange,
mPreviewPortraitRes,
ARRAY_SIZE(mPreviewPortraitRes),
supported,
MAX_PROP_VALUE_LENGTH);
+#endif
if ( NO_ERROR != ret ) {
CAMHAL_LOGEB("Error inserting supported Potrait preview sizes 0x%x", ret);
@@ -775,6 +785,7 @@ status_t OMXCameraAdapter::insertPreviewSizes(CameraProperties::Properties* para
params->set(CameraProperties::SUPPORTED_PREVIEW_SIZES, supported);
}
}
+#ifdef OMAP_ENHANCEMENT_S3D
else // 3d mode
{
if (s3d_tb_detected)
@@ -839,6 +850,7 @@ status_t OMXCameraAdapter::insertPreviewSizes(CameraProperties::Properties* para
params->set(CameraProperties::SUPPORTED_PREVIEW_SUBSAMPLED_SIZES, supported);
}
}
+#endif
LOG_FUNCTION_NAME_EXIT;
@@ -956,6 +968,7 @@ status_t OMXCameraAdapter::insertImageFormats(CameraProperties::Properties* para
}
}
+#ifndef CAMERAHAL_TUNA
for (int i = 0; i < caps.ulImageCodingFormatCount ; i++) {
ret = encodeImageCodingFormatCap(caps.eImageCodingFormat[i],
mImageCodingFormat,
@@ -967,8 +980,16 @@ status_t OMXCameraAdapter::insertImageFormats(CameraProperties::Properties* para
break;
}
}
+#endif
if ( NO_ERROR == ret ) {
+#ifdef CAMERAHAL_TUNA
+ // jpeg is supported but not advertised
+ if (supported[0] != '\0') {
+ strncat(supported, PARAM_SEP, 1);
+ }
+ strncat(supported, android::CameraParameters::PIXEL_FORMAT_JPEG, MAX_PROP_VALUE_LENGTH - 1);
+#endif
params->set(CameraProperties::SUPPORTED_PICTURE_FORMATS, supported);
}
@@ -1589,15 +1610,23 @@ status_t OMXCameraAdapter::insertRaw(CameraProperties::Properties* params, OMX_T
LOG_FUNCTION_NAME;
memset(supported, '\0', sizeof(supported));
+#ifdef CAMERAHAL_TUNA
+ sprintf(supported,"%d",int(caps.tImageResRange.nWidthMax));
+#else
sprintf(supported,"%d",int(caps.uSenNativeResWidth));
+#endif
params->set(CameraProperties::RAW_WIDTH, supported);
memset(supported, '\0', sizeof(supported));
+#ifdef CAMERAHAL_TUNA
+ sprintf(supported,"%d",int(caps.tImageResRange.nHeightMax));
+#else
if (caps.bMechanicalMisalignmentSupported) {
sprintf(supported,"%d",int(caps.uSenNativeResHeight) * 2);
} else {
sprintf(supported,"%d",int(caps.uSenNativeResHeight));
}
+#endif
params->set(CameraProperties::RAW_HEIGHT, supported);
LOG_FUNCTION_NAME_EXIT;
@@ -1616,11 +1645,19 @@ status_t OMXCameraAdapter::insertFacing(CameraProperties::Properties* params, OM
memset(supported, '\0', sizeof(supported));
+#ifdef CAMERAHAL_TUNA
+ if (caps.tSenMounting.nSenId == SENSORID_S5K4E1GA) {
+ i = 0; // FACING_BACK
+ } else {
+ i = 1; // FACING_FRONT
+ }
+#else
for (i = 0; i < ARRAY_SIZE(mFacing); i++) {
if((OMX_TI_SENFACING_TYPE)mFacing[i].num == caps.tSenMounting.eFacing) {
break;
}
}
+#endif
if ( i == ARRAY_SIZE(mFacing) ) {
p = "UNKNOWN_FACING";
} else {
@@ -1665,6 +1702,7 @@ status_t OMXCameraAdapter::insertAutoConvergenceModes(CameraProperties::Properti
memset(supported, '\0', sizeof(supported));
+#ifndef CAMERAHAL_TUNA
for ( unsigned int i = 0 ; i < caps.ulAutoConvModesCount; i++ ) {
p = getLUTvalue_OMXtoHAL(caps.eAutoConvModes[i], mAutoConvergenceLUT);
if ( NULL != p ) {
@@ -1674,6 +1712,7 @@ status_t OMXCameraAdapter::insertAutoConvergenceModes(CameraProperties::Properti
strncat(supported, p, REMAINING_BYTES(supported));
}
}
+#endif
params->set(CameraProperties::AUTOCONVERGENCE_MODE_VALUES, supported);
LOG_FUNCTION_NAME_EXIT;
@@ -1751,6 +1790,7 @@ status_t OMXCameraAdapter::insertCaptureModes(CameraProperties::Properties* para
strncat(supported, TICameraParameters::ZOOM_BRACKETING, REMAINING_BYTES(supported));
}
+#ifndef CAMERAHAL_TUNA
for ( unsigned int i = 0 ; i < caps.ulBracketingModesCount; i++ ) {
p = getLUTvalue_OMXtoHAL(caps.eBracketingModes[i], mBracketingModesLUT);
if ( NULL != p ) {
@@ -1760,6 +1800,7 @@ status_t OMXCameraAdapter::insertCaptureModes(CameraProperties::Properties* para
strncat(supported, p, REMAINING_BYTES(supported));
}
}
+#endif
params->set(CameraProperties::CAP_MODE_VALUES, supported);
@@ -1833,10 +1874,14 @@ status_t OMXCameraAdapter::insertGBCESupported(CameraProperties::Properties* par
LOG_FUNCTION_NAME;
+#ifndef CAMERAHAL_TUNA
if (caps.bGbceSupported) {
params->set(CameraProperties::SUPPORTED_GBCE,
android::CameraParameters::TRUE);
- } else {
+ } else
+#endif
+ {
+
params->set(CameraProperties::SUPPORTED_GBCE,
android::CameraParameters::FALSE);
}
@@ -2005,7 +2050,9 @@ status_t OMXCameraAdapter::insertDefaults(CameraProperties::Properties* params,
params->set(CameraProperties::SENSOR_ORIENTATION, DEFAULT_SENSOR_ORIENTATION);
params->set(CameraProperties::AUTOCONVERGENCE_MODE, DEFAULT_AUTOCONVERGENCE_MODE);
params->set(CameraProperties::MANUAL_CONVERGENCE, DEFAULT_MANUAL_CONVERGENCE);
+#ifndef CAMERAHAL_TUNA
params->set(CameraProperties::MECHANICAL_MISALIGNMENT_CORRECTION, DEFAULT_MECHANICAL_MISALIGNMENT_CORRECTION_MODE);
+#endif
char property[PROPERTY_VALUE_MAX];
property_get("ro.product.manufacturer",
@@ -2210,9 +2257,11 @@ bool OMXCameraAdapter::_checkOmxTiCap(const OMX_TI_CAPTYPE & caps)
CAMHAL_CHECK_OMX_TI_CAP(ulFlashCount, eFlashModes);
CAMHAL_CHECK_OMX_TI_CAP(ulPrvVarFPSModesCount, tPrvVarFPSModes);
CAMHAL_CHECK_OMX_TI_CAP(ulCapVarFPSModesCount, tCapVarFPSModes);
+#ifndef CAMERAHAL_TUNA
CAMHAL_CHECK_OMX_TI_CAP(ulAutoConvModesCount, eAutoConvModes);
CAMHAL_CHECK_OMX_TI_CAP(ulBracketingModesCount, eBracketingModes);
CAMHAL_CHECK_OMX_TI_CAP(ulImageCodingFormatCount, eImageCodingFormat);
+#endif
CAMHAL_CHECK_OMX_TI_CAP(ulPrvFrameLayoutCount, ePrvFrameLayout);
CAMHAL_CHECK_OMX_TI_CAP(ulCapFrameLayoutCount, eCapFrameLayout);
@@ -2248,28 +2297,36 @@ bool OMXCameraAdapter::_dumpOmxTiCap(const int sensorId, const OMX_TI_CAPTYPE &
CAMHAL_LOGD("tPreviewResRange.nHeightMin = %d", int(caps.tPreviewResRange.nHeightMin));
CAMHAL_LOGD("tPreviewResRange.nWidthMax = %d", int(caps.tPreviewResRange.nWidthMax));
CAMHAL_LOGD("tPreviewResRange.nHeightMax = %d", int(caps.tPreviewResRange.nHeightMax));
+#ifndef CAMERAHAL_TUNA
CAMHAL_LOGD("tPreviewResRange.nMaxResInPixels = %d", int(caps.tPreviewResRange.nMaxResInPixels));
+#endif
+#ifndef CAMERAHAL_TUNA
CAMHAL_LOGD("");
CAMHAL_LOGD("tRotatedPreviewResRange.nWidthMin = %d", int(caps.tRotatedPreviewResRange.nWidthMin));
CAMHAL_LOGD("tRotatedPreviewResRange.nHeightMin = %d", int(caps.tRotatedPreviewResRange.nHeightMin));
CAMHAL_LOGD("tRotatedPreviewResRange.nWidthMax = %d", int(caps.tRotatedPreviewResRange.nWidthMax));
CAMHAL_LOGD("tRotatedPreviewResRange.nHeightMax = %d", int(caps.tRotatedPreviewResRange.nHeightMax));
CAMHAL_LOGD("tRotatedPreviewResRange.nMaxResInPixels = %d", int(caps.tRotatedPreviewResRange.nMaxResInPixels));
+#endif
CAMHAL_LOGD("");
CAMHAL_LOGD("tImageResRange.nWidthMin = %d", int(caps.tImageResRange.nWidthMin));
CAMHAL_LOGD("tImageResRange.nHeightMin = %d", int(caps.tImageResRange.nHeightMin));
CAMHAL_LOGD("tImageResRange.nWidthMax = %d", int(caps.tImageResRange.nWidthMax));
CAMHAL_LOGD("tImageResRange.nHeightMax = %d", int(caps.tImageResRange.nHeightMax));
+#ifndef CAMERAHAL_TUNA
CAMHAL_LOGD("tImageResRange.nMaxResInPixels = %d", int(caps.tImageResRange.nMaxResInPixels));
+#endif
CAMHAL_LOGD("");
CAMHAL_LOGD("tThumbResRange.nWidthMin = %d", int(caps.tThumbResRange.nWidthMin));
CAMHAL_LOGD("tThumbResRange.nHeightMin = %d", int(caps.tThumbResRange.nHeightMin));
CAMHAL_LOGD("tThumbResRange.nWidthMax = %d", int(caps.tThumbResRange.nWidthMax));
CAMHAL_LOGD("tThumbResRange.nHeightMax = %d", int(caps.tThumbResRange.nHeightMax));
+#ifndef CAMERAHAL_TUNA
CAMHAL_LOGD("tThumbResRange.nMaxResInPixels = %d", int(caps.tThumbResRange.nMaxResInPixels));
+#endif
CAMHAL_LOGD("");
CAMHAL_LOGD("ulWhiteBalanceCount = %d", int(caps.ulWhiteBalanceCount));
@@ -2344,10 +2401,13 @@ bool OMXCameraAdapter::_dumpOmxTiCap(const int sensorId, const OMX_TI_CAPTYPE &
CAMHAL_LOGD("");
CAMHAL_LOGD("tSenMounting.nSenId = %d", int(caps.tSenMounting.nSenId));
CAMHAL_LOGD("tSenMounting.nRotation = %d", int(caps.tSenMounting.nRotation));
+#ifndef CAMERAHAL_TUNA
CAMHAL_LOGD("tSenMounting.bMirror = %d", int(caps.tSenMounting.bMirror));
CAMHAL_LOGD("tSenMounting.bFlip = %d", int(caps.tSenMounting.bFlip));
CAMHAL_LOGD("tSenMounting.eFacing = %d", int(caps.tSenMounting.eFacing));
+#endif
+#ifndef CAMERAHAL_TUNA
CAMHAL_LOGD("");
CAMHAL_LOGD("ulAutoConvModesCount = %d", int(caps.ulAutoConvModesCount));
for ( int i = 0; i < int(caps.ulAutoConvModesCount); ++i )
@@ -2357,19 +2417,26 @@ bool OMXCameraAdapter::_dumpOmxTiCap(const int sensorId, const OMX_TI_CAPTYPE &
CAMHAL_LOGD("ulBracketingModesCount = %d", int(caps.ulBracketingModesCount));
for ( int i = 0; i < int(caps.ulBracketingModesCount); ++i )
CAMHAL_LOGD(" eBracketingModes[%2d] = %d", i, int(caps.eBracketingModes[i]));
+#endif
CAMHAL_LOGD("");
+#ifndef CAMERAHAL_TUNA
CAMHAL_LOGD("bGbceSupported = %d", int(caps.bGbceSupported));
CAMHAL_LOGD("bRawJpegSupported = %d", int(caps.bRawJpegSupported));
+#endif
+#ifndef CAMERAHAL_TUNA
CAMHAL_LOGD("");
CAMHAL_LOGD("ulImageCodingFormatCount = %d", int(caps.ulImageCodingFormatCount));
for ( int i = 0; i < int(caps.ulImageCodingFormatCount); ++i )
CAMHAL_LOGD(" eImageCodingFormat[%2d] = %d", i, int(caps.eImageCodingFormat[i]));
+#endif
CAMHAL_LOGD("");
+#ifndef CAMERAHAL_TUNA
CAMHAL_LOGD("uSenNativeResWidth = %d", int(caps.uSenNativeResWidth));
CAMHAL_LOGD("uSenNativeResHeight = %d", int(caps.uSenNativeResHeight));
+#endif
CAMHAL_LOGD("ulAlgoAreasFocusCount = %d", int(caps.ulAlgoAreasFocusCount));
CAMHAL_LOGD("ulAlgoAreasExposureCount = %d", int(caps.ulAlgoAreasExposureCount));
CAMHAL_LOGD("bAELockSupported = %d", int(caps.bAELockSupported));
@@ -2488,6 +2555,19 @@ status_t OMXCameraAdapter::getCaps(const int sensorId, CameraProperties::Propert
}
#endif
+#ifdef CAMERAHAL_TUNA
+ // missing camera caps
+ caps->bAELockSupported = OMX_TRUE;
+ caps->bAWBLockSupported = OMX_TRUE;
+ caps->bStillCapDuringVideoSupported = OMX_TRUE;
+ caps->bVideoStabilizationSupported = OMX_TRUE;
+ if (caps->tSenMounting.nSenId == SENSORID_S5K4E1GA) {
+ caps->nFocalLength = 343; // DEFAULT_FOCAL_LENGTH_PRIMARY
+ } else {
+ caps->nFocalLength = 195; // DEFAULT_FOCAL_LENGTH_SECONDARY
+ }
+#endif
+
#ifdef CAMERAHAL_DEBUG
_dumpOmxTiCap(sensorId, *caps);
#endif
@@ -2498,7 +2578,9 @@ status_t OMXCameraAdapter::getCaps(const int sensorId, CameraProperties::Propert
}
CAMHAL_LOGDB("sen mount id=%u", (unsigned int)caps->tSenMounting.nSenId);
+#ifndef CAMERAHAL_TUNA
CAMHAL_LOGDB("facing id=%u", (unsigned int)caps->tSenMounting.eFacing);
+#endif
EXIT:
if (bufferlist) {
diff --git a/camera/OMXCameraAdapter/OMXCapture.cpp b/camera/OMXCameraAdapter/OMXCapture.cpp
index afc335e..0ae2b24 100644
--- a/camera/OMXCameraAdapter/OMXCapture.cpp
+++ b/camera/OMXCameraAdapter/OMXCapture.cpp
@@ -526,11 +526,12 @@ status_t OMXCameraAdapter::doExposureBracketing(int *evValues,
}
if ( NO_ERROR == ret ) {
+#ifdef OMAP_ENHANCEMENT_CPCAM
if (bracketMode == OMX_BracketVectorShot) {
ret = setVectorShot(evValues, evValues2, evModes2, evCount, frameCount, flush, bracketMode);
- } else {
+ } else
+#endif
ret = setExposureBracketing(evValues, evValues2, evCount, frameCount, bracketMode);
- }
}
LOG_FUNCTION_NAME_EXIT;
@@ -538,6 +539,7 @@ status_t OMXCameraAdapter::doExposureBracketing(int *evValues,
return ret;
}
+#ifdef OMAP_ENHANCEMENT_CPCAM
status_t OMXCameraAdapter::setVectorStop(bool toPreview)
{
status_t ret = NO_ERROR;
@@ -753,6 +755,7 @@ status_t OMXCameraAdapter::setVectorShot(int *evValues,
return (ret | Utils::ErrorUtils::omxToAndroidError(eError));
}
+#endif
status_t OMXCameraAdapter::setExposureBracketing(int *evValues,
int *evValues2,
@@ -818,7 +821,9 @@ status_t OMXCameraAdapter::setExposureBracketing(int *evValues,
{
if (bracketMode == OMX_BracketExposureGainAbsolute) {
extExpCapMode.tBracketConfigType.nBracketValues[i] = evValues[i];
+#ifndef CAMERAHAL_TUNA
extExpCapMode.tBracketConfigType.nBracketValues2[i] = evValues2[i];
+#endif
} else {
// assuming OMX_BracketExposureRelativeInEV
extExpCapMode.tBracketConfigType.nBracketValues[i] = ( evValues[i] * ( 1 << Q16_OFFSET ) ) / 10;
@@ -1409,7 +1414,9 @@ status_t OMXCameraAdapter::stopImageCapture()
}
mStartCaptureSem.Create(0);
}
- } else if (CP_CAM == mCapMode) {
+ }
+#ifdef OMAP_ENHANCEMENT_CPCAM
+ else if (CP_CAM == mCapMode) {
// Reset shot config queue
OMX_TI_CONFIG_ENQUEUESHOTCONFIGS resetShotConfigs;
OMX_INIT_STRUCT_PTR(&resetShotConfigs, OMX_TI_CONFIG_ENQUEUESHOTCONFIGS);
@@ -1427,6 +1434,7 @@ status_t OMXCameraAdapter::stopImageCapture()
CAMHAL_LOGDA("Shot config reset successfully");
}
}
+#endif
//Wait here for the capture to be done, in worst case timeout and proceed with cleanup
mCaptureSem.WaitTimeout(OMX_CAPTURE_TIMEOUT);
@@ -1613,6 +1621,7 @@ EXIT:
status_t OMXCameraAdapter::initInternalBuffers(OMX_U32 portIndex)
{
+#ifndef CAMERAHAL_TUNA
OMX_ERRORTYPE eError = OMX_ErrorNone;
int index = 0;
OMX_TI_PARAM_USEBUFFERDESCRIPTOR bufferdesc;
@@ -1680,11 +1689,15 @@ status_t OMXCameraAdapter::initInternalBuffers(OMX_U32 portIndex)
CAMHAL_LOGV("Ducati requested too many (>1) internal buffers");
return -EINVAL;
+#else
+ return NO_ERROR;
+#endif
}
status_t OMXCameraAdapter::deinitInternalBuffers(OMX_U32 portIndex)
{
OMX_ERRORTYPE eError = OMX_ErrorNone;
+#ifndef CAMERAHAL_TUNA
OMX_TI_PARAM_USEBUFFERDESCRIPTOR bufferdesc;
OMX_INIT_STRUCT_PTR (&bufferdesc, OMX_TI_PARAM_USEBUFFERDESCRIPTOR);
@@ -1713,6 +1726,7 @@ status_t OMXCameraAdapter::deinitInternalBuffers(OMX_U32 portIndex)
CAMHAL_LOGEB("OMX_SetParameter - %x", eError);
return -EINVAL;
}
+#endif
return Utils::ErrorUtils::omxToAndroidError(eError);
}
@@ -1885,14 +1899,18 @@ status_t OMXCameraAdapter::UseBuffersCapture(CameraBuffer * bufArr, int num)
if (mNextState != LOADED_REPROCESS_CAPTURE_STATE) {
// Enable WB and vector shot extra data for metadata
setExtraData(true, mCameraAdapterParameters.mImagePortIndex, OMX_WhiteBalance);
+#ifndef CAMERAHAL_TUNA
setExtraData(true, mCameraAdapterParameters.mImagePortIndex, OMX_TI_LSCTable);
+#endif
}
+#ifdef OMAP_ENHANCEMENT_CPCAM
// CPCam mode only supports vector shot
// Regular capture is not supported
if ( (mCapMode == CP_CAM) && (mNextState != LOADED_REPROCESS_CAPTURE_STATE) ) {
initVectorShot();
}
+#endif
mCaptureBuffersAvailable.clear();
for (unsigned int i = 0; i < imgCaptureData->mMaxQueueable; i++ ) {
@@ -1915,6 +1933,7 @@ status_t OMXCameraAdapter::UseBuffersCapture(CameraBuffer * bufArr, int num)
}
}
+#ifdef OMAP_ENHANCEMENT_CPCAM
// Choose proper single preview mode for cp capture (reproc or hs)
if (( NO_ERROR == ret) && (OMXCameraAdapter::CP_CAM == mCapMode)) {
OMX_TI_CONFIG_SINGLEPREVIEWMODETYPE singlePrevMode;
@@ -1937,6 +1956,7 @@ status_t OMXCameraAdapter::UseBuffersCapture(CameraBuffer * bufArr, int num)
CAMHAL_LOGDA("single preview mode configured successfully");
}
}
+#endif
#if PPM_INSTRUMENTATION || PPM_INSTRUMENTATION_ABS
@@ -1960,7 +1980,9 @@ EXIT:
// TODO: WA: if domx client disables VectShotInfo metadata on the image port, this causes
// VectShotInfo to be disabled internally on preview port also. Remove setting in OMXCapture
// setExtraData(false, mCameraAdapterParameters.mImagePortIndex, OMX_TI_VectShotInfo);
+#ifndef CAMERAHAL_TUNA
setExtraData(false, mCameraAdapterParameters.mImagePortIndex, OMX_TI_LSCTable);
+#endif
//Release image buffers
if ( NULL != mReleaseImageBuffersCallback ) {
mReleaseImageBuffersCallback(mReleaseData);