Lines Matching defs:sink

46 #include <pulsecore/sink-input.h>
645 * well as after the sink input has been activated using
689 * mechanism to tell the sink how often we want to be queried
690 * for data. The next best thing we can do is to set the sink's
695 pa_log_debug("Early requests mode enabled, configuring sink latency to minreq.");
700 * buffer according to the what the sink can provide. The
721 pa_log_debug("Adjust latency mode enabled, configuring sink latency to half of overall latency.");
734 pa_log_debug("Traditional mode enabled, modifying sink usec only for compat with minreq.");
763 * the sink latency is actually rewritable. */
801 pa_sink *sink,
846 /* Synced streams must connect to the same sink */
849 if (!sink)
850 sink = ssync->sink_input->sink;
851 else if (sink != ssync->sink_input->sink) {
863 if (sink)
864 pa_sink_input_new_data_set_sink(&data, sink, false, true);
1100 /*** sink input callbacks ***/
1114 /* We just ended an underrun, let's ask the sink
1130 /* OK, the sink already asked for this data, so
1251 s->current_sink_latency = pa_sink_get_latency_within_thread(s->sink_input->sink, false);
1489 if (old_state == i->sink->state)
1492 suspend = (i->sink->state == PA_SINK_SUSPENDED);
1732 pa_sink *sink = NULL;
1898 if (!(sink = pa_idxset_get_by_index(c->protocol->core->sinks, sink_index))) {
1905 if (!(sink = pa_namereg_get(c->protocol->core, sink_name, PA_NAMEREG_SINK))) {
1928 s = playback_stream_new(c, sink, &ss, &map, formats, &attr, volume_set ? &volume : NULL, muted, muted_set, flags, p, adjust_latency, early_requests, relative_volume, syncid, &missing, &ret);
1961 pa_tagstruct_putu32(reply, s->sink_input->sink->index);
1962 pa_tagstruct_puts(reply, s->sink_input->sink->name);
1964 pa_tagstruct_put_boolean(reply, s->sink_input->sink->state == PA_SINK_SUSPENDED);
2674 pa_sink *sink;
2675 if ((sink = pa_namereg_get(c->protocol->core, name, PA_NAMEREG_SINK)))
2676 idx = sink->index;
2713 pa_asyncmsgq_post(s->sink_input->sink->asyncmsgq, PA_MSGOBJECT(s->sink_input), SINK_INPUT_MESSAGE_DRAIN, PA_UINT_TO_PTR(tag), 0, NULL, NULL);
2765 pa_assert_se(pa_asyncmsgq_send(s->sink_input->sink->asyncmsgq, PA_MSGOBJECT(s->sink_input), SINK_INPUT_MESSAGE_UPDATE_LATENCY, s, 0, NULL) == 0);
2770 pa_bytes_to_usec(s->render_memblockq_length, &s->sink_input->sink->sample_spec));
2774 s->sink_input->sink->state == PA_SINK_RUNNING &&
2923 pa_sink *sink;
2948 sink = pa_idxset_get_by_index(c->protocol->core->sinks, sink_index);
2950 sink = pa_namereg_get(c->protocol->core, sink_name, PA_NAMEREG_SINK);
2952 CHECK_VALIDITY(c->pstream, sink, tag, PA_ERR_NOENTITY);
2965 if (pa_scache_play_item(c->protocol->core, name, sink, volume, p, &idx) < 0) {
3030 static void sink_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_sink *sink) {
3034 pa_sink_assert_ref(sink);
3036 fixup_sample_spec(c, &fixed_ss, &sink->sample_spec);
3040 PA_TAG_U32, sink->index,
3041 PA_TAG_STRING, sink->name,
3042 PA_TAG_STRING, pa_strnull(pa_proplist_gets(sink->proplist, PA_PROP_DEVICE_DESCRIPTION)),
3044 PA_TAG_CHANNEL_MAP, &sink->channel_map,
3045 PA_TAG_U32, sink->module ? sink->module->index : PA_INVALID_INDEX,
3046 PA_TAG_CVOLUME, pa_sink_get_volume(sink, false),
3047 PA_TAG_BOOLEAN, pa_sink_get_mute(sink, false),
3048 PA_TAG_U32, sink->monitor_source ? sink->monitor_source->index : PA_INVALID_INDEX,
3049 PA_TAG_STRING, sink->monitor_source ? sink->monitor_source->name : NULL,
3050 PA_TAG_USEC, pa_sink_get_latency(sink),
3051 PA_TAG_STRING, sink->driver,
3052 PA_TAG_U32, sink->flags & PA_SINK_CLIENT_FLAGS_MASK,
3056 pa_tagstruct_put_proplist(t, sink->proplist);
3057 pa_tagstruct_put_usec(t, pa_sink_get_requested_latency(sink));
3061 pa_tagstruct_put_volume(t, sink->base_volume);
3062 if (PA_UNLIKELY(sink->state == PA_SINK_INVALID_STATE))
3063 pa_log_error("Internal sink state is invalid.");
3064 pa_tagstruct_putu32(t, sink->state);
3065 pa_tagstruct_putu32(t, sink->n_volume_steps);
3066 pa_tagstruct_putu32(t, sink->card ? sink->card->index : PA_INVALID_INDEX);
3073 pa_tagstruct_putu32(t, pa_hashmap_size(sink->ports));
3075 PA_HASHMAP_FOREACH(p, sink->ports, state) {
3088 pa_tagstruct_puts(t, sink->active_port ? sink->active_port->name : NULL);
3094 pa_idxset *formats = pa_sink_get_formats(sink);
3289 pa_tagstruct_putu32(t, s->sink->index);
3387 pa_sink *sink = NULL;
3426 sink = pa_idxset_get_by_index(c->protocol->core->sinks, idx);
3428 sink = pa_namereg_get(c->protocol->core, name, PA_NAMEREG_SINK);
3455 if (!sink && !source && !client && !card && !module && !si && !so && !sce) {
3461 if (sink)
3462 sink_fill_tagstruct(c, reply, sink);
3641 pa_sink *sink = NULL;
3669 sink = pa_idxset_get_by_index(c->protocol->core->sinks, idx);
3671 sink = pa_namereg_get(c->protocol->core, name, PA_NAMEREG_SINK);
3693 CHECK_VALIDITY(c->pstream, si || so || sink || source, tag, PA_ERR_NOENTITY);
3697 if (sink) {
3698 CHECK_VALIDITY(c->pstream, volume.channels == 1 || pa_cvolume_compatible(&volume, &sink->sample_spec), tag, PA_ERR_INVALID);
3700 pa_log_debug("Client %s changes volume of sink %s.", client_name, sink->name);
3701 pa_sink_set_volume(sink, &volume, true, true);
3711 pa_log_debug("Client %s changes volume of sink input %s.",
3738 pa_sink *sink = NULL;
3764 sink = pa_idxset_get_by_index(c->protocol->core->sinks, idx);
3766 sink = pa_namereg_get(c->protocol->core, name, PA_NAMEREG_SINK);
3790 CHECK_VALIDITY(c->pstream, si || so || sink || source, tag, PA_ERR_NOENTITY);
3794 if (sink) {
3795 pa_log_debug("Client %s changes mute of sink %s.", client_name, sink->name);
3796 pa_sink_set_mute(sink, mute, true);
3801 pa_log_debug("Client %s changes mute of sink input %s.",
3867 pa_asyncmsgq_send(s->sink_input->sink->asyncmsgq, PA_MSGOBJECT(s->sink_input), SINK_INPUT_MESSAGE_FLUSH, NULL, 0, NULL);
3871 pa_asyncmsgq_send(s->sink_input->sink->asyncmsgq, PA_MSGOBJECT(s->sink_input), SINK_INPUT_MESSAGE_PREBUF_FORCE, NULL, 0, NULL);
3875 pa_asyncmsgq_send(s->sink_input->sink->asyncmsgq, PA_MSGOBJECT(s->sink_input), SINK_INPUT_MESSAGE_TRIGGER, NULL, 0, NULL);
3977 pa_assert_se(pa_asyncmsgq_send(s->sink_input->sink->asyncmsgq, PA_MSGOBJECT(s->sink_input), SINK_INPUT_MESSAGE_UPDATE_BUFFER_ATTR, NULL, 0, NULL) == 0);
4258 pa_sink *sink;
4261 sink = pa_namereg_get(c->protocol->core, s, PA_NAMEREG_SINK);
4262 CHECK_VALIDITY(c->pstream, sink, tag, PA_ERR_NOENTITY);
4264 pa_core_set_configured_default_sink(c->protocol->core, sink->name);
4434 pa_sink *sink = NULL;
4439 sink = pa_idxset_get_by_index(c->protocol->core->sinks, idx_device);
4441 sink = pa_namereg_get(c->protocol->core, name_device, PA_NAMEREG_SINK);
4443 CHECK_VALIDITY(c->pstream, si && sink, tag, PA_ERR_NOENTITY);
4445 if (pa_sink_input_move_to(si, sink, true) < 0) {
4505 pa_sink *sink = NULL;
4508 sink = pa_idxset_get_by_index(c->protocol->core->sinks, idx);
4510 sink = pa_namereg_get(c->protocol->core, name, PA_NAMEREG_SINK);
4512 CHECK_VALIDITY(c->pstream, sink, tag, PA_ERR_NOENTITY);
4514 pa_log_debug("%s of sink %s requested by client %" PRIu32 ".",
4515 b ? "Suspending" : "Resuming", sink->name, c->client->index);
4517 if (pa_sink_suspend(sink, b, PA_SUSPEND_USER) < 0) {
4715 pa_sink *sink;
4718 sink = pa_idxset_get_by_index(c->protocol->core->sinks, idx);
4720 sink = pa_namereg_get(c->protocol->core, name, PA_NAMEREG_SINK);
4722 CHECK_VALIDITY(c->pstream, sink, tag, PA_ERR_NOENTITY);
4724 if ((ret = pa_sink_set_port(sink, port, true)) < 0) {
4946 pa_asyncmsgq_post(ps->sink_input->sink->asyncmsgq, PA_MSGOBJECT(ps->sink_input), SINK_INPUT_MESSAGE_SEEK, PA_UINT_TO_PTR(seek), offset, chunk, NULL);
4948 pa_asyncmsgq_post(ps->sink_input->sink->asyncmsgq, PA_MSGOBJECT(ps->sink_input), SINK_INPUT_MESSAGE_POST_DATA, NULL, 0, chunk, NULL);
4950 pa_asyncmsgq_post(ps->sink_input->sink->asyncmsgq, PA_MSGOBJECT(ps->sink_input), SINK_INPUT_MESSAGE_SEEK, PA_UINT_TO_PTR(seek), offset+chunk->length, NULL, NULL);