Lines Matching defs:source

42 PA_MODULE_DESCRIPTION("Virtual channel remapping source");
46 "source_name=<name for the source> "
47 "source_properties=<properties for the source> "
48 "master=<name of source to filter> "
60 pa_source *source;
88 /* The source is _put() before the source output is, so let's
90 * source output is first shut down, the source second. */
91 if (!PA_SOURCE_IS_LINKED(u->source->thread_info.state) ||
99 /* Get the latency of the master source */
100 pa_source_get_latency_within_thread(u->source_output->source, true) +
101 /* Add the latency internal to our source output on top */
102 pa_bytes_to_usec(pa_memblockq_get_length(u->source_output->thread_info.delay_memblockq), &u->source_output->source->sample_spec);
135 if (!PA_SOURCE_IS_LINKED(u->source->thread_info.state) ||
141 /* Just hand this one over to the master source */
155 if (!PA_SOURCE_IS_LINKED(u->source->thread_info.state))
163 pa_source_post(u->source, chunk);
174 /* If the source is not yet linked, there is nothing to rewind */
175 if (PA_SOURCE_IS_LINKED(u->source->thread_info.state))
176 pa_source_process_rewind(u->source, nbytes);
187 pa_source_set_max_rewind_within_thread(u->source, nbytes);
198 if (PA_SOURCE_IS_LINKED(u->source->thread_info.state))
199 pa_source_detach_within_thread(u->source);
201 pa_source_set_rtpoll(u->source, NULL);
212 pa_source_set_rtpoll(u->source, o->source->thread_info.rtpoll);
213 pa_source_set_latency_range_within_thread(u->source, o->source->thread_info.min_latency, o->source->thread_info.max_latency);
214 pa_source_set_fixed_latency_within_thread(u->source, o->source->thread_info.fixed_latency);
215 pa_source_set_max_rewind_within_thread(u->source, pa_source_output_get_max_rewind(o));
217 if (PA_SOURCE_IS_LINKED(u->source->thread_info.state))
218 pa_source_attach_within_thread(u->source);
229 /* The order here matters! We first kill the source so that streams
230 * can properly be moved away while the source output is still connected
233 pa_source_unlink(u->source);
239 pa_source_unref(u->source);
240 u->source = NULL;
245 /* Called from output thread context except when cork() is called without valid source. */
266 pa_source_set_asyncmsgq(u->source, dest->asyncmsgq);
267 pa_source_update_flags(u->source, PA_SOURCE_LATENCY|PA_SOURCE_DYNAMIC_LATENCY, dest->flags);
269 pa_source_set_asyncmsgq(u->source, NULL);
272 PA_IDXSET_FOREACH(output, u->source->outputs, idx) {
274 output->moving(output, u->source);
285 pa_source_update_proplist(u->source, PA_UPDATE_REPLACE, pl);
309 pa_log("Master source not found.");
348 /* Create source */
372 u->source = pa_source_new(m->core, &source_data, master->flags & (PA_SOURCE_LATENCY|PA_SOURCE_DYNAMIC_LATENCY));
375 if (!u->source) {
376 pa_log("Failed to create source.");
380 u->source->parent.process_msg = source_process_msg_cb;
381 u->source->set_state_in_main_thread = source_set_state_in_main_thread_cb;
382 u->source->update_requested_latency = source_update_requested_latency_cb;
384 u->source->userdata = u;
386 pa_source_set_asyncmsgq(u->source, master->asyncmsgq);
388 /* Create source output */
393 source_output_data.destination_source = u->source;
418 u->source->output_from_master = u->source_output;
421 * otherwise streams might attach to the source before the
422 * source output is attached to the master. */
424 pa_source_put(u->source);
446 return pa_source_linked_by(u->source);
463 if (u->source)
464 pa_source_unlink(u->source);
471 if (u->source)
472 pa_source_unref(u->source);