mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
add pa_ prefix to all identifiers.
fix downsampling/resampling add support for U8 samples git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@49 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
a8a5ab1c79
commit
e61c2dddb7
91 changed files with 1795 additions and 1643 deletions
|
|
@ -5,17 +5,17 @@
|
|||
#include "sourceoutput.h"
|
||||
#include "strbuf.h"
|
||||
|
||||
struct source_output* source_output_new(struct source *s, const char *name, const struct pa_sample_spec *spec) {
|
||||
struct source_output *o;
|
||||
struct resampler *resampler = NULL;
|
||||
struct pa_source_output* pa_source_output_new(struct pa_source *s, const char *name, const struct pa_sample_spec *spec) {
|
||||
struct pa_source_output *o;
|
||||
struct pa_resampler *resampler = NULL;
|
||||
int r;
|
||||
assert(s && spec);
|
||||
|
||||
if (!pa_sample_spec_equal(&s->sample_spec, spec))
|
||||
if (!(resampler = resampler_new(&s->sample_spec, spec)))
|
||||
if (!(resampler = pa_resampler_new(&s->sample_spec, spec)))
|
||||
return NULL;
|
||||
|
||||
o = malloc(sizeof(struct source_output));
|
||||
o = malloc(sizeof(struct pa_source_output));
|
||||
assert(o);
|
||||
o->name = name ? strdup(name) : NULL;
|
||||
o->source = s;
|
||||
|
|
@ -27,59 +27,59 @@ struct source_output* source_output_new(struct source *s, const char *name, cons
|
|||
o->resampler = resampler;
|
||||
|
||||
assert(s->core);
|
||||
r = idxset_put(s->core->source_outputs, o, &o->index);
|
||||
assert(r == 0 && o->index != IDXSET_INVALID);
|
||||
r = idxset_put(s->outputs, o, NULL);
|
||||
r = pa_idxset_put(s->core->source_outputs, o, &o->index);
|
||||
assert(r == 0 && o->index != PA_IDXSET_INVALID);
|
||||
r = pa_idxset_put(s->outputs, o, NULL);
|
||||
assert(r == 0);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
void source_output_free(struct source_output* o) {
|
||||
void pa_source_output_free(struct pa_source_output* o) {
|
||||
assert(o);
|
||||
|
||||
assert(o->source && o->source->core);
|
||||
idxset_remove_by_data(o->source->core->source_outputs, o, NULL);
|
||||
idxset_remove_by_data(o->source->outputs, o, NULL);
|
||||
pa_idxset_remove_by_data(o->source->core->source_outputs, o, NULL);
|
||||
pa_idxset_remove_by_data(o->source->outputs, o, NULL);
|
||||
|
||||
if (o->resampler)
|
||||
resampler_free(o->resampler);
|
||||
pa_resampler_free(o->resampler);
|
||||
|
||||
free(o->name);
|
||||
free(o);
|
||||
}
|
||||
|
||||
void source_output_kill(struct source_output*i) {
|
||||
void pa_source_output_kill(struct pa_source_output*i) {
|
||||
assert(i);
|
||||
|
||||
if (i->kill)
|
||||
i->kill(i);
|
||||
}
|
||||
|
||||
char *source_output_list_to_string(struct core *c) {
|
||||
struct strbuf *s;
|
||||
struct source_output *o;
|
||||
uint32_t index = IDXSET_INVALID;
|
||||
char *pa_source_output_list_to_string(struct pa_core *c) {
|
||||
struct pa_strbuf *s;
|
||||
struct pa_source_output *o;
|
||||
uint32_t index = PA_IDXSET_INVALID;
|
||||
assert(c);
|
||||
|
||||
s = strbuf_new();
|
||||
s = pa_strbuf_new();
|
||||
assert(s);
|
||||
|
||||
strbuf_printf(s, "%u source outputs(s) available.\n", idxset_ncontents(c->source_outputs));
|
||||
pa_strbuf_printf(s, "%u source outputs(s) available.\n", pa_idxset_ncontents(c->source_outputs));
|
||||
|
||||
for (o = idxset_first(c->source_outputs, &index); o; o = idxset_next(c->source_outputs, &index)) {
|
||||
for (o = pa_idxset_first(c->source_outputs, &index); o; o = pa_idxset_next(c->source_outputs, &index)) {
|
||||
assert(o->source);
|
||||
strbuf_printf(s, " %c index: %u, name: <%s>, source: <%u>\n",
|
||||
o->index,
|
||||
o->name,
|
||||
o->source->index);
|
||||
pa_strbuf_printf(s, " %c index: %u, name: <%s>, source: <%u>\n",
|
||||
o->index,
|
||||
o->name,
|
||||
o->source->index);
|
||||
}
|
||||
|
||||
return strbuf_tostring_free(s);
|
||||
return pa_strbuf_tostring_free(s);
|
||||
}
|
||||
|
||||
void source_output_push(struct source_output *o, const struct memchunk *chunk) {
|
||||
struct memchunk rchunk;
|
||||
void pa_source_output_push(struct pa_source_output *o, const struct pa_memchunk *chunk) {
|
||||
struct pa_memchunk rchunk;
|
||||
assert(o && chunk && chunk->length && o->push);
|
||||
|
||||
if (!o->resampler) {
|
||||
|
|
@ -87,11 +87,11 @@ void source_output_push(struct source_output *o, const struct memchunk *chunk) {
|
|||
return;
|
||||
}
|
||||
|
||||
resampler_run(o->resampler, chunk, &rchunk);
|
||||
pa_resampler_run(o->resampler, chunk, &rchunk);
|
||||
if (!rchunk.length)
|
||||
return;
|
||||
|
||||
assert(rchunk.memblock);
|
||||
o->push(o, &rchunk);
|
||||
memblock_unref(rchunk.memblock);
|
||||
pa_memblock_unref(rchunk.memblock);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue