Merge "Audio effects: modified command() parameter types." into gingerbread
This commit is contained in:
@@ -382,10 +382,10 @@ public:
|
||||
* See EffectApi.h for details on effect command() function, valid command codes
|
||||
* and formats.
|
||||
*/
|
||||
virtual status_t command(int32_t cmdCode,
|
||||
int32_t cmdSize,
|
||||
virtual status_t command(uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *cmdData,
|
||||
int32_t *replySize,
|
||||
uint32_t *replySize,
|
||||
void *replyData);
|
||||
|
||||
|
||||
@@ -429,10 +429,10 @@ private:
|
||||
virtual void enableStatusChanged(bool enabled) {
|
||||
mEffect->enableStatusChanged(enabled);
|
||||
}
|
||||
virtual void commandExecuted(int cmdCode,
|
||||
int cmdSize,
|
||||
virtual void commandExecuted(uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *pCmdData,
|
||||
int replySize,
|
||||
uint32_t replySize,
|
||||
void *pReplyData) {
|
||||
mEffect->commandExecuted(cmdCode, cmdSize, pCmdData, replySize, pReplyData);
|
||||
}
|
||||
@@ -450,7 +450,11 @@ private:
|
||||
// IEffectClient
|
||||
void controlStatusChanged(bool controlGranted);
|
||||
void enableStatusChanged(bool enabled);
|
||||
void commandExecuted(int cmdCode, int cmdSize, void *pCmdData, int replySize, void *pReplyData);
|
||||
void commandExecuted(uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *pCmdData,
|
||||
uint32_t replySize,
|
||||
void *pReplyData);
|
||||
void binderDied();
|
||||
|
||||
|
||||
|
||||
@@ -284,10 +284,10 @@ typedef int32_t (*effect_process_t)(effect_interface_t self,
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
typedef int32_t (*effect_command_t)(effect_interface_t self,
|
||||
int32_t cmdCode,
|
||||
int32_t cmdSize,
|
||||
uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *pCmdData,
|
||||
int32_t *replySize,
|
||||
uint32_t *replySize,
|
||||
void *pReplyData);
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,11 @@ public:
|
||||
|
||||
virtual status_t disable() = 0;
|
||||
|
||||
virtual status_t command(int cmdCode, int cmdSize, void *pCmdData, int *pReplySize, void *pReplyData) = 0;
|
||||
virtual status_t command(uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *pCmdData,
|
||||
uint32_t *pReplySize,
|
||||
void *pReplyData) = 0;
|
||||
|
||||
virtual void disconnect() = 0;
|
||||
|
||||
|
||||
@@ -31,7 +31,11 @@ public:
|
||||
|
||||
virtual void controlStatusChanged(bool controlGranted) = 0;
|
||||
virtual void enableStatusChanged(bool enabled) = 0;
|
||||
virtual void commandExecuted(int cmdCode, int cmdSize, void *pCmdData, int replySize, void *pReplyData) = 0;
|
||||
virtual void commandExecuted(uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *pCmdData,
|
||||
uint32_t replySize,
|
||||
void *pReplyData) = 0;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@@ -698,8 +698,11 @@ static jint android_media_AudioEffect_native_command(JNIEnv *env, jobject thiz,
|
||||
}
|
||||
}
|
||||
|
||||
lStatus = translateError(lpAudioEffect->command(cmdCode, cmdSize, pCmdData,
|
||||
pReplySize, pReplyData));
|
||||
lStatus = translateError(lpAudioEffect->command((uint32_t)cmdCode,
|
||||
(uint32_t)cmdSize,
|
||||
pCmdData,
|
||||
(uint32_t *)pReplySize,
|
||||
pReplyData));
|
||||
|
||||
command_Exit:
|
||||
|
||||
|
||||
@@ -73,7 +73,12 @@ int Effect_Process(effect_interface_t self, audio_buffer_t *inBuffer, audio_buff
|
||||
return ret;
|
||||
}
|
||||
|
||||
int Effect_Command(effect_interface_t self, int cmdCode, int cmdSize, void *pCmdData, int *replySize, void *pReplyData)
|
||||
int Effect_Command(effect_interface_t self,
|
||||
uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *pCmdData,
|
||||
uint32_t *replySize,
|
||||
void *pReplyData)
|
||||
{
|
||||
int ret = init();
|
||||
if (ret < 0) {
|
||||
|
||||
@@ -2348,10 +2348,10 @@ extern "C" int Effect_process(effect_interface_t self,
|
||||
|
||||
/* Effect Control Interface Implementation: Command */
|
||||
extern "C" int Effect_command(effect_interface_t self,
|
||||
int cmdCode,
|
||||
int cmdSize,
|
||||
uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *pCmdData,
|
||||
int *replySize,
|
||||
uint32_t *replySize,
|
||||
void *pReplyData){
|
||||
EffectContext * pContext = (EffectContext *) self;
|
||||
int retsize;
|
||||
|
||||
@@ -551,8 +551,8 @@ extern "C" int Equalizer_process(effect_interface_t self, audio_buffer_t *inBuff
|
||||
return 0;
|
||||
} // end Equalizer_process
|
||||
|
||||
extern "C" int Equalizer_command(effect_interface_t self, int cmdCode, int cmdSize,
|
||||
void *pCmdData, int *replySize, void *pReplyData) {
|
||||
extern "C" int Equalizer_command(effect_interface_t self, uint32_t cmdCode, uint32_t cmdSize,
|
||||
void *pCmdData, uint32_t *replySize, void *pReplyData) {
|
||||
|
||||
android::EqualizerContext * pContext = (android::EqualizerContext *) self;
|
||||
int retsize;
|
||||
|
||||
@@ -270,8 +270,8 @@ static int Reverb_Process(effect_interface_t self, audio_buffer_t *inBuffer, aud
|
||||
}
|
||||
|
||||
|
||||
static int Reverb_Command(effect_interface_t self, int cmdCode, int cmdSize,
|
||||
void *pCmdData, int *replySize, void *pReplyData) {
|
||||
static int Reverb_Command(effect_interface_t self, uint32_t cmdCode, uint32_t cmdSize,
|
||||
void *pCmdData, uint32_t *replySize, void *pReplyData) {
|
||||
reverb_module_t *pRvbModule = (reverb_module_t *) self;
|
||||
reverb_object_t *pReverb;
|
||||
int retsize;
|
||||
|
||||
@@ -301,12 +301,23 @@ typedef struct reverb_module_s {
|
||||
*------------------------------------
|
||||
*/
|
||||
int EffectQueryNumberEffects(uint32_t *pNumEffects);
|
||||
int EffectQueryEffect(uint32_t index, effect_descriptor_t *pDescriptor);
|
||||
int EffectCreate(effect_uuid_t *effectUID, int32_t sessionId, int32_t ioId, effect_interface_t *pInterface);
|
||||
int EffectQueryEffect(uint32_t index,
|
||||
effect_descriptor_t *pDescriptor);
|
||||
int EffectCreate(effect_uuid_t *effectUID,
|
||||
int32_t sessionId,
|
||||
int32_t ioId,
|
||||
effect_interface_t *pInterface);
|
||||
int EffectRelease(effect_interface_t interface);
|
||||
|
||||
static int Reverb_Process(effect_interface_t self, audio_buffer_t *inBuffer, audio_buffer_t *outBuffer);
|
||||
static int Reverb_Command(effect_interface_t self, int cmdCode, int cmdSize, void *pCmdData, int *replySize, void *pReplyData);
|
||||
static int Reverb_Process(effect_interface_t self,
|
||||
audio_buffer_t *inBuffer,
|
||||
audio_buffer_t *outBuffer);
|
||||
static int Reverb_Command(effect_interface_t self,
|
||||
uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *pCmdData,
|
||||
uint32_t *replySize,
|
||||
void *pReplyData);
|
||||
|
||||
|
||||
/*------------------------------------
|
||||
|
||||
@@ -272,8 +272,8 @@ extern "C" int Visualizer_process(
|
||||
return 0;
|
||||
} // end Visualizer_process
|
||||
|
||||
extern "C" int Visualizer_command(effect_interface_t self, int cmdCode, int cmdSize,
|
||||
void *pCmdData, int *replySize, void *pReplyData) {
|
||||
extern "C" int Visualizer_command(effect_interface_t self, uint32_t cmdCode, uint32_t cmdSize,
|
||||
void *pCmdData, uint32_t *replySize, void *pReplyData) {
|
||||
|
||||
android::VisualizerContext * pContext = (android::VisualizerContext *)self;
|
||||
int retsize;
|
||||
|
||||
@@ -221,7 +221,11 @@ status_t AudioEffect::setEnabled(bool enabled)
|
||||
return INVALID_OPERATION;
|
||||
}
|
||||
|
||||
status_t AudioEffect::command(int32_t cmdCode, int32_t cmdSize, void *cmdData, int32_t *replySize, void *replyData)
|
||||
status_t AudioEffect::command(uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *cmdData,
|
||||
uint32_t *replySize,
|
||||
void *replyData)
|
||||
{
|
||||
if (mStatus != NO_ERROR && mStatus != ALREADY_EXISTS) {
|
||||
return INVALID_OPERATION;
|
||||
@@ -241,8 +245,8 @@ status_t AudioEffect::setParameter(effect_param_t *param)
|
||||
return BAD_VALUE;
|
||||
}
|
||||
|
||||
int size = sizeof(int);
|
||||
int psize = ((param->psize - 1) / sizeof(int) + 1) * sizeof(int) + param->vsize;
|
||||
uint32_t size = sizeof(int);
|
||||
uint32_t psize = ((param->psize - 1) / sizeof(int) + 1) * sizeof(int) + param->vsize;
|
||||
|
||||
LOGV("setParameter: param: %d, param2: %d", *(int *)param->data, (param->psize == 8) ? *((int *)param->data + 1): -1);
|
||||
|
||||
@@ -285,7 +289,7 @@ status_t AudioEffect::setParameterCommit()
|
||||
if (mCblk->clientIndex == 0) {
|
||||
return INVALID_OPERATION;
|
||||
}
|
||||
int size = 0;
|
||||
uint32_t size = 0;
|
||||
return mIEffect->command(EFFECT_CMD_SET_PARAM_COMMIT, 0, NULL, &size, NULL);
|
||||
}
|
||||
|
||||
@@ -301,7 +305,7 @@ status_t AudioEffect::getParameter(effect_param_t *param)
|
||||
|
||||
LOGV("getParameter: param: %d, param2: %d", *(int *)param->data, (param->psize == 8) ? *((int *)param->data + 1): -1);
|
||||
|
||||
int psize = sizeof(effect_param_t) + ((param->psize - 1) / sizeof(int) + 1) * sizeof(int) + param->vsize;
|
||||
uint32_t psize = sizeof(effect_param_t) + ((param->psize - 1) / sizeof(int) + 1) * sizeof(int) + param->vsize;
|
||||
|
||||
return mIEffect->command(EFFECT_CMD_GET_PARAM, sizeof(effect_param_t) + param->psize, param, &psize, param);
|
||||
}
|
||||
@@ -350,7 +354,11 @@ void AudioEffect::enableStatusChanged(bool enabled)
|
||||
}
|
||||
}
|
||||
|
||||
void AudioEffect::commandExecuted(int cmdCode, int cmdSize, void *cmdData, int replySize, void *replyData)
|
||||
void AudioEffect::commandExecuted(uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *cmdData,
|
||||
uint32_t replySize,
|
||||
void *replyData)
|
||||
{
|
||||
if (cmdData == NULL || replyData == NULL) {
|
||||
return;
|
||||
|
||||
@@ -59,7 +59,11 @@ public:
|
||||
return reply.readInt32();
|
||||
}
|
||||
|
||||
status_t command(int cmdCode, int cmdSize, void *pCmdData, int *pReplySize, void *pReplyData)
|
||||
status_t command(uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *pCmdData,
|
||||
uint32_t *pReplySize,
|
||||
void *pReplyData)
|
||||
{
|
||||
LOGV("command");
|
||||
Parcel data, reply;
|
||||
@@ -136,15 +140,15 @@ status_t BnEffect::onTransact(
|
||||
case COMMAND: {
|
||||
LOGV("COMMAND");
|
||||
CHECK_INTERFACE(IEffect, data, reply);
|
||||
int cmdCode = data.readInt32();
|
||||
int cmdSize = data.readInt32();
|
||||
uint32_t cmdCode = data.readInt32();
|
||||
uint32_t cmdSize = data.readInt32();
|
||||
char *cmd = NULL;
|
||||
if (cmdSize) {
|
||||
cmd = (char *)malloc(cmdSize);
|
||||
data.read(cmd, cmdSize);
|
||||
}
|
||||
int replySize = data.readInt32();
|
||||
int replySz = replySize;
|
||||
uint32_t replySize = data.readInt32();
|
||||
uint32_t replySz = replySize;
|
||||
char *resp = NULL;
|
||||
if (replySize) {
|
||||
resp = (char *)malloc(replySize);
|
||||
|
||||
@@ -56,7 +56,11 @@ public:
|
||||
remote()->transact(ENABLE_STATUS_CHANGED, data, &reply, IBinder::FLAG_ONEWAY);
|
||||
}
|
||||
|
||||
void commandExecuted(int cmdCode, int cmdSize, void *pCmdData, int replySize, void *pReplyData)
|
||||
void commandExecuted(uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *pCmdData,
|
||||
uint32_t replySize,
|
||||
void *pReplyData)
|
||||
{
|
||||
LOGV("commandExecuted");
|
||||
Parcel data, reply;
|
||||
@@ -108,14 +112,14 @@ status_t BnEffectClient::onTransact(
|
||||
case COMMAND_EXECUTED: {
|
||||
LOGV("COMMAND_EXECUTED");
|
||||
CHECK_INTERFACE(IEffectClient, data, reply);
|
||||
int cmdCode = data.readInt32();
|
||||
int cmdSize = data.readInt32();
|
||||
uint32_t cmdCode = data.readInt32();
|
||||
uint32_t cmdSize = data.readInt32();
|
||||
char *cmd = NULL;
|
||||
if (cmdSize) {
|
||||
cmd = (char *)malloc(cmdSize);
|
||||
data.read(cmd, cmdSize);
|
||||
}
|
||||
int replySize = data.readInt32();
|
||||
uint32_t replySize = data.readInt32();
|
||||
char *resp = NULL;
|
||||
if (replySize) {
|
||||
resp = (char *)malloc(replySize);
|
||||
|
||||
@@ -184,7 +184,7 @@ status_t Visualizer::getWaveForm(uint8_t *waveform)
|
||||
|
||||
status_t status = NO_ERROR;
|
||||
if (mEnabled) {
|
||||
int32_t replySize = mCaptureSize;
|
||||
uint32_t replySize = mCaptureSize;
|
||||
status_t status = command(VISU_CMD_CAPTURE, 0, NULL, &replySize, waveform);
|
||||
if (replySize == 0) {
|
||||
status = NOT_ENOUGH_DATA;
|
||||
|
||||
@@ -5408,8 +5408,13 @@ status_t AudioFlinger::EffectModule::configure()
|
||||
this, thread.get(), mConfig.inputCfg.buffer.raw, mConfig.inputCfg.buffer.frameCount);
|
||||
|
||||
status_t cmdStatus;
|
||||
int size = sizeof(int);
|
||||
status_t status = (*mEffectInterface)->command(mEffectInterface, EFFECT_CMD_CONFIGURE, sizeof(effect_config_t), &mConfig, &size, &cmdStatus);
|
||||
uint32_t size = sizeof(int);
|
||||
status_t status = (*mEffectInterface)->command(mEffectInterface,
|
||||
EFFECT_CMD_CONFIGURE,
|
||||
sizeof(effect_config_t),
|
||||
&mConfig,
|
||||
&size,
|
||||
&cmdStatus);
|
||||
if (status == 0) {
|
||||
status = cmdStatus;
|
||||
}
|
||||
@@ -5427,8 +5432,13 @@ status_t AudioFlinger::EffectModule::init()
|
||||
return NO_INIT;
|
||||
}
|
||||
status_t cmdStatus;
|
||||
int size = sizeof(status_t);
|
||||
status_t status = (*mEffectInterface)->command(mEffectInterface, EFFECT_CMD_INIT, 0, NULL, &size, &cmdStatus);
|
||||
uint32_t size = sizeof(status_t);
|
||||
status_t status = (*mEffectInterface)->command(mEffectInterface,
|
||||
EFFECT_CMD_INIT,
|
||||
0,
|
||||
NULL,
|
||||
&size,
|
||||
&cmdStatus);
|
||||
if (status == 0) {
|
||||
status = cmdStatus;
|
||||
}
|
||||
@@ -5441,8 +5451,13 @@ status_t AudioFlinger::EffectModule::start_l()
|
||||
return NO_INIT;
|
||||
}
|
||||
status_t cmdStatus;
|
||||
int size = sizeof(status_t);
|
||||
status_t status = (*mEffectInterface)->command(mEffectInterface, EFFECT_CMD_ENABLE, 0, NULL, &size, &cmdStatus);
|
||||
uint32_t size = sizeof(status_t);
|
||||
status_t status = (*mEffectInterface)->command(mEffectInterface,
|
||||
EFFECT_CMD_ENABLE,
|
||||
0,
|
||||
NULL,
|
||||
&size,
|
||||
&cmdStatus);
|
||||
if (status == 0) {
|
||||
status = cmdStatus;
|
||||
}
|
||||
@@ -5455,15 +5470,24 @@ status_t AudioFlinger::EffectModule::stop_l()
|
||||
return NO_INIT;
|
||||
}
|
||||
status_t cmdStatus;
|
||||
int size = sizeof(status_t);
|
||||
status_t status = (*mEffectInterface)->command(mEffectInterface, EFFECT_CMD_DISABLE, 0, NULL, &size, &cmdStatus);
|
||||
uint32_t size = sizeof(status_t);
|
||||
status_t status = (*mEffectInterface)->command(mEffectInterface,
|
||||
EFFECT_CMD_DISABLE,
|
||||
0,
|
||||
NULL,
|
||||
&size,
|
||||
&cmdStatus);
|
||||
if (status == 0) {
|
||||
status = cmdStatus;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
status_t AudioFlinger::EffectModule::command(int cmdCode, int cmdSize, void *pCmdData, int *replySize, void *pReplyData)
|
||||
status_t AudioFlinger::EffectModule::command(uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *pCmdData,
|
||||
uint32_t *replySize,
|
||||
void *pReplyData)
|
||||
{
|
||||
Mutex::Autolock _l(mLock);
|
||||
// LOGV("command(), cmdCode: %d, mEffectInterface: %p", cmdCode, mEffectInterface);
|
||||
@@ -5471,9 +5495,14 @@ status_t AudioFlinger::EffectModule::command(int cmdCode, int cmdSize, void *pCm
|
||||
if (mEffectInterface == NULL) {
|
||||
return NO_INIT;
|
||||
}
|
||||
status_t status = (*mEffectInterface)->command(mEffectInterface, cmdCode, cmdSize, pCmdData, replySize, pReplyData);
|
||||
status_t status = (*mEffectInterface)->command(mEffectInterface,
|
||||
cmdCode,
|
||||
cmdSize,
|
||||
pCmdData,
|
||||
replySize,
|
||||
pReplyData);
|
||||
if (cmdCode != EFFECT_CMD_GET_PARAM && status == NO_ERROR) {
|
||||
int size = (replySize == NULL) ? 0 : *replySize;
|
||||
uint32_t size = (replySize == NULL) ? 0 : *replySize;
|
||||
for (size_t i = 1; i < mHandles.size(); i++) {
|
||||
sp<EffectHandle> h = mHandles[i].promote();
|
||||
if (h != 0) {
|
||||
@@ -5549,13 +5578,18 @@ status_t AudioFlinger::EffectModule::setVolume(uint32_t *left, uint32_t *right,
|
||||
status_t cmdStatus;
|
||||
uint32_t volume[2];
|
||||
uint32_t *pVolume = NULL;
|
||||
int size = sizeof(volume);
|
||||
uint32_t size = sizeof(volume);
|
||||
volume[0] = *left;
|
||||
volume[1] = *right;
|
||||
if (controller) {
|
||||
pVolume = volume;
|
||||
}
|
||||
status = (*mEffectInterface)->command(mEffectInterface, EFFECT_CMD_SET_VOLUME, size, volume, &size, pVolume);
|
||||
status = (*mEffectInterface)->command(mEffectInterface,
|
||||
EFFECT_CMD_SET_VOLUME,
|
||||
size,
|
||||
volume,
|
||||
&size,
|
||||
pVolume);
|
||||
if (controller && status == NO_ERROR && size == sizeof(volume)) {
|
||||
*left = volume[0];
|
||||
*right = volume[1];
|
||||
@@ -5575,8 +5609,13 @@ status_t AudioFlinger::EffectModule::setDevice(uint32_t device)
|
||||
return BAD_VALUE;
|
||||
}
|
||||
status_t cmdStatus;
|
||||
int size = sizeof(status_t);
|
||||
status = (*mEffectInterface)->command(mEffectInterface, EFFECT_CMD_SET_DEVICE, sizeof(uint32_t), &device, &size, &cmdStatus);
|
||||
uint32_t size = sizeof(status_t);
|
||||
status = (*mEffectInterface)->command(mEffectInterface,
|
||||
EFFECT_CMD_SET_DEVICE,
|
||||
sizeof(uint32_t),
|
||||
&device,
|
||||
&size,
|
||||
&cmdStatus);
|
||||
if (status == NO_ERROR) {
|
||||
status = cmdStatus;
|
||||
}
|
||||
@@ -5595,8 +5634,13 @@ status_t AudioFlinger::EffectModule::setMode(uint32_t mode)
|
||||
return BAD_VALUE;
|
||||
}
|
||||
status_t cmdStatus;
|
||||
int size = sizeof(status_t);
|
||||
status = (*mEffectInterface)->command(mEffectInterface, EFFECT_CMD_SET_AUDIO_MODE, sizeof(int), &effectMode, &size, &cmdStatus);
|
||||
uint32_t size = sizeof(status_t);
|
||||
status = (*mEffectInterface)->command(mEffectInterface,
|
||||
EFFECT_CMD_SET_AUDIO_MODE,
|
||||
sizeof(int),
|
||||
&effectMode,
|
||||
&size,
|
||||
&cmdStatus);
|
||||
if (status == NO_ERROR) {
|
||||
status = cmdStatus;
|
||||
}
|
||||
@@ -5805,9 +5849,14 @@ void AudioFlinger::EffectHandle::disconnect()
|
||||
}
|
||||
}
|
||||
|
||||
status_t AudioFlinger::EffectHandle::command(int cmdCode, int cmdSize, void *pCmdData, int *replySize, void *pReplyData)
|
||||
status_t AudioFlinger::EffectHandle::command(uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *pCmdData,
|
||||
uint32_t *replySize,
|
||||
void *pReplyData)
|
||||
{
|
||||
// LOGV("command(), cmdCode: %d, mHasControl: %d, mEffect: %p", cmdCode, mHasControl, (mEffect == 0) ? 0 : mEffect.get());
|
||||
// LOGV("command(), cmdCode: %d, mHasControl: %d, mEffect: %p",
|
||||
// cmdCode, mHasControl, (mEffect == 0) ? 0 : mEffect.get());
|
||||
|
||||
// only get parameter command is permitted for applications not controlling the effect
|
||||
if (!mHasControl && cmdCode != EFFECT_CMD_GET_PARAM) {
|
||||
@@ -5829,7 +5878,7 @@ status_t AudioFlinger::EffectHandle::command(int cmdCode, int cmdSize, void *pCm
|
||||
status_t status = NO_ERROR;
|
||||
while (mCblk->serverIndex < mCblk->clientIndex) {
|
||||
int reply;
|
||||
int rsize = sizeof(int);
|
||||
uint32_t rsize = sizeof(int);
|
||||
int *p = (int *)(mBuffer + mCblk->serverIndex);
|
||||
int size = *p++;
|
||||
if (((uint8_t *)p + size) > mBuffer + mCblk->clientIndex) {
|
||||
@@ -5842,8 +5891,14 @@ status_t AudioFlinger::EffectHandle::command(int cmdCode, int cmdSize, void *pCm
|
||||
mCblk->serverIndex += size;
|
||||
continue;
|
||||
}
|
||||
int psize = sizeof(effect_param_t) + ((param->psize - 1) / sizeof(int) + 1) * sizeof(int) + param->vsize;
|
||||
status_t ret = mEffect->command(EFFECT_CMD_SET_PARAM, psize, p, &rsize, &reply);
|
||||
uint32_t psize = sizeof(effect_param_t) +
|
||||
((param->psize - 1) / sizeof(int) + 1) * sizeof(int) +
|
||||
param->vsize;
|
||||
status_t ret = mEffect->command(EFFECT_CMD_SET_PARAM,
|
||||
psize,
|
||||
p,
|
||||
&rsize,
|
||||
&reply);
|
||||
if (ret == NO_ERROR) {
|
||||
if (reply != NO_ERROR) {
|
||||
status = reply;
|
||||
@@ -5879,7 +5934,11 @@ void AudioFlinger::EffectHandle::setControl(bool hasControl, bool signal)
|
||||
}
|
||||
}
|
||||
|
||||
void AudioFlinger::EffectHandle::commandExecuted(int cmdCode, int cmdSize, void *pCmdData, int replySize, void *pReplyData)
|
||||
void AudioFlinger::EffectHandle::commandExecuted(uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *pCmdData,
|
||||
uint32_t replySize,
|
||||
void *pReplyData)
|
||||
{
|
||||
if (mEffectClient != 0) {
|
||||
mEffectClient->commandExecuted(cmdCode, cmdSize, pCmdData, replySize, pReplyData);
|
||||
|
||||
@@ -933,7 +933,11 @@ private:
|
||||
int id() { return mId; }
|
||||
void process();
|
||||
void updateState();
|
||||
status_t command(int cmdCode, int cmdSize, void *pCmdData, int *replySize, void *pReplyData);
|
||||
status_t command(uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *pCmdData,
|
||||
uint32_t *replySize,
|
||||
void *pReplyData);
|
||||
|
||||
void reset_l();
|
||||
status_t configure();
|
||||
@@ -1023,7 +1027,11 @@ private:
|
||||
// IEffect
|
||||
virtual status_t enable();
|
||||
virtual status_t disable();
|
||||
virtual status_t command(int cmdCode, int cmdSize, void *pCmdData, int *replySize, void *pReplyData);
|
||||
virtual status_t command(uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *pCmdData,
|
||||
uint32_t *replySize,
|
||||
void *pReplyData);
|
||||
virtual void disconnect();
|
||||
virtual sp<IMemory> getCblk() const;
|
||||
virtual status_t onTransact(uint32_t code, const Parcel& data,
|
||||
@@ -1032,7 +1040,11 @@ private:
|
||||
|
||||
// Give or take control of effect module
|
||||
void setControl(bool hasControl, bool signal);
|
||||
void commandExecuted(int cmdCode, int cmdSize, void *pCmdData, int replySize, void *pReplyData);
|
||||
void commandExecuted(uint32_t cmdCode,
|
||||
uint32_t cmdSize,
|
||||
void *pCmdData,
|
||||
uint32_t replySize,
|
||||
void *pReplyData);
|
||||
void setEnabled(bool enabled);
|
||||
|
||||
// Getters
|
||||
|
||||
Reference in New Issue
Block a user