fix non-validating docbook make sure validation gets checked before building

Original commit message from CVS:
fix non-validating docbook
make sure validation gets checked before building
This commit is contained in:
Thomas Vander Stichele 2004-01-29 17:25:18 +00:00
parent a093da6d7d
commit 55b67f084d
8 changed files with 64 additions and 27 deletions

View file

@ -1,3 +1,15 @@
2004-01-29 Thomas Vander Stichele <thomas at apestaart dot org>
* docs/Makefile.am:
* docs/gst/tmpl/gstelement.sgml:
* docs/gst/tmpl/gstxml.sgml:
* docs/manuals.mak:
* docs/pwg/advanced-request.xml:
* docs/pwg/advanced-scheduling.xml:
* docs/pwg/advanced-tagging.xml:
fix non-validating docbook using CDATA
make sure make check-local gets run first to check if it validates
2004-01-29 Julien MOUTTE <julien@moutte.net>
* docs/pwg/advanced-events.xml: Adding documentation on advanced event

View file

@ -5,6 +5,8 @@ else
SUBDIRS_PLUGINS =
endif
# FIXME: separate this out into docbook and gtk-doc so it doesn't descend
# for docs it can't build
if BUILD_DOCS
SUBDIRS_DOCS = faq manual pwg gst libs
else

View file

@ -995,6 +995,7 @@ Is triggered whenever an error occured.
@:
@:
@:
@:
@:
<!-- ##### SIGNAL GstElement::found-tag ##### -->

View file

@ -110,6 +110,10 @@ All GstElements can be serialized to an XML presentation and subsequently loaded
</para>
@:
@:
@:
@gstxml: the object which received the signal.
@arg1:
@arg2:
@ -119,7 +123,7 @@ All GstElements can be serialized to an XML presentation and subsequently loaded
</para>
@:
@:
@:
@gstxml: the object which received the signal.
@arg1:
@arg2:

View file

@ -92,6 +92,7 @@ $(BUILDDIR)/$(MAIN): $(XML) $(CSS)
@cp ../version.entities $(BUILDDIR)
html/index.html: $(BUILDDIR)/$(MAIN) $(PNG_BUILT) $(FIG_SRC)
@make check-local
@echo "*** Generating HTML output ***"
@-mkdir -p html
@cp -f $(srcdir)/../image-png $(BUILDDIR)/image.entities
@ -105,12 +106,14 @@ html/index.html: $(BUILDDIR)/$(MAIN) $(PNG_BUILT) $(FIG_SRC)
cp $(PNG_BUILT) html/images || true
$(DOC).ps: $(BUILDDIR)/$(MAIN) $(EPS_BUILT) $(PNG_SRC) $(FIG_SRC)
@make check-local
@echo "*** Generating PS output ***"
@cp -f $(srcdir)/../image-eps $(BUILDDIR)/image.entities
cd $(BUILDDIR) && docbook2ps -o .. $(MAIN)
# export LC_PAPER=$(PAPER_LOCALE) && cd $(BUILDDIR) && xmlto ps -o .. $(MAIN)
$(DOC).pdf: $(DOC).ps
@make check-local
@echo "*** Generating PDF output ***"
@ps2pdf $(DOC).ps

View file

@ -46,6 +46,7 @@
pads, looks like this:
</para>
<programlisting>
<![CDATA[
typedef struct _GstMyFilter {
[..]
gboolean firstrun;
@ -65,7 +66,7 @@ gst_my_filter_base_init (GstMyFilterClass *klass)
);
[..]
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&amp;src_factory));
gst_static_pad_template_get (&src_factory));
[..]
}
@ -89,7 +90,7 @@ gst_my_filter_getline (GstMyFilter *filter)
/* max. line length is 512 characters - for safety */
for (n = 0; n < 512; n++) {
num = gst_bytestream_peek_bytes (filter->bs, &amp;data, n + 1);
num = gst_bytestream_peek_bytes (filter->bs, &data, n + 1);
if (num != n + 1)
return NULL;
@ -97,7 +98,7 @@ gst_my_filter_getline (GstMyFilter *filter)
if (data[n] == '\n') {
GstBuffer *buf = gst_buffer_new_and_alloc (n + 1);
gst_bytestream_peek_bytes (filter->bs, &amp;data, n);
gst_bytestream_peek_bytes (filter->bs, &data, n);
memcpy (GST_BUFFER_DATA (buf), data, n);
GST_BUFFER_DATA (buf)[n] = '\0';
gst_bytestream_flush_fast (filter->bs, n + 1);
@ -163,11 +164,11 @@ gst_my_filter_loopfunc (GstElement *element)
/* parse stream number and go beyond the ':' in the data */
num = atoi (GST_BUFFER_DATA (buf));
if (num >= 0 &amp;&amp; num < g_list_length (filter->srcpadlist)) {
if (num >= 0 && num < g_list_length (filter->srcpadlist)) {
pad = GST_PAD (g_list_nth_data (filter->srcpadlist, num);
/* magic buffer parsing foo */
for (n = 0; GST_BUFFER_DATA (buf)[n] != ':' &amp;&amp;
for (n = 0; GST_BUFFER_DATA (buf)[n] != ':' &&
GST_BUFFER_DATA (buf)[n] != '\0'; n++) ;
if (GST_BUFFER_DATA (buf)[n] != '\0') {
GstBuffer *sub;
@ -184,6 +185,7 @@ gst_my_filter_loopfunc (GstElement *element)
}
gst_buffer_unref (buf);
}
]]>
</programlisting>
<para>
Note that we use a lot of checks everywhere to make sure that the content
@ -212,6 +214,7 @@ gst_my_filter_loopfunc (GstElement *element)
example of an aggregator based on request pads.
</para>
<programlisting>
<![CDATA[
static GstPad * gst_my_filter_request_new_pad (GstElement *element,
GstPadTemplate *templ,
const gchar *name);
@ -229,7 +232,7 @@ gst_my_filter_base_init (GstMyFilterClass *klass)
);
[..]
gst_element_class_add_pad_template (klass,
gst_static_pad_template_get (&amp;sink_factory));
gst_static_pad_template_get (&sink_factory));
}
static void
@ -258,6 +261,7 @@ gst_my_filter_request_new_pad (GstElement *element,
return pad;
}
]]>
</programlisting>
<para>
The <function>_loop ()</function> function is the same as the one given

View file

@ -149,6 +149,8 @@ gst_my_filter_loopfunc (GstElement *element)
useful in practice, but a good example, again.
</para>
<programlisting>
<![CDATA[
typedef struct _GstMyFilterInputContext {
gboolean eos;
GstBuffer *lastbuf;
@ -196,8 +198,8 @@ gst_my_filter_loopfunc (GstElement *element)
if (GST_PAD_IS_SRC (pad))
continue;
while (GST_PAD_IS_USABLE (pad) &amp;&amp;
!context->eos &amp;&amp; !context->lastbuf) {
while (GST_PAD_IS_USABLE (pad) &&
!context->eos && !context->lastbuf) {
GstData *data = gst_pad_pull (pad);
if (GST_IS_EVENT (data)) {
@ -246,6 +248,7 @@ gst_my_filter_loopfunc (GstElement *element)
gst_pad_push (filter->srcpad, GST_DATA (first_context->lastbuf));
first_context->lastbuf = NULL;
}
]]>
</programlisting>
<para>
Note that a loop-function is allowed to return. Better yet, a loop
@ -276,6 +279,7 @@ gst_my_filter_loopfunc (GstElement *element)
over its source pad.
</para>
<programlisting>
<![CDATA[
static void
gst_my_filter_loopfunc (GstElement *element)
{
@ -284,12 +288,12 @@ gst_my_filter_loopfunc (GstElement *element)
guint8 *data;
for (n = 0; ; n++) {
num = gst_bytestream_peek_bytes (filter->bs, &amp;data, n + 1);
num = gst_bytestream_peek_bytes (filter->bs, &data, n + 1);
if (num != n + 1) {
GstEvent *event = NULL;
guint remaining;
gst_bytestream_get_status (filter->bs, &amp;remaining, &amp;event);
gst_bytestream_get_status (filter->bs, &remaining, &event);
if (event) {
if (GST_EVENT_TYPE (event) == GST_EVENT_EOS)) {
/* end-of-file */
@ -312,7 +316,7 @@ gst_my_filter_loopfunc (GstElement *element)
GstBuffer *buf = gst_buffer_new_and_alloc (n + 1);
/* read the line of text without newline - then flush the newline */
gst_bytestream_peek_data (filter->bs, &amp;data, n);
gst_bytestream_peek_data (filter->bs, &data, n);
memcpy (GST_BUFFER_DATA (buf), data, n);
GST_BUFFER_DATA (buf)[n] = '\0';
gst_bytestream_flush_fast (filter->bs, n + 1);
@ -345,6 +349,7 @@ gst_my_filter_change_state (GstElement *element)
return GST_STATE_SUCCESS;
}
]]>
</programlisting>
<para>
In the above example, you'll notice how bytestream handles buffering of

View file

@ -66,6 +66,7 @@
<xref linkend="section-reqpad-sometimes"/>.
</para>
<programlisting>
<![CDATA[
static void
gst_my_filter_loopfunc (GstElement *element)
{
@ -85,7 +86,7 @@ gst_my_filter_loopfunc (GstElement *element)
type = g_strndup (line, colon_pos - line);
/* content is one character beyond the ':' */
colon_pos = &amp;colon_pos[1];
colon_pos = &colon_pos[1];
if (*colon_pos == '\0')
goto next;
@ -96,14 +97,14 @@ gst_my_filter_loopfunc (GstElement *element)
GType to_type;
to_type = gst_tag_get_type (type);
g_value_init (&amp;from, G_TYPE_STRING);
g_value_set_string (&amp;from, colon_pos);
g_value_init (&amp;to, to_type);
g_value_transform (&amp;from, &amp;to);
g_value_unset (&amp;from);
g_value_init (&from, G_TYPE_STRING);
g_value_set_string (&from, colon_pos);
g_value_init (&to, to_type);
g_value_transform (&from, &to);
g_value_unset (&from);
gst_tag_list_add_values (taglist, GST_TAG_MERGE_APPEND,
type, &amp;to, NULL);
g_value_unset (&amp;to);
type, &to, NULL);
g_value_unset (&to);
}
next:
@ -119,6 +120,7 @@ next:
gst_pad_send_event (filter->srcpad, GST_DATA (gst_event_new (GST_EVENT_EOS)));
gst_element_set_eos (element);
}
]]>
</programlisting>
<para>
We currently assume the core to already <emphasis>know</emphasis> the
@ -131,6 +133,7 @@ next:
functions, preferrably <function>_class_init ()</function>.
</para>
<programlisting>
<![CDATA[
static void
gst_my_filter_class_init (GstMyFilterClass *klass)
{
@ -142,6 +145,7 @@ gst_my_filter_class_init (GstMyFilterClass *klass)
NULL);
[..]
}
]]>
</programlisting>
</sect1>
@ -168,6 +172,7 @@ gst_my_filter_class_init (GstMyFilterClass *klass)
incoming events.
</para>
<programlisting>
<![CDATA[
GType
gst_my_filter_get_type (void)
{
@ -180,7 +185,7 @@ gst_my_filter_get_type (void)
[..]
g_type_add_interface_static (my_filter_type,
GST_TYPE_TAG_SETTER,
&amp;tag_setter_info);
&tag_setter_info);
[..]
}
@ -206,20 +211,20 @@ gst_my_filter_write_tag (const GstTagList *taglist,
const GValue *from;
GValue to = { 0 };
g_value_init (&amp;to, G_TYPE_STRING);
g_value_init (&to, G_TYPE_STRING);
for (n = 0; n < num_values; n++) {
from = gst_tag_list_get_value_index (taglist, tagname, n);
g_value_transform (from, &amp;to);
g_value_transform (from, &to);
buf = gst_buffer_new ();
GST_BUFFER_DATA (buf) = g_strdup_printf ("%s:%s", tagname,
g_value_get_string (&amp;to));
g_value_get_string (&to));
GST_BUFFER_SIZE (buf) = strlen (GST_BUFFER_DATA (buf));
gst_pad_push (filter->srcpad, GST_DATA (buf));
}
g_value_unset (&amp;to);
g_value_unset (&to);
}
static void
@ -270,6 +275,7 @@ gst_my_filter_loopfunc (GstElement *element)
gst_pad_push (filter->srcpad, GST_DATA (gst_event_new (GST_EVENT_EOS)));
gst_element_set_eos (element);
}
]]>
</programlisting>
<para>
Note that normally, elements would not read the full stream before