Lines Matching defs:sink

6     Based on module-virtual-sink.c
44 #include <pulsecore/sink.h>
62 "sink_name=<name for the sink> "
63 "sink_properties=<properties for the sink> "
64 "sink_master=<name of sink to filter> "
150 ((u)->sink->state == PA_SINK_RUNNING))
152 /* This module creates a new (virtual) source and sink.
154 * The data sent to the new sink is kept in a memblockq before being
157 * Data read from source_master is matched against the saved sink data and
160 * Both source and sink masters have their own threads to push/pull data
230 pa_sink *sink;
234 int64_t send_counter; /* updated in sink IO thread */
316 send_counter = pa_bytes_to_usec(snapshot->send_counter, &u->sink->sample_spec);
317 recv_counter = pa_bytes_to_usec(snapshot->recv_counter, &u->sink->sample_spec);
355 pa_asyncmsgq_send(u->sink_input->sink->asyncmsgq, PA_MSGOBJECT(u->sink_input), SINK_INPUT_MESSAGE_LATENCY_SNAPSHOT, &latency_snapshot, 0, NULL);
438 /* Called from sink I/O thread context */
446 /* The sink is _put() before the sink input is, so let's
448 * sink input is first shut down, the sink second. */
449 if (!PA_SINK_IS_LINKED(u->sink->thread_info.state) ||
457 /* Get the latency of the master sink */
458 pa_sink_get_latency_within_thread(u->sink_input->sink, true) +
460 /* Add the latency internal to our sink input on top */
461 pa_bytes_to_usec(pa_memblockq_get_length(u->sink_input->thread_info.render_memblockq), &u->sink_input->sink->sample_spec);
484 /* restart timer when both sink and source are active */
485 if ((u->sink->state == PA_SINK_RUNNING) && u->adjust_time)
509 /* restart timer when both sink and source are active */
530 * of the master sink to make sure we are heard immediately */
560 /* Called from sink I/O thread context */
568 if (!PA_SINK_IS_LINKED(u->sink->thread_info.state) ||
581 /* Called from sink I/O thread context */
588 if (!PA_SINK_IS_LINKED(u->sink->thread_info.state) ||
594 /* Just hand this one over to the master sink */
689 pa_log("Playback after capture (%lld), drop sink %lld", (long long) diff_time, (long long) diff);
714 /* 1. Get sink input latency snapshot, might cause buffers to be sent to source thread */
715 pa_asyncmsgq_send(u->sink_input->sink->asyncmsgq, PA_MSGOBJECT(u->sink_input), SINK_INPUT_MESSAGE_LATENCY_SNAPSHOT, &latency_snapshot, 0, NULL);
883 /* drop consumed sink samples */
937 * blocksize bytes and then adjust for that last bit on the sink side.
939 * means the only way to try to catch up is drop sink samples and let
961 /* And for the sink, these samples have been played back already, so we can
979 /* Called from sink I/O thread context. */
987 if (!PA_SINK_IS_LINKED(u->sink->thread_info.state))
990 if (u->sink->thread_info.rewind_requested)
991 pa_sink_process_rewind(u->sink, 0);
993 pa_sink_render_full(u->sink, nbytes, chunk);
1023 /* go back on read side, we need to use older sink data for this */
1033 /* Called from sink I/O thread context. */
1040 /* If the sink is not yet linked, there is nothing to rewind */
1041 if (!PA_SINK_IS_LINKED(u->sink->thread_info.state))
1046 pa_sink_process_rewind(u->sink, nbytes);
1126 /* Called from sink I/O thread context. */
1140 latency = pa_sink_get_latency_within_thread(u->sink_input->sink, false);
1159 /* Called from sink I/O thread context. */
1171 pa_sink_set_max_rewind_within_thread(u->sink, nbytes);
1186 /* Called from sink I/O thread context. */
1195 pa_sink_set_max_request_within_thread(u->sink, nbytes);
1198 /* Called from sink I/O thread context. */
1206 latency = pa_sink_get_requested_latency_within_thread(i->sink);
1224 /* Called from sink I/O thread context. */
1232 (long long) i->sink->thread_info.min_latency,
1233 (long long) i->sink->thread_info.max_latency);
1235 pa_sink_set_latency_range_within_thread(u->sink, i->sink->thread_info.min_latency, i->sink->thread_info.max_latency);
1252 /* Called from sink I/O thread context. */
1260 (long long) i->sink->thread_info.fixed_latency);
1262 pa_sink_set_fixed_latency_within_thread(u->sink, i->sink->thread_info.fixed_latency);
1302 /* Called from sink I/O thread context. */
1309 pa_sink_set_rtpoll(u->sink, i->sink->thread_info.rtpoll);
1310 pa_sink_set_latency_range_within_thread(u->sink, i->sink->thread_info.min_latency, i->sink->thread_info.max_latency);
1314 pa_sink_set_fixed_latency_within_thread(u->sink, i->sink->thread_info.fixed_latency);
1319 pa_sink_set_max_request_within_thread(u->sink, pa_sink_input_get_max_request(i));
1323 pa_sink_set_max_rewind_within_thread(u->sink, pa_sink_input_get_max_rewind(i));
1328 i->sink->thread_info.rtpoll,
1332 if (PA_SINK_IS_LINKED(u->sink->thread_info.state))
1333 pa_sink_attach_within_thread(u->sink);
1356 /* Called from sink I/O thread context. */
1363 if (PA_SINK_IS_LINKED(u->sink->thread_info.state))
1364 pa_sink_detach_within_thread(u->sink);
1366 pa_sink_set_rtpoll(u->sink, NULL);
1386 /* Called from sink I/O thread context. */
1433 /* The order here matters! We first kill the sink so that streams
1434 * can properly be moved away while the sink input is still connected
1437 pa_sink_unlink(u->sink);
1443 pa_sink_unref(u->sink);
1444 u->sink = NULL;
1462 return (u->source != dest) && (u->sink != dest->monitor_of);
1475 return u->sink != dest;
1505 if (u->sink_input->sink) {
1506 pa_proplist_sets(pl, PA_PROP_DEVICE_MASTER_DEVICE, u->sink_input->sink->name);
1507 y = pa_proplist_gets(u->sink_input->sink->proplist, PA_PROP_DEVICE_DESCRIPTION);
1512 y ? y : u->sink_input->sink->name);
1527 pa_sink_set_asyncmsgq(u->sink, dest->asyncmsgq);
1528 pa_sink_update_flags(u->sink, PA_SINK_LATENCY|PA_SINK_DYNAMIC_LATENCY, dest->flags);
1530 pa_sink_set_asyncmsgq(u->sink, NULL);
1546 pa_sink_update_proplist(u->sink, PA_UPDATE_REPLACE, pl);
1558 pa_sink_volume_changed(u->sink, &i->volume);
1568 pa_sink_mute_changed(u->sink, i->muted);
1744 pa_log("Master sink not found");
1750 pa_log("Can't cancel echo between a sink and its monitor");
1754 /* Set to true if we just want to inherit sample spec and channel map from the sink and source master */
1914 /* Create sink */
1942 u->sink = pa_sink_new(m->core, &sink_data, (sink_master->flags & (PA_SINK_LATENCY | PA_SINK_DYNAMIC_LATENCY))
1946 if (!u->sink) {
1947 pa_log("Failed to create sink.");
1951 u->sink->parent.process_msg = sink_process_msg_cb;
1952 u->sink->set_state_in_main_thread = sink_set_state_in_main_thread_cb;
1953 u->sink->set_state_in_io_thread = sink_set_state_in_io_thread_cb;
1954 u->sink->update_requested_latency = sink_update_requested_latency_cb;
1955 u->sink->request_rewind = sink_request_rewind_cb;
1956 pa_sink_set_set_mute_callback(u->sink, sink_set_mute_cb);
1958 pa_sink_set_set_volume_callback(u->sink, sink_set_volume_cb);
1959 pa_sink_enable_decibel_volume(u->sink, true);
1961 u->sink->userdata = u;
1963 pa_sink_set_asyncmsgq(u->sink, sink_master->asyncmsgq);
2004 /* Create sink input */
2009 sink_input_data.origin_sink = u->sink;
2044 u->sink->input_to_master = u->sink_input;
2099 blocksize_usec = pa_bytes_to_usec(u->sink_blocksize, &u->sink->sample_spec);
2100 if (u->sink->flags & PA_SINK_DYNAMIC_LATENCY)
2101 pa_sink_set_latency_range(u->sink, blocksize_usec, blocksize_usec * MAX_LATENCY_BLOCKS);
2105 * otherwise streams might attach to the sink/source before the
2106 * sink input or source output is attached to the master. */
2110 pa_sink_put(u->sink);
2136 return pa_sink_linked_by(u->sink) + pa_source_linked_by(u->source);
2163 if (u->sink)
2164 pa_sink_unlink(u->sink);
2178 if (u->sink)
2179 pa_sink_unref(u->sink);