Lines Matching full:stream

40  * @param stream The TX stream to generate and fill the sine wave for
42 static void fill_audio_buf_sin(struct tx_stream *stream) in fill_audio_buf_sin() argument
45 (stream->lc3_tx.frame_duration_us * stream->lc3_tx.freq_hz) / USEC_PER_SEC; in fill_audio_buf_sin()
46 const int sine_period_samples = stream->lc3_tx.freq_hz / AUDIO_TONE_FREQUENCY_HZ; in fill_audio_buf_sin()
56 static int extract_lc3_config(struct tx_stream *stream) in extract_lc3_config() argument
58 const struct bt_audio_codec_cfg *codec_cfg = stream->bap_stream->codec_cfg; in extract_lc3_config()
59 struct stream_lc3_tx *lc3_tx = &stream->lc3_tx; in extract_lc3_config()
133 static bool encode_frame(struct tx_stream *stream, uint8_t index, struct net_buf *out_buf) in encode_frame() argument
135 const uint16_t octets_per_frame = stream->lc3_tx.octets_per_frame; in encode_frame()
139 fill_audio_buf_sin(stream); in encode_frame()
141 lc3_ret = lc3_encode(stream->lc3_tx.encoder, LC3_PCM_FORMAT_S16, audio_buf, 1, in encode_frame()
154 static bool encode_frame_block(struct tx_stream *stream, struct net_buf *out_buf) in encode_frame_block() argument
156 for (uint8_t i = 0U; i < stream->lc3_tx.chan_cnt; i++) { in encode_frame_block()
160 if (!encode_frame(stream, i, out_buf)) { in encode_frame_block()
168 void stream_lc3_add_data(struct tx_stream *stream, struct net_buf *buf) in stream_lc3_add_data() argument
170 for (uint8_t i = 0U; i < stream->lc3_tx.frame_blocks_per_sdu; i++) { in stream_lc3_add_data()
171 if (!encode_frame_block(stream, buf)) { in stream_lc3_add_data()
177 int stream_lc3_init(struct tx_stream *stream) in stream_lc3_init() argument
181 err = extract_lc3_config(stream); in stream_lc3_init()
183 memset(&stream->lc3_tx, 0, sizeof(stream->lc3_tx)); in stream_lc3_init()
190 fill_audio_buf_sin(stream); in stream_lc3_init()
193 stream->lc3_tx.encoder = in stream_lc3_init()
194 lc3_setup_encoder(stream->lc3_tx.frame_duration_us, stream->lc3_tx.freq_hz, 0, in stream_lc3_init()
195 &stream->lc3_tx.encoder_mem); in stream_lc3_init()
197 if (stream->lc3_tx.encoder == NULL) { in stream_lc3_init()
200 memset(&stream->lc3_tx, 0, sizeof(stream->lc3_tx)); in stream_lc3_init()