Lines Matching refs:outputDesc
498 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(output); in updateCallRouting() local
499 ALOG_ASSERT(!outputDesc->isDuplicated(), in updateCallRouting()
501 outputDesc->toAudioPortConfig(&patch.sources[1]); in updateCallRouting()
541 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(output); in updateCallRouting() local
542 ALOG_ASSERT(!outputDesc->isDuplicated(), in updateCallRouting()
544 outputDesc->toAudioPortConfig(&patch.sources[1]); in updateCallRouting()
885 sp<AudioOutputDescriptor> outputDesc = new AudioOutputDescriptor(NULL); in getOutputForDevice() local
886 outputDesc->mDevice = mTestDevice; in getOutputForDevice()
887 outputDesc->mLatency = mTestLatencyMs; in getOutputForDevice()
888 outputDesc->mFlags = in getOutputForDevice()
890 outputDesc->mRefCount[stream] = 0; in getOutputForDevice()
901 &outputDesc->mDevice, in getOutputForDevice()
903 &outputDesc->mLatency, in getOutputForDevice()
904 outputDesc->mFlags); in getOutputForDevice()
906 outputDesc->mSamplingRate = config.sample_rate; in getOutputForDevice()
907 outputDesc->mFormat = config.format; in getOutputForDevice()
908 outputDesc->mChannelMask = config.channel_mask; in getOutputForDevice()
912 addOutput(mTestOutputs[mCurOutput], outputDesc); in getOutputForDevice()
957 sp<AudioOutputDescriptor> outputDesc = NULL; in getOutputForDevice() local
962 outputDesc = desc; in getOutputForDevice()
964 if ((samplingRate == outputDesc->mSamplingRate) && in getOutputForDevice()
965 (format == outputDesc->mFormat) && in getOutputForDevice()
966 (channelMask == outputDesc->mChannelMask)) { in getOutputForDevice()
967 outputDesc->mDirectOpenCount++; in getOutputForDevice()
974 if (outputDesc != NULL) { in getOutputForDevice()
975 closeOutput(outputDesc->mIoHandle); in getOutputForDevice()
977 outputDesc = new AudioOutputDescriptor(profile); in getOutputForDevice()
978 outputDesc->mDevice = device; in getOutputForDevice()
979 outputDesc->mLatency = 0; in getOutputForDevice()
980 outputDesc->mFlags =(audio_output_flags_t) (outputDesc->mFlags | flags); in getOutputForDevice()
991 &outputDesc->mDevice, in getOutputForDevice()
993 &outputDesc->mLatency, in getOutputForDevice()
994 outputDesc->mFlags); in getOutputForDevice()
1003 outputDesc->mSamplingRate, format, outputDesc->mFormat, channelMask, in getOutputForDevice()
1004 outputDesc->mChannelMask); in getOutputForDevice()
1010 outputDesc->mSamplingRate = config.sample_rate; in getOutputForDevice()
1011 outputDesc->mChannelMask = config.channel_mask; in getOutputForDevice()
1012 outputDesc->mFormat = config.format; in getOutputForDevice()
1013 outputDesc->mRefCount[stream] = 0; in getOutputForDevice()
1014 outputDesc->mStopTime[stream] = 0; in getOutputForDevice()
1015 outputDesc->mDirectOpenCount = 1; in getOutputForDevice()
1018 addOutput(output, outputDesc); in getOutputForDevice()
1076 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(outputs[i]); in selectOutput() local
1077 if (!outputDesc->isDuplicated()) { in selectOutput()
1080 if (outputDesc->mFlags & AUDIO_OUTPUT_FLAG_DIRECT) { in selectOutput()
1081 if (format != outputDesc->mFormat) { in selectOutput()
1089 int commonFlags = popcount(outputDesc->mProfile->mFlags & flags); in selectOutput()
1095 if (outputDesc->mProfile->mFlags & AUDIO_OUTPUT_FLAG_PRIMARY) { in selectOutput()
1122 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueAt(index); in startOutput() local
1127 outputDesc->changeRefCount(stream, 1); in startOutput()
1129 if (outputDesc->mRefCount[stream] == 1) { in startOutput()
1138 if (desc != outputDesc) { in startOutput()
1143 if (outputDesc->sharesHwModuleWith(desc) && in startOutput()
1190 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueAt(index); in stopOutput() local
1197 if (outputDesc->mRefCount[stream] > 0) { in stopOutput()
1199 outputDesc->changeRefCount(stream, -1); in stopOutput()
1201 if (outputDesc->mRefCount[stream] == 0) { in stopOutput()
1202 outputDesc->mStopTime[stream] = systemTime(); in stopOutput()
1209 setOutputDevice(output, newDevice, false, outputDesc->mLatency*2); in stopOutput()
1218 outputDesc->sharesHwModuleWith(desc) && in stopOutput()
1223 outputDesc->mLatency*2); in stopOutput()
1248 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueAt(index); in releaseOutput() local
1249 if (outputDesc->isActive()) { in releaseOutput()
1801 const sp<AudioOutputDescriptor> outputDesc = mOutputs.valueAt(i); in isStreamActive() local
1802 if (outputDesc->isStreamActive(stream, inPastMs, sysTime)) { in isStreamActive()
1814 const sp<AudioOutputDescriptor> outputDesc = mOutputs.valueAt(i); in isStreamActiveRemotely() local
1815 if (((outputDesc->device() & APM_AUDIO_OUT_DEVICE_REMOTE_ALL) != 0) && in isStreamActiveRemotely()
1816 outputDesc->isStreamActive(stream, inPastMs, sysTime)) { in isStreamActiveRemotely()
2068 sp<AudioOutputDescriptor> outputDesc = NULL; in getOutputFromId() local
2070 outputDesc = mOutputs.valueAt(i); in getOutputFromId()
2071 if (outputDesc->mId == id) { in getOutputFromId()
2075 return outputDesc; in getOutputFromId()
2134 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(mPrimaryOutput); in availablePrimaryOutputDevices() local
2135 audio_devices_t devices = outputDesc->mProfile->mSupportedDevices.types(); in availablePrimaryOutputDevices()
2207 sp<AudioOutputDescriptor> outputDesc = getOutputFromId(patch->sources[0].id); in createAudioPatch() local
2208 if (outputDesc == NULL) { in createAudioPatch()
2212 ALOG_ASSERT(!outputDesc->isDuplicated(),"duplicated output %d in source in ports", in createAudioPatch()
2213 outputDesc->mIoHandle); in createAudioPatch()
2236 if (!outputDesc->mProfile->isCompatibleProfile(devDesc->mDeviceType, in createAudioPatch()
2254 devices.types(), outputDesc->mIoHandle); in createAudioPatch()
2255 setOutputDevice(outputDesc->mIoHandle, devices.types(), true, 0, handle); in createAudioPatch()
2362 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(output); in createAudioPatch() local
2363 if (outputDesc->isDuplicated()) { in createAudioPatch()
2366 outputDesc->toAudioPortConfig(&newPatch.sources[1], &patch->sources[0]); in createAudioPatch()
2429 sp<AudioOutputDescriptor> outputDesc = getOutputFromId(patch->sources[0].id); in releaseAudioPatch() local
2430 if (outputDesc == NULL) { in releaseAudioPatch()
2435 setOutputDevice(outputDesc->mIoHandle, in releaseAudioPatch()
2436 getNewOutputDevice(outputDesc->mIoHandle, true /*fromCache*/), in releaseAudioPatch()
2514 sp<AudioOutputDescriptor> outputDesc = getOutputFromId(config->id); in setAudioPortConfig() local
2515 if (outputDesc == NULL) { in setAudioPortConfig()
2518 ALOG_ASSERT(!outputDesc->isDuplicated(), in setAudioPortConfig()
2520 outputDesc->mIoHandle); in setAudioPortConfig()
2521 audioPortConfig = outputDesc; in setAudioPortConfig()
2718 sp<AudioOutputDescriptor> outputDesc = new AudioOutputDescriptor(outProfile); in AudioPolicyManager() local
2720 outputDesc->mDevice = profileType; in AudioPolicyManager()
2722 config.sample_rate = outputDesc->mSamplingRate; in AudioPolicyManager()
2723 config.channel_mask = outputDesc->mChannelMask; in AudioPolicyManager()
2724 config.format = outputDesc->mFormat; in AudioPolicyManager()
2729 &outputDesc->mDevice, in AudioPolicyManager()
2731 &outputDesc->mLatency, in AudioPolicyManager()
2732 outputDesc->mFlags); in AudioPolicyManager()
2736 outputDesc->mDevice, in AudioPolicyManager()
2739 outputDesc->mSamplingRate = config.sample_rate; in AudioPolicyManager()
2740 outputDesc->mChannelMask = config.channel_mask; in AudioPolicyManager()
2741 outputDesc->mFormat = config.format; in AudioPolicyManager()
2757 addOutput(output, outputDesc); in AudioPolicyManager()
2759 outputDesc->mDevice, in AudioPolicyManager()
2992 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(mPrimaryOutput); in threadLoop() local
2995 audio_module_handle_t moduleHandle = outputDesc->mModule->mHandle; in threadLoop()
2999 sp<AudioOutputDescriptor> outputDesc = new AudioOutputDescriptor(NULL); in threadLoop() local
3000 outputDesc->mDevice = AUDIO_DEVICE_OUT_SPEAKER; in threadLoop()
3002 config.sample_rate = outputDesc->mSamplingRate; in threadLoop()
3003 config.channel_mask = outputDesc->mChannelMask; in threadLoop()
3004 config.format = outputDesc->mFormat; in threadLoop()
3008 &outputDesc->mDevice, in threadLoop()
3010 &outputDesc->mLatency, in threadLoop()
3011 outputDesc->mFlags); in threadLoop()
3015 outputDesc->mSamplingRate, outputDesc->mFormat, outputDesc->mChannelMask); in threadLoop()
3017 outputDesc->mSamplingRate = config.sample_rate; in threadLoop()
3018 outputDesc->mChannelMask = config.channel_mask; in threadLoop()
3019 outputDesc->mFormat = config.format; in threadLoop()
3023 addOutput(mPrimaryOutput, outputDesc); in threadLoop()
3055 void AudioPolicyManager::addOutput(audio_io_handle_t output, sp<AudioOutputDescriptor> outputDesc) in addOutput() argument
3057 outputDesc->mIoHandle = output; in addOutput()
3058 outputDesc->mId = nextUniqueId(); in addOutput()
3059 mOutputs.add(output, outputDesc); in addOutput()
3563 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(output); in closeOutput() local
3564 if (outputDesc == NULL) { in closeOutput()
3573 (dupOutputDesc->mOutput1 == outputDesc || in closeOutput()
3574 dupOutputDesc->mOutput2 == outputDesc)) { in closeOutput()
3576 if (dupOutputDesc->mOutput1 == outputDesc) { in closeOutput()
3599 ssize_t index = mAudioPatches.indexOfKey(outputDesc->mPatchHandle); in closeOutput()
3734 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueAt(i); in getA2dpOutput() local
3735 if (!outputDesc->isDuplicated() && outputDesc->device() & AUDIO_DEVICE_OUT_ALL_A2DP) { in getA2dpOutput()
3792 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(output); in getNewOutputDevice() local
3794 ssize_t index = mAudioPatches.indexOfKey(outputDesc->mPatchHandle); in getNewOutputDevice()
3799 outputDesc->device(), outputDesc->mPatchHandle); in getNewOutputDevice()
3800 return outputDesc->device(); in getNewOutputDevice()
3819 if (outputDesc->isStrategyActive(STRATEGY_ENFORCED_AUDIBLE) && in getNewOutputDevice()
3823 outputDesc->isStrategyActive(STRATEGY_PHONE)) { in getNewOutputDevice()
3825 } else if (outputDesc->isStrategyActive(STRATEGY_ENFORCED_AUDIBLE)) { in getNewOutputDevice()
3827 } else if (outputDesc->isStrategyActive(STRATEGY_SONIFICATION)) { in getNewOutputDevice()
3829 } else if (outputDesc->isStrategyActive(STRATEGY_SONIFICATION_RESPECTFUL)) { in getNewOutputDevice()
3831 } else if (outputDesc->isStrategyActive(STRATEGY_MEDIA)) { in getNewOutputDevice()
3833 } else if (outputDesc->isStrategyActive(STRATEGY_DTMF)) { in getNewOutputDevice()
3877 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(outputs[i]); in getDevicesForStream() local
3878 if (outputDesc->isStrategyActive(strategy)) { in getDevicesForStream()
3879 devices = outputDesc->device(); in getDevicesForStream()
4234 uint32_t AudioPolicyManager::checkDeviceMuteStrategies(sp<AudioOutputDescriptor> outputDesc, in checkDeviceMuteStrategies() argument
4241 if (outputDesc->isDuplicated()) { in checkDeviceMuteStrategies()
4246 audio_devices_t device = outputDesc->device(); in checkDeviceMuteStrategies()
4247 bool shouldMute = outputDesc->isActive() && (popcount(device) >= 2); in checkDeviceMuteStrategies()
4254 if (mute && !outputDesc->mStrategyMutedByDevice[i]) { in checkDeviceMuteStrategies()
4256 outputDesc->mStrategyMutedByDevice[i] = true; in checkDeviceMuteStrategies()
4257 } else if (!mute && outputDesc->mStrategyMutedByDevice[i]){ in checkDeviceMuteStrategies()
4259 outputDesc->mStrategyMutedByDevice[i] = false; in checkDeviceMuteStrategies()
4265 if ((desc->supportedDevices() & outputDesc->supportedDevices()) in checkDeviceMuteStrategies()
4291 if (outputDesc->isActive() && (device != prevDevice)) { in checkDeviceMuteStrategies()
4292 if (muteWaitMs < outputDesc->latency() * 2) { in checkDeviceMuteStrategies()
4293 muteWaitMs = outputDesc->latency() * 2; in checkDeviceMuteStrategies()
4296 if (outputDesc->isStrategyActive((routing_strategy)i)) { in checkDeviceMuteStrategies()
4297 setStrategyMute((routing_strategy)i, true, outputDesc->mIoHandle); in checkDeviceMuteStrategies()
4299 setStrategyMute((routing_strategy)i, false, outputDesc->mIoHandle, in checkDeviceMuteStrategies()
4322 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(output); in setOutputDevice() local
4326 if (outputDesc->isDuplicated()) { in setOutputDevice()
4327 muteWaitMs = setOutputDevice(outputDesc->mOutput1->mIoHandle, device, force, delayMs); in setOutputDevice()
4328 muteWaitMs += setOutputDevice(outputDesc->mOutput2->mIoHandle, device, force, delayMs); in setOutputDevice()
4334 ((device & outputDesc->mProfile->mSupportedDevices.types()) == 0)) { in setOutputDevice()
4339 device = (audio_devices_t)(device & outputDesc->mProfile->mSupportedDevices.types()); in setOutputDevice()
4341 audio_devices_t prevDevice = outputDesc->mDevice; in setOutputDevice()
4346 outputDesc->mDevice = device; in setOutputDevice()
4348 muteWaitMs = checkDeviceMuteStrategies(outputDesc, prevDevice, delayMs); in setOutputDevice()
4370 outputDesc->toAudioPortConfig(&patch.sources[0]); in setOutputDevice()
4381 index = mAudioPatches.indexOfKey(outputDesc->mPatchHandle); in setOutputDevice()
4409 outputDesc->mPatchHandle = patchDesc->mHandle; in setOutputDevice()
4440 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(output); in resetOutputDevice() local
4445 index = mAudioPatches.indexOfKey(outputDesc->mPatchHandle); in resetOutputDevice()
4453 outputDesc->mPatchHandle = 0; in resetOutputDevice()
4988 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(output); in computeVolume() local
4992 device = outputDesc->device(); in computeVolume()
5134 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(output); in setStreamMute() local
5136 device = outputDesc->device(); in setStreamMute()
5140 stream, on, output, outputDesc->mMuteCount[stream], device); in setStreamMute()
5143 if (outputDesc->mMuteCount[stream] == 0) { in setStreamMute()
5151 outputDesc->mMuteCount[stream]++; in setStreamMute()
5153 if (outputDesc->mMuteCount[stream] == 0) { in setStreamMute()
5157 if (--outputDesc->mMuteCount[stream] == 0) { in setStreamMute()
5179 sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(mPrimaryOutput); in handleIncallSonification() local
5181 stream, starting, outputDesc->mDevice, stateChange); in handleIncallSonification()
5182 if (outputDesc->mRefCount[stream]) { in handleIncallSonification()
5185 muteCount = outputDesc->mRefCount[stream]; in handleIncallSonification()
5194 if (outputDesc->device() & in handleIncallSonification()
5281 const sp<AudioOutputDescriptor> outputDesc) in sharesHwModuleWith() argument
5284 return mOutput1->sharesHwModuleWith(outputDesc) || mOutput2->sharesHwModuleWith(outputDesc); in sharesHwModuleWith()
5285 } else if (outputDesc->isDuplicated()){ in sharesHwModuleWith()
5286 return sharesHwModuleWith(outputDesc->mOutput1) || sharesHwModuleWith(outputDesc->mOutput2); in sharesHwModuleWith()
5288 return (mProfile->mModule == outputDesc->mProfile->mModule); in sharesHwModuleWith()