mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
examples: fix indent
This commit is contained in:
parent
7fc83ea417
commit
59756a7c5d
3 changed files with 35 additions and 35 deletions
|
|
@ -11,9 +11,9 @@ int main(int argc, char *argv[])
|
||||||
pw_init(&argc, &argv);
|
pw_init(&argc, &argv);
|
||||||
|
|
||||||
fprintf(stdout, "Compiled with libpipewire %s\n"
|
fprintf(stdout, "Compiled with libpipewire %s\n"
|
||||||
"Linked with libpipewire %s\n",
|
"Linked with libpipewire %s\n",
|
||||||
pw_get_headers_version(),
|
pw_get_headers_version(),
|
||||||
pw_get_library_version());
|
pw_get_library_version());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* [code] */
|
/* [code] */
|
||||||
|
|
|
||||||
|
|
@ -20,37 +20,37 @@ static const struct pw_registry_events registry_events = {
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
struct pw_main_loop *loop;
|
struct pw_main_loop *loop;
|
||||||
struct pw_context *context;
|
struct pw_context *context;
|
||||||
struct pw_core *core;
|
struct pw_core *core;
|
||||||
struct pw_registry *registry;
|
struct pw_registry *registry;
|
||||||
struct spa_hook registry_listener;
|
struct spa_hook registry_listener;
|
||||||
|
|
||||||
pw_init(&argc, &argv);
|
pw_init(&argc, &argv);
|
||||||
|
|
||||||
loop = pw_main_loop_new(NULL /* properties */);
|
loop = pw_main_loop_new(NULL /* properties */);
|
||||||
context = pw_context_new(pw_main_loop_get_loop(loop),
|
context = pw_context_new(pw_main_loop_get_loop(loop),
|
||||||
NULL /* properties */,
|
NULL /* properties */,
|
||||||
0 /* user_data size */);
|
0 /* user_data size */);
|
||||||
|
|
||||||
core = pw_context_connect(context,
|
core = pw_context_connect(context,
|
||||||
NULL /* properties */,
|
NULL /* properties */,
|
||||||
0 /* user_data size */);
|
0 /* user_data size */);
|
||||||
|
|
||||||
registry = pw_core_get_registry(core, PW_VERSION_REGISTRY,
|
registry = pw_core_get_registry(core, PW_VERSION_REGISTRY,
|
||||||
0 /* user_data size */);
|
0 /* user_data size */);
|
||||||
|
|
||||||
spa_zero(registry_listener);
|
spa_zero(registry_listener);
|
||||||
pw_registry_add_listener(registry, ®istry_listener,
|
pw_registry_add_listener(registry, ®istry_listener,
|
||||||
®istry_events, NULL);
|
®istry_events, NULL);
|
||||||
|
|
||||||
pw_main_loop_run(loop);
|
pw_main_loop_run(loop);
|
||||||
|
|
||||||
pw_proxy_destroy((struct pw_proxy*)registry);
|
pw_proxy_destroy((struct pw_proxy*)registry);
|
||||||
pw_core_disconnect(core);
|
pw_core_disconnect(core);
|
||||||
pw_context_destroy(context);
|
pw_context_destroy(context);
|
||||||
pw_main_loop_destroy(loop);
|
pw_main_loop_destroy(loop);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* [code] */
|
/* [code] */
|
||||||
|
|
|
||||||
|
|
@ -43,15 +43,15 @@ static void on_process(void *userdata)
|
||||||
stride = sizeof(int16_t) * DEFAULT_CHANNELS;
|
stride = sizeof(int16_t) * DEFAULT_CHANNELS;
|
||||||
n_frames = buf->datas[0].maxsize / stride;
|
n_frames = buf->datas[0].maxsize / stride;
|
||||||
|
|
||||||
for (i = 0; i < n_frames; i++) {
|
for (i = 0; i < n_frames; i++) {
|
||||||
data->accumulator += M_PI_M2 * 440 / DEFAULT_RATE;
|
data->accumulator += M_PI_M2 * 440 / DEFAULT_RATE;
|
||||||
if (data->accumulator >= M_PI_M2)
|
if (data->accumulator >= M_PI_M2)
|
||||||
data->accumulator -= M_PI_M2;
|
data->accumulator -= M_PI_M2;
|
||||||
|
|
||||||
val = sin(data->accumulator) * DEFAULT_VOLUME * 16767.f;
|
val = sin(data->accumulator) * DEFAULT_VOLUME * 16767.f;
|
||||||
for (c = 0; c < DEFAULT_CHANNELS; c++)
|
for (c = 0; c < DEFAULT_CHANNELS; c++)
|
||||||
*dst++ = val;
|
*dst++ = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
buf->datas[0].chunk->offset = 0;
|
buf->datas[0].chunk->offset = 0;
|
||||||
buf->datas[0].chunk->stride = stride;
|
buf->datas[0].chunk->stride = stride;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue