+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
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
@:
@:
@:
+@:
@:
<!-- ##### SIGNAL GstElement::found-tag ##### -->
</para>
+@:
+@:
+@:
+
@gstxml: the object which received the signal.
@arg1:
@arg2:
</para>
-@:
-@:
-@:
+@gstxml: the object which received the signal.
+@arg1:
+@arg2:
@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
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
pads, looks like this:
</para>
<programlisting>
+<![CDATA[
typedef struct _GstMyFilter {
[..]
gboolean firstrun;
);
[..]
gst_element_class_add_pad_template (element_class,
- gst_static_pad_template_get (&src_factory));
+ gst_static_pad_template_get (&src_factory));
[..]
}
/* max. line length is 512 characters - for safety */
for (n = 0; n < 512; n++) {
- num = gst_bytestream_peek_bytes (filter->bs, &data, n + 1);
+ num = gst_bytestream_peek_bytes (filter->bs, &data, n + 1);
if (num != n + 1)
return NULL;
if (data[n] == '\n') {
GstBuffer *buf = gst_buffer_new_and_alloc (n + 1);
- gst_bytestream_peek_bytes (filter->bs, &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);
/* parse stream number and go beyond the ':' in the data */
num = atoi (GST_BUFFER_DATA (buf));
- if (num >= 0 && 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] != ':' &&
+ for (n = 0; GST_BUFFER_DATA (buf)[n] != ':' &&
GST_BUFFER_DATA (buf)[n] != '\0'; n++) ;
if (GST_BUFFER_DATA (buf)[n] != '\0') {
GstBuffer *sub;
}
gst_buffer_unref (buf);
}
+]]>
</programlisting>
<para>
Note that we use a lot of checks everywhere to make sure that the content
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);
);
[..]
gst_element_class_add_pad_template (klass,
- gst_static_pad_template_get (&sink_factory));
+ gst_static_pad_template_get (&sink_factory));
}
static void
return pad;
}
+]]>
</programlisting>
<para>
The <function>_loop ()</function> function is the same as the one given
useful in practice, but a good example, again.
</para>
<programlisting>
+<![CDATA[
+
typedef struct _GstMyFilterInputContext {
gboolean eos;
GstBuffer *lastbuf;
if (GST_PAD_IS_SRC (pad))
continue;
- while (GST_PAD_IS_USABLE (pad) &&
- !context->eos && !context->lastbuf) {
+ while (GST_PAD_IS_USABLE (pad) &&
+ !context->eos && !context->lastbuf) {
GstData *data = gst_pad_pull (pad);
if (GST_IS_EVENT (data)) {
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
over its source pad.
</para>
<programlisting>
+<![CDATA[
static void
gst_my_filter_loopfunc (GstElement *element)
{
guint8 *data;
for (n = 0; ; n++) {
- num = gst_bytestream_peek_bytes (filter->bs, &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, &remaining, &event);
+ gst_bytestream_get_status (filter->bs, &remaining, &event);
if (event) {
if (GST_EVENT_TYPE (event) == GST_EVENT_EOS)) {
/* end-of-file */
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, &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);
return GST_STATE_SUCCESS;
}
+]]>
</programlisting>
<para>
In the above example, you'll notice how bytestream handles buffering of
<xref linkend="section-reqpad-sometimes"/>.
</para>
<programlisting>
+<![CDATA[
static void
gst_my_filter_loopfunc (GstElement *element)
{
type = g_strndup (line, colon_pos - line);
/* content is one character beyond the ':' */
- colon_pos = &colon_pos[1];
+ colon_pos = &colon_pos[1];
if (*colon_pos == '\0')
goto next;
GType to_type;
to_type = gst_tag_get_type (type);
- 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);
+ 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, &to, NULL);
- g_value_unset (&to);
+ type, &to, NULL);
+ g_value_unset (&to);
}
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
functions, preferrably <function>_class_init ()</function>.
</para>
<programlisting>
+<![CDATA[
static void
gst_my_filter_class_init (GstMyFilterClass *klass)
{
NULL);
[..]
}
+]]>
</programlisting>
</sect1>
incoming events.
</para>
<programlisting>
+<![CDATA[
GType
gst_my_filter_get_type (void)
{
[..]
g_type_add_interface_static (my_filter_type,
GST_TYPE_TAG_SETTER,
- &tag_setter_info);
+ &tag_setter_info);
[..]
}
const GValue *from;
GValue to = { 0 };
- g_value_init (&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, &to);
+ g_value_transform (from, &to);
buf = gst_buffer_new ();
GST_BUFFER_DATA (buf) = g_strdup_printf ("%s:%s", tagname,
- g_value_get_string (&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 (&to);
+ g_value_unset (&to);
}
static void
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