summaryrefslogtreecommitdiffstats
path: root/src/pulse
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulse')
-rw-r--r--src/pulse/def.h17
-rw-r--r--src/pulse/stream.c10
2 files changed, 25 insertions, 2 deletions
diff --git a/src/pulse/def.h b/src/pulse/def.h
index 82106ef8..80d2a508 100644
--- a/src/pulse/def.h
+++ b/src/pulse/def.h
@@ -289,6 +289,12 @@ typedef enum pa_stream_flags {
* device volume. If this is not specified the volume will be
* consider absolute when the sink is in flat volume mode,
* relative otherwise. \since 0.9.20 */
+
+ PA_STREAM_PASSTHROUGH = 0x80000U
+ /**< Used to tag content that will be rendered by passthrough sinks.
+ * The data will be left as is and not reformatted, resampled.
+ * \since 0.9.22*/
+
} pa_stream_flags_t;
/** \cond fulldocs */
@@ -316,6 +322,7 @@ typedef enum pa_stream_flags {
#define PA_STREAM_START_UNMUTED PA_STREAM_START_UNMUTED
#define PA_STREAM_FAIL_ON_SUSPEND PA_STREAM_FAIL_ON_SUSPEND
#define PA_STREAM_RELATIVE_VOLUME PA_STREAM_RELATIVE_VOLUME
+#define PA_STREAM_PASSTHROUGH PA_STREAM_PASSTHROUGH
/** \endcond */
@@ -729,9 +736,15 @@ typedef enum pa_sink_flags {
/**< This sink is in flat volume mode, i.e. always the maximum of
* the volume of all connected inputs. \since 0.9.15 */
- PA_SINK_DYNAMIC_LATENCY = 0x0080U
+ PA_SINK_DYNAMIC_LATENCY = 0x0080U,
/**< The latency can be adjusted dynamically depending on the
* needs of the connected streams. \since 0.9.15 */
+
+ PA_SINK_PASSTHROUGH = 0x0100U
+ /**< This sink has support for passthrough mode. The data will be left
+ * as is and not reformatted, resampled, mixed.
+ * \since 0.9.22*/
+
} pa_sink_flags_t;
/** \cond fulldocs */
@@ -743,6 +756,8 @@ typedef enum pa_sink_flags {
#define PA_SINK_DECIBEL_VOLUME PA_SINK_DECIBEL_VOLUME
#define PA_SINK_FLAT_VOLUME PA_SINK_FLAT_VOLUME
#define PA_SINK_DYNAMIC_LATENCY PA_SINK_DYNAMIC_LATENCY
+#define PA_SINK_PASSTHROUGH PA_SINK_PASSTHROUGH
+
/** \endcond */
/** Sink state. \since 0.9.15 */
diff --git a/src/pulse/stream.c b/src/pulse/stream.c
index 36514e0e..87c24ba8 100644
--- a/src/pulse/stream.c
+++ b/src/pulse/stream.c
@@ -1065,7 +1065,9 @@ static int create_stream(
PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND|
PA_STREAM_START_UNMUTED|
PA_STREAM_FAIL_ON_SUSPEND|
- PA_STREAM_RELATIVE_VOLUME)), PA_ERR_INVALID);
+ PA_STREAM_RELATIVE_VOLUME|
+ PA_STREAM_PASSTHROUGH)), 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);
@@ -1206,6 +1208,12 @@ static int create_stream(
}
+ if (s->context->version >= 18) {
+
+ if (s->direction == PA_STREAM_PLAYBACK)
+ pa_tagstruct_put_boolean(t, flags & (PA_STREAM_PASSTHROUGH));
+ }
+
pa_pstream_send_tagstruct(s->context->pstream, t);
pa_pdispatch_register_reply(s->context->pdispatch, tag, DEFAULT_TIMEOUT, pa_create_stream_callback, s, NULL);