зеркало из https://github.com/mozilla/cubeb.git
Update tests for the new latency interface.
This commit is contained in:
Родитель
dd2a89d90d
Коммит
43bcb26999
|
@ -89,14 +89,14 @@ print_device_info(cubeb_device_info * info, FILE * f)
|
|||
"\tCh: %u\n"
|
||||
"\tFormat: %s (0x%x) (default: %s)\n"
|
||||
"\tRate: %u - %u (default: %u)\n"
|
||||
"\tLatency: lo %ums, hi %ums\n",
|
||||
"\tLatency: lo %u frames, hi %u frames\n",
|
||||
info->device_id, info->preferred ? " (PREFERRED)" : "",
|
||||
info->friendly_name, info->group_id, info->vendor_name,
|
||||
devtype, devstate, info->max_channels,
|
||||
(devfmts[0] == ' ') ? &devfmts[1] : devfmts,
|
||||
(unsigned int)info->format, devdeffmt,
|
||||
info->min_rate, info->max_rate, info->default_rate,
|
||||
info->latency_lo_ms, info->latency_hi_ms);
|
||||
info->latency_lo, info->latency_hi);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -101,7 +101,7 @@ int main(int argc, char *argv[])
|
|||
cubeb_stream_params output_params;
|
||||
int r;
|
||||
user_state stream_state = { false };
|
||||
uint32_t latency_ms = 0;
|
||||
uint32_t latency_frames = 0;
|
||||
|
||||
r = cubeb_init(&ctx, "Cubeb duplex example");
|
||||
if (r != CUBEB_OK) {
|
||||
|
@ -123,7 +123,7 @@ int main(int argc, char *argv[])
|
|||
output_params.rate = 48000;
|
||||
output_params.channels = 2;
|
||||
|
||||
r = cubeb_get_min_latency(ctx, output_params, &latency_ms);
|
||||
r = cubeb_get_min_latency(ctx, output_params, &latency_frames);
|
||||
|
||||
if (r != CUBEB_OK) {
|
||||
fprintf(stderr, "Could not get minimal latency\n");
|
||||
|
@ -132,7 +132,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
r = cubeb_stream_init(ctx, &stream, "Cubeb duplex",
|
||||
NULL, &input_params, NULL, &output_params,
|
||||
latency_ms, data_cb, state_cb, &stream_state);
|
||||
latency_frames, data_cb, state_cb, &stream_state);
|
||||
if (r != CUBEB_OK) {
|
||||
fprintf(stderr, "Error initializing cubeb stream\n");
|
||||
return r;
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
#define BEGIN_TEST fprintf(stderr, "START %s\n", __func__)
|
||||
#define END_TEST fprintf(stderr, "END %s\n", __func__)
|
||||
|
||||
#define STREAM_LATENCY 100
|
||||
#define STREAM_RATE 44100
|
||||
#define STREAM_LATENCY 100 * STREAM_RATE / 1000
|
||||
#define STREAM_CHANNELS 1
|
||||
#if (defined(_WIN32) || defined(__WIN32__))
|
||||
#define STREAM_FORMAT CUBEB_SAMPLE_FLOAT32LE
|
||||
|
|
Загрузка…
Ссылка в новой задаче