[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/mer-hybris/pulseaudio-modules-droid.git</param>
<param name="branch">master</param>
- <param name="revision">b00bc7c3ea8cd58da61559769866e75308309ccd</param>
+ <param name="revision">b1ce02b3d6e983fed34bba9defea9a1d74d6b917</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-12.2.77.tar.bz2/src/droid/droid-sink.c
^
|
@@ -442,6 +442,7 @@
return ret;
}
+/* Called from IO context */
static int unsuspend(struct userdata *u) {
uint32_t i;
@@ -466,56 +467,67 @@
}
/* Called from IO context */
+static int sink_set_state_in_io_thread_cb(pa_sink *s, pa_sink_state_t new_state, pa_suspend_cause_t new_suspend_cause) {
+ struct userdata *u;
+ int r;
+
+ pa_assert(s);
+ pa_assert_se(u = s->userdata);
+
+ /* It may be that only the suspend cause is changing, in which case there's
+ * nothing more to do. */
+ if (new_state == s->thread_info.state)
+ return 0;
+
+ switch (new_state) {
+ case PA_SINK_SUSPENDED:
+ pa_assert(PA_SINK_IS_OPENED(u->sink->thread_info.state));
+
+ if ((r = suspend(u)) < 0)
+ return r;
+
+ break;
+
+ case PA_SINK_IDLE:
+ /* Fall through */
+ case PA_SINK_RUNNING:
+ if (u->sink->thread_info.state == PA_SINK_SUSPENDED) {
+ if ((r = unsuspend(u)) < 0)
+ return r;
+ }
+
+ pa_rtpoll_set_timer_absolute(u->rtpoll, pa_rtclock_now());
+ break;
+
+ case PA_SINK_UNLINKED:
+ /* Suspending since some implementations do not want to free running stream. */
+ suspend(u);
+ break;
+
+ /* not needed */
+ case PA_SINK_INIT:
+ case PA_SINK_INVALID_STATE:
+ break;
+ }
+
+ return 0;
+}
+
+/* Called from IO context */
static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offset, pa_memchunk *chunk) {
struct userdata *u = PA_SINK(o)->userdata;
switch (code) {
-
case PA_SINK_MESSAGE_GET_LATENCY: {
*((pa_usec_t*) data) = pa_droid_stream_get_latency(u->stream);
return 0;
}
+#if PULSEAUDIO_VERSION < 12
case PA_SINK_MESSAGE_SET_STATE: {
- switch ((pa_sink_state_t) PA_PTR_TO_UINT(data)) {
- case PA_SINK_SUSPENDED: {
- int r;
-
- pa_assert(PA_SINK_IS_OPENED(u->sink->thread_info.state));
-
- if ((r = suspend(u)) < 0)
- return r;
-
- break;
- }
-
- case PA_SINK_IDLE:
- /* Fall through */
- case PA_SINK_RUNNING: {
- int r;
-
- if (u->sink->thread_info.state == PA_SINK_SUSPENDED) {
- if ((r = unsuspend(u)) < 0)
- return r;
- }
-
- pa_rtpoll_set_timer_absolute(u->rtpoll, pa_rtclock_now());
- break;
- }
-
- case PA_SINK_UNLINKED: {
- /* Suspending since some implementations do not want to free running stream. */
- suspend(u);
- break;
- }
-
- /* not needed */
- case PA_SINK_INIT:
- case PA_SINK_INVALID_STATE:
- ;
- }
- break;
+ return sink_set_state_in_io_thread_cb(u->sink, PA_PTR_TO_UINT(data), 0);
}
+#endif
}
return pa_sink_process_msg(o, code, data, offset, chunk);
@@ -1258,6 +1270,9 @@
u->sink->userdata = u;
u->sink->parent.process_msg = sink_process_msg;
+#if PULSEAUDIO_VERSION >= 12
+ u->sink->set_state_in_io_thread = sink_set_state_in_io_thread_cb;
+#endif
u->sink->set_port = sink_set_port_cb;
|
[-]
[+]
|
Changed |
_service:tar_git:pulseaudio-modules-droid-12.2.77.tar.bz2/src/droid/droid-source.c
^
|
@@ -275,6 +275,51 @@
}
/* Called from IO context */
+static int source_set_state_in_io_thread_cb(pa_source *s, pa_source_state_t new_state, pa_suspend_cause_t new_suspend_cause) {
+ struct userdata *u;
+ int r;
+
+ pa_assert(s);
+ pa_assert_se(u = s->userdata);
+
+ /* It may be that only the suspend cause is changing, in which case there's
+ * nothing more to do. */
+ if (new_state == s->thread_info.state)
+ return 0;
+
+ switch (new_state) {
+ case PA_SOURCE_SUSPENDED:
+ if (PA_SOURCE_IS_OPENED(u->source->thread_info.state)) {
+ if ((r = suspend(u)) < 0)
+ return r;
+ }
+
+ break;
+
+ case PA_SOURCE_IDLE:
+ /* Fall through */
+ case PA_SOURCE_RUNNING:
+ if (u->source->thread_info.state == PA_SOURCE_SUSPENDED) {
+ unsuspend(u);
+ u->timestamp = pa_rtclock_now();
+ }
+ break;
+
+ case PA_SOURCE_UNLINKED:
+ /* Suspending since some implementations do not want to free running stream. */
+ suspend(u);
+ break;
+
+ /* not needed */
+ case PA_SOURCE_INIT:
+ case PA_SOURCE_INVALID_STATE:
+ break;
+ }
+
+ return 0;
+}
+
+/* Called from IO context */
static int source_process_msg(pa_msgobject *o, int code, void *data, int64_t offset, pa_memchunk *chunk) {
struct userdata *u = PA_SOURCE(o)->userdata;
@@ -290,42 +335,11 @@
break;
}
+#if PULSEAUDIO_VERSION < 12
case PA_SOURCE_MESSAGE_SET_STATE: {
- switch ((pa_source_state_t) PA_PTR_TO_UINT(data)) {
- case PA_SOURCE_SUSPENDED: {
- int r;
-
- if (PA_SOURCE_IS_OPENED(u->source->thread_info.state)) {
- if ((r = suspend(u)) < 0)
- return r;
- }
-
- break;
- }
-
- case PA_SOURCE_IDLE:
- /* Fall through */
- case PA_SOURCE_RUNNING: {
- if (u->source->thread_info.state == PA_SOURCE_SUSPENDED) {
- unsuspend(u);
- u->timestamp = pa_rtclock_now();
- }
- break;
- }
-
- case PA_SOURCE_UNLINKED: {
- /* Suspending since some implementations do not want to free running stream. */
- suspend(u);
- break;
- }
-
- /* not needed */
- case PA_SOURCE_INIT:
- case PA_SOURCE_INVALID_STATE:
- ;
- }
- break;
+ return source_set_state_in_io_thread_cb(u->source, PA_PTR_TO_UINT(data), 0);
}
+#endif
}
return pa_source_process_msg(o, code, data, offset, chunk);
@@ -687,6 +701,9 @@
u->source->userdata = u;
u->source->parent.process_msg = source_process_msg;
+#if PULSEAUDIO_VERSION >= 12
+ u->source->set_state_in_io_thread = source_set_state_in_io_thread_cb;
+#endif
source_set_mute_control(u);
|