From 79e762425b5bb4bd9254bc08e3c6fc5e47a2b79e Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Wed, 21 Dec 2005 15:24:59 +0000 Subject: [PATCH] Add documentation for id3demux. Original commit message from CVS: 2005-12-21 Jan Schmidt * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-good-plugins-docs.sgml: * docs/plugins/gst-plugins-good-plugins-sections.txt: * docs/plugins/gst-plugins-good-plugins.args: * gst/id3demux/gstid3demux.c: (gst_id3demux_get_type), (gst_id3demux_base_init), (gst_id3demux_class_init), (gst_id3demux_chain): * gst/id3demux/gstid3demux.h: Add documentation for id3demux. Don't fail if the first buffer is not at offset 0, just attempt to typefind and do pass through Rename the gst_type function from gst_gst_id3demux.. --- ChangeLog | 15 +++ docs/plugins/Makefile.am | 1 + docs/plugins/gst-plugins-good-plugins-docs.sgml | 2 + docs/plugins/gst-plugins-good-plugins-sections.txt | 8 ++ docs/plugins/gst-plugins-good-plugins.args | 110 +++++++++++++++++++++ gst/id3demux/gstid3demux.c | 44 ++++++--- gst/id3demux/gstid3demux.h | 4 +- 7 files changed, 170 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 50a58a1..b97a3b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2005-12-21 Jan Schmidt + + * docs/plugins/Makefile.am: + * docs/plugins/gst-plugins-good-plugins-docs.sgml: + * docs/plugins/gst-plugins-good-plugins-sections.txt: + * docs/plugins/gst-plugins-good-plugins.args: + * gst/id3demux/gstid3demux.c: (gst_id3demux_get_type), + (gst_id3demux_base_init), (gst_id3demux_class_init), + (gst_id3demux_chain): + * gst/id3demux/gstid3demux.h: + Add documentation for id3demux. + Don't fail if the first buffer is not at offset 0, just + attempt to typefind and do pass through + Rename the gst_type function from gst_gst_id3demux.. + 2005-12-20 Michael Smith * gst/udp/gstmultiudpsink.c: (gst_multiudpsink_render), diff --git a/docs/plugins/Makefile.am b/docs/plugins/Makefile.am index ddc8062..b720b73 100644 --- a/docs/plugins/Makefile.am +++ b/docs/plugins/Makefile.am @@ -78,6 +78,7 @@ EXTRA_HFILES = \ $(top_srcdir)/gst/autodetect/gstautovideosink.h \ $(top_srcdir)/gst/level/gstlevel.h \ $(top_srcdir)/gst/goom/gstgoom.h \ + $(top_srcdir)/gst/id3demux/gstid3demux.h \ $(top_srcdir)/ext/cairo/gsttimeoverlay.h \ $(top_srcdir)/ext/flac/gstflacdec.h \ $(top_srcdir)/gst/multipart/multipartmux.c \ diff --git a/docs/plugins/gst-plugins-good-plugins-docs.sgml b/docs/plugins/gst-plugins-good-plugins-docs.sgml index 731225d..a156d94 100644 --- a/docs/plugins/gst-plugins-good-plugins-docs.sgml +++ b/docs/plugins/gst-plugins-good-plugins-docs.sgml @@ -17,6 +17,7 @@ + @@ -45,6 +46,7 @@ + diff --git a/docs/plugins/gst-plugins-good-plugins-sections.txt b/docs/plugins/gst-plugins-good-plugins-sections.txt index 8cfbfd5..6cdef5e 100644 --- a/docs/plugins/gst-plugins-good-plugins-sections.txt +++ b/docs/plugins/gst-plugins-good-plugins-sections.txt @@ -39,6 +39,14 @@ GstGoomClass
+element-id3demux +GstID3Demux +id3demux + +GstID3DemuxClass +
+ +
element-level GstLevel level diff --git a/docs/plugins/gst-plugins-good-plugins.args b/docs/plugins/gst-plugins-good-plugins.args index 9ae70f6..73457a7 100644 --- a/docs/plugins/gst-plugins-good-plugins.args +++ b/docs/plugins/gst-plugins-good-plugins.args @@ -1548,3 +1548,113 @@ "ThisRandomString" + +GstCairoTextOverlay::deltax +gint + +w +X position modifier +Shift X position to the left or to the right. Unit is pixels. +0 + + + +GstCairoTextOverlay::deltay +gint + +w +Y position modifier +Shift Y position up or down. Unit is pixels. +0 + + + +GstCairoTextOverlay::font-desc +gchararray + +w +font description +Pango font description of font to be used for rendering. See documentation of pango_font_description_from_string for syntax. +"" + + + +GstCairoTextOverlay::halign +gchararray + +w +horizontal alignment +Horizontal alignment of the text. Can be either 'left', 'right', or 'center'. +"center" + + + +GstCairoTextOverlay::shaded-background +gboolean + +w +shaded background +Whether to shade the background under the text area. +FALSE + + + +GstCairoTextOverlay::text +gchararray + +w +text +Text to be display. +"" + + + +GstCairoTextOverlay::valign +gchararray + +w +vertical alignment +Vertical alignment of the text. Can be either 'baseline', 'bottom', or 'top'. +"baseline" + + + +GstCairoTextOverlay::xpad +gint + +w +horizontal paddding +Horizontal paddding when using left/right alignment. +25 + + + +GstCairoTextOverlay::ypad +gint + +w +vertical padding +Vertical padding when using top/bottom alignment. +25 + + + +GstOssMixerElement::device-name +gchararray + +r +Device name +Human-readable name of the sound device. +"" + + + +GstID3Demux::prefer-v1 +gboolean + +rwx +Prefer version 1 tag +Prefer tags from ID3v1 tag at end of file. +FALSE + + diff --git a/gst/id3demux/gstid3demux.c b/gst/id3demux/gstid3demux.c index 4a7a370..541e109 100644 --- a/gst/id3demux/gstid3demux.c +++ b/gst/id3demux/gstid3demux.c @@ -18,6 +18,27 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:element-id3demux + * @short_description: reads tag information from ID3v1 and ID3v2 (<= 2.4.0) data blocks and outputs them as GStreamer tag messages and events. + * + * + * + * id3demux accepts data streams with either (or both) ID3v2 regions at the start, or ID3v1 at the end. The mime type of the data between the tag blocks is detected using typefind functions, and the appropriate output mime type set on outgoing buffers. + * + * The element is only able to read ID3v1 tags from a seekable stream, because they are at the end of the stream. That is, when get_range mode is supported by the upstream elements. If get_range operation is available, id3demux makes it available downstream. This means that elements which require get_range mode, such as wavparse, can operate on files containing ID3 tag information. + * + * Example launch line + * + * + * gst-launch filesrc location=file.mp3 ! id3demux ! fakesink -t + * + * This pipeline should read any available ID3 tag information and output it. The contents of the file inside the ID3 tag regions should be detected, and the appropriate mime type set on buffers produced from id3demux. + * + * This id3demux element replaced an older element with the same name which relied on libid3tag from the MAD project. + * + * + */ #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -27,6 +48,12 @@ #include "gstid3demux.h" #include "id3tags.h" +static GstElementDetails gst_id3demux_details = +GST_ELEMENT_DETAILS ("ID3 tag demuxer", + "Codec/Demuxer/Metadata", + "Read and output ID3v1 and ID3v2 tags while demuxing the contents", + "Jan Schmidt "); + enum { ARG_0, @@ -93,7 +120,7 @@ static void gst_id3demux_send_tag_event (GstID3Demux * id3demux); static GstElementClass *parent_class = NULL; GType -gst_gst_id3demux_get_type (void) +gst_id3demux_get_type (void) { static GType plugin_type = 0; @@ -118,19 +145,13 @@ gst_gst_id3demux_get_type (void) static void gst_id3demux_base_init (GstID3DemuxClass * klass) { - static GstElementDetails plugin_details = { - "GStreamer ID3 Demuxer", - "Codec/Demuxer/Metadata", - "ID3 tag reader and demuxer", - "Jan Schmidt " - }; GstElementClass *element_class = GST_ELEMENT_CLASS (klass); gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&src_factory)); gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&sink_factory)); - gst_element_class_set_details (element_class, &plugin_details); + gst_element_class_set_details (element_class, &gst_id3demux_details); } static void @@ -153,7 +174,8 @@ gst_id3demux_class_init (GstID3DemuxClass * klass) g_object_class_install_property (gobject_class, ARG_PREFER_V1, g_param_spec_boolean ("prefer-v1", "Prefer version 1 tag", - "Prefer tags from ID3v1 tag at end of file", FALSE, + "Prefer tags from ID3v1 tag at end of file when both ID3v1 " + "and ID3v2 tags are present", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); } @@ -382,8 +404,6 @@ gst_id3demux_chain (GstPad * pad, GstBuffer * buf) if (GST_BUFFER_OFFSET (id3demux->collect) != 0) { GST_DEBUG_OBJECT (id3demux, "Received buffer from non-zero offset. Can't read tags"); - id3demux->state = GST_ID3DEMUX_TYPEFINDING; - break; } else { ID3TagsResult tag_result; @@ -398,9 +418,9 @@ gst_id3demux_chain (GstPad * pad, GstBuffer * buf) GST_DEBUG_OBJECT (id3demux, "Found an ID3v2 tag of size %d\n", id3demux->strip_start); - id3demux->state = GST_ID3DEMUX_TYPEFINDING; id3demux->send_tag_event = TRUE; } + id3demux->state = GST_ID3DEMUX_TYPEFINDING; /* Fall-through */ case GST_ID3DEMUX_TYPEFINDING:{ diff --git a/gst/id3demux/gstid3demux.h b/gst/id3demux/gstid3demux.h index 46ae6f1..4dc72e3 100644 --- a/gst/id3demux/gstid3demux.h +++ b/gst/id3demux/gstid3demux.h @@ -25,7 +25,7 @@ G_BEGIN_DECLS #define GST_TYPE_ID3DEMUX \ - (gst_gst_id3demux_get_type()) + (gst_id3demux_get_type()) #define GST_ID3DEMUX(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ID3DEMUX,GstID3Demux)) #define GST_ID3DEMUX_CLASS(klass) \ @@ -72,7 +72,7 @@ struct _GstID3DemuxClass GstElementClass parent_class; }; -GType gst_gst_id3demux_get_type (void); +GType gst_id3demux_get_type (void); G_END_DECLS -- 2.7.4