mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
allow hooking into the process of creating playback streams. To implement this I modified the pa_sink_input_new() signature to take a pa_sink_input_new_data structure instead of direct arguments.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1237 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
b5cbea940e
commit
a621d90285
16 changed files with 291 additions and 133 deletions
|
|
@ -82,24 +82,33 @@ static void sink_input_drop(pa_sink_input *i, const pa_memchunk*chunk, size_t le
|
|||
}
|
||||
|
||||
int pa_play_memchunk(
|
||||
pa_sink *sink,
|
||||
const char *name,
|
||||
const pa_sample_spec *ss,
|
||||
const pa_channel_map *map,
|
||||
const pa_memchunk *chunk,
|
||||
pa_cvolume *cvolume) {
|
||||
pa_sink *sink,
|
||||
const char *name,
|
||||
const pa_sample_spec *ss,
|
||||
const pa_channel_map *map,
|
||||
const pa_memchunk *chunk,
|
||||
pa_cvolume *volume) {
|
||||
|
||||
pa_sink_input *si;
|
||||
pa_memchunk *nchunk;
|
||||
pa_sink_input_new_data data;
|
||||
|
||||
assert(sink);
|
||||
assert(ss);
|
||||
assert(chunk);
|
||||
|
||||
if (cvolume && pa_cvolume_is_muted(cvolume))
|
||||
if (volume && pa_cvolume_is_muted(volume))
|
||||
return 0;
|
||||
|
||||
if (!(si = pa_sink_input_new(sink, name, __FILE__, ss, map, cvolume, 0, PA_RESAMPLER_INVALID)))
|
||||
pa_sink_input_new_data_init(&data);
|
||||
data.sink = sink;
|
||||
data.name = name;
|
||||
data.driver = __FILE__;
|
||||
pa_sink_input_new_data_set_sample_spec(&data, ss);
|
||||
pa_sink_input_new_data_set_channel_map(&data, map);
|
||||
pa_sink_input_new_data_set_volume(&data, volume);
|
||||
|
||||
if (!(si = pa_sink_input_new(sink->core, &data, 0)))
|
||||
return -1;
|
||||
|
||||
si->peek = sink_input_peek;
|
||||
|
|
@ -111,7 +120,7 @@ int pa_play_memchunk(
|
|||
|
||||
pa_memblock_ref(chunk->memblock);
|
||||
|
||||
pa_sink_notify(sink);
|
||||
pa_sink_notify(si->sink);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue