Home | History | Annotate | Download | only in audio

Lines Matching full:profile

500 // Find a direct output profile compatible with the parameters passed, even if the input flags do
514 IOProfile *profile = mHwModules[i]->mOutputProfiles[j];
516 if (profile->isCompatibleProfile(device, samplingRate, format,
519 if (mAvailableOutputDevices & profile->mSupportedDevices) {
524 if (profile->isCompatibleProfile(device, samplingRate, format,
527 if (mAvailableOutputDevices & profile->mSupportedDevices) {
598 IOProfile *profile = NULL;
601 profile = getProfileForDirectOutput(device,
608 if (profile != NULL) {
613 if (!desc->isDuplicated() && (profile == desc->mProfile)) {
629 outputDesc = new AudioOutputDescriptor(profile);
639 output = mpClientInterface->openOutput(profile->mModule->mHandle,
940 IOProfile *profile = getInputProfile(device,
944 if (profile == NULL) {
945 ALOGW("getInput() could not find profile for device 0x%X, samplingRate %d, format %d, "
951 if (profile->mModule->mHandle == 0) {
952 ALOGE("getInput(): HW module %s not opened", profile->mModule->mName);
956 AudioInputDescriptor *inputDesc = new AudioInputDescriptor(profile);
965 input = mpClientInterface->openInput(profile->mModule->mHandle,
1527 // See if there is a profile to support this.
1529 IOProfile *profile = getProfileForDirectOutput(AUDIO_DEVICE_NONE /*ignore device */,
1534 ALOGV("isOffloadSupported() profile %sfound", profile != NULL ? "" : "NOT ");
1535 return (profile != NULL);
1867 ALOGV("checkOutputsForDevice(): adding profile %zu from module %zu", j, i);
1881 IOProfile *profile = profiles[profile_index];
1883 // nothing to do if one output is already opened for this profile
1887 if (!desc->isDuplicated() && desc->mProfile == profile) {
1896 desc = new AudioOutputDescriptor(profile);
1903 audio_io_handle_t output = mpClientInterface->openOutput(profile->mModule->mHandle,
1920 if (profile->mSamplingRates[0] == 0) {
1927 loadSamplingRates(value + 1, profile);
1930 if (profile->mFormats[0] == AUDIO_FORMAT_DEFAULT) {
1937 loadFormats(value + 1, profile);
1940 if (profile->mChannelMasks[0] == 0) {
1947 loadOutChannels(value + 1, profile);
1950 if (((profile->mSamplingRates[0] == 0) &&
1951 (profile->mSamplingRates.size() < 2)) ||
1952 ((profile->mFormats[0] == 0) &&
1953 (profile->mFormats.size() < 2)) ||
1954 ((profile->mChannelMasks[0] == 0) &&
1955 (profile->mChannelMasks.size() < 2))) {
1959 } else if (profile->mSamplingRates[0] == 0) {
1961 desc->mSamplingRate = profile->mSamplingRates[1];
1964 profile->mModule->mHandle,
2041 IOProfile *profile = mHwModules[i]->mOutputProfiles[j];
2042 if (profile->mSupportedDevices & device) {
2043 ALOGV("checkOutputsForDevice(): clearing direct output profile %zu on module %zu",
2045 if (profile->mSamplingRates[0] == 0) {
2046 profile->mSamplingRates.clear();
2047 profile->mSamplingRates.add(0);
2049 if (profile->mFormats[0] == AUDIO_FORMAT_DEFAULT) {
2050 profile->mFormats.clear();
2051 profile->mFormats.add(AUDIO_FORMAT_DEFAULT);
2053 if (profile->mChannelMasks[0] == 0) {
2054 profile->mChannelMasks.clear();
2055 profile->mChannelMasks.add(0);
2093 ALOGV("checkInputsForDevice(): adding profile %d from module %d",
2109 IOProfile *profile = profiles[profile_index];
2110 // nothing to do if one input is already opened for this profile
2114 if (desc->mProfile == profile) {
2123 desc = new AudioInputDescriptor(profile);
2126 audio_io_handle_t input = mpClientInterface->openInput(profile->mModule->mHandle,
2140 if (profile->mSamplingRates[0] == 0) {
2147 loadSamplingRates(value + 1, profile);
2150 if (profile->mFormats[0] == AUDIO_FORMAT_DEFAULT) {
2156 loadFormats(value + 1, profile);
2159 if (profile->mChannelMasks[0] == 0) {
2166 loadInChannels(value + 1, profile);
2169 if (((profile->mSamplingRates[0] == 0) && (profile->mSamplingRates.size() < 2)) ||
2170 ((profile->mFormats[0] == 0) && (profile->mFormats.size() < 2)) ||
2171 ((profile->mChannelMasks[0] == 0) && (profile->mChannelMasks.size() < 2))) {
2218 IOProfile *profile = mHwModules[module_index]->mInputProfiles[profile_index];
2219 if (profile->mSupportedDevices & device) {
2220 ALOGV("checkInputsForDevice(): clearing direct input profile %d on module %d",
2222 if (profile->mSamplingRates[0] == 0) {
2223 profile->mSamplingRates.clear();
2224 profile->mSamplingRates.add(0);
2226 if (profile->mFormats[0] == AUDIO_FORMAT_DEFAULT) {
2227 profile->mFormats.clear();
2228 profile->mFormats.add(AUDIO_FORMAT_DEFAULT);
2230 if (profile->mChannelMasks[0] == 0) {
2231 profile->mChannelMasks.clear();
2232 profile->mChannelMasks.add(0);
2842 // output profile
2900 // Choose an input profile based on the requested capture parameters: select the first available
2901 // profile supporting all requested parameters.
2909 IOProfile *profile = mHwModules[i]->mInputProfiles[j];
2910 // profile->log();
2911 if (profile->isCompatibleProfile(device, samplingRate, format,
2913 return profile;
3489 const IOProfile *profile)
3493 mOutput1(0), mOutput2(0), mProfile(profile), mDirectOpenCount(0),
3506 if (profile != NULL) {
3507 mSamplingRate = profile->mSamplingRates[0];
3508 mFormat = profile->mFormats[0];
3509 mChannelMask = profile->mChannelMasks[0];
3510 mFlags = profile->mFlags;
3642 AudioPolicyManagerBase::AudioInputDescriptor::AudioInputDescriptor(const IOProfile *profile)
3645 mInputSource(0), mProfile(profile)
3647 if (profile != NULL) {
3648 mSamplingRate = profile->mSamplingRates[0];
3649 mFormat = profile->mFormats[0];
3650 mChannelMask = profile->mChannelMasks[0];
3792 // checks if the IO profile is compatible with specified parameters.
4042 void AudioPolicyManagerBase::loadSamplingRates(char *name, IOProfile *profile)
4049 profile->mSamplingRates.add(0);
4057 profile->mSamplingRates.add(rate);
4064 void AudioPolicyManagerBase::loadFormats(char *name, IOProfile *profile)
4071 profile->mFormats.add(AUDIO_FORMAT_DEFAULT);
4080 profile->mFormats.add(format);
4087 void AudioPolicyManagerBase::loadInChannels(char *name, IOProfile *profile)
4094 profile->mChannelMasks.add(0);
4105 profile->mChannelMasks.add(channelMask);
4112 void AudioPolicyManagerBase::loadOutChannels(char *name, IOProfile *profile)
4121 profile->mChannelMasks.add(0);
4131 profile->mChannelMasks.add(channelMask);
4142 IOProfile *profile = new IOProfile(module);
4146 loadSamplingRates((char *)node->value, profile);
4148 loadFormats((char *)node->value, profile);
4150 loadInChannels((char *)node->value, profile);
4152 profile->mSupportedDevices = parseDeviceNames((char *)node->value);
4156 ALOGW_IF(profile->mSupportedDevices == AUDIO_DEVICE_NONE,
4158 ALOGW_IF(profile->mChannelMasks.size() == 0,
4160 ALOGW_IF(profile->mSamplingRates.size() == 0,
4162 ALOGW_IF(profile->mFormats.size() == 0,
4164 if ((profile->mSupportedDevices != AUDIO_DEVICE_NONE) &&
4165 (profile->mChannelMasks.size() != 0) &&
4166 (profile->mSamplingRates.size() != 0) &&
4167 (profile->mFormats.size() != 0)) {
4169 ALOGV("loadInput() adding input mSupportedDevices 0x%X", profile->mSupportedDevices);
4171 module->mInputProfiles.add(profile);
4174 delete profile;
4183 IOProfile *profile = new IOProfile(module);
4187 loadSamplingRates((char *)node->value, profile);
4189 loadFormats((char *)node->value, profile);
4191 loadOutChannels((char *)node->value, profile);
4193 profile->mSupportedDevices = parseDeviceNames((char *)node->value);
4195 profile->mFlags = parseFlagNames((char *)node->value);
4199 ALOGW_IF(profile->mSupportedDevices == AUDIO_DEVICE_NONE,
4201 ALOGW_IF(profile->mChannelMasks.size() == 0,
4203 ALOGW_IF(profile->mSamplingRates.size() == 0,
4205 ALOGW_IF(profile->mFormats.size() == 0,
4207 if ((profile->mSupportedDevices != AUDIO_DEVICE_NONE) &&
4208 (profile->mChannelMasks.size() != 0) &&
4209 (profile->mSamplingRates.size() != 0) &&
4210 (profile->mFormats.size() != 0)) {
4213 profile->mSupportedDevices, profile->mFlags);
4215 module->mOutputProfiles.add(profile);
4218 delete profile;
4341 IOProfile *profile;
4349 profile = new IOProfile(module);
4350 profile->mSamplingRates.add(44100);
4351 profile->mFormats.add(AUDIO_FORMAT_PCM_16_BIT);
4352 profile->mChannelMasks.add(AUDIO_CHANNEL_OUT_STEREO);
4353 profile->mSupportedDevices = AUDIO_DEVICE_OUT_SPEAKER;
4354 profile->mFlags = AUDIO_OUTPUT_FLAG_PRIMARY;
4355 module->mOutputProfiles.add(profile);
4357 profile = new IOProfile(module);
4358 profile->mSamplingRates.add(8000);
4359 profile->mFormats.add(AUDIO_FORMAT_PCM_16_BIT);
4360 profile->mChannelMasks.add(AUDIO_CHANNEL_IN_MONO);
4361 profile->mSupportedDevices = AUDIO_DEVICE_IN_BUILTIN_MIC;
4362 module->mInputProfiles.add(profile);