switch (state) { case CUBEB_STATE_STARTED:
fprintf(stderr, "stream started\n"); break; case CUBEB_STATE_STOPPED:
fprintf(stderr, "stream stopped\n"); break; case CUBEB_STATE_DRAINED:
fprintf(stderr, "stream drained\n"); break; default:
fprintf(stderr, "unknown stream state %d\n", state);
}
return;
}
// Waits for at least one audio callback to have occured. void
wait_for_audio_callback()
{
uint32_t audio_callback_index =
data_callback_call_count.load(std::memory_order_acquire); while (audio_callback_index ==
data_callback_call_count.load(std::memory_order_acquire)) {
delay(100);
}
}
if (!log_callback_set) {
ASSERT_EQ(log_statements_received.load(std::memory_order_acquire), 0u); // Set a logging callback, start logging
cubeb_set_log_callback(CUBEB_LOG_VERBOSE, test_logging_callback);
log_callback_set = true;
} else { // Disable the logging callback, stop logging.
ASSERT_NE(log_statements_received.load(std::memory_order_acquire), 0u);
cubeb_set_log_callback(CUBEB_LOG_DISABLED, nullptr);
log_statements_received.store(0, std::memory_order_release); // Disabling logging should flush any log message -- wait a bit and check // that this is true.
ASSERT_EQ(log_statements_received.load(std::memory_order_acquire), 0u);
log_callback_set = false;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.