Lines Matching defs:mb
60 PDMAUDIOMIXBUF mb;
61 RTTESTI_CHECK_RC_OK(audioMixBufInit(&mb, "Single", &props, cBufSize));
62 RTTESTI_CHECK(audioMixBufSize(&mb) == cBufSize);
63 RTTESTI_CHECK(AUDIOMIXBUF_B2S(&mb, audioMixBufSizeBytes(&mb)) == cBufSize);
64 RTTESTI_CHECK(AUDIOMIXBUF_S2B(&mb, audioMixBufSize(&mb)) == audioMixBufSizeBytes(&mb));
65 RTTESTI_CHECK(audioMixBufFree(&mb) == cBufSize);
66 RTTESTI_CHECK(AUDIOMIXBUF_S2B(&mb, audioMixBufFree(&mb)) == audioMixBufFreeBytes(&mb));
77 RTTESTI_CHECK_RC_OK(audioMixBufWriteAt(&mb, 0, &samples8, sizeof(samples8), &written));
80 RTTESTI_CHECK_RC_OK(audioMixBufWriteAt(&mb, 0, &samples16, sizeof(samples16), &written));
83 RTTESTI_CHECK_RC_OK(audioMixBufWriteAt(&mb, 2, &samples32, sizeof(samples32), &written));
88 RTTESTI_CHECK_RC(audioMixBufWriteAt(&mb, audioMixBufSize(&mb) + 1, &samples16, sizeof(samples16),
94 uint32_t cToWrite = audioMixBufSize(&mb) - written_abs - 1; /* -1 as padding plus -2 samples for above. */
97 RTTESTI_CHECK_RC_OK(audioMixBufWriteCirc(&mb, &samples16, sizeof(samples16), &written));
100 RTTESTI_CHECK(!audioMixBufIsEmpty(&mb));
101 RTTESTI_CHECK(audioMixBufFree(&mb) == 1);
102 RTTESTI_CHECK(audioMixBufFreeBytes(&mb) == AUDIOMIXBUF_S2B(&mb, 1U));
103 RTTESTI_CHECK(audioMixBufProcessed(&mb) == cToWrite + written_abs /* + last absolute write */);
105 RTTESTI_CHECK_RC_OK(audioMixBufWriteCirc(&mb, &samples16, sizeof(samples16), &written));
107 RTTESTI_CHECK(audioMixBufFree(&mb) == 0);
108 RTTESTI_CHECK(audioMixBufFreeBytes(&mb) == AUDIOMIXBUF_S2B(&mb, 0));
109 RTTESTI_CHECK(audioMixBufProcessed(&mb) == cBufSize);
112 uint32_t cToRead = audioMixBufSize(&mb) - written_abs - 1;
115 RTTESTI_CHECK_RC_OK(audioMixBufReadCirc(&mb, &samples16, sizeof(samples16), &read));
117 audioMixBufFinish(&mb, read);
119 RTTESTI_CHECK(!audioMixBufIsEmpty(&mb));
120 RTTESTI_CHECK(audioMixBufFree(&mb) == audioMixBufSize(&mb) - written_abs - 1);
121 RTTESTI_CHECK(audioMixBufFreeBytes(&mb) == AUDIOMIXBUF_S2B(&mb, cBufSize - written_abs - 1));
122 RTTESTI_CHECK(audioMixBufProcessed(&mb) == cBufSize - cToRead + written_abs);
124 RTTESTI_CHECK_RC_OK(audioMixBufReadCirc(&mb, &samples16, sizeof(samples16), &read));
126 audioMixBufFinish(&mb, read);
127 RTTESTI_CHECK(audioMixBufFree(&mb) == cBufSize - written_abs);
128 RTTESTI_CHECK(audioMixBufFreeBytes(&mb) == AUDIOMIXBUF_S2B(&mb, cBufSize - written_abs));
129 RTTESTI_CHECK(audioMixBufProcessed(&mb) == written_abs);