Lines Matching refs:bap_stream

210 			bap_stream_param->stream = &cap_stream_param->stream->bap_stream;  in cap_initiator_broadcast_to_bap_broadcast_param()
400 static enum bt_bap_ep_state stream_get_state(const struct bt_bap_stream *bap_stream) in stream_get_state() argument
405 if (bap_stream->ep == NULL) { in stream_get_state()
409 err = bt_bap_ep_get_info(bap_stream->ep, &ep_info); in stream_get_state()
411 LOG_DBG("Failed to get endpoint info %p: %d", bap_stream, err); in stream_get_state()
419 static bool stream_is_in_state(const struct bt_bap_stream *bap_stream, enum bt_bap_ep_state state) in stream_is_in_state() argument
421 if (bap_stream->conn == NULL) { in stream_is_in_state()
425 return stream_get_state(bap_stream) == state; in stream_is_in_state()
428 static bool stream_is_dir(const struct bt_bap_stream *bap_stream, enum bt_audio_dir dir) in stream_is_dir() argument
433 if (bap_stream->conn == NULL) { in stream_is_dir()
437 err = bt_bap_ep_get_info(bap_stream->ep, &ep_info); in stream_is_dir()
439 LOG_DBG("Failed to get endpoint info %p: %d", bap_stream, err); in stream_is_dir()
447 static enum bt_iso_state bap_stream_get_iso_state(const struct bt_bap_stream *bap_stream) in bap_stream_get_iso_state() argument
452 if (bap_stream->ep == NULL) { in bap_stream_get_iso_state()
456 err = bt_bap_ep_get_info(bap_stream->ep, &ep_info); in bap_stream_get_iso_state()
458 LOG_DBG("Failed to get endpoint info %p: %d", bap_stream, err); in bap_stream_get_iso_state()
472 const struct bt_bap_stream *bap_stream = &cap_stream->bap_stream; in iso_is_in_state() local
474 return bap_stream_get_iso_state(bap_stream) == state; in iso_is_in_state()
523 struct bt_bap_stream *bap_stream; in update_proc_done_cnt() local
528 bap_stream = &cap_stream->bap_stream; in update_proc_done_cnt()
530 state = stream_get_state(bap_stream); in update_proc_done_cnt()
543 bt_cap_common_abort_proc(bap_stream->conn, -EBADMSG); in update_proc_done_cnt()
551 bt_cap_common_abort_proc(bap_stream->conn, -EBADMSG); in update_proc_done_cnt()
557 bt_cap_common_abort_proc(bap_stream->conn, -EBADMSG); in update_proc_done_cnt()
568 bt_cap_common_abort_proc(bap_stream->conn, -EBADMSG); in update_proc_done_cnt()
584 struct bt_bap_stream *bap_stream; in update_proc_done_cnt() local
589 bap_stream = &cap_stream->bap_stream; in update_proc_done_cnt()
591 state = stream_get_state(bap_stream); in update_proc_done_cnt()
622 struct bt_bap_stream *bap_stream; in update_proc_done_cnt() local
627 bap_stream = &cap_stream->bap_stream; in update_proc_done_cnt()
629 state = stream_get_state(bap_stream); in update_proc_done_cnt()
638 bt_cap_common_abort_proc(bap_stream->conn, -EBADMSG); in update_proc_done_cnt()
665 struct bt_bap_stream *bap_stream; in get_next_proc_param() local
675 bap_stream = &cap_stream->bap_stream; in get_next_proc_param()
676 state = stream_get_state(bap_stream); in get_next_proc_param()
789 const struct bt_bap_stream *bap_stream; in valid_unicast_audio_start_param() local
828 bap_stream = &cap_stream->bap_stream; in valid_unicast_audio_start_param()
830 CHECKIF(bap_stream->group == NULL) { in valid_unicast_audio_start_param()
837 unicast_group = bap_stream->group; in valid_unicast_audio_start_param()
839 CHECKIF(bap_stream->group != unicast_group) { in valid_unicast_audio_start_param()
924 bt_cap_common_abort_proc(cap_stream->bap_stream.conn, -EBADMSG); in bt_cap_initiator_cp_cb()
942 struct bt_bap_stream *bap_stream; in cap_initiator_unicast_audio_configure() local
986 bap_stream = &proc_param->stream->bap_stream; in cap_initiator_unicast_audio_configure()
998 err = bt_bap_stream_config(conn, bap_stream, ep, codec_cfg); in cap_initiator_unicast_audio_configure()
1023 const struct bt_bap_stream *bap_stream = in bt_cap_initiator_unicast_audio_start() local
1024 &param->stream_params[i].stream->bap_stream; in bt_cap_initiator_unicast_audio_start()
1026 if (!stream_is_in_state(bap_stream, BT_BAP_EP_STATE_STREAMING)) { in bt_cap_initiator_unicast_audio_start()
1062 bt_cap_common_abort_proc(cap_stream->bap_stream.conn, -EBADMSG); in bt_cap_initiator_codec_configured()
1092 next_bap_stream = &next_cap_stream->bap_stream; in bt_cap_initiator_codec_configured()
1114 active_proc->proc_param.initiator[i].stream->bap_stream.conn; in bt_cap_initiator_codec_configured()
1152 unicast_group = (struct bt_bap_unicast_group *)proc_param->stream->bap_stream.group; in bt_cap_initiator_codec_configured()
1164 if (proc_param->stream->bap_stream.conn == conns[i]) { in bt_cap_initiator_codec_configured()
1207 bt_cap_common_abort_proc(cap_stream->bap_stream.conn, -EBADMSG); in bt_cap_initiator_qos_configured()
1226 struct bt_bap_stream *bap_stream; in bt_cap_initiator_qos_configured() local
1246 bap_stream = &next_cap_stream->bap_stream; in bt_cap_initiator_qos_configured()
1250 err = bt_bap_stream_enable(bap_stream, bap_stream->codec_cfg->meta, in bt_cap_initiator_qos_configured()
1251 bap_stream->codec_cfg->meta_len); in bt_cap_initiator_qos_configured()
1255 bt_cap_common_abort_proc(bap_stream->conn, err); in bt_cap_initiator_qos_configured()
1268 next_bap_stream = &next_cap_stream->bap_stream; in bt_cap_initiator_qos_configured()
1286 struct bt_bap_stream *bap_stream; in bt_cap_initiator_enabled() local
1298 bt_cap_common_abort_proc(cap_stream->bap_stream.conn, -EBADMSG); in bt_cap_initiator_enabled()
1321 next_bap_stream = &next_cap_stream->bap_stream; in bt_cap_initiator_enabled()
1348 bap_stream = &proc_param->stream->bap_stream; in bt_cap_initiator_enabled()
1351 err = bt_bap_stream_connect(bap_stream); in bt_cap_initiator_enabled()
1366 bt_cap_common_abort_proc(bap_stream->conn, err); in bt_cap_initiator_enabled()
1375 struct bt_bap_stream *bap_stream; in bt_cap_initiator_connected() local
1389 bt_cap_common_abort_proc(cap_stream->bap_stream.conn, -EBADMSG); in bt_cap_initiator_connected()
1419 next_bap_stream = &next_cap_stream->bap_stream; in bt_cap_initiator_connected()
1455 bap_stream = &proc_param->stream->bap_stream; in bt_cap_initiator_connected()
1456 if (stream_is_dir(bap_stream, BT_AUDIO_DIR_SOURCE)) { in bt_cap_initiator_connected()
1459 err = bt_bap_stream_start(bap_stream); in bt_cap_initiator_connected()
1463 bt_cap_common_abort_proc(bap_stream->conn, err); in bt_cap_initiator_connected()
1490 bt_cap_common_abort_proc(cap_stream->bap_stream.conn, -EBADMSG); in bt_cap_initiator_started()
1506 next_bap_stream = &next_cap_stream->bap_stream; in bt_cap_initiator_started()
1537 static bool can_update_metadata(const struct bt_bap_stream *bap_stream) in can_update_metadata() argument
1539 return stream_is_in_state(bap_stream, BT_BAP_EP_STATE_ENABLING) || in can_update_metadata()
1540 stream_is_in_state(bap_stream, BT_BAP_EP_STATE_STREAMING); in can_update_metadata()
1573 const struct bt_bap_stream *bap_stream; in valid_unicast_audio_update_param() local
1581 bap_stream = &cap_stream->bap_stream; in valid_unicast_audio_update_param()
1582 conn = bap_stream->conn; in valid_unicast_audio_update_param()
1589 CHECKIF(bap_stream->group == NULL) { in valid_unicast_audio_update_param()
1596 unicast_group = bap_stream->group; in valid_unicast_audio_update_param()
1598 CHECKIF(bap_stream->group != unicast_group) { in valid_unicast_audio_update_param()
1605 if (!can_update_metadata(bap_stream)) { in valid_unicast_audio_update_param()
1637 struct bt_bap_stream *bap_stream; in bt_cap_initiator_unicast_audio_update() local
1672 bap_stream = &proc_param->stream->bap_stream; in bt_cap_initiator_unicast_audio_update()
1678 err = bt_bap_stream_metadata(bap_stream, meta, meta_len); in bt_cap_initiator_unicast_audio_update()
1713 bt_cap_common_abort_proc(cap_stream->bap_stream.conn, -EBADMSG); in bt_cap_initiator_metadata_updated()
1733 struct bt_bap_stream *bap_stream; in bt_cap_initiator_metadata_updated() local
1742 bap_stream = &next_cap_stream->bap_stream; in bt_cap_initiator_metadata_updated()
1746 err = bt_bap_stream_metadata(bap_stream, meta, meta_len); in bt_cap_initiator_metadata_updated()
1751 bt_cap_common_abort_proc(bap_stream->conn, err); in bt_cap_initiator_metadata_updated()
1761 static bool can_release_stream(const struct bt_bap_stream *bap_stream) in can_release_stream() argument
1765 if (bap_stream->conn == NULL) { in can_release_stream()
1769 state = stream_get_state(bap_stream); in can_release_stream()
1778 static bool can_disable_stream(const struct bt_bap_stream *bap_stream) in can_disable_stream() argument
1782 if (bap_stream->conn == NULL) { in can_disable_stream()
1786 state = stream_get_state(bap_stream); in can_disable_stream()
1791 static bool can_stop_stream(const struct bt_bap_stream *bap_stream) in can_stop_stream() argument
1795 if (bap_stream->conn == NULL) { in can_stop_stream()
1799 if (stream_is_dir(bap_stream, BT_AUDIO_DIR_SINK)) { in can_stop_stream()
1803 iso_state = bap_stream_get_iso_state(bap_stream); in can_stop_stream()
1808 return stream_is_in_state(bap_stream, BT_BAP_EP_STATE_DISABLING); in can_stop_stream()
1839 const struct bt_bap_stream *bap_stream; in valid_unicast_audio_stop_param() local
1847 bap_stream = &cap_stream->bap_stream; in valid_unicast_audio_stop_param()
1848 conn = bap_stream->conn; in valid_unicast_audio_stop_param()
1867 CHECKIF(bap_stream->group == NULL) { in valid_unicast_audio_stop_param()
1874 unicast_group = bap_stream->group; in valid_unicast_audio_stop_param()
1876 CHECKIF(bap_stream->group != unicast_group) { in valid_unicast_audio_stop_param()
1917 struct bt_bap_stream *bap_stream = &cap_stream->bap_stream; in bt_cap_initiator_unicast_audio_stop() local
1925 if (!can_disable && can_disable_stream(bap_stream)) { in bt_cap_initiator_unicast_audio_stop()
1929 if (!can_stop && can_stop_stream(bap_stream)) { in bt_cap_initiator_unicast_audio_stop()
1933 if (!can_release && param->release && can_release_stream(bap_stream)) { in bt_cap_initiator_unicast_audio_stop()
1953 struct bt_bap_stream *bap_stream; in bt_cap_initiator_unicast_audio_stop() local
1960 bap_stream = &proc_param->stream->bap_stream; in bt_cap_initiator_unicast_audio_stop()
1964 err = bt_bap_stream_disable(bap_stream); in bt_cap_initiator_unicast_audio_stop()
1972 struct bt_bap_stream *bap_stream; in bt_cap_initiator_unicast_audio_stop() local
1979 bap_stream = &proc_param->stream->bap_stream; in bt_cap_initiator_unicast_audio_stop()
1983 err = bt_bap_stream_stop(bap_stream); in bt_cap_initiator_unicast_audio_stop()
1991 struct bt_bap_stream *bap_stream; in bt_cap_initiator_unicast_audio_stop() local
1998 bap_stream = &proc_param->stream->bap_stream; in bt_cap_initiator_unicast_audio_stop()
2002 err = bt_bap_stream_release(bap_stream); in bt_cap_initiator_unicast_audio_stop()
2024 bt_cap_common_abort_proc(cap_stream->bap_stream.conn, -EBADMSG); in bt_cap_initiator_disabled()
2049 next_bap_stream = &next_cap_stream->bap_stream; in bt_cap_initiator_disabled()
2079 next_bap_stream = &next_cap_stream->bap_stream; in bt_cap_initiator_disabled()
2106 bt_cap_common_abort_proc(cap_stream->bap_stream.conn, -EBADMSG); in bt_cap_initiator_stopped()
2138 next_bap_stream = &next_cap_stream->bap_stream; in bt_cap_initiator_stopped()
2192 bt_cap_common_abort_proc(cap_stream->bap_stream.conn, -EBADMSG); in bt_cap_initiator_released()
2217 next_bap_stream = &next_cap_stream->bap_stream; in bt_cap_initiator_released()