mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
core: move rtpoll to thread_info sub structure
This commit is contained in:
parent
58d441f7ea
commit
4eb59fb90e
6 changed files with 16 additions and 16 deletions
|
|
@ -455,12 +455,12 @@ static void sink_input_attach_cb(pa_sink_input *i) {
|
|||
pa_assert(!o->inq_rtpoll_item_read && !o->outq_rtpoll_item_write);
|
||||
|
||||
o->inq_rtpoll_item_read = pa_rtpoll_item_new_asyncmsgq_read(
|
||||
i->sink->rtpoll,
|
||||
i->sink->thread_info.rtpoll,
|
||||
PA_RTPOLL_LATE, /* This one is not that important, since we check for data in _peek() anyway. */
|
||||
o->inq);
|
||||
|
||||
o->outq_rtpoll_item_write = pa_rtpoll_item_new_asyncmsgq_write(
|
||||
i->sink->rtpoll,
|
||||
i->sink->thread_info.rtpoll,
|
||||
PA_RTPOLL_EARLY,
|
||||
o->outq);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ static void sink_input_attach(pa_sink_input *i) {
|
|||
pa_assert_se(s = i->userdata);
|
||||
|
||||
pa_assert(!s->rtpoll_item);
|
||||
s->rtpoll_item = pa_rtpoll_item_new(i->sink->rtpoll, PA_RTPOLL_LATE, 1);
|
||||
s->rtpoll_item = pa_rtpoll_item_new(i->sink->thread_info.rtpoll, PA_RTPOLL_LATE, 1);
|
||||
|
||||
p = pa_rtpoll_item_get_pollfd(s->rtpoll_item, NULL);
|
||||
p->fd = s->rtp_context.fd;
|
||||
|
|
|
|||
|
|
@ -262,7 +262,6 @@ pa_sink* pa_sink_new(
|
|||
s->userdata = NULL;
|
||||
|
||||
s->asyncmsgq = NULL;
|
||||
s->rtpoll = NULL;
|
||||
|
||||
/* As a minor optimization we just steal the list instead of
|
||||
* copying it here */
|
||||
|
|
@ -295,6 +294,7 @@ pa_sink* pa_sink_new(
|
|||
&s->sample_spec,
|
||||
0);
|
||||
|
||||
s->thread_info.rtpoll = NULL;
|
||||
s->thread_info.inputs = pa_hashmap_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
|
||||
s->thread_info.soft_volume = s->soft_volume;
|
||||
s->thread_info.soft_muted = s->muted;
|
||||
|
|
@ -421,7 +421,6 @@ void pa_sink_put(pa_sink* s) {
|
|||
|
||||
/* The following fields must be initialized properly when calling _put() */
|
||||
pa_assert(s->asyncmsgq);
|
||||
pa_assert(s->rtpoll);
|
||||
pa_assert(s->thread_info.min_latency <= s->thread_info.max_latency);
|
||||
|
||||
/* Generally, flags should be initialized via pa_sink_new(). As a
|
||||
|
|
@ -563,12 +562,12 @@ void pa_sink_set_asyncmsgq(pa_sink *s, pa_asyncmsgq *q) {
|
|||
pa_source_set_asyncmsgq(s->monitor_source, q);
|
||||
}
|
||||
|
||||
/* Called from main context */
|
||||
/* Called from IO context, or before _put() from main context */
|
||||
void pa_sink_set_rtpoll(pa_sink *s, pa_rtpoll *p) {
|
||||
pa_sink_assert_ref(s);
|
||||
pa_assert_ctl_context();
|
||||
pa_sink_assert_io_context(s);
|
||||
|
||||
s->rtpoll = p;
|
||||
s->thread_info.rtpoll = p;
|
||||
|
||||
if (s->monitor_source)
|
||||
pa_source_set_rtpoll(s->monitor_source, p);
|
||||
|
|
@ -1184,7 +1183,7 @@ pa_usec_t pa_sink_get_latency_within_thread(pa_sink *s) {
|
|||
|
||||
o = PA_MSGOBJECT(s);
|
||||
|
||||
/* We probably should make this a proper vtable callback instead of going through process_msg() */
|
||||
/* FIXME: We probably should make this a proper vtable callback instead of going through process_msg() */
|
||||
|
||||
if (o->process_msg(o, PA_SINK_MESSAGE_GET_LATENCY, &usec, 0, NULL) < 0)
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -102,7 +102,6 @@ struct pa_sink {
|
|||
pa_bool_t save_muted:1;
|
||||
|
||||
pa_asyncmsgq *asyncmsgq;
|
||||
pa_rtpoll *rtpoll;
|
||||
|
||||
pa_memchunk silence;
|
||||
|
||||
|
|
@ -156,6 +155,8 @@ struct pa_sink {
|
|||
pa_sink_state_t state;
|
||||
pa_hashmap *inputs;
|
||||
|
||||
pa_rtpoll *rtpoll;
|
||||
|
||||
pa_cvolume soft_volume;
|
||||
pa_bool_t soft_muted:1;
|
||||
|
||||
|
|
|
|||
|
|
@ -232,7 +232,6 @@ pa_source* pa_source_new(
|
|||
s->userdata = NULL;
|
||||
|
||||
s->asyncmsgq = NULL;
|
||||
s->rtpoll = NULL;
|
||||
|
||||
/* As a minor optimization we just steal the list instead of
|
||||
* copying it here */
|
||||
|
|
@ -265,6 +264,7 @@ pa_source* pa_source_new(
|
|||
&s->sample_spec,
|
||||
0);
|
||||
|
||||
s->thread_info.rtpoll = NULL;
|
||||
s->thread_info.outputs = pa_hashmap_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
|
||||
s->thread_info.soft_volume = s->soft_volume;
|
||||
s->thread_info.soft_muted = s->muted;
|
||||
|
|
@ -356,7 +356,6 @@ void pa_source_put(pa_source *s) {
|
|||
|
||||
/* The following fields must be initialized properly when calling _put() */
|
||||
pa_assert(s->asyncmsgq);
|
||||
pa_assert(s->rtpoll);
|
||||
pa_assert(s->thread_info.min_latency <= s->thread_info.max_latency);
|
||||
|
||||
/* Generally, flags should be initialized via pa_source_new(). As
|
||||
|
|
@ -465,18 +464,18 @@ static void source_free(pa_object *o) {
|
|||
|
||||
/* Called from main context */
|
||||
void pa_source_set_asyncmsgq(pa_source *s, pa_asyncmsgq *q) {
|
||||
pa_assert_ctl_context();
|
||||
pa_source_assert_ref(s);
|
||||
pa_assert_ctl_context();
|
||||
|
||||
s->asyncmsgq = q;
|
||||
}
|
||||
|
||||
/* Called from main context */
|
||||
void pa_source_set_rtpoll(pa_source *s, pa_rtpoll *p) {
|
||||
pa_assert_ctl_context();
|
||||
pa_source_assert_ref(s);
|
||||
pa_source_assert_io_context(s);
|
||||
|
||||
s->rtpoll = p;
|
||||
s->thread_info.rtpoll = p;
|
||||
}
|
||||
|
||||
/* Called from main context */
|
||||
|
|
|
|||
|
|
@ -90,7 +90,6 @@ struct pa_source {
|
|||
pa_bool_t save_muted:1;
|
||||
|
||||
pa_asyncmsgq *asyncmsgq;
|
||||
pa_rtpoll *rtpoll;
|
||||
|
||||
pa_memchunk silence;
|
||||
|
||||
|
|
@ -140,6 +139,8 @@ struct pa_source {
|
|||
pa_source_state_t state;
|
||||
pa_hashmap *outputs;
|
||||
|
||||
pa_rtpoll *rtpoll;
|
||||
|
||||
pa_cvolume soft_volume;
|
||||
pa_bool_t soft_muted:1;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue