summaryrefslogtreecommitdiffstats
path: root/src/pulse
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-10-26 19:32:04 +0100
committerLennart Poettering <lennart@poettering.net>2008-10-26 19:32:04 +0100
commitadc2973c8dfab862d4333e0c1206995cd2df20c6 (patch)
treee74b9b79f36cfe7cd42c6261844009c39f5d6074 /src/pulse
parentc180cb5c48737b60b14fee22f20edc906ae8fec6 (diff)
Implement new flags DONT_INHIBIT_AUTO_SUSPEND and START_UNMUTED
Diffstat (limited to 'src/pulse')
-rw-r--r--src/pulse/def.h20
-rw-r--r--src/pulse/stream.c12
2 files changed, 29 insertions, 3 deletions
diff --git a/src/pulse/def.h b/src/pulse/def.h
index 66d9aff8..ace56574 100644
--- a/src/pulse/def.h
+++ b/src/pulse/def.h
@@ -194,7 +194,10 @@ typedef enum pa_stream_flags {
/**< Find peaks instead of resampling. \since 0.9.11 */
PA_STREAM_START_MUTED = 0x1000U,
- /**< Create in muted state. \since 0.9.11 */
+ /**< Create in muted state. If neither PA_STREAM_START_UNMUTED nor
+ * PA_STREAM_START_MUTED it is left to the server to decide
+ * whether to create the stream in muted or in unmuted
+ * state. \since 0.9.11 */
PA_STREAM_ADJUST_LATENCY = 0x2000U,
/**< Try to adjust the latency of the sink/source based on the
@@ -203,7 +206,7 @@ typedef enum pa_stream_flags {
* specified at the same time as PA_STREAM_EARLY_REQUESTS. \since
* 0.9.11 */
- PA_STREAM_EARLY_REQUESTS = 0x4000U
+ PA_STREAM_EARLY_REQUESTS = 0x4000U,
/**< Enable compatibility mode for legacy clients that rely on a
* "classic" hardware device fragment-style playback model. If
* this option is set, the minreq value of the buffer metrics gets
@@ -220,6 +223,17 @@ typedef enum pa_stream_flags {
* not be specified at the same time as
* PA_STREAM_ADJUST_LATENCY. \since 0.9.12 */
+ PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND = 0x8000U,
+ /**< If set this stream won't be taken into account when we it is
+ * checked whether the device this stream is connected to should
+ * auto-suspend. \ since 0.9.14 */
+
+ PA_STREAM_START_UNMUTED = 0x10000U
+ /**< Create in unmuted state. If neither PA_STREAM_START_UNMUTED
+ * nor PA_STREAM_START_MUTED it is left to the server to decide
+ * whether to create the stream in muted or in unmuted
+ * state. \since 0.9.14 */
+
} pa_stream_flags_t;
/** \cond fulldocs */
@@ -243,6 +257,8 @@ typedef enum pa_stream_flags {
#define PA_STREAM_START_MUTED PA_STREAM_START_MUTED
#define PA_STREAM_ADJUST_LATENCY PA_STREAM_ADJUST_LATENCY
#define PA_STREAM_EARLY_REQUESTS PA_STREAM_EARLY_REQUESTS
+#define PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND
+#define PA_STREAM_START_UNMUTED PA_STREAM_START_UNMUTED
/** \endcond */
diff --git a/src/pulse/stream.c b/src/pulse/stream.c
index 00aa1cf9..c0ae4ac2 100644
--- a/src/pulse/stream.c
+++ b/src/pulse/stream.c
@@ -887,7 +887,9 @@ static int create_stream(
PA_STREAM_PEAK_DETECT|
PA_STREAM_START_MUTED|
PA_STREAM_ADJUST_LATENCY|
- PA_STREAM_EARLY_REQUESTS)), PA_ERR_INVALID);
+ PA_STREAM_EARLY_REQUESTS|
+ PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND|
+ PA_STREAM_START_UNMUTED)), PA_ERR_INVALID);
PA_CHECK_VALIDITY(s->context, s->context->version >= 12 || !(flags & PA_STREAM_VARIABLE_RATE), PA_ERR_NOTSUPPORTED);
PA_CHECK_VALIDITY(s->context, s->context->version >= 13 || !(flags & PA_STREAM_PEAK_DETECT), PA_ERR_NOTSUPPORTED);
@@ -1007,6 +1009,14 @@ static int create_stream(
pa_tagstruct_put_boolean(t, flags & PA_STREAM_EARLY_REQUESTS);
}
+ if (s->context->version >= 15) {
+
+ if (s->direction == PA_STREAM_PLAYBACK)
+ pa_tagstruct_put_boolean(t, flags & (PA_STREAM_START_MUTED|PA_STREAM_START_UNMUTED));
+
+ pa_tagstruct_put_boolean(t, flags & PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND);
+ }
+
pa_pstream_send_tagstruct(s->context->pstream, t);
pa_pdispatch_register_reply(s->context->pdispatch, tag, DEFAULT_TIMEOUT, pa_create_stream_callback, s, NULL);