summaryrefslogtreecommitdiffstats
path: root/src/pulsesrc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsesrc.c')
-rw-r--r--src/pulsesrc.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/pulsesrc.c b/src/pulsesrc.c
index faf6def..5a3e918 100644
--- a/src/pulsesrc.c
+++ b/src/pulsesrc.c
@@ -115,9 +115,10 @@ static void gst_pulsesrc_base_init(gpointer g_class) {
"channels = (int) [ 1, 16 ];"
"audio/x-raw-int, "
- "signed = (boolean) FALSE, "
- "width = (int) 8, "
- "depth = (int) 8, "
+ "endianness = (int) { " ENDIANNESS " }, "
+ "signed = (boolean) TRUE, "
+ "width = (int) 32, "
+ "depth = (int) 32, "
"rate = (int) [ 1, MAX ], "
"channels = (int) [ 1, 16 ];"
@@ -127,6 +128,13 @@ static void gst_pulsesrc_base_init(gpointer g_class) {
"rate = (int) [ 1, MAX ], "
"channels = (int) [ 1, 16 ];"
+ "audio/x-raw-int, "
+ "signed = (boolean) FALSE, "
+ "width = (int) 8, "
+ "depth = (int) 8, "
+ "rate = (int) [ 1, MAX ], "
+ "channels = (int) [ 1, 16 ];"
+
"audio/x-alaw, "
"rate = (int) [ 1, MAX], "
"channels = (int) [ 1, 16 ];"
@@ -388,6 +396,7 @@ static gboolean gst_pulsesrc_close(GstAudioSrc *asrc) {
}
static gboolean gst_pulsesrc_prepare(GstAudioSrc *asrc, GstRingBufferSpec *spec) {
pa_buffer_attr buf_attr;
+ pa_channel_map channel_map;
GstPulseSrc *pulsesrc = GST_PULSESRC(asrc);
@@ -403,7 +412,11 @@ static gboolean gst_pulsesrc_prepare(GstAudioSrc *asrc, GstRingBufferSpec *spec)
goto unlock_and_fail;
}
- if (!(pulsesrc->stream = pa_stream_new(pulsesrc->context, "Record Stream", &pulsesrc->sample_spec, NULL))) {
+ if (!(pulsesrc->stream = pa_stream_new(
+ pulsesrc->context,
+ "Record Stream",
+ &pulsesrc->sample_spec,
+ gst_pulse_gst_to_channel_map(&channel_map, spec)))) {
GST_ELEMENT_ERROR(pulsesrc, RESOURCE, FAILED, ("Failed to create stream: %s", pa_strerror(pa_context_errno(pulsesrc->context))), (NULL));
goto unlock_and_fail;
}