Lines Matching refs:patch
65 status_t AudioFlinger::createAudioPatch(const struct audio_patch *patch, in createAudioPatch() argument
69 return mPatchPanel.createAudioPatch(patch, handle); in createAudioPatch()
113 status_t AudioFlinger::PatchPanel::createAudioPatch(const struct audio_patch *patch, in createAudioPatch() argument
116 if (handle == NULL || patch == NULL) { in createAudioPatch()
120 __func__, patch->num_sources, patch->num_sinks, *handle); in createAudioPatch()
124 if (!audio_patch_is_valid(patch) || (patch->num_sinks == 0 && patch->num_sources != 2)) { in createAudioPatch()
129 if (patch->num_sources > 2) { in createAudioPatch()
151 (patch->sources[0].type != AUDIO_PORT_TYPE_DEVICE || in createAudioPatch()
153 patch->sources[0].ext.device.hw_module)) { in createAudioPatch()
155 } else if (patch->num_sinks == 0 || in createAudioPatch()
157 (patch->sinks[0].type != AUDIO_PORT_TYPE_DEVICE || in createAudioPatch()
159 patch->sinks[0].ext.device.hw_module))) { in createAudioPatch()
176 Patch newPatch{*patch}; in createAudioPatch()
179 switch (patch->sources[0].type) { in createAudioPatch()
181 audio_module_handle_t srcModule = patch->sources[0].ext.device.hw_module; in createAudioPatch()
187 for (unsigned int i = 0; i < patch->num_sinks; i++) { in createAudioPatch()
189 if ((patch->sinks[i].type == AUDIO_PORT_TYPE_MIX || in createAudioPatch()
190 (patch->sinks[i].type == AUDIO_PORT_TYPE_DEVICE && in createAudioPatch()
191 patch->sinks[i].ext.device.hw_module != srcModule)) && in createAudioPatch()
192 patch->num_sinks > 1) { in createAudioPatch()
198 if (patch->sinks[i].type != patch->sinks[0].type) { in createAudioPatch()
210 if ((patch->num_sources == 2) || in createAudioPatch()
211 ((patch->sinks[0].type == AUDIO_PORT_TYPE_DEVICE) && in createAudioPatch()
212 ((patch->sinks[0].ext.device.hw_module != srcModule) || in createAudioPatch()
214 audio_devices_t outputDevice = patch->sinks[0].ext.device.type; in createAudioPatch()
215 String8 outputDeviceAddress = String8(patch->sinks[0].ext.device.address); in createAudioPatch()
216 if (patch->num_sources == 2) { in createAudioPatch()
217 if (patch->sources[1].type != AUDIO_PORT_TYPE_MIX || in createAudioPatch()
218 (patch->num_sinks != 0 && patch->sinks[0].ext.device.hw_module != in createAudioPatch()
219 patch->sources[1].ext.mix.hw_module)) { in createAudioPatch()
226 mAudioFlinger.checkPlaybackThread_l(patch->sources[1].ext.mix.handle); in createAudioPatch()
239 if (patch->sinks[0].config_mask & AUDIO_PORT_CONFIG_SAMPLE_RATE) { in createAudioPatch()
240 config.sample_rate = patch->sinks[0].sample_rate; in createAudioPatch()
242 if (patch->sinks[0].config_mask & AUDIO_PORT_CONFIG_CHANNEL_MASK) { in createAudioPatch()
243 config.channel_mask = patch->sinks[0].channel_mask; in createAudioPatch()
245 if (patch->sinks[0].config_mask & AUDIO_PORT_CONFIG_FORMAT) { in createAudioPatch()
246 config.format = patch->sinks[0].format; in createAudioPatch()
248 if (patch->sinks[0].config_mask & AUDIO_PORT_CONFIG_FLAGS) { in createAudioPatch()
249 flags = patch->sinks[0].flags.output; in createAudioPatch()
252 patch->sinks[0].ext.device.hw_module, in createAudioPatch()
265 audio_devices_t device = patch->sources[0].ext.device.type; in createAudioPatch()
266 String8 address = String8(patch->sources[0].ext.device.address); in createAudioPatch()
270 if (patch->sources[0].config_mask & AUDIO_PORT_CONFIG_SAMPLE_RATE) { in createAudioPatch()
271 config.sample_rate = patch->sources[0].sample_rate; in createAudioPatch()
275 if (patch->sources[0].config_mask & AUDIO_PORT_CONFIG_CHANNEL_MASK) { in createAudioPatch()
276 config.channel_mask = patch->sources[0].channel_mask; in createAudioPatch()
281 if (patch->sources[0].config_mask & AUDIO_PORT_CONFIG_FORMAT) { in createAudioPatch()
282 config.format = patch->sources[0].format; in createAudioPatch()
287 patch->sources[0].config_mask & AUDIO_PORT_CONFIG_FLAGS ? in createAudioPatch()
288 patch->sources[0].flags.input : AUDIO_INPUT_FLAG_NONE; in createAudioPatch()
314 if (patch->sinks[0].type == AUDIO_PORT_TYPE_MIX) { in createAudioPatch()
316 patch->sinks[0].ext.mix.handle); in createAudioPatch()
318 thread = mAudioFlinger.checkMmapThread_l(patch->sinks[0].ext.mix.handle); in createAudioPatch()
321 __func__, patch->sinks[0].ext.mix.handle); in createAudioPatch()
326 status = thread->sendCreateAudioPatchConfigEvent(patch, &halHandle); in createAudioPatch()
340 status = hwDevice->createAudioPatch(patch->num_sources, in createAudioPatch()
341 patch->sources, in createAudioPatch()
342 patch->num_sinks, in createAudioPatch()
343 patch->sinks, in createAudioPatch()
350 audio_module_handle_t srcModule = patch->sources[0].ext.mix.hw_module; in createAudioPatch()
359 for (unsigned int i = 0; i < patch->num_sinks; i++) { in createAudioPatch()
360 if (patch->sinks[i].type != AUDIO_PORT_TYPE_DEVICE) { in createAudioPatch()
362 __func__, patch->sinks[i].type); in createAudioPatch()
367 if (patch->sinks[i].ext.device.hw_module != srcModule) { in createAudioPatch()
372 patch->sinks[i].ext.device.type); in createAudioPatch()
373 device->setAddress(patch->sinks[i].ext.device.address); in createAudioPatch()
374 device->applyAudioPortConfig(&patch->sinks[i]); in createAudioPatch()
378 mAudioFlinger.checkPlaybackThread_l(patch->sources[0].ext.mix.handle); in createAudioPatch()
380 thread = mAudioFlinger.checkMmapThread_l(patch->sources[0].ext.mix.handle); in createAudioPatch()
383 __func__, patch->sources[0].ext.mix.handle); in createAudioPatch()
392 status = thread->sendCreateAudioPatchConfigEvent(patch, &halHandle); in createAudioPatch()
436 addSink(mRecord.thread(), { .source = AUDIO_SOURCE_MIC }).patch(), in createConnections()
446 PatchBuilder().addSource(mPlayback.thread()).addSink(mAudioPatch.sinks[0]).patch(), in createConnections()
685 const struct audio_patch &patch = removedPatch.mAudioPatch; in releaseAudioPatch() local
687 const struct audio_port_config &src = patch.sources[0]; in releaseAudioPatch()
702 if (patch.sinks[0].type == AUDIO_PORT_TYPE_MIX) { in releaseAudioPatch()
703 audio_io_handle_t ioHandle = patch.sinks[0].ext.mix.handle; in releaseAudioPatch()
767 const Patch &patch = patch_iter->second; in getDownstreamSoftwarePatches() local
769 patch.mPlayback.const_thread()->id(), in getDownstreamSoftwarePatches()
770 patch.mRecord.const_thread()->id()); in getDownstreamSoftwarePatches()
854 for (const auto& patch : module.second.sw_patches) { in dump() local
855 moduleDump.appendFormat("%d ", patch); in dump()