return 0;
}
-/* Called from I/O thread context */
+/* Called from source I/O thread context */
static void source_update_requested_latency_cb(pa_source *s) {
struct userdata *u;
pa_source_get_requested_latency_within_thread(s));
}
-/* Called from I/O thread context */
+/* Called from sink I/O thread context */
static void sink_update_requested_latency_cb(pa_sink *s) {
struct userdata *u;
pa_sink_get_requested_latency_within_thread(s));
}
-/* Called from I/O thread context */
+/* Called from sink I/O thread context */
static void sink_request_rewind_cb(pa_sink *s) {
struct userdata *u;
pa_sink_input_set_volume(u->sink_input, &s->real_volume, s->save_volume, TRUE);
}
+/* Called from main context. */
static void source_get_volume_cb(pa_source *s) {
struct userdata *u;
pa_cvolume v;
pa_source_output_get_mute(u->source_output);
}
-/* must be called from the input thread context */
+/* Called from source I/O thread context. */
static void apply_diff_time(struct userdata *u, int64_t diff_time) {
int64_t diff;
}
}
-/* must be called from the input thread */
+/* Called from source I/O thread context. */
static void do_resync(struct userdata *u) {
int64_t diff_time;
struct snapshot latency_snapshot;
* 3. Push out capture samples in blocksize chunks
* 4. ???
* 5. Profit
+ *
+ * Called from source I/O thread context.
*/
static void do_push_drift_comp(struct userdata *u) {
size_t rlen, plen;
/* This one's simpler than the drift compensation case -- we just iterate over
* the capture buffer, and pass the canceller blocksize bytes of playback and
- * capture data. */
+ * capture data.
+ *
+ * Called from source I/O thread context. */
static void do_push(struct userdata *u) {
size_t rlen, plen;
pa_memchunk rchunk, pchunk, cchunk;
}
}
-/* Called from input thread context */
+/* Called from source I/O thread context. */
static void source_output_push_cb(pa_source_output *o, const pa_memchunk *chunk) {
struct userdata *u;
size_t rlen, plen, to_skip;
do_push(u);
}
-/* Called from I/O thread context */
+/* Called from sink I/O thread context. */
static int sink_input_pop_cb(pa_sink_input *i, size_t nbytes, pa_memchunk *chunk) {
struct userdata *u;
return 0;
}
-/* Called from input thread context */
+/* Called from source I/O thread context. */
static void source_output_process_rewind_cb(pa_source_output *o, size_t nbytes) {
struct userdata *u;
(long long) pa_memblockq_get_length (u->source_memblockq));
}
-/* Called from I/O thread context */
+/* Called from sink I/O thread context. */
static void sink_input_process_rewind_cb(pa_sink_input *i, size_t nbytes) {
struct userdata *u;
u->send_counter -= nbytes;
}
+/* Called from source I/O thread context. */
static void source_output_snapshot_within_thread(struct userdata *u, struct snapshot *snapshot) {
size_t delay, rlen, plen;
pa_usec_t now, latency;
snapshot->plen = plen + u->source_skip;
}
-
-/* Called from output thread context */
+/* Called from source I/O thread context. */
static int source_output_process_msg_cb(pa_msgobject *obj, int code, void *data, int64_t offset, pa_memchunk *chunk) {
struct userdata *u = PA_SOURCE_OUTPUT(obj)->userdata;
return pa_source_output_process_msg(obj, code, data, offset, chunk);
}
+/* Called from sink I/O thread context. */
static int sink_input_process_msg_cb(pa_msgobject *obj, int code, void *data, int64_t offset, pa_memchunk *chunk) {
struct userdata *u = PA_SINK_INPUT(obj)->userdata;
return pa_sink_input_process_msg(obj, code, data, offset, chunk);
}
-/* Called from I/O thread context */
+/* Called from sink I/O thread context. */
static void sink_input_update_max_rewind_cb(pa_sink_input *i, size_t nbytes) {
struct userdata *u;
pa_sink_set_max_rewind_within_thread(u->sink, nbytes);
}
-/* Called from I/O thread context */
+/* Called from source I/O thread context. */
static void source_output_update_max_rewind_cb(pa_source_output *o, size_t nbytes) {
struct userdata *u;
pa_source_set_max_rewind_within_thread(u->source, nbytes);
}
-/* Called from I/O thread context */
+/* Called from sink I/O thread context. */
static void sink_input_update_max_request_cb(pa_sink_input *i, size_t nbytes) {
struct userdata *u;
pa_sink_set_max_request_within_thread(u->sink, nbytes);
}
-/* Called from I/O thread context */
+/* Called from sink I/O thread context. */
static void sink_input_update_sink_requested_latency_cb(pa_sink_input *i) {
struct userdata *u;
pa_usec_t latency;
pa_log_debug("Sink input update requested latency %lld", (long long) latency);
}
-/* Called from I/O thread context */
+/* Called from source I/O thread context. */
static void source_output_update_source_requested_latency_cb(pa_source_output *o) {
struct userdata *u;
pa_usec_t latency;
pa_log_debug("Source output update requested latency %lld", (long long) latency);
}
-/* Called from I/O thread context */
+/* Called from sink I/O thread context. */
static void sink_input_update_sink_latency_range_cb(pa_sink_input *i) {
struct userdata *u;
pa_sink_set_latency_range_within_thread(u->sink, i->sink->thread_info.min_latency, i->sink->thread_info.max_latency);
}
-/* Called from I/O thread context */
+/* Called from source I/O thread context. */
static void source_output_update_source_latency_range_cb(pa_source_output *o) {
struct userdata *u;
pa_source_set_latency_range_within_thread(u->source, o->source->thread_info.min_latency, o->source->thread_info.max_latency);
}
-/* Called from I/O thread context */
+/* Called from sink I/O thread context. */
static void sink_input_update_sink_fixed_latency_cb(pa_sink_input *i) {
struct userdata *u;
pa_sink_set_fixed_latency_within_thread(u->sink, i->sink->thread_info.fixed_latency);
}
-/* Called from I/O thread context */
+/* Called from source I/O thread context. */
static void source_output_update_source_fixed_latency_cb(pa_source_output *o) {
struct userdata *u;
pa_source_set_fixed_latency_within_thread(u->source, o->source->thread_info.fixed_latency);
}
-/* Called from output thread context */
+/* Called from source I/O thread context. */
static void source_output_attach_cb(pa_source_output *o) {
struct userdata *u;
u->asyncmsgq);
}
-/* Called from I/O thread context */
+/* Called from sink I/O thread context. */
static void sink_input_attach_cb(pa_sink_input *i) {
struct userdata *u;
}
-/* Called from output thread context */
+/* Called from source I/O thread context. */
static void source_output_detach_cb(pa_source_output *o) {
struct userdata *u;
}
}
-/* Called from I/O thread context */
+/* Called from sink I/O thread context. */
static void sink_input_detach_cb(pa_sink_input *i) {
struct userdata *u;
}
}
-/* Called from output thread context */
+/* Called from source I/O thread context. */
static void source_output_state_change_cb(pa_source_output *o, pa_source_output_state_t state) {
struct userdata *u;
pa_log_debug("Source output %d state %d", o->index, state);
}
-/* Called from IO thread context */
+/* Called from sink I/O thread context. */
static void sink_input_state_change_cb(pa_sink_input *i, pa_sink_input_state_t state) {
struct userdata *u;
}
}
-/* Called from main thread */
+/* Called from main context. */
static void source_output_kill_cb(pa_source_output *o) {
struct userdata *u;
pa_module_unload_request(u->module, TRUE);
}
-/* Called from main thread */
+/* Called from main context. */
static pa_bool_t source_output_may_move_to_cb(pa_source_output *o, pa_source *dest) {
struct userdata *u;
return u->sink != dest;
}
-/* Called from main thread */
+/* Called from main context. */
static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
struct userdata *u;
return 0;
}
-/* Called by the canceller, so thread context */
+/* Called by the canceller, so source I/O thread context. */
void pa_echo_canceller_get_capture_volume(pa_echo_canceller *ec, pa_cvolume *v) {
*v = ec->msg->userdata->thread_info.current_volume;
}
-/* Called by the canceller, so thread context */
+/* Called by the canceller, so source I/O thread context. */
void pa_echo_canceller_set_capture_volume(pa_echo_canceller *ec, pa_cvolume *v) {
if (!pa_cvolume_equal(&ec->msg->userdata->thread_info.current_volume, v)) {
pa_cvolume *vol = pa_xnewdup(pa_cvolume, v, 1);
return PA_ECHO_CANCELLER_INVALID;
}
-/* Common initialisation bits between module-echo-cancel and the standalone test program */
+/* Common initialisation bits between module-echo-cancel and the standalone
+ * test program.
+ *
+ * Called from main context. */
static int init_common(pa_modargs *ma, struct userdata *u, pa_sample_spec *source_ss, pa_channel_map *source_map) {
pa_echo_canceller_method_t ec_method;
return -1;
}
-
+/* Called from main context. */
int pa__init(pa_module*m) {
struct userdata *u;
pa_sample_spec source_ss, sink_ss;
return -1;
}
+/* Called from main context. */
int pa__get_n_used(pa_module *m) {
struct userdata *u;
return pa_sink_linked_by(u->sink) + pa_source_linked_by(u->source);
}
+/* Called from main context. */
void pa__done(pa_module*m) {
struct userdata *u;