MCPcopy Create free account
hub / github.com/ARM-software/AVH / init_streams

Function init_streams

example/FVP_Audio/project/app_main.c:77–104  ·  view source on GitHub ↗

Initialize streams. This function initializes the input and output streams, registers the event callbacks and sets up the stream buffers. */

Source from the content-addressed store, hash-verified

75 event callbacks and sets up the stream buffers.
76*/
77static void init_streams (void) {
78 int32_t rval;
79 void *out_block;
80
81 /* Setup input stream */
82 rval = vStream_AudioIn->Initialize(AudioIn_Event_Callback);
83 ASSERT(rval == VSTREAM_OK);
84
85 rval = vStream_AudioIn->SetBuf(audio_in_buf, sizeof(audio_in_buf), AUDIO_BUF_BLOCK_SIZE);
86 ASSERT(rval == VSTREAM_OK);
87
88 /* Setup output stream */
89 rval = vStream_AudioOut->Initialize(AudioOut_Event_Callback);
90 ASSERT(rval == VSTREAM_OK);
91
92 rval = vStream_AudioOut->SetBuf(audio_out_buf, sizeof(audio_out_buf), AUDIO_BUF_BLOCK_SIZE);
93 ASSERT(rval == VSTREAM_OK);
94
95 /* Output stream will fail to start without data to output. */
96 /* Prepare first block of data and release it to the driver. */
97 out_block = vStream_AudioOut->GetBlock();
98 ASSERT(out_block != NULL);
99
100 memset(out_block, 0x00, AUDIO_BUF_BLOCK_SIZE);
101
102 rval = vStream_AudioOut->ReleaseBlock();
103 ASSERT(rval == VSTREAM_OK);
104}
105
106/*
107 Application main thread.

Callers 1

app_main_threadFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected