diff options
author | Mark Salyzyn <salyzyn@google.com> | 2014-04-18 22:11:00 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-04-18 22:11:00 +0000 |
commit | cb010a3fa85db1eb90346b35e484e21e7f1b1a4b (patch) | |
tree | 720906051414d27dfca82c175618a83190d9ea3d /media/libeffects | |
parent | 77d4f613bbed8b646c8ddade6a0737fcbd391b07 (diff) | |
parent | e1ff1051ffee8fb650741ad133f0f28b73eb7a73 (diff) | |
download | frameworks_av-cb010a3fa85db1eb90346b35e484e21e7f1b1a4b.zip frameworks_av-cb010a3fa85db1eb90346b35e484e21e7f1b1a4b.tar.gz frameworks_av-cb010a3fa85db1eb90346b35e484e21e7f1b1a4b.tar.bz2 |
am e1ff1051: am e0f20cea: Merge "libeffects: 64 bit compile issues"
* commit 'e1ff1051ffee8fb650741ad133f0f28b73eb7a73':
libeffects: 64 bit compile issues
Diffstat (limited to 'media/libeffects')
-rw-r--r-- | media/libeffects/downmix/EffectDownmix.c | 45 | ||||
-rw-r--r-- | media/libeffects/visualizer/EffectVisualizer.cpp | 35 |
2 files changed, 41 insertions, 39 deletions
diff --git a/media/libeffects/downmix/EffectDownmix.c b/media/libeffects/downmix/EffectDownmix.c index a39d837..1663d47 100644 --- a/media/libeffects/downmix/EffectDownmix.c +++ b/media/libeffects/downmix/EffectDownmix.c @@ -16,7 +16,8 @@ #define LOG_TAG "EffectDownmix" //#define LOG_NDEBUG 0 -#include <cutils/log.h> +#include <log/log.h> +#include <inttypes.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> @@ -99,7 +100,7 @@ const int kNbEffects = sizeof(gDescriptors) / sizeof(const effect_descriptor_t * // strictly for testing, logs the indices of the channels for a given mask, // uses the same code as Downmix_foldGeneric() void Downmix_testIndexComputation(uint32_t mask) { - ALOGI("Testing index computation for 0x%x:", mask); + ALOGI("Testing index computation for 0x%" PRIx32 ":", mask); // check against unsupported channels if (mask & kUnsupported) { ALOGE("Unsupported channels (top or front left/right of center)"); @@ -220,7 +221,7 @@ int32_t DownmixLib_Create(const effect_uuid_t *uuid, *pHandle = (effect_handle_t) module; - ALOGV("DownmixLib_Create() %p , size %d", module, sizeof(downmix_module_t)); + ALOGV("DownmixLib_Create() %p , size %zu", module, sizeof(downmix_module_t)); return 0; } @@ -254,7 +255,7 @@ int32_t DownmixLib_GetDescriptor(const effect_uuid_t *uuid, effect_descriptor_t ALOGV("DownmixLib_GetDescriptor() i=%d", i); if (memcmp(uuid, &gDescriptors[i]->uuid, sizeof(effect_uuid_t)) == 0) { memcpy(pDescriptor, gDescriptors[i], sizeof(effect_descriptor_t)); - ALOGV("EffectGetDescriptor - UUID matched downmix type %d, UUID = %x", + ALOGV("EffectGetDescriptor - UUID matched downmix type %d, UUID = %" PRIx32, i, gDescriptors[i]->uuid.timeLow); return 0; } @@ -328,7 +329,7 @@ static int Downmix_Process(effect_handle_t self, // bypass the optimized downmix routines for the common formats if (!Downmix_foldGeneric( downmixInputChannelMask, pSrc, pDst, numFrames, accumulate)) { - ALOGE("Multichannel configuration 0x%x is not supported", downmixInputChannelMask); + ALOGE("Multichannel configuration 0x%" PRIx32 " is not supported", downmixInputChannelMask); return -EINVAL; } break; @@ -352,7 +353,7 @@ static int Downmix_Process(effect_handle_t self, default: if (!Downmix_foldGeneric( downmixInputChannelMask, pSrc, pDst, numFrames, accumulate)) { - ALOGE("Multichannel configuration 0x%x is not supported", downmixInputChannelMask); + ALOGE("Multichannel configuration 0x%" PRIx32 " is not supported", downmixInputChannelMask); return -EINVAL; } break; @@ -380,7 +381,7 @@ static int Downmix_Command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdS pDownmixer = (downmix_object_t*) &pDwmModule->context; - ALOGV("Downmix_Command command %d cmdSize %d",cmdCode, cmdSize); + ALOGV("Downmix_Command command %" PRIu32 " cmdSize %" PRIu32, cmdCode, cmdSize); switch (cmdCode) { case EFFECT_CMD_INIT: @@ -404,7 +405,7 @@ static int Downmix_Command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdS break; case EFFECT_CMD_GET_PARAM: - ALOGV("Downmix_Command EFFECT_CMD_GET_PARAM pCmdData %p, *replySize %d, pReplyData: %p", + ALOGV("Downmix_Command EFFECT_CMD_GET_PARAM pCmdData %p, *replySize %" PRIu32 ", pReplyData: %p", pCmdData, *replySize, pReplyData); if (pCmdData == NULL || cmdSize < (int)(sizeof(effect_param_t) + sizeof(int32_t)) || pReplyData == NULL || @@ -413,7 +414,7 @@ static int Downmix_Command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdS } effect_param_t *rep = (effect_param_t *) pReplyData; memcpy(pReplyData, pCmdData, sizeof(effect_param_t) + sizeof(int32_t)); - ALOGV("Downmix_Command EFFECT_CMD_GET_PARAM param %d, replySize %d", + ALOGV("Downmix_Command EFFECT_CMD_GET_PARAM param %" PRId32 ", replySize %" PRIu32, *(int32_t *)rep->data, rep->vsize); rep->status = Downmix_getParameter(pDownmixer, *(int32_t *)rep->data, &rep->vsize, rep->data + sizeof(int32_t)); @@ -421,8 +422,8 @@ static int Downmix_Command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdS break; case EFFECT_CMD_SET_PARAM: - ALOGV("Downmix_Command EFFECT_CMD_SET_PARAM cmdSize %d pCmdData %p, *replySize %d, " \ - "pReplyData %p", cmdSize, pCmdData, *replySize, pReplyData); + ALOGV("Downmix_Command EFFECT_CMD_SET_PARAM cmdSize %d pCmdData %p, *replySize %" PRIu32 + ", pReplyData %p", cmdSize, pCmdData, *replySize, pReplyData); if (pCmdData == NULL || (cmdSize < (int)(sizeof(effect_param_t) + sizeof(int32_t))) || pReplyData == NULL || *replySize != (int)sizeof(int32_t)) { return -EINVAL; @@ -471,7 +472,7 @@ static int Downmix_Command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdS return -EINVAL; } // FIXME change type if playing on headset vs speaker - ALOGV("Downmix_Command EFFECT_CMD_SET_DEVICE: 0x%08x", *(uint32_t *)pCmdData); + ALOGV("Downmix_Command EFFECT_CMD_SET_DEVICE: 0x%08" PRIx32, *(uint32_t *)pCmdData); break; case EFFECT_CMD_SET_VOLUME: { @@ -491,7 +492,7 @@ static int Downmix_Command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdS if (pCmdData == NULL || cmdSize != (int)sizeof(uint32_t)) { return -EINVAL; } - ALOGV("Downmix_Command EFFECT_CMD_SET_AUDIO_MODE: %d", *(uint32_t *)pCmdData); + ALOGV("Downmix_Command EFFECT_CMD_SET_AUDIO_MODE: %" PRIu32, *(uint32_t *)pCmdData); break; case EFFECT_CMD_SET_CONFIG_REVERSE: @@ -500,7 +501,7 @@ static int Downmix_Command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdS break; default: - ALOGW("Downmix_Command invalid command %d",cmdCode); + ALOGW("Downmix_Command invalid command %" PRIu32, cmdCode); return -EINVAL; } @@ -702,28 +703,28 @@ int Downmix_Reset(downmix_object_t *pDownmixer, bool init) { int Downmix_setParameter(downmix_object_t *pDownmixer, int32_t param, uint32_t size, void *pValue) { int16_t value16; - ALOGV("Downmix_setParameter, context %p, param %d, value16 %d, value32 %d", + ALOGV("Downmix_setParameter, context %p, param %" PRId32 ", value16 %" PRId16 ", value32 %" PRId32, pDownmixer, param, *(int16_t *)pValue, *(int32_t *)pValue); switch (param) { case DOWNMIX_PARAM_TYPE: if (size != sizeof(downmix_type_t)) { - ALOGE("Downmix_setParameter(DOWNMIX_PARAM_TYPE) invalid size %u, should be %zu", + ALOGE("Downmix_setParameter(DOWNMIX_PARAM_TYPE) invalid size %" PRIu32 ", should be %zu", size, sizeof(downmix_type_t)); return -EINVAL; } value16 = *(int16_t *)pValue; - ALOGV("set DOWNMIX_PARAM_TYPE, type %d", value16); + ALOGV("set DOWNMIX_PARAM_TYPE, type %" PRId16, value16); if (!((value16 > DOWNMIX_TYPE_INVALID) && (value16 <= DOWNMIX_TYPE_LAST))) { - ALOGE("Downmix_setParameter invalid DOWNMIX_PARAM_TYPE value %d", value16); + ALOGE("Downmix_setParameter invalid DOWNMIX_PARAM_TYPE value %" PRId16, value16); return -EINVAL; } else { pDownmixer->type = (downmix_type_t) value16; break; default: - ALOGE("Downmix_setParameter unknown parameter %d", param); + ALOGE("Downmix_setParameter unknown parameter %" PRId32, param); return -EINVAL; } } @@ -762,17 +763,17 @@ int Downmix_getParameter(downmix_object_t *pDownmixer, int32_t param, uint32_t * case DOWNMIX_PARAM_TYPE: if (*pSize < sizeof(int16_t)) { - ALOGE("Downmix_getParameter invalid parameter size %zu for DOWNMIX_PARAM_TYPE", *pSize); + ALOGE("Downmix_getParameter invalid parameter size %" PRIu32 " for DOWNMIX_PARAM_TYPE", *pSize); return -EINVAL; } pValue16 = (int16_t *)pValue; *pValue16 = (int16_t) pDownmixer->type; *pSize = sizeof(int16_t); - ALOGV("Downmix_getParameter DOWNMIX_PARAM_TYPE is %d", *pValue16); + ALOGV("Downmix_getParameter DOWNMIX_PARAM_TYPE is %" PRId16, *pValue16); break; default: - ALOGE("Downmix_getParameter unknown parameter %d", param); + ALOGE("Downmix_getParameter unknown parameter %" PRId16, param); return -EINVAL; } diff --git a/media/libeffects/visualizer/EffectVisualizer.cpp b/media/libeffects/visualizer/EffectVisualizer.cpp index 5bdaa03..47cab62 100644 --- a/media/libeffects/visualizer/EffectVisualizer.cpp +++ b/media/libeffects/visualizer/EffectVisualizer.cpp @@ -16,8 +16,9 @@ #define LOG_TAG "EffectVisualizer" //#define LOG_NDEBUG 0 -#include <cutils/log.h> +#include <log/log.h> #include <assert.h> +#include <inttypes.h> #include <stdlib.h> #include <string.h> #include <new> @@ -226,8 +227,8 @@ int Visualizer_init(VisualizerContext *pContext) // int VisualizerLib_Create(const effect_uuid_t *uuid, - int32_t sessionId, - int32_t ioId, + int32_t /*sessionId*/, + int32_t /*ioId*/, effect_handle_t *pHandle) { int ret; int i; @@ -418,7 +419,7 @@ int Visualizer_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize, return -EINVAL; } -// ALOGV("Visualizer_command command %d cmdSize %d",cmdCode, cmdSize); +// ALOGV("Visualizer_command command %" PRIu32 " cmdSize %" PRIu32, cmdCode, cmdSize); switch (cmdCode) { case EFFECT_CMD_INIT: @@ -484,19 +485,19 @@ int Visualizer_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize, } switch (*(uint32_t *)p->data) { case VISUALIZER_PARAM_CAPTURE_SIZE: - ALOGV("get mCaptureSize = %d", pContext->mCaptureSize); + ALOGV("get mCaptureSize = %" PRIu32, pContext->mCaptureSize); *((uint32_t *)p->data + 1) = pContext->mCaptureSize; p->vsize = sizeof(uint32_t); *replySize += sizeof(uint32_t); break; case VISUALIZER_PARAM_SCALING_MODE: - ALOGV("get mScalingMode = %d", pContext->mScalingMode); + ALOGV("get mScalingMode = %" PRIu32, pContext->mScalingMode); *((uint32_t *)p->data + 1) = pContext->mScalingMode; p->vsize = sizeof(uint32_t); *replySize += sizeof(uint32_t); break; case VISUALIZER_PARAM_MEASUREMENT_MODE: - ALOGV("get mMeasurementMode = %d", pContext->mMeasurementMode); + ALOGV("get mMeasurementMode = %" PRIu32, pContext->mMeasurementMode); *((uint32_t *)p->data + 1) = pContext->mMeasurementMode; p->vsize = sizeof(uint32_t); *replySize += sizeof(uint32_t); @@ -520,19 +521,19 @@ int Visualizer_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize, switch (*(uint32_t *)p->data) { case VISUALIZER_PARAM_CAPTURE_SIZE: pContext->mCaptureSize = *((uint32_t *)p->data + 1); - ALOGV("set mCaptureSize = %d", pContext->mCaptureSize); + ALOGV("set mCaptureSize = %" PRIu32, pContext->mCaptureSize); break; case VISUALIZER_PARAM_SCALING_MODE: pContext->mScalingMode = *((uint32_t *)p->data + 1); - ALOGV("set mScalingMode = %d", pContext->mScalingMode); + ALOGV("set mScalingMode = %" PRIu32, pContext->mScalingMode); break; case VISUALIZER_PARAM_LATENCY: pContext->mLatency = *((uint32_t *)p->data + 1); - ALOGV("set mLatency = %d", pContext->mLatency); + ALOGV("set mLatency = %" PRIu32, pContext->mLatency); break; case VISUALIZER_PARAM_MEASUREMENT_MODE: pContext->mMeasurementMode = *((uint32_t *)p->data + 1); - ALOGV("set mMeasurementMode = %d", pContext->mMeasurementMode); + ALOGV("set mMeasurementMode = %" PRIu32, pContext->mMeasurementMode); break; default: *(int32_t *)pReplyData = -EINVAL; @@ -545,9 +546,9 @@ int Visualizer_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize, case VISUALIZER_CMD_CAPTURE: { - int32_t captureSize = pContext->mCaptureSize; + uint32_t captureSize = pContext->mCaptureSize; if (pReplyData == NULL || *replySize != captureSize) { - ALOGV("VISUALIZER_CMD_CAPTURE() error *replySize %d captureSize %d", + ALOGV("VISUALIZER_CMD_CAPTURE() error *replySize %" PRIu32 " captureSize %" PRIu32, *replySize, captureSize); return -EINVAL; } @@ -573,7 +574,7 @@ int Visualizer_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize, int32_t capturePoint = pContext->mCaptureIdx - captureSize - deltaSmpl; if (capturePoint < 0) { - int32_t size = -capturePoint; + uint32_t size = -capturePoint; if (size > captureSize) { size = captureSize; } @@ -604,7 +605,7 @@ int Visualizer_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize, // measurements aren't relevant anymore and shouldn't bias the new one) const int32_t delayMs = Visualizer_getDeltaTimeMsFromUpdatedTime(pContext); if (delayMs > DISCARD_MEASUREMENTS_TIME_MS) { - ALOGV("Discarding measurements, last measurement is %dms old", delayMs); + ALOGV("Discarding measurements, last measurement is %" PRId32 "ms old", delayMs); for (uint32_t i=0 ; i<pContext->mMeasurementWindowSizeInBuffers ; i++) { pContext->mPastMeasurements[i].mIsValid = false; pContext->mPastMeasurements[i].mPeakU16 = 0; @@ -638,14 +639,14 @@ int Visualizer_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize, } else { pIntReplyData[MEASUREMENT_IDX_PEAK] = (int32_t) (2000 * log10(peakU16 / 32767.0f)); } - ALOGV("VISUALIZER_CMD_MEASURE peak=%d (%dmB), rms=%.1f (%dmB)", + ALOGV("VISUALIZER_CMD_MEASURE peak=%" PRIu16 " (%" PRId32 "mB), rms=%.1f (%" PRId32 "mB)", peakU16, pIntReplyData[MEASUREMENT_IDX_PEAK], rms, pIntReplyData[MEASUREMENT_IDX_RMS]); } break; default: - ALOGW("Visualizer_command invalid command %d",cmdCode); + ALOGW("Visualizer_command invalid command %" PRIu32, cmdCode); return -EINVAL; } |