summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3f3536b)
raw | patch | inline | side by side (parent: 3f3536b)
author | Tim-Philipp Müller <tim@centricular.net> | |
Wed, 8 Mar 2006 14:30:40 +0000 (14:30 +0000) | ||
committer | Tim-Philipp Müller <tim@centricular.net> | |
Wed, 8 Mar 2006 14:30:40 +0000 (14:30 +0000) |
Original commit message from CVS:
* docs/manual/advanced-dataaccess.xml:
Add some very very basic error checking.
* docs/pwg/appendix-checklist.xml:
Some updates to the list of things to check when writing an element.
* docs/manual/advanced-dataaccess.xml:
Add some very very basic error checking.
* docs/pwg/appendix-checklist.xml:
Some updates to the list of things to check when writing an element.
ChangeLog | patch | blob | history | |
docs/manual/advanced-dataaccess.xml | patch | blob | history | |
docs/pwg/appendix-checklist.xml | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 8a815553c94ccf51276fa8a0f27a55cea17bd87a..75806655a65a75f76ca76595ffad219a77780de2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2006-03-08 Tim-Philipp Müller <tim at centricular dot net>
+
+ * docs/manual/advanced-dataaccess.xml:
+ Add some very very basic error checking.
+
+ * docs/pwg/appendix-checklist.xml:
+ Some updates to the list of things to check when writing an element.
+
2006-03-08 Wim Taymans <wim@fluendo.com>
* docs/design/part-element-transform.txt:
index f1e5743741ab34a1a9b42d1095f3c0377ac0b0be..222a9ec17be735835e0ac54bc10037cbe44aa3ce 100644 (file)
/* build */
pipeline = gst_pipeline_new ("my-pipeline");
src = gst_element_factory_make ("videotestsrc", "src");
+ if (src == NULL)
+ g_error ("Could not create 'videotestsrc' element");
+
filter = gst_element_factory_make ("capsfilter", "filter");
+ g_assert (filer != NULL); /* should always exist */
+
csp = gst_element_factory_make ("ffmpegcolorspace", "csp");
+ if (csp == NULL)
+ g_error ("Could not create 'ffmpegcolorspace' element");
+
sink = gst_element_factory_make ("xvimagesink", "sink");
+ if (sink == NULL) {
+ sink = gst_element_factory_make ("ximagesink", "sink");
+ if (sink == NULL)
+ g_error ("Could not create neither 'xvimagesink' nor 'ximagesink' element");
+ }
+
gst_bin_add_many (GST_BIN (pipeline), src, filter, csp, sink, NULL);
gst_element_link_many (src, filter, csp, sink, NULL);
filtercaps = gst_caps_new_simple ("video/x-raw-rgb",
/* run */
gst_element_set_state (pipeline, GST_STATE_PLAYING);
+
+ /* wait until it's up and running or failed */
+ if (gst_element_get_state (pipeline, NULL, NULL, -1) == GST_STATE_CHANGE_FAILURE) {
+ g_error ("Failed to go into PLAYING state");
+ }
+
+ g_print ("Running ...\n");
g_main_loop_run (loop);
/* exit */
index 9c1de58f57c9309dd9d160a1ce6f6f24304a1367..503031fc111f6ba9ed352f02db77693eeb1540cc 100644 (file)
option <command>--gst-debug=myelement:5</command>.
</para>
</listitem>
+ <listitem>
+ <para>
+ Elements should use GST_DEBUG_FUNCPTR when setting pad functions or
+ overriding element class methods, for example:
+ <programlisting>
+gst_pad_set_event_func (myelement->srcpad,
+ GST_DEBUG_FUNCPTR (my_element_src_event));
+ </programlisting>
+ This makes debug output much easier to read later on.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Elements that are aimed for inclusion into one of the GStreamer
+ modules should ensure consistent naming of the element name,
+ structures and function names. For example, if the element type is
+ GstYellowFooDec, functions should be prefixed with
+ gst_yellow_foo_dec_ and the element should be registered
+ as 'yellowfoodec'. Separate words should be separate in this scheme,
+ so it should be GstFooDec and gst_foo_dec, and not GstFoodec and
+ gst_foodec.
+ </para>
+ </listitem>
</itemizedlist>
</sect1>
</listitem>
<listitem>
<para>
- All elements that are event-aware (their
- <classname>GST_ELEMENT_EVENT_AWARE</classname> flag is set)
- should implement event handling for <emphasis>all</emphasis>
- events, either specifically or using
- <function>gst_pad_event_default ()</function>. Elements that
- you should handle specifically are the interrupt event, in
- order to properly bail out as soon as possible if state is
- changed. Events may never be dropped unless specifically
- intended.
+ Elements should make sure they forward events they do not
+ handle with gst_pad_event_default (pad, event) instead of
+ just dropping them. Events should never be dropped unless
+ specifically intended.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Elements should make sure they forward queries they do not
+ handle with gst_pad_query_default (pad, query) instead of
+ just dropping them.
</para>
</listitem>
<listitem>
<para>
- Loop-based elements should always implement event handling,
- in order to prevent hangs (infinite loop) on state changes.
+ Elements should use gst_pad_get_parent() in event and query
+ functions, so that they hold a reference to the element while they
+ are operating. Note that gst_pad_get_parent() increases the
+ reference count of the element, so you must be very careful to call
+ gst_object_unref (element) before returning from your query or
+ event function, otherwise you will leak memory.
</para>
</listitem>
</itemizedlist>