memblockq: Improve debuggability by storing a name and a sample spec.

These are not used for anything at this point, but this
makes it easy to add ad-hoc debug prints that show the
memblockq name and to convert between bytes and usecs.
This commit is contained in:
Tanu Kaskinen 2011-09-29 18:54:03 +03:00 committed by Colin Guthrie
parent 4d930f19f9
commit 666261ece8
21 changed files with 89 additions and 46 deletions

View file

@ -1608,10 +1608,10 @@ int pa__init(pa_module*m) {
pa_sink_input_get_silence(u->sink_input, &silence);
u->source_memblockq = pa_memblockq_new(0, MEMBLOCKQ_MAXLENGTH, 0,
pa_frame_size(&source_ss), 1, 1, 0, &silence);
u->sink_memblockq = pa_memblockq_new(0, MEMBLOCKQ_MAXLENGTH, 0,
pa_frame_size(&sink_ss), 1, 1, 0, &silence);
u->source_memblockq = pa_memblockq_new("module-echo-cancel source_memblockq", 0, MEMBLOCKQ_MAXLENGTH, 0,
&source_ss, 1, 1, 0, &silence);
u->sink_memblockq = pa_memblockq_new("module-echo-cancel sink_memblockq", 0, MEMBLOCKQ_MAXLENGTH, 0,
&sink_ss, 1, 1, 0, &silence);
pa_memblock_unref(silence.memblock);

View file

@ -897,10 +897,11 @@ static struct output *output_new(struct userdata *u, pa_sink *sink) {
o->outq = pa_asyncmsgq_new(0);
o->sink = sink;
o->memblockq = pa_memblockq_new(
"module-combine-sink output memblockq",
0,
MEMBLOCKQ_MAXLENGTH,
MEMBLOCKQ_MAXLENGTH,
pa_frame_size(&u->sink->sample_spec),
&u->sink->sample_spec,
1,
0,
0,

View file

@ -1207,8 +1207,8 @@ int pa__init(pa_module*m) {
}
u->sink->userdata = u;
u->input_q = pa_memblockq_new(0, MEMBLOCKQ_MAXLENGTH, 0, fs, 1, 1, 0, &u->sink->silence);
u->output_q = pa_memblockq_new(0, MEMBLOCKQ_MAXLENGTH, 0, fs, 1, 1, 0, NULL);
u->input_q = pa_memblockq_new("module-equalizer-sink input_q", 0, MEMBLOCKQ_MAXLENGTH, 0, &ss, 1, 1, 0, &u->sink->silence);
u->output_q = pa_memblockq_new("module-equalizer-sink output_q", 0, MEMBLOCKQ_MAXLENGTH, 0, &ss, 1, 1, 0, NULL);
u->output_buffer = NULL;
u->output_buffer_length = 0;
u->output_buffer_max_length = 0;

View file

@ -529,7 +529,7 @@ int pa__init(pa_module*m) {
u = pa_xnew0(struct userdata, 1);
u->module = m;
m->userdata = u;
u->memblockq = pa_memblockq_new(0, MEMBLOCKQ_MAXLENGTH, 0, pa_frame_size(&ss), 1, 1, 0, NULL);
u->memblockq = pa_memblockq_new("module-ladspa-sink memblockq", 0, MEMBLOCKQ_MAXLENGTH, 0, &ss, 1, 1, 0, NULL);
u->max_ladspaport_count = 1; /*to avoid division by zero etc. in pa__done when failing before this value has been set*/
u->channels = 0;
u->input = NULL;

View file

@ -806,10 +806,11 @@ int pa__init(pa_module *m) {
pa_sink_input_get_silence(u->sink_input, &silence);
u->memblockq = pa_memblockq_new(
"module-loopback memblockq",
0, /* idx */
MEMBLOCKQ_MAXLENGTH, /* maxlength */
MEMBLOCKQ_MAXLENGTH, /* tlength */
pa_frame_size(&ss), /* base */
&ss, /* sample_spec */
0, /* prebuf */
0, /* minreq */
0, /* maxrewind */

View file

@ -614,7 +614,7 @@ int pa__init(pa_module*m) {
u->sink->input_to_master = u->sink_input;
pa_sink_input_get_silence(u->sink_input, &silence);
u->memblockq = pa_memblockq_new(0, MEMBLOCKQ_MAXLENGTH, 0, pa_frame_size(&ss), 1, 1, 0, &silence);
u->memblockq = pa_memblockq_new("module-virtual-sink memblockq", 0, MEMBLOCKQ_MAXLENGTH, 0, &ss, 1, 1, 0, &silence);
pa_memblock_unref(silence.memblock);
/* (9) INITIALIZE ANYTHING ELSE YOU NEED HERE */

View file

@ -548,7 +548,7 @@ int pa__init(pa_module*m) {
}
u->module = m;
m->userdata = u;
u->memblockq = pa_memblockq_new(0, MEMBLOCKQ_MAXLENGTH, 0, pa_frame_size(&ss), 1, 1, 0, NULL);
u->memblockq = pa_memblockq_new("module-virtual-source memblockq", 0, MEMBLOCKQ_MAXLENGTH, 0, &ss, 1, 1, 0, NULL);
if (!u->memblockq) {
pa_log("Failed to create source memblockq.");
goto fail;
@ -659,7 +659,7 @@ int pa__init(pa_module*m) {
pa_proplist_setf(sink_data.proplist, PA_PROP_DEVICE_DESCRIPTION, "Uplink Sink %s on %s", sink_data.name, z ? z : master->name);
}
u->sink_memblockq = pa_memblockq_new(0, MEMBLOCKQ_MAXLENGTH, 0, pa_frame_size(&ss), 1, 1, 0, NULL);
u->sink_memblockq = pa_memblockq_new("module-virtual-source sink_memblockq", 0, MEMBLOCKQ_MAXLENGTH, 0, &ss, 1, 1, 0, NULL);
if (!u->sink_memblockq) {
pa_sink_new_data_done(&sink_data);
pa_log("Failed to create sink memblockq.");

View file

@ -556,10 +556,11 @@ static struct session *session_new(struct userdata *u, const pa_sdp_info *sdp_in
s->intended_latency = s->sink_latency*2;
s->memblockq = pa_memblockq_new(
"module-rtp-recv memblockq",
0,
MEMBLOCKQ_MAXLENGTH,
MEMBLOCKQ_MAXLENGTH,
pa_frame_size(&s->sink_input->sample_spec),
&s->sink_input->sample_spec,
pa_usec_to_bytes(s->intended_latency - s->sink_latency, &s->sink_input->sample_spec),
0,
0,

View file

@ -348,10 +348,11 @@ int pa__init(pa_module*m) {
u->source_output = o;
u->memblockq = pa_memblockq_new(
"module-rtp-send memblockq",
0,
MEMBLOCKQ_MAXLENGTH,
MEMBLOCKQ_MAXLENGTH,
pa_frame_size(&ss),
&ss,
1,
0,
0,