Lines Matching refs:sh_stream
329 size_t bap_usb_get_read_cnt(const struct shell_stream *sh_stream) in bap_usb_get_read_cnt() argument
331 return (USB_SAMPLE_CNT * sh_stream->lc3_frame_duration_us) / USEC_PER_MSEC; in bap_usb_get_read_cnt()
334 size_t bap_usb_get_frame_size(const struct shell_stream *sh_stream) in bap_usb_get_frame_size() argument
336 return USB_BYTES_PER_SAMPLE * bap_usb_get_read_cnt(sh_stream); in bap_usb_get_frame_size()
339 static void stream_cb(struct shell_stream *sh_stream, void *user_data) in stream_cb() argument
341 if (sh_stream->is_tx) { in stream_cb()
343 (sh_stream->lc3_chan_allocation & BT_AUDIO_LOCATION_FRONT_LEFT) != 0; in stream_cb()
345 (sh_stream->lc3_chan_allocation & BT_AUDIO_LOCATION_FRONT_RIGHT) != 0; in stream_cb()
347 const bool is_mono = sh_stream->lc3_chan_allocation == BT_AUDIO_LOCATION_MONO_AUDIO; in stream_cb()
354 read_idx = MIN(sh_stream->tx.left_read_idx, sh_stream->tx.right_read_idx); in stream_cb()
356 read_idx = sh_stream->tx.left_read_idx; in stream_cb()
358 read_idx = sh_stream->tx.right_read_idx; in stream_cb()
369 sh_stream->tx.left_read_idx = write_index; in stream_cb()
370 sh_stream->tx.right_read_idx = write_index; in stream_cb()
424 bool bap_usb_can_get_full_sdu(struct shell_stream *sh_stream) in bap_usb_can_get_full_sdu() argument
426 const bool has_left = (sh_stream->lc3_chan_allocation & BT_AUDIO_LOCATION_FRONT_LEFT) != 0; in bap_usb_can_get_full_sdu()
428 (sh_stream->lc3_chan_allocation & BT_AUDIO_LOCATION_FRONT_RIGHT) != 0; in bap_usb_can_get_full_sdu()
430 const bool is_mono = sh_stream->lc3_chan_allocation == BT_AUDIO_LOCATION_MONO_AUDIO; in bap_usb_can_get_full_sdu()
431 const uint32_t read_cnt = bap_usb_get_read_cnt(sh_stream); in bap_usb_can_get_full_sdu()
432 const uint32_t retrieve_cnt = read_cnt * sh_stream->lc3_frame_blocks_per_sdu; in bap_usb_can_get_full_sdu()
439 read_idx = MIN(sh_stream->tx.left_read_idx, sh_stream->tx.right_read_idx); in bap_usb_can_get_full_sdu()
441 read_idx = sh_stream->tx.left_read_idx; in bap_usb_can_get_full_sdu()
443 read_idx = sh_stream->tx.right_read_idx; in bap_usb_can_get_full_sdu()
507 void bap_usb_get_frame(struct shell_stream *sh_stream, enum bt_audio_location chan_alloc, in bap_usb_get_frame() argument
513 const uint32_t read_cnt = bap_usb_get_read_cnt(sh_stream); in bap_usb_get_frame()
516 sh_stream->tx.left_read_idx = usb_ring_buf_get( in bap_usb_get_frame()
517 buffer, usb_in_left_ring_buffer, sh_stream->tx.left_read_idx, read_cnt); in bap_usb_get_frame()
519 sh_stream->tx.right_read_idx = usb_ring_buf_get( in bap_usb_get_frame()
520 buffer, usb_in_right_ring_buffer, sh_stream->tx.right_read_idx, read_cnt); in bap_usb_get_frame()