Lines Matching refs:profile

493 // Find a direct output profile compatible with the parameters passed, even if the input flags do
507 IOProfile *profile = mHwModules[i]->mOutputProfiles[j];
509 if (profile->isCompatibleProfile(device, samplingRate, format,
512 if (mAvailableOutputDevices & profile->mSupportedDevices) {
517 if (profile->isCompatibleProfile(device, samplingRate, format,
520 if (mAvailableOutputDevices & profile->mSupportedDevices) {
591 IOProfile *profile = NULL;
594 profile = getProfileForDirectOutput(device,
601 if (profile != NULL) {
606 if (!desc->isDuplicated() && (profile == desc->mProfile)) {
622 outputDesc = new AudioOutputDescriptor(profile);
632 output = mpClientInterface->openOutput(profile->mModule->mHandle,
933 IOProfile *profile = getInputProfile(device,
937 if (profile == NULL) {
938 ALOGW("getInput() could not find profile for device %04x, samplingRate %d, format %d,"
944 if (profile->mModule->mHandle == 0) {
945 ALOGE("getInput(): HW module %s not opened", profile->mModule->mName);
949 AudioInputDescriptor *inputDesc = new AudioInputDescriptor(profile);
957 input = mpClientInterface->openInput(profile->mModule->mHandle,
1510 // See if there is a profile to support this.
1512 IOProfile *profile = getProfileForDirectOutput(AUDIO_DEVICE_NONE /*ignore device */,
1517 ALOGV("isOffloadSupported() profile %sfound", profile != NULL ? "" : "NOT ");
1518 return (profile != NULL);
1844 ALOGV("checkOutputsForDevice(): adding profile %d from module %d", j, i);
1858 IOProfile *profile = profiles[profile_index];
1860 // nothing to do if one output is already opened for this profile
1864 if (!desc->isDuplicated() && desc->mProfile == profile) {
1873 desc = new AudioOutputDescriptor(profile);
1880 audio_io_handle_t output = mpClientInterface->openOutput(profile->mModule->mHandle,
1892 if (profile->mSamplingRates[0] == 0) {
1899 loadSamplingRates(value + 1, profile);
1902 if (profile->mFormats[0] == 0) {
1909 loadFormats(value + 1, profile);
1912 if (profile->mChannelMasks[0] == 0) {
1919 loadOutChannels(value + 1, profile);
1922 if (((profile->mSamplingRates[0] == 0) &&
1923 (profile->mSamplingRates.size() < 2)) ||
1924 ((profile->mFormats[0] == 0) &&
1925 (profile->mFormats.size() < 2)) ||
1926 ((profile->mFormats[0] == 0) &&
1927 (profile->mChannelMasks.size() < 2))) {
1998 IOProfile *profile = mHwModules[i]->mOutputProfiles[j];
1999 if ((profile->mSupportedDevices & device) &&
2000 (profile->mFlags & AUDIO_OUTPUT_FLAG_DIRECT)) {
2001 ALOGV("checkOutputsForDevice(): clearing direct output profile %d on module %d",
2003 if (profile->mSamplingRates[0] == 0) {
2004 profile->mSamplingRates.clear();
2005 profile->mSamplingRates.add(0);
2007 if (profile->mFormats[0] == 0) {
2008 profile->mFormats.clear();
2009 profile->mFormats.add((audio_format_t)0);
2011 if (profile->mChannelMasks[0] == 0) {
2012 profile->mChannelMasks.clear();
2013 profile->mChannelMasks.add((audio_channel_mask_t)0);
2624 // output profile
2667 // Choose an input profile based on the requested capture parameters: select the first available
2668 // profile supporting all requested parameters.
2677 IOProfile *profile = mHwModules[i]->mInputProfiles[j];
2678 if (profile->isCompatibleProfile(device, samplingRate, format,
2680 return profile;
3250 const IOProfile *profile)
3254 mOutput1(0), mOutput2(0), mProfile(profile), mDirectOpenCount(0)
3266 if (profile != NULL) {
3267 mSamplingRate = profile->mSamplingRates[0];
3268 mFormat = profile->mFormats[0];
3269 mChannelMask = profile->mChannelMasks[0];
3270 mFlags = profile->mFlags;
3402 AudioPolicyManagerBase::AudioInputDescriptor::AudioInputDescriptor(const IOProfile *profile)
3405 mInputSource(0), mProfile(profile)
3547 // checks if the IO profile is compatible with specified parameters.
3761 void AudioPolicyManagerBase::loadSamplingRates(char *name, IOProfile *profile)
3768 profile->mSamplingRates.add(0);
3776 profile->mSamplingRates.add(rate);
3783 void AudioPolicyManagerBase::loadFormats(char *name, IOProfile *profile)
3790 profile->mFormats.add((audio_format_t)0);
3799 profile->mFormats.add(format);
3806 void AudioPolicyManagerBase::loadInChannels(char *name, IOProfile *profile)
3813 profile->mChannelMasks.add((audio_channel_mask_t)0);
3824 profile->mChannelMasks.add(channelMask);
3831 void AudioPolicyManagerBase::loadOutChannels(char *name, IOProfile *profile)
3840 profile->mChannelMasks.add((audio_channel_mask_t)0);
3850 profile->mChannelMasks.add(channelMask);
3861 IOProfile *profile = new IOProfile(module);
3865 loadSamplingRates((char *)node->value, profile);
3867 loadFormats((char *)node->value, profile);
3869 loadInChannels((char *)node->value, profile);
3871 profile->mSupportedDevices = parseDeviceNames((char *)node->value);
3875 ALOGW_IF(profile->mSupportedDevices == AUDIO_DEVICE_NONE,
3877 ALOGW_IF(profile->mChannelMasks.size() == 0,
3879 ALOGW_IF(profile->mSamplingRates.size() == 0,
3881 ALOGW_IF(profile->mFormats.size() == 0,
3883 if ((profile->mSupportedDevices != AUDIO_DEVICE_NONE) &&
3884 (profile->mChannelMasks.size() != 0) &&
3885 (profile->mSamplingRates.size() != 0) &&
3886 (profile->mFormats.size() != 0)) {
3888 ALOGV("loadInput() adding input mSupportedDevices %04x", profile->mSupportedDevices);
3890 module->mInputProfiles.add(profile);
3893 delete profile;
3902 IOProfile *profile = new IOProfile(module);
3906 loadSamplingRates((char *)node->value, profile);
3908 loadFormats((char *)node->value, profile);
3910 loadOutChannels((char *)node->value, profile);
3912 profile->mSupportedDevices = parseDeviceNames((char *)node->value);
3914 profile->mFlags = parseFlagNames((char *)node->value);
3918 ALOGW_IF(profile->mSupportedDevices == AUDIO_DEVICE_NONE,
3920 ALOGW_IF(profile->mChannelMasks.size() == 0,
3922 ALOGW_IF(profile->mSamplingRates.size() == 0,
3924 ALOGW_IF(profile->mFormats.size() == 0,
3926 if ((profile->mSupportedDevices != AUDIO_DEVICE_NONE) &&
3927 (profile->mChannelMasks.size() != 0) &&
3928 (profile->mSamplingRates.size() != 0) &&
3929 (profile->mFormats.size() != 0)) {
3932 profile->mSupportedDevices, profile->mFlags);
3934 module->mOutputProfiles.add(profile);
3937 delete profile;
4060 IOProfile *profile;
4068 profile = new IOProfile(module);
4069 profile->mSamplingRates.add(44100);
4070 profile->mFormats.add(AUDIO_FORMAT_PCM_16_BIT);
4071 profile->mChannelMasks.add(AUDIO_CHANNEL_OUT_STEREO);
4072 profile->mSupportedDevices = AUDIO_DEVICE_OUT_SPEAKER;
4073 profile->mFlags = AUDIO_OUTPUT_FLAG_PRIMARY;
4074 module->mOutputProfiles.add(profile);
4076 profile = new IOProfile(module);
4077 profile->mSamplingRates.add(8000);
4078 profile->mFormats.add(AUDIO_FORMAT_PCM_16_BIT);
4079 profile->mChannelMasks.add(AUDIO_CHANNEL_IN_MONO);
4080 profile->mSupportedDevices = AUDIO_DEVICE_IN_BUILTIN_MIC;
4081 module->mInputProfiles.add(profile);