Skip to content

Commit 78c914f

Browse files
gkastenAndroid (Google) Code Review
authored andcommitted
Merge "IAudioFlingerClient::ioConfigChanged param2 const"
2 parents ac3c337 + ffed04a commit 78c914f

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

include/media/AudioSystem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ class AudioSystem
218218
// IAudioFlingerClient
219219

220220
// indicate a change in the configuration of an output or input: keeps the cached
221-
// values for output/input parameters upto date in client process
222-
virtual void ioConfigChanged(int event, audio_io_handle_t ioHandle, void *param2);
221+
// values for output/input parameters up-to-date in client process
222+
virtual void ioConfigChanged(int event, audio_io_handle_t ioHandle, const void *param2);
223223
};
224224

225225
class AudioPolicyServiceClient: public IBinder::DeathRecipient

include/media/IAudioFlingerClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class IAudioFlingerClient : public IInterface
3333
DECLARE_META_INTERFACE(AudioFlingerClient);
3434

3535
// Notifies a change of audio input/output configuration.
36-
virtual void ioConfigChanged(int event, audio_io_handle_t ioHandle, void *param2) = 0;
36+
virtual void ioConfigChanged(int event, audio_io_handle_t ioHandle, const void *param2) = 0;
3737

3838
};
3939

media/libmedia/AudioSystem.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,9 @@ void AudioSystem::AudioFlingerClient::binderDied(const wp<IBinder>& who) {
405405
}
406406

407407
void AudioSystem::AudioFlingerClient::ioConfigChanged(int event, audio_io_handle_t ioHandle,
408-
void *param2) {
408+
const void *param2) {
409409
ALOGV("ioConfigChanged() event %d", event);
410-
OutputDescriptor *desc;
410+
const OutputDescriptor *desc;
411411
audio_stream_type_t stream;
412412

413413
if (ioHandle == 0) return;
@@ -417,7 +417,7 @@ void AudioSystem::AudioFlingerClient::ioConfigChanged(int event, audio_io_handle
417417
switch (event) {
418418
case STREAM_CONFIG_CHANGED:
419419
if (param2 == NULL) break;
420-
stream = *(audio_stream_type_t *)param2;
420+
stream = *(const audio_stream_type_t *)param2;
421421
ALOGV("ioConfigChanged() STREAM_CONFIG_CHANGED stream %d, output %d", stream, ioHandle);
422422
if (gStreamOutputMap.indexOfKey(stream) >= 0) {
423423
gStreamOutputMap.replaceValueFor(stream, ioHandle);
@@ -429,7 +429,7 @@ void AudioSystem::AudioFlingerClient::ioConfigChanged(int event, audio_io_handle
429429
break;
430430
}
431431
if (param2 == NULL) break;
432-
desc = (OutputDescriptor *)param2;
432+
desc = (const OutputDescriptor *)param2;
433433

434434
OutputDescriptor *outputDesc = new OutputDescriptor(*desc);
435435
gOutputs.add(ioHandle, outputDesc);
@@ -458,7 +458,7 @@ void AudioSystem::AudioFlingerClient::ioConfigChanged(int event, audio_io_handle
458458
break;
459459
}
460460
if (param2 == NULL) break;
461-
desc = (OutputDescriptor *)param2;
461+
desc = (const OutputDescriptor *)param2;
462462

463463
ALOGV("ioConfigChanged() new config for output %d samplingRate %d, format %d channels %d frameCount %d latency %d",
464464
ioHandle, desc->samplingRate, desc->format,

media/libmedia/IAudioFlingerClient.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ class BpAudioFlingerClient : public BpInterface<IAudioFlingerClient>
3939
{
4040
}
4141

42-
void ioConfigChanged(int event, audio_io_handle_t ioHandle, void *param2)
42+
void ioConfigChanged(int event, audio_io_handle_t ioHandle, const void *param2)
4343
{
4444
Parcel data, reply;
4545
data.writeInterfaceToken(IAudioFlingerClient::getInterfaceDescriptor());
4646
data.writeInt32(event);
4747
data.writeInt32((int32_t) ioHandle);
4848
if (event == AudioSystem::STREAM_CONFIG_CHANGED) {
49-
uint32_t stream = *(uint32_t *)param2;
49+
uint32_t stream = *(const uint32_t *)param2;
5050
ALOGV("ioConfigChanged stream %d", stream);
5151
data.writeInt32(stream);
5252
} else if (event != AudioSystem::OUTPUT_CLOSED && event != AudioSystem::INPUT_CLOSED) {
53-
AudioSystem::OutputDescriptor *desc = (AudioSystem::OutputDescriptor *)param2;
53+
const AudioSystem::OutputDescriptor *desc = (const AudioSystem::OutputDescriptor *)param2;
5454
data.writeInt32(desc->samplingRate);
5555
data.writeInt32(desc->format);
5656
data.writeInt32(desc->channels);
@@ -73,7 +73,7 @@ status_t BnAudioFlingerClient::onTransact(
7373
CHECK_INTERFACE(IAudioFlingerClient, data, reply);
7474
int event = data.readInt32();
7575
audio_io_handle_t ioHandle = (audio_io_handle_t) data.readInt32();
76-
void *param2 = NULL;
76+
const void *param2 = NULL;
7777
AudioSystem::OutputDescriptor desc;
7878
uint32_t stream;
7979
if (event == AudioSystem::STREAM_CONFIG_CHANGED) {

services/audioflinger/AudioFlinger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ void AudioFlinger::removeNotificationClient(pid_t pid)
10531053
}
10541054

10551055
// audioConfigChanged_l() must be called with AudioFlinger::mLock held
1056-
void AudioFlinger::audioConfigChanged_l(int event, audio_io_handle_t ioHandle, void *param2)
1056+
void AudioFlinger::audioConfigChanged_l(int event, audio_io_handle_t ioHandle, const void *param2)
10571057
{
10581058
size_t size = mNotificationClients.size();
10591059
for (size_t i = 0; i < size; i++) {

services/audioflinger/AudioFlinger.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ class AudioFlinger :
10901090
// no range check, doesn't check per-thread stream volume, AudioFlinger::mLock held
10911091
float streamVolume_l(audio_stream_type_t stream) const
10921092
{ return mStreamTypes[stream].volume; }
1093-
void audioConfigChanged_l(int event, audio_io_handle_t ioHandle, void *param2);
1093+
void audioConfigChanged_l(int event, audio_io_handle_t ioHandle, const void *param2);
10941094

10951095
// allocate an audio_io_handle_t, session ID, or effect ID
10961096
uint32_t nextUniqueId();

0 commit comments

Comments
 (0)