Lines Matching defs:profile

39         "auto_switch=<Switch between hsp and a2dp profile? (0 - never, 1 - media.role=phone, 2 - heuristic> "
40 "a2dp_source=<Handle a2dp_source card profile (sink role)?> "
41 "ag=<Handle headset_audio_gateway or handsfree_audio_gateway card profile (headset role)?> ");
146 pa_card_profile *profile;
149 /* Find available profile and activate it */
150 PA_HASHMAP_FOREACH(profile, card->profiles, state) {
151 if (profile->available == PA_AVAILABLE_NO)
154 /* Check for correct profile based on revert_to_a2dp */
156 if (!pa_streq(profile->name, "a2dp_sink"))
159 if (!pa_streq(profile->name, "headset_head_unit") && !pa_streq(profile->name, "handsfree_head_unit"))
163 pa_log_debug("Setting card '%s' to profile '%s'", card->name, profile->name);
165 if (pa_card_set_profile(card, profile, false) != 0) {
166 pa_log_warn("Could not set profile '%s'", profile->name);
178 /* Switch profile for one card */
193 /* Skip card if does not have active headset profile */
197 /* Skip card if already has active a2dp profile */
201 /* Skip card if does not have active a2dp profile */
205 /* Skip card if already has active headset profile */
255 /* Switch profile for all cards */
264 /* When a source output is created, switch profile a2dp to profile hsp */
276 /* When all source outputs are unlinked, switch profile hsp back back to profile a2dp */
307 /* Ignore card if has already set other initial profile than a2dp */
312 /* Set initial profile to hsp */
329 pa_card_profile *profile;
332 PA_HASHMAP_FOREACH(profile, card->profiles, state) {
333 if (profile->available == PA_AVAILABLE_NO)
337 (profile->available == PA_AVAILABLE_YES && result->available == PA_AVAILABLE_UNKNOWN) ||
338 (profile->available == result->available && profile->priority > result->priority))
339 result = profile;
345 static pa_hook_result_t profile_available_hook_callback(pa_core *c, pa_card_profile *profile, void *userdata) {
352 pa_assert(profile);
353 pa_assert_se((card = profile->card));
361 if (pa_streq(profile->name, "a2dp_sink") ||
362 pa_streq(profile->name, "headset_head_unit") ||
363 pa_streq(profile->name, "handsfree_head_unit"))
366 is_active_profile = card->active_profile == profile;
368 if (profile->available == PA_AVAILABLE_YES) {
372 if (card->active_profile->available == PA_AVAILABLE_YES && card->active_profile->priority >= profile->priority)
375 selected_profile = profile;
386 pa_log_debug("Setting card '%s' to profile '%s'", card->name, selected_profile->name);
389 pa_log_warn("Could not set profile '%s'", selected_profile->name);
399 pa_card_profile *profile;
402 PA_HASHMAP_FOREACH(profile, card->profiles, state2)
403 profile_available_hook_callback(core, profile, NULL);