diff options
-rw-r--r-- | include/camera/CameraParameters.h | 20 | ||||
-rw-r--r-- | media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp | 28 | ||||
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayer.cpp | 2 |
3 files changed, 31 insertions, 19 deletions
diff --git a/include/camera/CameraParameters.h b/include/camera/CameraParameters.h index ef4cf5c..7edf6b4 100644 --- a/include/camera/CameraParameters.h +++ b/include/camera/CameraParameters.h @@ -644,15 +644,17 @@ public: // than FOCUS_MODE_CONTINUOUS_VIDEO. Auto focus starts when the parameter is // set. // - // If applications call CameraHardwareInterface.autoFocus in this mode, the - // focus callback will immediately return with a boolean that indicates - // whether the focus is sharp or not. The apps can then decide if they want - // to take a picture immediately or to change the focus mode to auto, and - // run a full autofocus cycle. The focus position is locked after autoFocus - // call. If applications want to resume the continuous focus, - // cancelAutoFocus must be called. Restarting the preview will not resume - // the continuous autofocus. To stop continuous focus, applications should - // change the focus mode to other modes. + // Applications can call CameraHardwareInterface.autoFocus in this mode. If + // the autofocus is in the middle of scanning, the focus callback will + // return when it completes. If the autofocus is not scanning, focus + // callback will immediately return with a boolean that indicates whether + // the focus is sharp or not. The apps can then decide if they want to take + // a picture immediately or to change the focus mode to auto, and run a full + // autofocus cycle. The focus position is locked after autoFocus call. If + // applications want to resume the continuous focus, cancelAutoFocus must be + // called. Restarting the preview will not resume the continuous autofocus. + // To stop continuous focus, applications should change the focus mode to + // other modes. static const char FOCUS_MODE_CONTINUOUS_PICTURE[]; private: diff --git a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp index 270f6c1..5a1e93a 100644 --- a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp +++ b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp @@ -49,6 +49,16 @@ extern "C" const struct effect_interface_s gLvmEffectInterface; }\ } + +static inline int16_t clamp16(int32_t sample) +{ + // check overflow for both positive and negative values: + // all bits above short range must me equal to sign bit + if ((sample>>15) ^ (sample>>31)) + sample = 0x7FFF ^ (sample>>31); + return sample; +} + // Namespaces namespace android { namespace { @@ -707,13 +717,6 @@ int LvmBundle_init(EffectContext *pContext){ } /* end LvmBundle_init */ -static inline int16_t clamp16(int32_t sample) -{ - if ((sample>>15) ^ (sample>>31)) - sample = 0x7FFF ^ (sample>>31); - return sample; -} - //---------------------------------------------------------------------------- // LvmBundle_process() //---------------------------------------------------------------------------- @@ -2690,12 +2693,19 @@ int Effect_process(effect_handle_t self, LOGV("\tLVM_ERROR : LvmBundle_process returned error %d", lvmStatus); return lvmStatus; } - }else{ + } else { //LOGV("\tEffect_process Not Calling process with %d effects enabled, %d called: Effect %d", //pContext->pBundledContext->NumberEffectsEnabled, //pContext->pBundledContext->NumberEffectsCalled, pContext->EffectType); // 2 is for stereo input - memcpy(outBuffer->raw, inBuffer->raw, outBuffer->frameCount*sizeof(LVM_INT16)*2); + if (pContext->config.outputCfg.accessMode == EFFECT_BUFFER_ACCESS_ACCUMULATE) { + for (size_t i=0; i < outBuffer->frameCount*2; i++){ + outBuffer->s16[i] = + clamp16((LVM_INT32)outBuffer->s16[i] + (LVM_INT32)inBuffer->s16[i]); + } + } else { + memcpy(outBuffer->raw, inBuffer->raw, outBuffer->frameCount*sizeof(LVM_INT16)*2); + } } return status; diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp index 7cdb76c..70208f8 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -282,7 +282,7 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { if (err == -EWOULDBLOCK) { if (mSource->feedMoreTSData() == OK) { - msg->post(); + msg->post(10000ll); } } } else if (what == ACodec::kWhatEOS) { |