mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-12-28 08:57:11 -05:00
implement hook_source_ouput_new. For this I modified the pa_source_output_new constructor to take a struct similar to what I already did for pa_sink_input_new()
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1250 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
e0f7e8614c
commit
a75e1ed9ef
8 changed files with 160 additions and 76 deletions
|
|
@ -379,22 +379,20 @@ static void on_connection(pa_socket_server*s, pa_iochannel *io, void *userdata)
|
|||
}
|
||||
|
||||
if (p->mode & RECORD) {
|
||||
pa_source *source;
|
||||
pa_source_output_new_data data;
|
||||
size_t l;
|
||||
|
||||
if (!(source = pa_namereg_get(p->core, p->source_name, PA_NAMEREG_SOURCE, 1))) {
|
||||
pa_log(__FILE__": Failed to get source.");
|
||||
goto fail;
|
||||
}
|
||||
pa_source_output_new_data_init(&data);
|
||||
data.driver = __FILE__;
|
||||
data.name = c->client->name;
|
||||
pa_source_output_new_data_set_sample_spec(&data, &p->sample_spec);
|
||||
data.module = p->module;
|
||||
data.client = c->client;
|
||||
|
||||
c->source_output = pa_source_output_new(source, __FILE__, c->client->name, &p->sample_spec, NULL, -1);
|
||||
if (!c->source_output) {
|
||||
if (!(c->source_output = pa_source_output_new(p->core, &data, 0))) {
|
||||
pa_log(__FILE__": Failed to create source output.");
|
||||
goto fail;
|
||||
}
|
||||
c->source_output->owner = p->module;
|
||||
c->source_output->client = c->client;
|
||||
|
||||
c->source_output->push = source_output_push_cb;
|
||||
c->source_output->kill = source_output_kill_cb;
|
||||
c->source_output->get_latency = source_output_get_latency_cb;
|
||||
|
|
@ -411,6 +409,7 @@ static void on_connection(pa_socket_server*s, pa_iochannel *io, void *userdata)
|
|||
NULL,
|
||||
p->core->memblock_stat);
|
||||
pa_iochannel_socket_set_sndbuf(io, l/RECORD_BUFFER_FRAGMENTS*2);
|
||||
pa_source_notify(c->source_output->source);
|
||||
}
|
||||
|
||||
pa_iochannel_set_callback(c->io, io_callback, c);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue