Lines Matching defs:outputDesc
559 AudioOutputDescriptor *outputDesc = new AudioOutputDescriptor(NULL);
560 outputDesc->mDevice = mTestDevice;
561 outputDesc->mSamplingRate = mTestSamplingRate;
562 outputDesc->mFormat = mTestFormat;
563 outputDesc->mChannelMask = mTestChannels;
564 outputDesc->mLatency = mTestLatencyMs;
565 outputDesc->mFlags = (audio_output_flags_t)(mDirectOutput ? AudioSystem::OUTPUT_FLAG_DIRECT : 0);
566 outputDesc->mRefCount[stream] = 0;
567 mTestOutputs[mCurOutput] = mpClientInterface->openOutput(0, &outputDesc->mDevice,
568 &outputDesc->mSamplingRate,
569 &outputDesc->mFormat,
570 &outputDesc->mChannelMask,
571 &outputDesc->mLatency,
572 outputDesc->mFlags,
578 addOutput(mTestOutputs[mCurOutput], outputDesc);
610 AudioOutputDescriptor *outputDesc = NULL;
615 outputDesc = desc;
617 if ((samplingRate == outputDesc->mSamplingRate) &&
618 (format == outputDesc->mFormat) &&
619 (channelMask == outputDesc->mChannelMask)) {
620 outputDesc->mDirectOpenCount++;
627 if (outputDesc != NULL) {
628 closeOutput(outputDesc->mId);
630 outputDesc = new AudioOutputDescriptor(profile);
631 outputDesc->mDevice = device;
632 outputDesc->mSamplingRate = samplingRate;
633 outputDesc->mFormat = format;
634 outputDesc->mChannelMask = channelMask;
635 outputDesc->mLatency = 0;
636 outputDesc->mFlags =(audio_output_flags_t) (outputDesc->mFlags | flags);
637 outputDesc->mRefCount[stream] = 0;
638 outputDesc->mStopTime[stream] = 0;
639 outputDesc->mDirectOpenCount = 1;
641 &outputDesc->mDevice,
642 &outputDesc->mSamplingRate,
643 &outputDesc->mFormat,
644 &outputDesc->mChannelMask,
645 &outputDesc->mLatency,
646 outputDesc->mFlags,
651 (samplingRate != 0 && samplingRate != outputDesc->mSamplingRate) ||
652 (format != AUDIO_FORMAT_DEFAULT && format != outputDesc->mFormat) ||
653 (channelMask != 0 && channelMask != outputDesc->mChannelMask)) {
656 outputDesc->mSamplingRate, format, outputDesc->mFormat, channelMask,
657 outputDesc->mChannelMask);
661 delete outputDesc;
665 addOutput(output, outputDesc);
717 AudioOutputDescriptor *outputDesc = mOutputs.valueFor(outputs[i]);
718 if (!outputDesc->isDuplicated()) {
719 int commonFlags = (int)AudioSystem::popCount(outputDesc->mProfile->mFlags & flags);
725 if (outputDesc->mProfile->mFlags & AUDIO_OUTPUT_FLAG_PRIMARY) {
752 AudioOutputDescriptor *outputDesc = mOutputs.valueAt(index);
757 outputDesc->changeRefCount(stream, 1);
759 if (outputDesc->mRefCount[stream] == 1) {
768 if (desc != outputDesc) {
773 if (outputDesc->sharesHwModuleWith(desc) &&
820 AudioOutputDescriptor *outputDesc = mOutputs.valueAt(index);
827 if (outputDesc->mRefCount[stream] > 0) {
829 outputDesc->changeRefCount(stream, -1);
831 if (outputDesc->mRefCount[stream] == 0) {
832 outputDesc->mStopTime[stream] = systemTime();
839 setOutputDevice(output, newDevice, false, outputDesc->mLatency*2);
848 outputDesc->sharesHwModuleWith(desc) &&
853 outputDesc->mLatency*2);
878 AudioOutputDescriptor *outputDesc = mOutputs.valueAt(index);
879 if (outputDesc->isActive()) {
1349 const AudioOutputDescriptor *outputDesc = mOutputs.valueAt(i);
1350 if (outputDesc->isStreamActive((AudioSystem::stream_type)stream, inPastMs, sysTime)) {
1361 const AudioOutputDescriptor *outputDesc = mOutputs.valueAt(i);
1362 if (((outputDesc->device() & APM_AUDIO_OUT_DEVICE_REMOTE_ALL) != 0) &&
1363 outputDesc->isStreamActive((AudioSystem::stream_type)stream, inPastMs, sysTime)) {
1592 AudioOutputDescriptor *outputDesc = new AudioOutputDescriptor(outProfile);
1593 outputDesc->mDevice = (audio_devices_t)(mDefaultOutputDevice &
1597 &outputDesc->mDevice,
1598 &outputDesc->mSamplingRate,
1599 &outputDesc->mFormat,
1600 &outputDesc->mChannelMask,
1601 &outputDesc->mLatency,
1602 outputDesc->mFlags);
1604 delete outputDesc;
1612 addOutput(output, outputDesc);
1774 AudioOutputDescriptor *outputDesc = mOutputs.valueFor(mPrimaryOutput);
1777 audio_module_handle_t moduleHandle = outputDesc->mModule->mHandle;
1782 AudioOutputDescriptor *outputDesc = new AudioOutputDescriptor(NULL);
1783 outputDesc->mDevice = AUDIO_DEVICE_OUT_SPEAKER;
1785 &outputDesc->mDevice,
1786 &outputDesc->mSamplingRate,
1787 &outputDesc->mFormat,
1788 &outputDesc->mChannelMask,
1789 &outputDesc->mLatency,
1790 outputDesc->mFlags);
1793 outputDesc->mSamplingRate, outputDesc->mFormat, outputDesc->mChannelMask);
1798 addOutput(mPrimaryOutput, outputDesc);
1830 void AudioPolicyManagerBase::addOutput(audio_io_handle_t id, AudioOutputDescriptor *outputDesc)
1832 outputDesc->mId = id;
1833 mOutputs.add(id, outputDesc);
2247 AudioOutputDescriptor *outputDesc = mOutputs.valueFor(output);
2248 if (outputDesc == NULL) {
2257 (dupOutputDesc->mOutput1 == outputDesc ||
2258 dupOutputDesc->mOutput2 == outputDesc)) {
2260 if (dupOutputDesc->mOutput1 == outputDesc) {
2287 delete outputDesc;
2387 AudioOutputDescriptor *outputDesc = mOutputs.valueAt(i);
2388 if (!outputDesc->isDuplicated() && outputDesc->device() & AUDIO_DEVICE_OUT_ALL_A2DP) {
2445 AudioOutputDescriptor *outputDesc = mOutputs.valueFor(output);
2459 if (outputDesc->isStrategyActive(STRATEGY_ENFORCED_AUDIBLE)) {
2462 outputDesc->isStrategyActive(STRATEGY_PHONE)) {
2464 } else if (outputDesc->isStrategyActive(STRATEGY_SONIFICATION)) {
2466 } else if (outputDesc->isStrategyActive(STRATEGY_SONIFICATION_RESPECTFUL)) {
2468 } else if (outputDesc->isStrategyActive(STRATEGY_MEDIA)) {
2470 } else if (outputDesc->isStrategyActive(STRATEGY_DTMF)) {
2754 uint32_t AudioPolicyManagerBase::checkDeviceMuteStrategies(AudioOutputDescriptor *outputDesc,
2761 if (outputDesc->isDuplicated()) {
2766 audio_devices_t device = outputDesc->device();
2767 bool shouldMute = outputDesc->isActive() && (AudioSystem::popCount(device) >= 2);
2770 bool tempMute = outputDesc->isActive() && (device != prevDevice);
2777 if (mute && !outputDesc->mStrategyMutedByDevice[i]) {
2779 outputDesc->mStrategyMutedByDevice[i] = true;
2780 } else if (!mute && outputDesc->mStrategyMutedByDevice[i]){
2782 outputDesc->mStrategyMutedByDevice[i] = false;
2788 if ((desc->supportedDevices() & outputDesc->supportedDevices())
2798 if (tempMute && (desc == outputDesc)) {
2803 if ((tempMute && (desc == outputDesc)) || mute) {
2833 AudioOutputDescriptor *outputDesc = mOutputs.valueFor(output);
2837 if (outputDesc->isDuplicated()) {
2838 muteWaitMs = setOutputDevice(outputDesc->mOutput1->mId, device, force, delayMs);
2839 muteWaitMs += setOutputDevice(outputDesc->mOutput2->mId, device, force, delayMs);
2845 ((device & outputDesc->mProfile->mSupportedDevices) == 0)) {
2850 device = (audio_devices_t)(device & outputDesc->mProfile->mSupportedDevices);
2852 audio_devices_t prevDevice = outputDesc->mDevice;
2857 outputDesc->mDevice = device;
2860 if (outputDesc->mForceRouting) {
2865 outputDesc->mForceRouting = false;
2871 outputDesc->mForceRouting = true;
2874 muteWaitMs = checkDeviceMuteStrategies(outputDesc, prevDevice, delayMs);
3239 AudioOutputDescriptor *outputDesc = mOutputs.valueFor(output);
3243 device = outputDesc->device();
3391 AudioOutputDescriptor *outputDesc = mOutputs.valueFor(output);
3393 device = outputDesc->device();
3397 stream, on, output, outputDesc->mMuteCount[stream], device);
3400 if (outputDesc->mMuteCount[stream] == 0) {
3408 outputDesc->mMuteCount[stream]++;
3410 if (outputDesc->mMuteCount[stream] == 0) {
3414 if (--outputDesc->mMuteCount[stream] == 0) {
3435 AudioOutputDescriptor *outputDesc = mOutputs.valueFor(mPrimaryOutput);
3437 stream, starting, outputDesc->mDevice, stateChange);
3438 if (outputDesc->mRefCount[stream]) {
3441 muteCount = outputDesc->mRefCount[stream];
3450 if (outputDesc->device() &
3534 const AudioOutputDescriptor *outputDesc)
3537 return mOutput1->sharesHwModuleWith(outputDesc) || mOutput2->sharesHwModuleWith(outputDesc);
3538 } else if (outputDesc->isDuplicated()){
3539 return sharesHwModuleWith(outputDesc->mOutput1) || sharesHwModuleWith(outputDesc->mOutput2);
3541 return (mProfile->mModule == outputDesc->mProfile->mModule);