summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2015-04-03 15:57:54 -0700
committerEric Laurent <elaurent@google.com>2015-04-08 12:37:35 -0700
commit322b4d25387a04c9afebe998326d005bbdf17ede (patch)
tree3cf0c2912dc7cb75acb60526bef382dd90e9a51d /services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
parent6dc4dc4ad23dc82eca9af3112292f3e6d5b17b15 (diff)
downloadframeworks_av-322b4d25387a04c9afebe998326d005bbdf17ede.zip
frameworks_av-322b4d25387a04c9afebe998326d005bbdf17ede.tar.gz
frameworks_av-322b4d25387a04c9afebe998326d005bbdf17ede.tar.bz2
audio policy: fix unique audio port ID.
Remove mId member from AudioPort as it was shadowed by mId in DeviceDescriptor. Add getters for Id, and HW module name and version to device, output and input descriptors. Fix DeviceDescriptor name initialization. Change-Id: I4a69f385e40330954d9dad5f2926c521f60b2ec1
Diffstat (limited to 'services/audiopolicy/common/managerdefinitions/src/HwModule.cpp')
-rw-r--r--services/audiopolicy/common/managerdefinitions/src/HwModule.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
index 0097d69..e955447 100644
--- a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
@@ -48,7 +48,7 @@ status_t HwModule::loadInput(cnode *root)
{
cnode *node = root->first_child;
- sp<IOProfile> profile = new IOProfile(String8(root->name), AUDIO_PORT_ROLE_SINK, this);
+ sp<IOProfile> profile = new IOProfile(String8(root->name), AUDIO_PORT_ROLE_SINK);
while (node) {
if (strcmp(node->name, SAMPLING_RATES_TAG) == 0) {
@@ -83,6 +83,7 @@ status_t HwModule::loadInput(cnode *root)
ALOGV("loadInput() adding input Supported Devices %04x",
profile->mSupportedDevices.types());
+ profile->attach(this);
mInputProfiles.add(profile);
return NO_ERROR;
} else {
@@ -94,7 +95,7 @@ status_t HwModule::loadOutput(cnode *root)
{
cnode *node = root->first_child;
- sp<IOProfile> profile = new IOProfile(String8(root->name), AUDIO_PORT_ROLE_SOURCE, this);
+ sp<IOProfile> profile = new IOProfile(String8(root->name), AUDIO_PORT_ROLE_SOURCE);
while (node) {
if (strcmp(node->name, SAMPLING_RATES_TAG) == 0) {
@@ -128,7 +129,7 @@ status_t HwModule::loadOutput(cnode *root)
ALOGV("loadOutput() adding output Supported Devices %04x, mFlags %04x",
profile->mSupportedDevices.types(), profile->mFlags);
-
+ profile->attach(this);
mOutputProfiles.add(profile);
return NO_ERROR;
} else {
@@ -154,7 +155,6 @@ status_t HwModule::loadDevice(cnode *root)
return BAD_VALUE;
}
sp<DeviceDescriptor> deviceDesc = new DeviceDescriptor(String8(root->name), type);
- deviceDesc->mModule = this;
node = root->first_child;
while (node) {
@@ -183,7 +183,7 @@ status_t HwModule::loadDevice(cnode *root)
status_t HwModule::addOutputProfile(String8 name, const audio_config_t *config,
audio_devices_t device, String8 address)
{
- sp<IOProfile> profile = new IOProfile(name, AUDIO_PORT_ROLE_SOURCE, this);
+ sp<IOProfile> profile = new IOProfile(name, AUDIO_PORT_ROLE_SOURCE);
profile->mSamplingRates.add(config->sample_rate);
profile->mChannelMasks.add(config->channel_mask);
@@ -193,6 +193,7 @@ status_t HwModule::addOutputProfile(String8 name, const audio_config_t *config,
devDesc->mAddress = address;
profile->mSupportedDevices.add(devDesc);
+ profile->attach(this);
mOutputProfiles.add(profile);
return NO_ERROR;
@@ -213,7 +214,7 @@ status_t HwModule::removeOutputProfile(String8 name)
status_t HwModule::addInputProfile(String8 name, const audio_config_t *config,
audio_devices_t device, String8 address)
{
- sp<IOProfile> profile = new IOProfile(name, AUDIO_PORT_ROLE_SINK, this);
+ sp<IOProfile> profile = new IOProfile(name, AUDIO_PORT_ROLE_SINK);
profile->mSamplingRates.add(config->sample_rate);
profile->mChannelMasks.add(config->channel_mask);
@@ -225,6 +226,7 @@ status_t HwModule::addInputProfile(String8 name, const audio_config_t *config,
ALOGV("addInputProfile() name %s rate %d mask 0x08", name.string(), config->sample_rate, config->channel_mask);
+ profile->attach(this);
mInputProfiles.add(profile);
return NO_ERROR;