Lines Matching refs:p_peer
168 static void bta_av_co_audio_peer_reset_config(tBTA_AV_CO_PEER *p_peer);
171 static BOOLEAN bta_av_co_audio_peer_supports_codec(tBTA_AV_CO_PEER *p_peer, UINT8 *p_snk_index);
174 static BOOLEAN bta_av_co_audio_peer_src_supports_codec(tBTA_AV_CO_PEER *p_peer, UINT8 *p_src_index);
344 tBTA_AV_CO_PEER *p_peer; in bta_av_co_audio_disc_res() local
352 p_peer = bta_av_co_get_peer(hndl); in bta_av_co_audio_disc_res()
353 if (p_peer == NULL) in bta_av_co_audio_disc_res()
360 if (p_peer->opened) in bta_av_co_audio_disc_res()
366 bdcpy(p_peer->addr, addr); in bta_av_co_audio_disc_res()
367 p_peer->num_snks = num_snk; in bta_av_co_audio_disc_res()
368 p_peer->num_srcs = num_src; in bta_av_co_audio_disc_res()
369 p_peer->num_seps = num_seps; in bta_av_co_audio_disc_res()
370 p_peer->num_rx_snks = 0; in bta_av_co_audio_disc_res()
371 p_peer->num_rx_srcs = 0; in bta_av_co_audio_disc_res()
372 p_peer->num_sup_snks = 0; in bta_av_co_audio_disc_res()
374 p_peer->uuid_to_connect = UUID_SERVCLASS_AUDIO_SOURCE; in bta_av_co_audio_disc_res()
376 p_peer->uuid_to_connect = UUID_SERVCLASS_AUDIO_SINK; in bta_av_co_audio_disc_res()
463 tBTA_AV_CO_PEER *p_peer; in bta_av_audio_sink_getconfig() local
476 p_peer = bta_av_co_get_peer(hndl); in bta_av_audio_sink_getconfig()
477 if (p_peer == NULL) in bta_av_audio_sink_getconfig()
484 p_peer->opened, p_peer->num_srcs, p_peer->num_rx_srcs, p_peer->num_sup_srcs); in bta_av_audio_sink_getconfig()
486 p_peer->num_rx_srcs++; in bta_av_audio_sink_getconfig()
503 if (p_peer->num_sup_srcs < BTA_AV_CO_NUM_ELEMENTS(p_peer->srcs)) in bta_av_audio_sink_getconfig()
505 p_src = &p_peer->srcs[p_peer->num_sup_srcs++]; in bta_av_audio_sink_getconfig()
525 if ((p_peer->num_rx_srcs == p_peer->num_srcs) || in bta_av_audio_sink_getconfig()
526 (p_peer->num_sup_srcs == BTA_AV_CO_NUM_ELEMENTS(p_peer->srcs))) in bta_av_audio_sink_getconfig()
534 if (bta_av_co_audio_peer_src_supports_codec(p_peer, &index)) in bta_av_audio_sink_getconfig()
537 p_src = &p_peer->srcs[index]; in bta_av_audio_sink_getconfig()
542 p_peer->p_src = p_src; in bta_av_audio_sink_getconfig()
545 memcpy(p_peer->codec_cfg, pref_cfg, AVDT_CODEC_SIZE); in bta_av_audio_sink_getconfig()
548 p_peer->codec_cfg[1], p_peer->codec_cfg[2], p_peer->codec_cfg[3], in bta_av_audio_sink_getconfig()
549 p_peer->codec_cfg[4], p_peer->codec_cfg[5], p_peer->codec_cfg[6]); in bta_av_audio_sink_getconfig()
554 p_peer->cp_active = FALSE; in bta_av_audio_sink_getconfig()
559 memcpy(p_codec_info, p_peer->codec_cfg, AVDT_CODEC_SIZE); in bta_av_audio_sink_getconfig()
587 tBTA_AV_CO_PEER *p_peer; in bta_av_co_audio_getconfig() local
595 p_peer = bta_av_co_get_peer(hndl); in bta_av_co_audio_getconfig()
596 if (p_peer == NULL) in bta_av_co_audio_getconfig()
602 if (p_peer->uuid_to_connect == UUID_SERVCLASS_AUDIO_SOURCE) in bta_av_co_audio_getconfig()
614 p_peer->opened, p_peer->num_snks, p_peer->num_rx_snks, p_peer->num_sup_snks); in bta_av_co_audio_getconfig()
616 p_peer->num_rx_snks++; in bta_av_co_audio_getconfig()
633 if (p_peer->num_sup_snks < BTA_AV_CO_NUM_ELEMENTS(p_peer->snks)) in bta_av_co_audio_getconfig()
635 p_sink = &p_peer->snks[p_peer->num_sup_snks++]; in bta_av_co_audio_getconfig()
655 if ((p_peer->num_rx_snks == p_peer->num_snks) || in bta_av_co_audio_getconfig()
656 (p_peer->num_sup_snks == BTA_AV_CO_NUM_ELEMENTS(p_peer->snks))) in bta_av_co_audio_getconfig()
664 if (bta_av_co_audio_peer_supports_codec(p_peer, &index)) in bta_av_co_audio_getconfig()
667 if (p_peer->acp) in bta_av_co_audio_getconfig()
669 *p_sep_info_idx = p_peer->num_seps; in bta_av_co_audio_getconfig()
673 p_sink = &p_peer->snks[index]; in bta_av_co_audio_getconfig()
683 p_peer->p_snk = p_sink; in bta_av_co_audio_getconfig()
684 memcpy(p_peer->codec_cfg, codec_cfg, AVDT_CODEC_SIZE); in bta_av_co_audio_getconfig()
693 p_peer->cp_active = TRUE; in bta_av_co_audio_getconfig()
700 p_peer->cp_active = FALSE; in bta_av_co_audio_getconfig()
706 if (p_peer->acp) in bta_av_co_audio_getconfig()
708 if (p_peer->recfg_needed) in bta_av_co_audio_getconfig()
711 …BTA_AvReconfig(hndl, TRUE, p_sink->sep_info_idx, p_peer->codec_cfg, *p_num_protect, (UINT8 *)bta_a… in bta_av_co_audio_getconfig()
717 memcpy(p_codec_info, p_peer->codec_cfg, AVDT_CODEC_SIZE); in bta_av_co_audio_getconfig()
743 tBTA_AV_CO_PEER *p_peer; in bta_av_co_audio_setconfig() local
760 p_peer = bta_av_co_get_peer(hndl); in bta_av_co_audio_setconfig()
761 if (p_peer == NULL) in bta_av_co_audio_setconfig()
770 p_peer->opened, p_peer->num_snks, p_peer->num_rx_snks, p_peer->num_sup_snks); in bta_av_co_audio_setconfig()
773 if (p_peer->opened) in bta_av_co_audio_setconfig()
874 p_peer->acp = TRUE; in bta_av_co_audio_setconfig()
875 p_peer->recfg_needed = recfg_needed; in bta_av_co_audio_setconfig()
898 tBTA_AV_CO_PEER *p_peer; in bta_av_co_audio_open() local
906 p_peer = bta_av_co_get_peer(hndl); in bta_av_co_audio_open()
907 if (p_peer == NULL) in bta_av_co_audio_open()
913 p_peer->opened = TRUE; in bta_av_co_audio_open()
914 p_peer->mtu = mtu; in bta_av_co_audio_open()
932 tBTA_AV_CO_PEER *p_peer; in bta_av_co_audio_close() local
941 p_peer = bta_av_co_get_peer(hndl); in bta_av_co_audio_close()
942 if (p_peer) in bta_av_co_audio_close()
945 memset(p_peer, 0, sizeof(*p_peer)); in bta_av_co_audio_close()
1207 static void bta_av_co_audio_peer_reset_config(tBTA_AV_CO_PEER *p_peer) in bta_av_co_audio_peer_reset_config() argument
1212 p_peer->p_snk = NULL; in bta_av_co_audio_peer_reset_config()
1311 static BOOLEAN bta_av_co_audio_peer_supports_codec(tBTA_AV_CO_PEER *p_peer, UINT8 *p_snk_index) in bta_av_co_audio_peer_supports_codec() argument
1321 for (index = 0; index < p_peer->num_sup_snks; index++) in bta_av_co_audio_peer_supports_codec()
1323 if (p_peer->snks[index].codec_type == codec_type) in bta_av_co_audio_peer_supports_codec()
1329 return bta_av_co_audio_codec_match(p_peer->snks[index].codec_caps); in bta_av_co_audio_peer_supports_codec()
1352 static BOOLEAN bta_av_co_audio_peer_src_supports_codec(tBTA_AV_CO_PEER *p_peer, UINT8 *p_src_index) in bta_av_co_audio_peer_src_supports_codec() argument
1362 for (index = 0; index < p_peer->num_sup_srcs; index++) in bta_av_co_audio_peer_src_supports_codec()
1364 if (p_peer->srcs[index].codec_type == codec_type) in bta_av_co_audio_peer_src_supports_codec()
1370 if (0 == bta_av_sbc_cfg_matches_cap((UINT8 *)p_peer->srcs[index].codec_caps, in bta_av_co_audio_peer_src_supports_codec()
1464 tBTA_AV_CO_PEER *p_peer; in bta_av_co_audio_codec_supported() local
1481 p_peer = &bta_av_co_cb.peers[index]; in bta_av_co_audio_codec_supported()
1482 if (p_peer->opened) in bta_av_co_audio_codec_supported()
1484 if (bta_av_co_audio_peer_supports_codec(p_peer, &snk_index)) in bta_av_co_audio_codec_supported()
1486 p_sink = &p_peer->snks[snk_index]; in bta_av_co_audio_codec_supported()
1505 if ((p_sink != p_peer->p_snk) || in bta_av_co_audio_codec_supported()
1506 (memcmp(codec_cfg, p_peer->codec_cfg, AVDT_CODEC_SIZE)) in bta_av_co_audio_codec_supported()
1508 || (p_peer->cp_active != cp_active) in bta_av_co_audio_codec_supported()
1513 p_peer->p_snk = p_sink; in bta_av_co_audio_codec_supported()
1514 memcpy(p_peer->codec_cfg, codec_cfg, AVDT_CODEC_SIZE); in bta_av_co_audio_codec_supported()
1516 p_peer->cp_active = cp_active; in bta_av_co_audio_codec_supported()
1517 if (p_peer->cp_active) in bta_av_co_audio_codec_supported()
1529 p_peer->codec_cfg, num_protect, (UINT8 *)bta_av_co_cp_scmst); in bta_av_co_audio_codec_supported()
1671 tBTA_AV_CO_PEER *p_peer; in bta_av_co_audio_get_sbc_config() local
1686 p_peer = &bta_av_co_cb.peers[index]; in bta_av_co_audio_get_sbc_config()
1687 if (p_peer->opened) in bta_av_co_audio_get_sbc_config()
1689 if (p_peer->mtu < *p_minmtu) in bta_av_co_audio_get_sbc_config()
1691 *p_minmtu = p_peer->mtu; in bta_av_co_audio_get_sbc_config()
1693 for (jndex = 0; jndex < p_peer->num_sup_snks; jndex++) in bta_av_co_audio_get_sbc_config()
1695 p_sink = &p_peer->snks[jndex]; in bta_av_co_audio_get_sbc_config()
1737 tBTA_AV_CO_PEER *p_peer; in bta_av_co_audio_discard_config() local
1742 p_peer = bta_av_co_get_peer(hndl); in bta_av_co_audio_discard_config()
1743 if (p_peer == NULL) in bta_av_co_audio_discard_config()
1750 bta_av_co_audio_peer_reset_config(p_peer); in bta_av_co_audio_discard_config()
1793 tBTA_AV_CO_PEER *p_peer; in bta_av_co_peer_cp_supported() local
1800 p_peer = bta_av_co_get_peer(hndl); in bta_av_co_peer_cp_supported()
1801 if (p_peer == NULL) in bta_av_co_peer_cp_supported()
1807 for (index = 0; index < p_peer->num_sup_snks; index++) in bta_av_co_peer_cp_supported()
1809 p_sink = &p_peer->snks[index]; in bta_av_co_peer_cp_supported()