Merge "Added damr box for AMR (NB and WB) sample entry" into gingerbread
diff --git a/camera/Camera.cpp b/camera/Camera.cpp
index 0037399..7efc6d7 100644
--- a/camera/Camera.cpp
+++ b/camera/Camera.cpp
@@ -1,7 +1,6 @@
/*
**
** Copyright (C) 2008, The Android Open Source Project
-** Copyright (C) 2008 HTC Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
diff --git a/include/camera/Camera.h b/include/camera/Camera.h
index 9974f2f..964700b 100644
--- a/include/camera/Camera.h
+++ b/include/camera/Camera.h
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2008 The Android Open Source Project
- * Copyright (C) 2008 HTC Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/include/media/IMediaRecorder.h b/include/media/IMediaRecorder.h
index cfc17a5..54adca8 100644
--- a/include/media/IMediaRecorder.h
+++ b/include/media/IMediaRecorder.h
@@ -1,6 +1,6 @@
/*
**
- ** Copyright 2008, HTC Inc.
+ ** Copyright 2008, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
diff --git a/include/media/PVMediaRecorder.h b/include/media/PVMediaRecorder.h
index f75d80d..c091c39 100644
--- a/include/media/PVMediaRecorder.h
+++ b/include/media/PVMediaRecorder.h
@@ -1,6 +1,6 @@
/*
**
- ** Copyright 2008, HTC Inc.
+ ** Copyright 2008, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
diff --git a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
index 4c3ebca..a70bdff 100644
--- a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
+++ b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
@@ -1848,6 +1848,8 @@
case EQ_PARAM_NUM_BANDS:
case EQ_PARAM_CUR_PRESET:
case EQ_PARAM_GET_NUM_OF_PRESETS:
+ case EQ_PARAM_BAND_LEVEL:
+ case EQ_PARAM_GET_BAND:
if (*pValueSize < sizeof(int16_t)) {
LOGV("\tLVM_ERROR : Equalizer_getParameter() invalid pValueSize 1 %d", *pValueSize);
return -EINVAL;
@@ -1856,6 +1858,13 @@
break;
case EQ_PARAM_LEVEL_RANGE:
+ if (*pValueSize < 2 * sizeof(int16_t)) {
+ LOGV("\tLVM_ERROR : Equalizer_getParameter() invalid pValueSize 2 %d", *pValueSize);
+ return -EINVAL;
+ }
+ *pValueSize = 2 * sizeof(int16_t);
+ break;
+
case EQ_PARAM_BAND_FREQ_RANGE:
if (*pValueSize < 2 * sizeof(int32_t)) {
LOGV("\tLVM_ERROR : Equalizer_getParameter() invalid pValueSize 2 %d", *pValueSize);
@@ -1863,8 +1872,7 @@
}
*pValueSize = 2 * sizeof(int32_t);
break;
- case EQ_PARAM_BAND_LEVEL:
- case EQ_PARAM_GET_BAND:
+
case EQ_PARAM_CENTER_FREQ:
if (*pValueSize < sizeof(int32_t)) {
LOGV("\tLVM_ERROR : Equalizer_getParameter() invalid pValueSize 1 %d", *pValueSize);
@@ -1891,13 +1899,13 @@
switch (param) {
case EQ_PARAM_NUM_BANDS:
- *(int16_t *)pValue = FIVEBAND_NUMBANDS;
+ *(uint16_t *)pValue = (uint16_t)FIVEBAND_NUMBANDS;
//LOGV("\tEqualizer_getParameter() EQ_PARAM_NUM_BANDS %d", *(int16_t *)pValue);
break;
case EQ_PARAM_LEVEL_RANGE:
- *(int32_t *)pValue = -1500;
- *((int32_t *)pValue + 1) = 1500;
+ *(int16_t *)pValue = -1500;
+ *((int16_t *)pValue + 1) = 1500;
//LOGV("\tEqualizer_getParameter() EQ_PARAM_LEVEL_RANGE min %d, max %d",
// *(int32_t *)pValue, *((int32_t *)pValue + 1));
break;
@@ -1908,7 +1916,7 @@
status = -EINVAL;
break;
}
- *(int32_t *)pValue = EqualizerGetBandLevel(pContext, param2);
+ *(int16_t *)pValue = (int16_t)EqualizerGetBandLevel(pContext, param2);
//LOGV("\tEqualizer_getParameter() EQ_PARAM_BAND_LEVEL band %d, level %d",
// param2, *(int32_t *)pValue);
break;
@@ -1937,18 +1945,18 @@
case EQ_PARAM_GET_BAND:
param2 = *pParam;
- *(int32_t *)pValue = EqualizerGetBand(pContext, param2);
+ *(uint16_t *)pValue = (uint16_t)EqualizerGetBand(pContext, param2);
//LOGV("\tEqualizer_getParameter() EQ_PARAM_GET_BAND frequency %d, band %d",
// param2, *(int32_t *)pValue);
break;
case EQ_PARAM_CUR_PRESET:
- *(int16_t *)pValue = EqualizerGetPreset(pContext);
+ *(uint16_t *)pValue = (uint16_t)EqualizerGetPreset(pContext);
//LOGV("\tEqualizer_getParameter() EQ_PARAM_CUR_PRESET %d", *(int32_t *)pValue);
break;
case EQ_PARAM_GET_NUM_OF_PRESETS:
- *(int16_t *)pValue = EqualizerGetNumPresets();
+ *(uint16_t *)pValue = (uint16_t)EqualizerGetNumPresets();
//LOGV("\tEqualizer_getParameter() EQ_PARAM_GET_NUM_OF_PRESETS %d", *(int16_t *)pValue);
break;
@@ -1968,12 +1976,12 @@
break;
case EQ_PARAM_PROPERTIES: {
- uint16_t *p = (uint16_t *)pValue;
+ int16_t *p = (int16_t *)pValue;
LOGV("\tEqualizer_getParameter() EQ_PARAM_PROPERTIES");
- p[0] = EqualizerGetPreset(pContext);
- p[1] = FIVEBAND_NUMBANDS;
+ p[0] = (int16_t)EqualizerGetPreset(pContext);
+ p[1] = (int16_t)FIVEBAND_NUMBANDS;
for (int i = 0; i < FIVEBAND_NUMBANDS; i++) {
- p[2 + i] = EqualizerGetBandLevel(pContext, i);
+ p[2 + i] = (int16_t)EqualizerGetBandLevel(pContext, i);
}
} break;
@@ -2011,7 +2019,7 @@
//LOGV("\tEqualizer_setParameter start");
switch (param) {
case EQ_PARAM_CUR_PRESET:
- preset = *(int16_t *)pValue;
+ preset = (int32_t)(*(uint16_t *)pValue);
//LOGV("\tEqualizer_setParameter() EQ_PARAM_CUR_PRESET %d", preset);
if ((preset >= EqualizerGetNumPresets())||(preset < 0)) {
@@ -2022,7 +2030,7 @@
break;
case EQ_PARAM_BAND_LEVEL:
band = *pParam;
- level = *(int32_t *)pValue;
+ level = (int32_t)(*(int16_t *)pValue);
//LOGV("\tEqualizer_setParameter() EQ_PARAM_BAND_LEVEL band %d, level %d", band, level);
if (band >= FIVEBAND_NUMBANDS) {
status = -EINVAL;
@@ -2030,8 +2038,28 @@
}
EqualizerSetBandLevel(pContext, band, level);
break;
+ case EQ_PARAM_PROPERTIES: {
+ //LOGV("\tEqualizer_setParameter() EQ_PARAM_PROPERTIES");
+ int16_t *p = (int16_t *)pValue;
+ if ((int)p[0] >= EqualizerGetNumPresets()) {
+ status = -EINVAL;
+ break;
+ }
+ if (p[0] >= 0) {
+ EqualizerSetPreset(pContext, (int)p[0]);
+ } else {
+ if ((int)p[1] != FIVEBAND_NUMBANDS) {
+ status = -EINVAL;
+ break;
+ }
+ for (int i = 0; i < FIVEBAND_NUMBANDS; i++) {
+ EqualizerSetBandLevel(pContext, i, (int)p[2 + i]);
+ }
+ }
+ } break;
default:
LOGV("\tLVM_ERROR : setParameter() invalid param %d", param);
+ status = -EINVAL;
break;
}
diff --git a/media/libeffects/testlibs/EffectEqualizer.cpp b/media/libeffects/testlibs/EffectEqualizer.cpp
index a71f236..f8e4357 100644
--- a/media/libeffects/testlibs/EffectEqualizer.cpp
+++ b/media/libeffects/testlibs/EffectEqualizer.cpp
@@ -350,6 +350,8 @@
case EQ_PARAM_NUM_BANDS:
case EQ_PARAM_CUR_PRESET:
case EQ_PARAM_GET_NUM_OF_PRESETS:
+ case EQ_PARAM_BAND_LEVEL:
+ case EQ_PARAM_GET_BAND:
if (*pValueSize < sizeof(int16_t)) {
return -EINVAL;
}
@@ -357,14 +359,19 @@
break;
case EQ_PARAM_LEVEL_RANGE:
+ if (*pValueSize < 2 * sizeof(int16_t)) {
+ return -EINVAL;
+ }
+ *pValueSize = 2 * sizeof(int16_t);
+ break;
+
case EQ_PARAM_BAND_FREQ_RANGE:
if (*pValueSize < 2 * sizeof(int32_t)) {
return -EINVAL;
}
*pValueSize = 2 * sizeof(int32_t);
break;
- case EQ_PARAM_BAND_LEVEL:
- case EQ_PARAM_GET_BAND:
+
case EQ_PARAM_CENTER_FREQ:
if (*pValueSize < sizeof(int32_t)) {
return -EINVAL;
@@ -375,19 +382,26 @@
case EQ_PARAM_GET_PRESET_NAME:
break;
+ case EQ_PARAM_PROPERTIES:
+ if (*pValueSize < (2 + kNumBands) * sizeof(uint16_t)) {
+ return -EINVAL;
+ }
+ *pValueSize = (2 + kNumBands) * sizeof(uint16_t);
+ break;
+
default:
return -EINVAL;
}
switch (param) {
case EQ_PARAM_NUM_BANDS:
- *(int16_t *)pValue = kNumBands;
+ *(uint16_t *)pValue = (uint16_t)kNumBands;
LOGV("Equalizer_getParameter() EQ_PARAM_NUM_BANDS %d", *(int16_t *)pValue);
break;
case EQ_PARAM_LEVEL_RANGE:
- *(int32_t *)pValue = -9600;
- *((int32_t *)pValue + 1) = 4800;
+ *(int16_t *)pValue = -9600;
+ *((int16_t *)pValue + 1) = 4800;
LOGV("Equalizer_getParameter() EQ_PARAM_LEVEL_RANGE min %d, max %d", *(int32_t *)pValue, *((int32_t *)pValue + 1));
break;
@@ -397,7 +411,7 @@
status = -EINVAL;
break;
}
- *(int32_t *)pValue = pEqualizer->getGain(param2);
+ *(int16_t *)pValue = (int16_t)pEqualizer->getGain(param2);
LOGV("Equalizer_getParameter() EQ_PARAM_BAND_LEVEL band %d, level %d", param2, *(int32_t *)pValue);
break;
@@ -423,17 +437,17 @@
case EQ_PARAM_GET_BAND:
param2 = *pParam;
- *(int32_t *)pValue = pEqualizer->getMostRelevantBand(param2);
+ *(uint16_t *)pValue = (uint16_t)pEqualizer->getMostRelevantBand(param2);
LOGV("Equalizer_getParameter() EQ_PARAM_GET_BAND frequency %d, band %d", param2, *(int32_t *)pValue);
break;
case EQ_PARAM_CUR_PRESET:
- *(int16_t *)pValue = pEqualizer->getPreset();
+ *(uint16_t *)pValue = (uint16_t)pEqualizer->getPreset();
LOGV("Equalizer_getParameter() EQ_PARAM_CUR_PRESET %d", *(int32_t *)pValue);
break;
case EQ_PARAM_GET_NUM_OF_PRESETS:
- *(int16_t *)pValue = pEqualizer->getNumPresets();
+ *(uint16_t *)pValue = (uint16_t)pEqualizer->getNumPresets();
LOGV("Equalizer_getParameter() EQ_PARAM_GET_NUM_OF_PRESETS %d", *(int16_t *)pValue);
break;
@@ -450,6 +464,16 @@
LOGV("Equalizer_getParameter() EQ_PARAM_GET_PRESET_NAME preset %d, name %s len %d", param2, gEqualizerPresets[param2].name, *pValueSize);
break;
+ case EQ_PARAM_PROPERTIES: {
+ int16_t *p = (int16_t *)pValue;
+ LOGV("Equalizer_getParameter() EQ_PARAM_PROPERTIES");
+ p[0] = (int16_t)pEqualizer->getPreset();
+ p[1] = (int16_t)kNumBands;
+ for (int i = 0; i < kNumBands; i++) {
+ p[2 + i] = (int16_t)pEqualizer->getGain(i);
+ }
+ } break;
+
default:
LOGV("Equalizer_getParameter() invalid param %d", param);
status = -EINVAL;
@@ -489,10 +513,10 @@
switch (param) {
case EQ_PARAM_CUR_PRESET:
- preset = *(int16_t *)pValue;
+ preset = (int32_t)(*(uint16_t *)pValue);
LOGV("setParameter() EQ_PARAM_CUR_PRESET %d", preset);
- if (preset >= pEqualizer->getNumPresets()) {
+ if (preset < 0 || preset >= pEqualizer->getNumPresets()) {
status = -EINVAL;
break;
}
@@ -501,7 +525,7 @@
break;
case EQ_PARAM_BAND_LEVEL:
band = *pParam;
- level = *(int32_t *)pValue;
+ level = (int32_t)(*(int16_t *)pValue);
LOGV("setParameter() EQ_PARAM_BAND_LEVEL band %d, level %d", band, level);
if (band >= kNumBands) {
status = -EINVAL;
@@ -510,8 +534,29 @@
pEqualizer->setGain(band, level);
pEqualizer->commit(true);
break;
+ case EQ_PARAM_PROPERTIES: {
+ LOGV("setParameter() EQ_PARAM_PROPERTIES");
+ int16_t *p = (int16_t *)pValue;
+ if ((int)p[0] >= pEqualizer->getNumPresets()) {
+ status = -EINVAL;
+ break;
+ }
+ if (p[0] >= 0) {
+ pEqualizer->setPreset((int)p[0]);
+ } else {
+ if ((int)p[1] != kNumBands) {
+ status = -EINVAL;
+ break;
+ }
+ for (int i = 0; i < kNumBands; i++) {
+ pEqualizer->setGain(i, (int32_t)p[2 + i]);
+ }
+ }
+ pEqualizer->commit(true);
+ } break;
default:
LOGV("setParameter() invalid param %d", param);
+ status = -EINVAL;
break;
}
diff --git a/media/libmedia/IMediaRecorder.cpp b/media/libmedia/IMediaRecorder.cpp
index 9fe207c..4eb63e8 100644
--- a/media/libmedia/IMediaRecorder.cpp
+++ b/media/libmedia/IMediaRecorder.cpp
@@ -1,6 +1,6 @@
/*
**
- ** Copyright 2008, HTC Inc.
+ ** Copyright 2008, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
diff --git a/media/libmediaplayerservice/MediaRecorderClient.cpp b/media/libmediaplayerservice/MediaRecorderClient.cpp
index fef3e6e..73862c3 100644
--- a/media/libmediaplayerservice/MediaRecorderClient.cpp
+++ b/media/libmediaplayerservice/MediaRecorderClient.cpp
@@ -1,5 +1,5 @@
/*
- ** Copyright 2008, HTC Inc.
+ ** Copyright 2008, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
diff --git a/media/libmediaplayerservice/MediaRecorderClient.h b/media/libmediaplayerservice/MediaRecorderClient.h
index d12e558..1d1913d 100644
--- a/media/libmediaplayerservice/MediaRecorderClient.h
+++ b/media/libmediaplayerservice/MediaRecorderClient.h
@@ -1,6 +1,6 @@
/*
**
- ** Copyright 2008, HTC Inc.
+ ** Copyright 2008, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp
index f26676d..c40d285 100644
--- a/media/libmediaplayerservice/StagefrightRecorder.cpp
+++ b/media/libmediaplayerservice/StagefrightRecorder.cpp
@@ -344,7 +344,7 @@
status_t StagefrightRecorder::setParamMaxFileDurationUs(int64_t timeUs) {
LOGV("setParamMaxFileDurationUs: %lld us", timeUs);
- if (timeUs <= 1000000LL) { // XXX: 1 second
+ if (timeUs <= 100000LL) { // XXX: 100 milli-seconds
LOGE("Max file duration is too short: %lld us", timeUs);
return BAD_VALUE;
}
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index c786f94..3b3904a 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -1,7 +1,6 @@
/*
**
** Copyright (C) 2008, The Android Open Source Project
-** Copyright (C) 2008 HTC Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index b0b2d7a..77ccf41 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -1,7 +1,6 @@
/*
**
** Copyright (C) 2008, The Android Open Source Project
-** Copyright (C) 2008 HTC Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.