diff --git a/ChangeLog b/ChangeLog index 443b1015f2..39a4c6368a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +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/gnomevfs/gstgnomevfssink.h: + * ext/gnomevfs/gstgnomevfssrc.h: + * ext/vorbis/vorbisdec.c: (vorbis_handle_data_packet): + * ext/vorbis/vorbisdec.h: + * ext/vorbis/vorbisenc.c: (gst_vorbisenc_convert_sink): + * ext/vorbis/vorbisenc.h: + * ext/vorbis/vorbisparse.c: (vorbis_parse_set_header_on_caps), + (vorbis_parse_chain), (vorbis_parse_change_state): + * ext/vorbis/vorbisparse.h: + * gst/audioconvert/gstaudioconvert.h: + * gst/tcp/gsttcpserversink.h: + * gst/videotestsrc/gstvideotestsrc.c: + * gst/videotestsrc/gstvideotestsrc.h: + * gst/volume/gstvolume.c: + * gst/volume/gstvolume.h: + Fix some more docs. + Added docs for vorbisdec and vorbisparse. + Fix vorbisparse. + 2006-03-01 Wim Taymans * docs/plugins/Makefile.am: diff --git a/docs/plugins/Makefile.am b/docs/plugins/Makefile.am index a502a24dd0..a0610561f4 100644 --- a/docs/plugins/Makefile.am +++ b/docs/plugins/Makefile.am @@ -82,7 +82,9 @@ EXTRA_HFILES = \ $(top_srcdir)/ext/pango/gsttimeoverlay.h \ $(top_srcdir)/ext/theora/gsttheoradec.h \ $(top_srcdir)/ext/theora/gsttheoraenc.h \ + $(top_srcdir)/ext/vorbis/vorbisdec.h \ $(top_srcdir)/ext/vorbis/vorbisenc.h \ + $(top_srcdir)/ext/vorbis/vorbisparse.h \ $(top_srcdir)/gst/audioconvert/gstaudioconvert.h \ $(top_srcdir)/gst/audiotestsrc/gstaudiotestsrc.h \ $(top_srcdir)/gst/ffmpegcolorspace/gstffmpegcolorspace.h \ diff --git a/docs/plugins/gst-plugins-base-plugins-docs.sgml b/docs/plugins/gst-plugins-base-plugins-docs.sgml index 159256355b..5bd80e3a7f 100644 --- a/docs/plugins/gst-plugins-base-plugins-docs.sgml +++ b/docs/plugins/gst-plugins-base-plugins-docs.sgml @@ -27,7 +27,9 @@ + + diff --git a/docs/plugins/gst-plugins-base-plugins-sections.txt b/docs/plugins/gst-plugins-base-plugins-sections.txt index 3c5cbcff6e..6d823dfa29 100644 --- a/docs/plugins/gst-plugins-base-plugins-sections.txt +++ b/docs/plugins/gst-plugins-base-plugins-sections.txt @@ -223,6 +223,7 @@ gst_video_test_src_get_type volume GstVolume +GstVolumeFormat GST_VOLUME GST_VOLUME_CLASS GST_IS_VOLUME @@ -232,6 +233,20 @@ GstVolumeClass gst_volume_get_type +
+element-vorbisdec +GstVorbisDec +vorbisdec + +GstVorbisDecClass +GST_VORBIS_DEC +GST_IS_VORBIS_DEC +GST_TYPE_VORBIS_DEC +gst_vorbis_dec_get_type +GST_VORBIS_DEC_CLASS +GST_IS_VORBIS_DEC_CLASS +
+
element-vorbisenc vorbisenc @@ -247,6 +262,20 @@ GST_TYPE_VORBISENC GST_IS_VORBISENC_CLASS
+
+element-vorbisparse +vorbisparse +GstVorbisParse + +GstVorbisParseClass +GST_VORBIS_PARSE +GST_IS_VORBIS_PARSE +GST_TYPE_VORBIS_PARSE +gst_vorbis_parse_get_type +GST_VORBIS_PARSE_CLASS +GST_IS_VORBIS_PARSE_CLASS +
+
element-ximagesink ximagesink diff --git a/ext/gnomevfs/gstgnomevfssink.h b/ext/gnomevfs/gstgnomevfssink.h index 2712cb03ca..8e460d6de0 100644 --- a/ext/gnomevfs/gstgnomevfssink.h +++ b/ext/gnomevfs/gstgnomevfssink.h @@ -44,6 +44,11 @@ G_BEGIN_DECLS typedef struct _GstGnomeVFSSink GstGnomeVFSSink; typedef struct _GstGnomeVFSSinkClass GstGnomeVFSSinkClass; +/** + * GstGnomeVFSSink: + * + * Opaque data structure. + */ struct _GstGnomeVFSSink { GstBaseSink basesink; diff --git a/ext/gnomevfs/gstgnomevfssrc.h b/ext/gnomevfs/gstgnomevfssrc.h index 2a8853b35c..ac216a1a1a 100644 --- a/ext/gnomevfs/gstgnomevfssrc.h +++ b/ext/gnomevfs/gstgnomevfssrc.h @@ -46,6 +46,11 @@ G_BEGIN_DECLS typedef struct _GstGnomeVFSSrc GstGnomeVFSSrc; typedef struct _GstGnomeVFSSrcClass GstGnomeVFSSrcClass; +/** + * GstGnomeVFSSrc: + * + * Opaque data structure. + */ struct _GstGnomeVFSSrc { GstBaseSrc basesrc; diff --git a/ext/vorbis/vorbisdec.c b/ext/vorbis/vorbisdec.c index 48c4f47597..f644e8ec7f 100644 --- a/ext/vorbis/vorbisdec.c +++ b/ext/vorbis/vorbisdec.c @@ -17,6 +17,30 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:element-vorbisdec + * @short_description: a decoder that decodes Vorbis to raw audio + * @see_also: vorbisenc, oggdemux + * + * + * + * This element decodes a Vorbis stream to raw float audio. + * Vorbis is a royalty-free + * audio codec maintained by the Xiph.org + * Foundation. + * + * Example pipelines + * + * + * gst-launch -v filesrc location=sine.ogg ! oggdemux ! vorbisdec ! audioconvert ! alsasink + * + * Decode an Ogg/Vorbis. To create an Ogg/Vorbis file refer to the documentation of vorbisenc. + * + * + * + * Last reviewed on 2006-03-01 (0.10.4) + */ + #ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -798,6 +822,7 @@ vorbis_handle_data_packet (GstVorbisDec * vd, ogg_packet * packet) } else { GST_BUFFER_TIMESTAMP (out) = -1; } + /* this should not overflow */ GST_BUFFER_DURATION (out) = sample_count * GST_SECOND / vd->vi.rate; if (vd->cur_timestamp != GST_CLOCK_TIME_NONE) { diff --git a/ext/vorbis/vorbisdec.h b/ext/vorbis/vorbisdec.h index 2663496da4..7879393eab 100644 --- a/ext/vorbis/vorbisdec.h +++ b/ext/vorbis/vorbisdec.h @@ -42,6 +42,11 @@ G_BEGIN_DECLS typedef struct _GstVorbisDec GstVorbisDec; typedef struct _GstVorbisDecClass GstVorbisDecClass; +/** + * GstVorbisDec: + * + * Opaque data structure. + */ struct _GstVorbisDec { GstElement element; diff --git a/ext/vorbis/vorbisenc.c b/ext/vorbis/vorbisenc.c index 4928d4d677..4def90866a 100644 --- a/ext/vorbis/vorbisenc.c +++ b/ext/vorbis/vorbisenc.c @@ -19,6 +19,7 @@ /** * SECTION:element-vorbisenc + * @short_description: an encoder that encodes audio to Vorbis * @see_also: vorbisdec, oggmux * * @@ -42,17 +43,11 @@ * * gst-launch -v alsasrc ! audioconvert ! vorbisenc ! oggmux ! filesink location=alsasrc.ogg * - * - */ - -/** - * SECTION:vorbisenc - * @short_description: an encoder that encodes to Ogg/Vorbis - * @see_also: oggdemux + * * + * Last reviewed on 2006-03-01 (0.10.4) */ - #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/ext/vorbis/vorbisenc.h b/ext/vorbis/vorbisenc.h index b8e41d28bc..32cb0f0793 100644 --- a/ext/vorbis/vorbisenc.h +++ b/ext/vorbis/vorbisenc.h @@ -26,9 +26,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +G_BEGIN_DECLS #define GST_TYPE_VORBISENC \ (vorbisenc_get_type()) @@ -44,6 +42,11 @@ extern "C" { typedef struct _GstVorbisEnc GstVorbisEnc; typedef struct _GstVorbisEncClass GstVorbisEncClass; +/** + * GstVorbisEnc: + * + * Opaque data structure. + */ struct _GstVorbisEnc { GstElement element; @@ -86,10 +89,6 @@ struct _GstVorbisEncClass { GType vorbisenc_get_type(void); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __VORBISENC_H__ */ diff --git a/ext/vorbis/vorbisparse.c b/ext/vorbis/vorbisparse.c index 1d30a05d29..9fd53eff2b 100644 --- a/ext/vorbis/vorbisparse.c +++ b/ext/vorbis/vorbisparse.c @@ -17,6 +17,31 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:element-vorbisparse + * @short_description: parses vorbis streams + * @see_also: vorbisdec, oggdemux + * + * + * + * The vorbisparse element will parse the header packets of the Vorbis + * stream and put them as the streamheader in the caps. This is used in the + * multifdsink case where you want to stream live vorbis streams to multiple + * clients, each client has to receive the streamheaders first before they can + * consume the vorbis packets. + * + * Example pipelines + * + * + * gst-launch -v filesrc location=sine.ogg ! oggdemux ! vorbisparse ! fakesink + * + * This pipeline shows that the streamheader is set in the caps. + * + * + * + * Last reviewed on 2006-03-01 (0.10.4) + */ + #ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -128,15 +153,15 @@ vorbis_parse_set_header_on_caps (GstVorbisParse * parse, GstCaps * caps) /* put buffers in a fixed list */ g_value_init (&array, GST_TYPE_ARRAY); g_value_init (&value, GST_TYPE_BUFFER); - g_value_set_boxed (&value, buf1); + gst_value_set_buffer (&value, buf1); gst_value_array_append_value (&array, &value); g_value_unset (&value); g_value_init (&value, GST_TYPE_BUFFER); - g_value_set_boxed (&value, buf2); + gst_value_set_buffer (&value, buf2); gst_value_array_append_value (&array, &value); g_value_unset (&value); g_value_init (&value, GST_TYPE_BUFFER); - g_value_set_boxed (&value, buf3); + gst_value_set_buffer (&value, buf3); gst_value_array_append_value (&array, &value); gst_structure_set_value (structure, "streamheader", &array); g_value_unset (&value); @@ -146,6 +171,7 @@ vorbis_parse_set_header_on_caps (GstVorbisParse * parse, GstCaps * caps) static GstFlowReturn vorbis_parse_chain (GstPad * pad, GstBuffer * buffer) { + GstFlowReturn ret; GstBuffer *buf; GstVorbisParse *parse; @@ -165,39 +191,58 @@ vorbis_parse_chain (GstPad * pad, GstBuffer * buffer) * set caps again, and send out the streamheader buffers */ if (!parse->streamheader_sent) { /* mark and put on caps */ - GstCaps *caps = gst_pad_get_caps (parse->srcpad); + GstCaps *padcaps, *caps; + GstBuffer *outbuf; + + padcaps = gst_pad_get_caps (parse->srcpad); + caps = gst_caps_make_writable (padcaps); + gst_caps_unref (padcaps); vorbis_parse_set_header_on_caps (parse, caps); /* negotiate with these caps */ - GST_DEBUG ("here are the caps: %" GST_PTR_FORMAT, caps); + GST_DEBUG_OBJECT (parse, "here are the caps: %" GST_PTR_FORMAT, caps); gst_pad_set_caps (parse->srcpad, caps); + gst_caps_unref (caps); - /* push out buffers */ - gst_pad_push (parse->srcpad, parse->streamheader->data); - gst_pad_push (parse->srcpad, parse->streamheader->next->data); - gst_pad_push (parse->srcpad, parse->streamheader->next->next->data); + /* push out buffers, ignoring return value... */ + outbuf = GST_BUFFER_CAST (parse->streamheader->data); + gst_buffer_set_caps (outbuf, GST_PAD_CAPS (parse->srcpad)); + gst_pad_push (parse->srcpad, outbuf); + outbuf = GST_BUFFER_CAST (parse->streamheader->next->data); + gst_buffer_set_caps (outbuf, GST_PAD_CAPS (parse->srcpad)); + gst_pad_push (parse->srcpad, outbuf); + outbuf = GST_BUFFER_CAST (parse->streamheader->next->next->data); + gst_buffer_set_caps (outbuf, GST_PAD_CAPS (parse->srcpad)); + gst_pad_push (parse->srcpad, outbuf); + + g_list_free (parse->streamheader); + parse->streamheader = NULL; parse->streamheader_sent = TRUE; } /* just send on buffer by default */ - gst_pad_push (parse->srcpad, buf); + gst_buffer_set_caps (buf, GST_PAD_CAPS (parse->srcpad)); + ret = gst_pad_push (parse->srcpad, buf); - return GST_FLOW_OK; + return ret; } static GstStateChangeReturn vorbis_parse_change_state (GstElement * element, GstStateChange transition) { GstVorbisParse *parse = GST_VORBIS_PARSE (element); + GstStateChangeReturn ret; switch (transition) { - case GST_STATE_CHANGE_PAUSED_TO_READY: + case GST_STATE_CHANGE_READY_TO_PAUSED: parse->packetno = 0; + parse->streamheader_sent = FALSE; break; default: break; } + ret = parent_class->change_state (element, transition); - return parent_class->change_state (element, transition); + return ret; } diff --git a/ext/vorbis/vorbisparse.h b/ext/vorbis/vorbisparse.h index d77bb7bad6..32d8727d8c 100644 --- a/ext/vorbis/vorbisparse.h +++ b/ext/vorbis/vorbisparse.h @@ -25,10 +25,7 @@ #include -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - +G_BEGIN_DECLS #define GST_TYPE_VORBIS_PARSE \ (gst_vorbis_parse_get_type()) @@ -44,6 +41,11 @@ extern "C" { typedef struct _GstVorbisParse GstVorbisParse; typedef struct _GstVorbisParseClass GstVorbisParseClass; +/** + * GstVorbisParse: + * + * Opaque data structure. + */ struct _GstVorbisParse { GstElement element; @@ -61,9 +63,6 @@ struct _GstVorbisParseClass { GType gst_vorbis_parse_get_type(void); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - +G_END_DECLS #endif /* __GST_VORBIS_PARSE_H__ */ diff --git a/gst/audioconvert/gstaudioconvert.h b/gst/audioconvert/gstaudioconvert.h index a833891ef3..bf4eb852fe 100644 --- a/gst/audioconvert/gstaudioconvert.h +++ b/gst/audioconvert/gstaudioconvert.h @@ -38,7 +38,7 @@ typedef struct _GstAudioConvert GstAudioConvert; typedef struct _GstAudioConvertClass GstAudioConvertClass; /** - * GstAudioConvert + * GstAudioConvert: * * The audioconvert object structure. */ diff --git a/gst/tcp/gsttcpserversink.h b/gst/tcp/gsttcpserversink.h index 9b2539881f..da4117fddc 100644 --- a/gst/tcp/gsttcpserversink.h +++ b/gst/tcp/gsttcpserversink.h @@ -62,6 +62,11 @@ typedef enum { GST_TCP_SERVER_SINK_FLAG_LAST = (GST_ELEMENT_FLAG_LAST << 2) } GstTCPServerSinkFlags; +/** + * GstTCPServerSink: + * + * Opaque data structure. + */ struct _GstTCPServerSink { GstMultiFdSink element; diff --git a/gst/videotestsrc/gstvideotestsrc.c b/gst/videotestsrc/gstvideotestsrc.c index 6213f34a0d..68d00ff5df 100644 --- a/gst/videotestsrc/gstvideotestsrc.c +++ b/gst/videotestsrc/gstvideotestsrc.c @@ -24,9 +24,15 @@ * * Example launch line * + * The videotestsrc element is used to produce test video data in a wide variaty + * of formats. The video test data produced can be controlled with the "pattern" + * property. + * + * * * gst-launch -v videotestsrc pattern=snow ! ximagesink * + * Shows random noise in an X window. * * */ diff --git a/gst/videotestsrc/gstvideotestsrc.h b/gst/videotestsrc/gstvideotestsrc.h index d18eab3662..28003f1c65 100644 --- a/gst/videotestsrc/gstvideotestsrc.h +++ b/gst/videotestsrc/gstvideotestsrc.h @@ -37,6 +37,14 @@ G_BEGIN_DECLS #define GST_IS_VIDEO_TEST_SRC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEO_TEST_SRC)) +/** + * GstVideoTestSrcPattern: + * @GST_VIDEO_TEST_SRC_SMPTE: A standard SMPTE test pattern + * @GST_VIDEO_TEST_SRC_SNOW: Random noise + * @GST_VIDEO_TEST_SRC_BLACK: A black image + * + * The test pattern to produce. + */ typedef enum { GST_VIDEO_TEST_SRC_SMPTE, GST_VIDEO_TEST_SRC_SNOW, @@ -46,6 +54,11 @@ typedef enum { typedef struct _GstVideoTestSrc GstVideoTestSrc; typedef struct _GstVideoTestSrcClass GstVideoTestSrcClass; +/** + * GstVideoTestSrc: + * + * Opaque data structure. + */ struct _GstVideoTestSrc { GstPushSrc element; diff --git a/gst/volume/gstvolume.c b/gst/volume/gstvolume.c index 3982901336..8b86b075f6 100644 --- a/gst/volume/gstvolume.c +++ b/gst/volume/gstvolume.c @@ -27,6 +27,9 @@ * * Example launch line * + * The volume element changes the volume of the audio data. + * + * * * gst-launch -v -m audiotestsrc ! volume volume=0.5 ! level ! fakesink silent=TRUE * diff --git a/gst/volume/gstvolume.h b/gst/volume/gstvolume.h index b2ac9934de..7cdfaa8d3b 100644 --- a/gst/volume/gstvolume.h +++ b/gst/volume/gstvolume.h @@ -47,6 +47,11 @@ typedef enum { GST_VOLUME_FORMAT_FLOAT } GstVolumeFormat; +/** + * GstVolume: + * + * Opaque data structure. + */ struct _GstVolume { GstBaseTransform element;