PROP_DEVICE_NAME,
PROP_CLIENT,
PROP_STREAM_PROPERTIES,
+ PROP_SOURCE_OUTPUT_INDEX,
PROP_LAST
};
g_param_spec_boxed ("stream-properties", "stream properties",
"list of pulseaudio stream properties",
GST_TYPE_STRUCTURE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ /**
+ * GstPulseSrc:source-output-index
+ *
+ * The index of the PulseAudio source output corresponding to this element.
+ *
+ * Since: 0.10.31
+ */
+ g_object_class_install_property (gobject_class,
+ PROP_SOURCE_OUTPUT_INDEX,
+ g_param_spec_uint ("source-output-index", "source output index",
+ "The index of the PulseAudio source output corresponding to this "
+ "record stream", 0, G_MAXUINT, PA_INVALID_INDEX,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
}
static void
pulsesrc->context = NULL;
pulsesrc->stream = NULL;
+ pulsesrc->source_output_idx = PA_INVALID_INDEX;
pulsesrc->read_buffer = NULL;
pulsesrc->read_buffer_length = 0;
pa_stream_disconnect (pulsesrc->stream);
pa_stream_unref (pulsesrc->stream);
pulsesrc->stream = NULL;
+ pulsesrc->source_output_idx = PA_INVALID_INDEX;
+ g_object_notify (G_OBJECT (pulsesrc), "source-output-index");
}
g_free (pulsesrc->device_description);
case PROP_STREAM_PROPERTIES:
gst_value_set_structure (value, pulsesrc->properties);
break;
+ case PROP_SOURCE_OUTPUT_INDEX:
+ g_value_set_uint (value, pulsesrc->source_output_idx);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
pa_threaded_mainloop_wait (pulsesrc->mainloop);
}
+ /* store the source output index so it can be accessed via a property */
+ pulsesrc->source_output_idx = pa_stream_get_index (pulsesrc->stream);
+ g_object_notify (G_OBJECT (pulsesrc), "source-output-index");
+
/* get the actual buffering properties now */
actual = pa_stream_get_buffer_attr (pulsesrc->stream);