Lines Matching refs:sourceDesc

5096     sp<SourceClientDescriptor> sourceDesc =  in createAudioPatch()  local
5101 sourceDesc->setPreferredDeviceId(sinkDevice->getId()); in createAudioPatch()
5104 connectAudioSourceToSink(sourceDesc, sinkDevice, patch, *handle, uid, 0 /* delayMs */); in createAudioPatch()
5109 mAudioSources.add(portId, sourceDesc); in createAudioPatch()
5114 const sp<SourceClientDescriptor>& sourceDesc, const sp<DeviceDescriptor> &sinkDevice, in connectAudioSourceToSink() argument
5119 status_t status = createAudioPatchInternal(patch, &handle, uid, delayMs, sourceDesc); in connectAudioSourceToSink()
5124 sourceDesc->connect(handle, sinkDevice); in connectAudioSourceToSink()
5129 sp<SwAudioOutputDescriptor> swOutput = sourceDesc->swOutput().promote(); in connectAudioSourceToSink()
5131 if (swOutput->getClient(sourceDesc->portId()) != nullptr) { in connectAudioSourceToSink()
5139 swOutput->addClient(sourceDesc); in connectAudioSourceToSink()
5140 status = startSource(swOutput, sourceDesc, &delayMs); in connectAudioSourceToSink()
5152 releaseOutput(sourceDesc->portId()); in connectAudioSourceToSink()
5154 sourceDesc->setSwOutput(nullptr); in connectAudioSourceToSink()
5163 const sp<SourceClientDescriptor>& sourceDesc) in createAudioPatchInternal() argument
5356 if (!sourceDesc->isInternal()) { in createAudioPatchInternal()
5358 audio_attributes_t attributes = sourceDesc->attributes(); in createAudioPatchInternal()
5359 audio_stream_type_t stream = sourceDesc->stream(); in createAudioPatchInternal()
5362 config.sample_rate = sourceDesc->config().sample_rate; in createAudioPatchInternal()
5363 audio_channel_mask_t sourceMask = sourceDesc->config().channel_mask; in createAudioPatchInternal()
5368 config.format = sourceDesc->config().format; in createAudioPatchInternal()
5376 &stream, sourceDesc->uid(), &config, &flags, in createAudioPatchInternal()
5390 sourceDesc->setSwOutput(outputDesc, closeOutput); in createAudioPatchInternal()
5409 sourceDesc->setSwOutput(outputDesc, /* closeOutput= */ false); in createAudioPatchInternal()
5420 (!sourceDesc->isInternal() && in createAudioPatchInternal()
5426 sourceDesc->setUseSwBridge(); in createAudioPatchInternal()
5432 (!sourceDesc->isInternal() || sourceDesc->isCallTx()) ? in createAudioPatchInternal()
5433 mEngine->getStreamTypeForAttributes(sourceDesc->attributes()) : in createAudioPatchInternal()
5473 sp<SourceClientDescriptor> sourceDesc = mAudioSources.valueAt(i); in releaseAudioPatch() local
5474 if (sourceDesc != nullptr && sourceDesc->getPatchHandle() == handle) { in releaseAudioPatch()
5475 portId = sourceDesc->portId(); in releaseAudioPatch()
5485 const sp<SourceClientDescriptor>& sourceDesc) in releaseAudioPatchInternal() argument
5531 } else if (patch->num_sources == 1 && sourceDesc != nullptr) { in releaseAudioPatchInternal()
5532 outputDesc = sourceDesc->swOutput().promote(); in releaseAudioPatchInternal()
5542 const bool force = sourceDesc->canCloseOutput() && !outputDesc->isActive(); in releaseAudioPatchInternal()
5549 bool updateDevice = outputDesc->isActive() || !sourceDesc->useSwBridge() || in releaseAudioPatchInternal()
5550 sourceDesc->canCloseOutput(); in releaseAudioPatchInternal()
5744 sp<SourceClientDescriptor> sourceDesc = mAudioSources.valueAt(i); in clearAudioSources() local
5745 if (sourceDesc->uid() == uid) { in clearAudioSources()
5808 sp<SourceClientDescriptor> sourceDesc = in startAudioSourceInternal() local
5814 status_t status = connectAudioSource(sourceDesc, delayMs); in startAudioSourceInternal()
5816 mAudioSources.add(*portId, sourceDesc); in startAudioSourceInternal()
5821 status_t AudioPolicyManager::connectAudioSource(const sp<SourceClientDescriptor>& sourceDesc, in connectAudioSource() argument
5824 ALOGV("%s handle %d", __FUNCTION__, sourceDesc->portId()); in connectAudioSource()
5827 disconnectAudioSource(sourceDesc); in connectAudioSource()
5829 audio_attributes_t attributes = sourceDesc->attributes(); in connectAudioSource()
5832 sourceDesc->srcDevice()->type(), in connectAudioSource()
5833 String8(sourceDesc->srcDevice()->address().c_str()), in connectAudioSource()
5848 sourceDesc, sinkDevice, patchBuilder.patch(), handle, mUidCached, delayMs); in connectAudioSource()
5853 sp<SourceClientDescriptor> sourceDesc = mAudioSources.valueFor(portId); in stopAudioSource() local
5855 if (sourceDesc == 0) { in stopAudioSource()
5859 status_t status = disconnectAudioSource(sourceDesc); in stopAudioSource()
6163 status_t AudioPolicyManager::disconnectAudioSource(const sp<SourceClientDescriptor>& sourceDesc) in disconnectAudioSource() argument
6165 ALOGV("%s port Id %d", __FUNCTION__, sourceDesc->portId()); in disconnectAudioSource()
6166 if (!sourceDesc->isConnected()) { in disconnectAudioSource()
6167 ALOGV("%s port Id %d already disconnected", __FUNCTION__, sourceDesc->portId()); in disconnectAudioSource()
6170 sp<SwAudioOutputDescriptor> swOutput = sourceDesc->swOutput().promote(); in disconnectAudioSource()
6172 status_t status = stopSource(swOutput, sourceDesc); in disconnectAudioSource()
6176 if (releaseOutput(sourceDesc->portId())) { in disconnectAudioSource()
6182 sp<HwAudioOutputDescriptor> hwOutputDesc = sourceDesc->hwOutput().promote(); in disconnectAudioSource()
6189 status_t status = releaseAudioPatchInternal(sourceDesc->getPatchHandle(), 0, sourceDesc); in disconnectAudioSource()
6190 sourceDesc->disconnect(); in disconnectAudioSource()
6199 sp<SourceClientDescriptor> sourceDesc = mAudioSources.valueAt(i); in getSourceForAttributesOnOutput() local
6200 sp<SwAudioOutputDescriptor> outputDesc = sourceDesc->swOutput().promote(); in getSourceForAttributesOnOutput()
6201 if (followsSameRouting(attr, sourceDesc->attributes()) && in getSourceForAttributesOnOutput()
6203 source = sourceDesc; in getSourceForAttributesOnOutput()
7190 sp<SourceClientDescriptor> sourceDesc = mAudioSources.valueAt(i); in checkAudioSourceForAttributes() local
7191 if (sourceDesc != nullptr && followsSameRouting(attr, sourceDesc->attributes()) in checkAudioSourceForAttributes()
7192 && sourceDesc->getPatchHandle() == AUDIO_PATCH_HANDLE_NONE in checkAudioSourceForAttributes()
7193 && !sourceDesc->isCallRx() && !sourceDesc->isInternal()) { in checkAudioSourceForAttributes()
7194 connectAudioSource(sourceDesc, 0 /*delayMs*/); in checkAudioSourceForAttributes()
7202 sp<SourceClientDescriptor> sourceDesc = mAudioSources.valueAt(i); in clearAudioSourcesForOutput() local
7203 if (sourceDesc != nullptr && sourceDesc->swOutput().promote() != nullptr in clearAudioSourcesForOutput()
7204 && sourceDesc->swOutput().promote()->mIoHandle == output) { in clearAudioSourcesForOutput()
7205 disconnectAudioSource(sourceDesc); in clearAudioSourcesForOutput()
8467 sp<SourceClientDescriptor> sourceDesc = mAudioSources.valueAt(i); in cleanUpForDevice() local
8468 if (sourceDesc->isConnected() && (sourceDesc->srcDevice()->equals(deviceDesc) || in cleanUpForDevice()
8469 sourceDesc->sinkDevice()->equals(deviceDesc)) in cleanUpForDevice()
8470 && !sourceDesc->isCallRx()) { in cleanUpForDevice()
8471 disconnectAudioSource(sourceDesc); in cleanUpForDevice()