diff --git a/ChangeLog b/ChangeLog index 2db597f9d0..2c256acf48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2006-03-01 Wim Taymans + + * docs/plugins/Makefile.am: + * docs/plugins/gst-plugins-base-plugins-docs.sgml: + * docs/plugins/gst-plugins-base-plugins-sections.txt: + * ext/alsa/gstalsamixer.c: + * ext/alsa/gstalsamixer.h: + * ext/alsa/gstalsamixerelement.c: + (gst_alsa_mixer_element_class_init), (gst_alsa_mixer_element_init): + * ext/alsa/gstalsamixerelement.h: + * ext/alsa/gstalsasink.c: + * ext/alsa/gstalsasink.h: + * ext/alsa/gstalsasrc.c: (gst_alsasrc_class_init), + (gst_alsasrc_init): + * ext/alsa/gstalsasrc.h: + Added alsa docs. + Small code cleanups. + 2006-03-01 Wim Taymans * ext/theora/Makefile.am: diff --git a/docs/plugins/Makefile.am b/docs/plugins/Makefile.am index a0610561f4..2de5280540 100644 --- a/docs/plugins/Makefile.am +++ b/docs/plugins/Makefile.am @@ -74,6 +74,9 @@ IGNORE_CFILES = utils.c mem.c imgconvert.c # the registry won't have the element EXTRA_HFILES = \ + $(top_srcdir)/ext/alsa/gstalsamixerelement.h \ + $(top_srcdir)/ext/alsa/gstalsasink.h \ + $(top_srcdir)/ext/alsa/gstalsasrc.h \ $(top_srcdir)/ext/gnomevfs/gstgnomevfssink.h \ $(top_srcdir)/ext/gnomevfs/gstgnomevfssrc.h \ $(top_srcdir)/ext/pango/gstclockoverlay.h \ diff --git a/docs/plugins/gst-plugins-base-plugins-docs.sgml b/docs/plugins/gst-plugins-base-plugins-docs.sgml index 5bd80e3a7f..86bd8f2643 100644 --- a/docs/plugins/gst-plugins-base-plugins-docs.sgml +++ b/docs/plugins/gst-plugins-base-plugins-docs.sgml @@ -12,6 +12,9 @@ gst-plugins-base Elements + + + diff --git a/docs/plugins/gst-plugins-base-plugins-sections.txt b/docs/plugins/gst-plugins-base-plugins-sections.txt index 6d823dfa29..0e382b9ddc 100644 --- a/docs/plugins/gst-plugins-base-plugins-sections.txt +++ b/docs/plugins/gst-plugins-base-plugins-sections.txt @@ -1,3 +1,49 @@ +
+element-alsamixer +GstAlsaMixerElement +alsamixer + +GstAlsaMixerElementClass +GST_ALSA_MIXER_ELEMENT +GST_IS_ALSA_MIXER_ELEMENT +GST_TYPE_ALSA_MIXER_ELEMENT +gst_alsa_mixer_element_get_type +GST_ALSA_MIXER_ELEMENT_CLASS +GST_IS_ALSA_MIXER_ELEMENT_CLASS +
+ +
+element-alsasink +GstAlsaSink +alsasink + +GstAlsaSinkClass +GST_ALSA_SINK +GST_ALSA_SINK_CAST +GST_ALSA_GET_LOCK +GST_ALSA_LOCK +GST_ALSA_UNLOCK +GST_IS_ALSA_SINK +GST_TYPE_ALSA_SINK +gst_alsasink_get_type +GST_ALSA_SINK_CLASS +GST_IS_ALSA_SINK_CLASS +
+ +
+element-alsasrc +GstAlsaSrc +alsasrc + +GstAlsaSrcClass +GST_ALSA_SRC +GST_IS_ALSA_SRC +GST_TYPE_ALSA_SRC +gst_alsasrc_get_type +GST_ALSA_SRC_CLASS +GST_IS_ALSA_SRC_CLASS +
+
element-audioconvert audioconvert diff --git a/ext/alsa/gstalsamixer.c b/ext/alsa/gstalsamixer.c index f4cffea49a..dfb040b9d7 100644 --- a/ext/alsa/gstalsamixer.c +++ b/ext/alsa/gstalsamixer.c @@ -17,6 +17,24 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:element-alsamixer + * @short_description: control properties of an audio device + * @see_also: alsasink, alsasrc + * + * + * + * This element controls various aspects such as the volume and balance + * of an audio device using the ALSA api. + * + * + * The application should query and use the interfaces provided by this + * element to control the device. + * + * + * + * Last reviewed on 2006-03-01 (0.10.4) + */ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/ext/alsa/gstalsamixer.h b/ext/alsa/gstalsamixer.h index 971f8053d5..6c9eb1e7ca 100644 --- a/ext/alsa/gstalsamixer.h +++ b/ext/alsa/gstalsamixer.h @@ -33,18 +33,21 @@ G_BEGIN_DECLS /* This does not get you what you think it does, use obj->mixer */ /* #define GST_ALSA_MIXER(obj) ((GstAlsaMixer*)(obj)) */ +typedef struct _GstAlsaMixer GstAlsaMixer; typedef enum { GST_ALSA_MIXER_CAPTURE = 1<<0, GST_ALSA_MIXER_PLAYBACK = 1<<1, GST_ALSA_MIXER_ALL = GST_ALSA_MIXER_CAPTURE | GST_ALSA_MIXER_PLAYBACK } GstAlsaMixerDirection; - -typedef struct _GstAlsaMixer GstAlsaMixer; - - -struct _GstAlsaMixer { +/** + * GstAlsaMixer: + * + * Opaque data structure + */ +struct _GstAlsaMixer +{ GList * tracklist; /* list of available tracks */ snd_mixer_t * handle; diff --git a/ext/alsa/gstalsamixerelement.c b/ext/alsa/gstalsamixerelement.c index ae19035c8f..ee83cf7789 100644 --- a/ext/alsa/gstalsamixerelement.c +++ b/ext/alsa/gstalsamixerelement.c @@ -25,9 +25,13 @@ #include "gstalsamixerelement.h" #include "gstalsadeviceprobe.h" +#define DEFAULT_PROP_DEVICE "default" +#define DEFAULT_PROP_DEVICE_NAME "" + enum { - PROP_DEVICE = 1, + PROP_0, + PROP_DEVICE, PROP_DEVICE_NAME }; @@ -118,11 +122,12 @@ gst_alsa_mixer_element_class_init (GstAlsaMixerElementClass * klass) g_object_class_install_property (gobject_class, PROP_DEVICE, g_param_spec_string ("device", "Device", "ALSA device, as defined in an asound configuration file", - "default", G_PARAM_READWRITE)); + DEFAULT_PROP_DEVICE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_DEVICE_NAME, g_param_spec_string ("device-name", "Device name", - "Human-readable name of the sound device", "", G_PARAM_READABLE)); + "Human-readable name of the sound device", + DEFAULT_PROP_DEVICE_NAME, G_PARAM_READABLE)); element_class->change_state = GST_DEBUG_FUNCPTR (gst_alsa_mixer_element_change_state); @@ -143,7 +148,7 @@ gst_alsa_mixer_element_init (GstAlsaMixerElement * this, GstAlsaMixerElementClass * klass) { this->mixer = NULL; - this->device = g_strdup ("default"); + this->device = g_strdup (DEFAULT_PROP_DEVICE); } static void diff --git a/ext/alsa/gstalsamixerelement.h b/ext/alsa/gstalsamixerelement.h index de9471cb70..3b85afb297 100644 --- a/ext/alsa/gstalsamixerelement.h +++ b/ext/alsa/gstalsamixerelement.h @@ -25,21 +25,22 @@ #include "gstalsamixer.h" #include "gstalsadeviceprobe.h" - G_BEGIN_DECLS - #define GST_ALSA_MIXER_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ALSA_MIXER_ELEMENT,GstAlsaMixerElement)) #define GST_ALSA_MIXER_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ALSA_MIXER_ELEMENT,GstAlsaMixerElementClass)) #define GST_IS_ALSA_MIXER_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ALSA_MIXER_ELEMENT)) #define GST_IS_ALSA_MIXER_ELEMENT_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ALSA_MIXER_ELEMENT)) #define GST_TYPE_ALSA_MIXER_ELEMENT (gst_alsa_mixer_element_get_type()) - typedef struct _GstAlsaMixerElement GstAlsaMixerElement; typedef struct _GstAlsaMixerElementClass GstAlsaMixerElementClass; - +/** + * GstAlsaMixerElement + * + * Opaque datastructure. + */ struct _GstAlsaMixerElement { GstElement parent; diff --git a/ext/alsa/gstalsasink.c b/ext/alsa/gstalsasink.c index 4cb1920399..051444b97f 100644 --- a/ext/alsa/gstalsasink.c +++ b/ext/alsa/gstalsasink.c @@ -19,6 +19,27 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:element-alsasink + * @short_description: play audio to an ALSA device + * @see_also: alsasrc, alsamixer + * + * + * + * This element renders raw audio samples using the ALSA api. + * + * Example pipelines + * + * Play an Ogg/Vorbis file. + * + * + * gst-launch -v filesrc location=sine.ogg ! oggdemux ! vorbisdec ! audioconvert ! alsasink + * + * + * + * Last reviewed on 2006-03-01 (0.10.4) + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/ext/alsa/gstalsasink.h b/ext/alsa/gstalsasink.h index 9e234bf193..bd2179fba5 100644 --- a/ext/alsa/gstalsasink.h +++ b/ext/alsa/gstalsasink.h @@ -23,12 +23,10 @@ #ifndef __GST_ALSASINK_H__ #define __GST_ALSASINK_H__ - #include #include #include - G_BEGIN_DECLS #define GST_TYPE_ALSA_SINK (gst_alsasink_get_type()) @@ -45,6 +43,11 @@ typedef struct _GstAlsaSinkClass GstAlsaSinkClass; #define GST_ALSA_LOCK(obj) (g_mutex_lock (GST_ALSA_GET_LOCK (obj))) #define GST_ALSA_UNLOCK(obj) (g_mutex_unlock (GST_ALSA_GET_LOCK (obj))) +/** + * GstAlsaSink: + * + * Opaque data structure + */ struct _GstAlsaSink { GstAudioSink sink; diff --git a/ext/alsa/gstalsasrc.c b/ext/alsa/gstalsasrc.c index 268b22785d..353186ed13 100644 --- a/ext/alsa/gstalsasrc.c +++ b/ext/alsa/gstalsasrc.c @@ -19,6 +19,27 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:element-alsasrc + * @short_description: capture audio from an alsa device + * @see_also: alsasink, alsamixer + * + * + * + * This element reads data from an audio card using the ALSA API. + * + * Example pipelines + * + * Record from a sound card using ALSA and encode to Ogg/Vorbis. + * + * + * gst-launch -v alsasrc ! audioconvert ! vorbisenc ! oggmux ! filesink location=alsasrc.ogg + * + * + * + * Last reviewed on 2006-03-01 (0.10.4) + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -41,6 +62,9 @@ GST_ELEMENT_DETAILS ("Audio Src (ALSA)", "Read from a sound card via ALSA", "Wim Taymans "); +#define DEFAULT_PROP_DEVICE "default" +#define DEFAULT_PROP_DEVICE_NAME "" + enum { PROP_0, @@ -76,12 +100,18 @@ enum LAST_SIGNAL }; +#if (G_BYTE_ORDER == G_LITTLE_ENDIAN) +# define ALSA_SRC_FACTORY_ENDIANNESS "LITTLE_ENDIAN, BIG_ENDIAN" +#else +# define ALSA_SRC_FACTORY_ENDIANNESS "BIG_ENDIAN, LITTLE_ENDIAN" +#endif + static GstStaticPadTemplate alsasrc_src_factory = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " + "endianness = (int) { " ALSA_SRC_FACTORY_ENDIANNESS " }, " "signed = (boolean) { TRUE, FALSE }, " "width = (int) 16, " "depth = (int) 16, " @@ -142,11 +172,12 @@ gst_alsasrc_class_init (GstAlsaSrcClass * klass) g_object_class_install_property (gobject_class, PROP_DEVICE, g_param_spec_string ("device", "Device", "ALSA device, as defined in an asound configuration file", - "default", G_PARAM_READWRITE)); + DEFAULT_PROP_DEVICE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_DEVICE_NAME, g_param_spec_string ("device-name", "Device name", - "Human-readable name of the sound device", "", G_PARAM_READABLE)); + "Human-readable name of the sound device", + DEFAULT_PROP_DEVICE_NAME, G_PARAM_READABLE)); } static void @@ -204,7 +235,7 @@ gst_alsasrc_init (GstAlsaSrc * alsasrc, GstAlsaSrcClass * g_class) { GST_DEBUG_OBJECT (alsasrc, "initializing"); - alsasrc->device = g_strdup ("default"); + alsasrc->device = g_strdup (DEFAULT_PROP_DEVICE); } static GstCaps * diff --git a/ext/alsa/gstalsasrc.h b/ext/alsa/gstalsasrc.h index 3693d01a97..48cd6290aa 100644 --- a/ext/alsa/gstalsasrc.h +++ b/ext/alsa/gstalsasrc.h @@ -23,12 +23,10 @@ #ifndef __GST_ALSASRC_H__ #define __GST_ALSASRC_H__ - #include #include "gstalsa.h" #include "gstalsamixer.h" - G_BEGIN_DECLS #define GST_TYPE_ALSA_SRC (gst_alsasrc_get_type()) @@ -40,6 +38,11 @@ G_BEGIN_DECLS typedef struct _GstAlsaSrc GstAlsaSrc; typedef struct _GstAlsaSrcClass GstAlsaSrcClass; +/** + * GstAlsaSrc: + * + * Opaque data structure + */ struct _GstAlsaSrc { GstAudioSrc src;