move check stuff to its own library to be used by other modules
authorThomas Vander Stichele <thomas@apestaart.org>
Sat, 20 Aug 2005 12:14:28 +0000 (12:14 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Sat, 20 Aug 2005 12:14:28 +0000 (12:14 +0000)
Original commit message from CVS:
move check stuff to its own library to be used by other modules

65 files changed:
ChangeLog
check/Makefile.am
check/elements/.gitignore
check/elements/fakesrc.c [moved from check/elements/gstfakesrc.c with 99% similarity]
check/elements/identity.c [new file with mode: 0644]
check/gst-libs/controller.c
check/gst-libs/gdp.c
check/gst/gst.c
check/gst/gstbin.c
check/gst/gstbuffer.c
check/gst/gstbus.c
check/gst/gstcaps.c
check/gst/gstelement.c
check/gst/gstghostpad.c
check/gst/gstiterator.c
check/gst/gstmessage.c
check/gst/gstminiobject.c
check/gst/gstobject.c
check/gst/gstpad.c
check/gst/gststructure.c
check/gst/gstsystemclock.c
check/gst/gsttag.c
check/gst/gstvalue.c
check/pipelines/cleanup.c
check/pipelines/simple_launch_lines.c
check/states/sinks.c
configure.ac
docs/gst/gstreamer-sections.txt
docs/gst/tmpl/gstpad.sgml
gst/Makefile.am
gst/check/Makefile.am [new file with mode: 0644]
gst/check/gstcheck.c [moved from tests/check/gstcheck.c with 100% similarity]
gst/check/gstcheck.h [moved from tests/check/gstcheck.h with 100% similarity]
gst/gstminiobject.c
libs/gst/check/Makefile.am [new file with mode: 0644]
libs/gst/check/gstcheck.c [moved from check/gstcheck.c with 100% similarity]
libs/gst/check/gstcheck.h [moved from check/gstcheck.h with 100% similarity]
pkgconfig/Makefile.am
pkgconfig/gstreamer-check-uninstalled.pc.in [new file with mode: 0644]
pkgconfig/gstreamer-check.pc.in [new file with mode: 0644]
tests/check/Makefile.am
tests/check/elements/.gitignore
tests/check/elements/fakesrc.c [moved from tests/check/elements/gstfakesrc.c with 99% similarity]
tests/check/elements/identity.c [new file with mode: 0644]
tests/check/generic/sinks.c
tests/check/gst/gst.c
tests/check/gst/gstbin.c
tests/check/gst/gstbuffer.c
tests/check/gst/gstbus.c
tests/check/gst/gstcaps.c
tests/check/gst/gstelement.c
tests/check/gst/gstghostpad.c
tests/check/gst/gstiterator.c
tests/check/gst/gstmessage.c
tests/check/gst/gstminiobject.c
tests/check/gst/gstobject.c
tests/check/gst/gstpad.c
tests/check/gst/gststructure.c
tests/check/gst/gstsystemclock.c
tests/check/gst/gsttag.c
tests/check/gst/gstvalue.c
tests/check/libs/controller.c
tests/check/libs/gdp.c
tests/check/pipelines/cleanup.c
tests/check/pipelines/simple-launch-lines.c

index 495f07a..bdf99aa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,56 @@
+2005-08-20  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+       * check/elements/.cvsignore:
+       * check/elements/gstfakesrc.c:
+         rename to name of element
+       * check/elements/identity.c: (chain_func), (event_func),
+       (setup_identity), (cleanup_identity), (GST_START_TEST),
+       (identity_suite), (main):
+         add a test for identity
+       * check/Makefile.am:
+       * pkgconfig/Makefile.am:
+       * pkgconfig/gstreamer-check.pc.in:
+       * pkgconfig/gstreamer-check-uninstalled.pc.in:
+       * gst/check:
+       * gst/Makefile.am:
+       * configure.ac:
+         move the check stuff to a library that gets installed
+       * check/gst-libs/controller.c: (GST_START_TEST):
+       * check/gst-libs/gdp.c:
+       * check/gst/gst.c: (GST_START_TEST):
+       * check/gst/gstbin.c:
+       * check/gst/gstbuffer.c: (GST_START_TEST), (gst_test_suite):
+       * check/gst/gstbus.c:
+       * check/gst/gstcaps.c: (GST_START_TEST):
+       * check/gst/gstelement.c:
+       * check/gst/gstghostpad.c:
+       * check/gst/gstiterator.c:
+       * check/gst/gstmessage.c:
+       * check/gst/gstminiobject.c: (thread_ref), (GST_START_TEST):
+       * check/gst/gstobject.c:
+       * check/gst/gstpad.c: (GST_START_TEST):
+       * check/gst/gststructure.c: (GST_START_TEST):
+       * check/gst/gstsystemclock.c: (GST_START_TEST),
+       (gst_systemclock_suite):
+       * check/gst/gsttag.c: (gst_tag_suite):
+       * check/gst/gstvalue.c:
+       * check/pipelines/cleanup.c:
+       * check/pipelines/simple_launch_lines.c:
+       * check/states/sinks.c:
+         change include statement
+
+       * docs/gst/gstreamer-sections.txt:
+       * docs/gst/tmpl/gstpad.sgml:
+         document more pad stuff
+       * gst/gstminiobject.c: (gst_mini_object_ref),
+       (gst_mini_object_unref):
+         debug refcounting
+
 2005-08-19  Stefan Kost  <ensonic@users.sf.net>
 
        * docs/gst/tmpl/gst.sgml:
        * gst/gst.c:
-          eliminate another tmpl file, fix spelling in the long-description
+         eliminate another tmpl file, fix spelling in the long-description
 
 2005-08-18  Jan Schmidt  <thaytan@mad.scientist.com>
 
@@ -46,7 +94,7 @@
 
        * check/gst/gstevents.c: (GST_START_TEST), (event_probe),
        (test_event), (timediff), (gstevents_suite):
-           Fix error message output so I might be able to tell why the
+          Fix error message output so I might be able to tell why the
           test works here but fails on the build farm.
 
 2005-08-18  Jan Schmidt  <thaytan@mad.scientist.com>
index d4fbc05..982a21b 100644 (file)
@@ -49,6 +49,7 @@ TESTS = $(top_builddir)/tools/gst-register    \
        gst/gsttag                              \
        gst/gstvalue                            \
        elements/gstfakesrc                     \
+       elements/identity                       \
        pipelines/simple_launch_lines           \
        pipelines/cleanup                       \
        states/sinks                            \
@@ -57,14 +58,11 @@ TESTS = $(top_builddir)/tools/gst-register  \
 
 check_PROGRAMS = $(TESTS)
 
-noinst_LTLIBRARIES = libgstcheck.la
+noinst_HEADERS = gst/capslist.h
 
-libgstcheck_la_SOURCES = gstcheck.c
-libgstcheck_la_LIBADD = $(GST_OBJ_LIBS)
-noinst_HEADERS = gstcheck.h gst/capslist.h
-
-AM_CFLAGS = $(GST_OBJ_CFLAGS) $(CHECK_CFLAGS)
-LDADD = $(GST_OBJ_LIBS) $(CHECK_LIBS) libgstcheck.la
+AM_CFLAGS = $(GST_OBJ_CFLAGS)
+LDADD = $(GST_OBJ_LIBS) \
+       $(top_builddir)/gst/check/libgstcheck-@GST_MAJORMINOR@.la
 
 gst_libs_gdp_SOURCES = \
        gst-libs/gdp.c \
@@ -72,7 +70,8 @@ gst_libs_gdp_SOURCES = \
 # remove GST_ENABLE_NEW when dataprotocol has been declared API-stable
 gst_libs_gdp_CFLAGS = $(AM_CFLAGS) -DGST_ENABLE_NEW
 
-gst_libs_controller_LDADD = $(GST_OBJ_LIBS) $(CHECK_LIBS) libgstcheck.la \
+gst_libs_controller_LDADD = $(GST_OBJ_LIBS) \
+       $(top_builddir)/gst/check/libgstcheck-@GST_MAJORMINOR@.la \
        $(top_builddir)/libs/gst/controller/libgstcontroller-@GST_MAJORMINOR@.la
 
 # valgrind testing
index a10e4f5..3bac562 100644 (file)
@@ -1,2 +1,3 @@
 .dirstamp
-gstfakesrc
+fakesrc
+identity
similarity index 99%
rename from check/elements/gstfakesrc.c
rename to check/elements/fakesrc.c
index e121684..f5328cc 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <unistd.h>
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 GList *buffers = NULL;
 gboolean have_eos = FALSE;
diff --git a/check/elements/identity.c b/check/elements/identity.c
new file mode 100644 (file)
index 0000000..3da0ce1
--- /dev/null
@@ -0,0 +1,211 @@
+/* GStreamer
+ *
+ * unit test for identity
+ *
+ * Copyright (C) <2005> Thomas Vander Stichele <thomas at apestaart dot org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <unistd.h>
+
+#include <gst/check/gstcheck.h>
+
+GList *buffers = NULL;
+gboolean have_eos = FALSE;
+
+/* For ease of programming we use globals to keep refs for our floating
+ * src and sink pads we create; otherwise we always have to do get_pad,
+ * get_peer, and then remove references in every test function */
+GstPad *mysrcpad, *mysinkpad;
+
+
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
+GstFlowReturn
+chain_func (GstPad * pad, GstBuffer * buffer)
+{
+  GST_DEBUG ("chain_func: received buffer %p", buffer);
+  buffers = g_list_append (buffers, buffer);
+
+  return GST_FLOW_OK;
+}
+
+gboolean
+event_func (GstPad * pad, GstEvent * event)
+{
+  if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) {
+    /* we take the lock here because it's good practice to so, even though
+     * no buffers will be pushed anymore anyway */
+    GST_STREAM_LOCK (pad);
+    have_eos = TRUE;
+    GST_STREAM_UNLOCK (pad);
+    gst_event_unref (event);
+    return TRUE;
+  }
+
+  gst_event_unref (event);
+  return FALSE;
+}
+
+GstElement *
+setup_identity ()
+{
+  GstElement *identity;
+  GstPad *srcpad, *sinkpad;
+
+  GST_DEBUG ("setup_identity");
+
+  identity = gst_element_factory_make ("identity", "identity");
+  fail_if (identity == NULL, "Could not create a identity");
+
+  /* sending pad */
+  mysrcpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
+  fail_if (mysrcpad == NULL, "Could not create a mysrcpad");
+  ASSERT_OBJECT_REFCOUNT (mysrcpad, "mysrcpad", 1);
+
+  sinkpad = gst_element_get_pad (identity, "sink");
+  fail_if (sinkpad == NULL, "Could not get source pad from identity");
+  ASSERT_OBJECT_REFCOUNT (sinkpad, "sinkpad", 2);
+  gst_pad_set_caps (mysrcpad, NULL);
+  fail_unless (gst_pad_link (mysrcpad, sinkpad) == GST_PAD_LINK_OK,
+      "Could not link source and identity sink pads");
+  gst_object_unref (sinkpad);   /* because we got it higher up */
+  ASSERT_OBJECT_REFCOUNT (sinkpad, "sinkpad", 1);
+
+  /* receiving pad */
+  mysinkpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
+      "sink");
+  fail_if (mysinkpad == NULL, "Could not create a mysinkpad");
+
+  srcpad = gst_element_get_pad (identity, "src");
+  fail_if (srcpad == NULL, "Could not get source pad from identity");
+  gst_pad_set_caps (mysinkpad, NULL);
+  gst_pad_set_chain_function (mysinkpad, chain_func);
+  gst_pad_set_event_function (mysinkpad, event_func);
+
+  fail_unless (gst_pad_link (srcpad, mysinkpad) == GST_PAD_LINK_OK,
+      "Could not link identity source and mysink pads");
+  gst_object_unref (srcpad);    /* because we got it higher up */
+  ASSERT_OBJECT_REFCOUNT (srcpad, "srcpad", 1);
+
+  return identity;
+}
+
+void
+cleanup_identity (GstElement * identity)
+{
+  GstPad *srcpad, *sinkpad;
+
+  GST_DEBUG ("cleanup_identity");
+
+  fail_unless (gst_element_set_state (identity, GST_STATE_NULL) ==
+      GST_STATE_SUCCESS, "could not set to null");
+  ASSERT_OBJECT_REFCOUNT (identity, "identity", 1);
+
+  /* clean up floating src pad */
+  sinkpad = gst_element_get_pad (identity, "sink");
+  ASSERT_OBJECT_REFCOUNT (sinkpad, "sinkpad", 2);
+
+  gst_pad_unlink (mysrcpad, sinkpad);
+
+  /* pad refs held by both creator and this function (through _get) */
+  ASSERT_OBJECT_REFCOUNT (mysrcpad, "srcpad", 1);
+  gst_object_unref (mysrcpad);
+  mysrcpad = NULL;
+
+  ASSERT_OBJECT_REFCOUNT (sinkpad, "sinkpad", 2);
+  gst_object_unref (sinkpad);
+  /* one more ref is held by identity itself */
+
+  /* clean up floating sink pad */
+  srcpad = gst_element_get_pad (identity, "src");
+  gst_pad_unlink (srcpad, mysinkpad);
+
+  /* pad refs held by both creator and this function (through _get) */
+  ASSERT_OBJECT_REFCOUNT (srcpad, "srcpad", 2);
+  gst_object_unref (srcpad);
+  /* one more ref is held by identity itself */
+
+  ASSERT_OBJECT_REFCOUNT (mysinkpad, "mysinkpad", 1);
+  gst_object_unref (mysinkpad);
+  mysinkpad = NULL;
+
+  ASSERT_OBJECT_REFCOUNT (identity, "identity", 1);
+  gst_object_unref (identity);
+}
+
+GST_START_TEST (test_one_buffer)
+{
+  GstElement *identity;
+  GstBuffer *buffer;
+
+  identity = setup_identity ();
+  fail_unless (gst_element_set_state (identity,
+          GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
+
+  buffer = gst_buffer_new_and_alloc (4);
+  ASSERT_BUFFER_REFCOUNT (buffer, "buffer", 1);
+  memcpy (GST_BUFFER_DATA (buffer), "data", 4);
+  /* pushing gives away my reference ... */
+  gst_pad_push (mysrcpad, buffer);
+  /* ... but it ends up being collected on the global buffer list */
+  ASSERT_BUFFER_REFCOUNT (buffer, "buffer", 1);
+
+  /* cleanup */
+  cleanup_identity (identity);
+}
+
+GST_END_TEST;
+
+Suite *
+identity_suite (void)
+{
+  Suite *s = suite_create ("identity");
+  TCase *tc_chain = tcase_create ("general");
+
+  suite_add_tcase (s, tc_chain);
+  tcase_add_test (tc_chain, test_one_buffer);
+
+  return s;
+}
+
+int
+main (int argc, char **argv)
+{
+  int nf;
+
+  Suite *s = identity_suite ();
+  SRunner *sr = srunner_create (s);
+
+  gst_check_init (&argc, &argv);
+
+  srunner_run_all (sr, CK_NORMAL);
+  nf = srunner_ntests_failed (sr);
+  srunner_free (sr);
+
+  return nf;
+}
index dc1e100..23d0a00 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #include "config.h"
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 #include <gst/controller/gst-controller.h>
 
 /* LOCAL TEST ELEMENT */
index 7a44741..69e74e5 100644 (file)
@@ -20,7 +20,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 #include <gst/dataprotocol/dataprotocol.h>
 #include "libs/gst/dataprotocol/dp-private.h"   /* private header */
index 11ae64a..993c633 100644 (file)
@@ -19,7 +19,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 GST_START_TEST (test_init)
 {
index bf41dc0..61ae0d2 100644 (file)
@@ -20,7 +20,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 static void
 pop_messages (GstBus * bus, int count)
index 801a609..5791214 100644 (file)
@@ -20,7 +20,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 GST_START_TEST (test_caps)
 {
index f1677ed..54ea722 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 
 static GstBus *test_bus = NULL;
index df5da49..9141fce 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 #include "capslist.h"
 
 GST_START_TEST (test_from_string)
index 27bd84e..aeff42d 100644 (file)
@@ -19,7 +19,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 GST_START_TEST (test_add_remove_pad)
 {
index 2741483..455dd1f 100644 (file)
@@ -19,7 +19,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 static void
 assert_gstrefcount (gpointer p, gint i)
index 01378fc..ab64004 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 
 static GList *
index 1d6c0c5..0cfad06 100644 (file)
@@ -20,7 +20,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 static GQuark domain;
 
index 7513f34..c7e61ef 100644 (file)
@@ -20,7 +20,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 GST_START_TEST (test_copy)
 {
index a7dccb3..5d8a94f 100644 (file)
@@ -20,7 +20,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 /*
   Create a fake subclass
index 5283c20..8a46721 100644 (file)
@@ -19,7 +19,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 GST_START_TEST (test_link)
 {
index cf9eeeb..47fc72a 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 
 GST_START_TEST (test_from_string_int)
index a20e98f..f9a6a35 100644 (file)
@@ -19,7 +19,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 GST_START_TEST (test_signedness)
 {
index 1b33971..a91315d 100644 (file)
@@ -18,7 +18,7 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 #include <string.h>
 
index 4dc3dae..b492d12 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 
 GST_START_TEST (test_deserialize_buffer)
index 7b3a3b4..6872447 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 
 static GstElement *
index d29c88e..618d3a5 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 
 static GstElement *
index ae295be..84bd9fb 100644 (file)
@@ -20,7 +20,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 /* a sink should go ASYNC to PAUSE. forcing PLAYING is possible */
 GST_START_TEST (test_sink)
index be04d2b..4d3e281 100644 (file)
@@ -624,6 +624,7 @@ gst/Makefile
 gst/gstconfig.h
 gst/gstversion.h
 gst/base/Makefile
+gst/check/Makefile
 gst/indexers/Makefile
 gst/elements/Makefile
 gst/parse/Makefile
@@ -694,6 +695,8 @@ pkgconfig/gstreamer.pc
 pkgconfig/gstreamer-uninstalled.pc
 pkgconfig/gstreamer-base.pc
 pkgconfig/gstreamer-base-uninstalled.pc
+pkgconfig/gstreamer-check.pc
+pkgconfig/gstreamer-check-uninstalled.pc
 pkgconfig/gstreamer-controller.pc
 pkgconfig/gstreamer-controller-uninstalled.pc
 pkgconfig/gstreamer-dataprotocol.pc
index 1efc083..5c4f000 100644 (file)
@@ -844,72 +844,111 @@ xmlNodePtr
 GstPad
 GST_PAD_LINK_FAILED
 GST_PAD_LINK_SUCCESSFUL
+GstPadActivateFunction
+GstPadActivateModeFunction
+GstPadBlockCallback
 GstPadChainFunction
 GstPadEventFunction
+GstPadCheckGetRangeFunction
+GstPadGetRangeFunction
 GstPadQueryFunction
 GstPadIntLinkFunction
 GstPadQueryTypeFunction
 GstPadLinkFunction
 GstPadUnlinkFunction
+GstPadAcceptCapsFunction
+GstPadFixateCapsFunction
 GstPadGetCapsFunction
+GstPadSetCapsFunction
 GstPadBufferAllocFunction
 GstPadDispatcherFunction
 GstPadDirection
 GstPadFlags
 GstPadLinkReturn
 GstPadPresence
-GST_PAD_NAME
-GST_PAD_PARENT
-GST_PAD_ELEMENT_PRIVATE
-GST_PAD_PAD_TEMPLATE
-GST_PAD_DIRECTION
-GST_PAD_CAPS
-GST_PAD_PEER
-GST_PAD_IS_LINKED
-GST_PAD_IS_USABLE
-GST_PAD_IS_SRC
-GST_PAD_IS_SINK
+
 gst_pad_new
 gst_pad_new_from_template
+
 gst_pad_get_name
 gst_pad_get_direction
+gst_pad_get_parent
+gst_pad_get_parent_element
+
 gst_pad_set_active
 gst_pad_is_active
+gst_pad_set_blocked
+gst_pad_set_blocked_async
+gst_pad_is_blocked
 gst_pad_set_element_private
 gst_pad_get_element_private
-gst_pad_get_parent
 gst_pad_get_pad_template
 gst_pad_set_bufferalloc_function
 gst_pad_alloc_buffer
 gst_pad_set_chain_function
+gst_pad_chain
+gst_pad_set_checkgetrange_function
+gst_pad_set_getrange_function
+gst_pad_get_range
 gst_pad_set_event_function
-gst_pad_set_link_function
-gst_pad_can_link
 gst_pad_set_unlink_function
+gst_pad_set_activate_function
+gst_pad_set_activatepull_function
+
+gst_pad_start_task
+gst_pad_pause_task
+gst_pad_stop_task
+
 gst_pad_link
 gst_pad_unlink
 gst_pad_is_linked
-gst_pad_get_peer
+gst_pad_set_link_function
+gst_pad_can_link
+
+gst_pad_accept_caps
 gst_pad_get_negotiated_caps
 gst_pad_get_caps
+gst_pad_set_caps
 gst_pad_get_pad_template_caps
+gst_pad_set_acceptcaps_function
 gst_pad_set_getcaps_function
+gst_pad_set_setcaps_function
 gst_pad_proxy_getcaps
+gst_pad_proxy_setcaps
 gst_pad_get_allowed_caps
+gst_pad_get_fixed_caps_func
+gst_pad_get_peer
+gst_pad_peer_get_caps
+gst_pad_peer_accept_caps
+gst_pad_use_fixed_caps
+gst_pad_fixate_caps
+gst_pad_set_fixatecaps_function
+
+gst_pad_set_activatepush_function
 gst_pad_push
+gst_pad_push_event
+gst_pad_check_pull_range
+gst_pad_pull_range
+gst_pad_activate_pull
+gst_pad_activate_push
 gst_pad_send_event
 gst_pad_event_default
+
 gst_pad_set_query_function
 gst_pad_set_query_type_function
 gst_pad_get_query_types
 gst_pad_get_query_types_default
 gst_pad_query
 gst_pad_query_default
+gst_pad_query_position
+gst_pad_query_convert
+
 gst_pad_set_internal_link_function
 gst_pad_get_internal_links
 gst_pad_get_internal_links_default
 gst_pad_dispatcher
 gst_pad_load_and_link
+
 gst_pad_add_data_probe
 gst_pad_add_buffer_probe
 gst_pad_add_event_probe
@@ -927,12 +966,61 @@ GST_TYPE_PAD_DIRECTION
 GST_TYPE_PAD_FLAGS
 GST_TYPE_PAD_LINK_RETURN
 GST_TYPE_PAD_PRESENCE
+
 <SUBSECTION Private>
 gst_pad_get_type
 gst_pad_direction_get_type
 gst_pad_flags_get_type
 gst_pad_link_return_get_type
 gst_pad_presence_get_type
+
+GST_PAD_NAME
+GST_PAD_PARENT
+GST_PAD_ELEMENT_PRIVATE
+GST_PAD_PAD_TEMPLATE
+GST_PAD_DIRECTION
+GST_PAD_CAPS
+GST_PAD_PEER
+GST_PAD_IS_LINKED
+GST_PAD_IS_USABLE
+GST_PAD_IS_SRC
+GST_PAD_IS_SINK
+
+GST_PAD_IS_IN_GETCAPS
+GST_PAD_MODE_ACTIVATE
+GST_PAD_BLOCK_GET_COND
+GST_PAD_BLOCK_SIGNAL
+GST_PAD_BLOCK_WAIT
+GST_PAD_CAST
+GST_PAD_ACTIVATE_MODE
+GST_PAD_DO_BUFFER_SIGNALS
+GST_PAD_DO_EVENT_SIGNALS
+GST_PAD_IS_BLOCKED
+GST_PAD_IS_IN_SETCAPS
+GST_PAD_SET_FLUSHING
+GST_PAD_TASK
+GST_PAD_UNSET_FLUSHING
+
+
+GST_PAD_ACCEPTCAPSFUNC
+GST_PAD_ACTIVATEFUNC
+GST_PAD_ACTIVATEPULLFUNC
+GST_PAD_ACTIVATEPUSHFUNC
+GST_PAD_BUFFERALLOCFUNC
+GST_PAD_CHAINFUNC
+GST_PAD_CHECKGETRANGEFUNC
+GST_PAD_EVENTFUNC
+GST_PAD_FIXATECAPSFUNC
+GST_PAD_GETCAPSFUNC
+GST_PAD_GETRANGEFUNC
+GST_PAD_INTLINKFUNC
+GST_PAD_IS_FLUSHING
+GST_PAD_LINKFUNC
+GST_PAD_QUERYFUNC
+GST_PAD_QUERYTYPEFUNC
+GST_PAD_SETCAPSFUNC
+GST_PAD_UNLINKFUNC
+
 </SECTION>
 
 <SECTION>
index fa5a64d..1427afa 100644 (file)
@@ -161,6 +161,35 @@ successfull negotiation step (OK/DONE).
 @ret: the #GstPadLinkReturn value
 
 
+<!-- ##### USER_FUNCTION GstPadActivateFunction ##### -->
+<para>
+
+</para>
+
+@pad: 
+@Returns: 
+
+
+<!-- ##### USER_FUNCTION GstPadActivateModeFunction ##### -->
+<para>
+
+</para>
+
+@pad: 
+@active: 
+@Returns: 
+
+
+<!-- ##### USER_FUNCTION GstPadBlockCallback ##### -->
+<para>
+
+</para>
+
+@pad: 
+@blocked: 
+@user_data: 
+
+
 <!-- ##### USER_FUNCTION GstPadChainFunction ##### -->
 <para>
 A function that will be called when chaining buffers.
@@ -184,6 +213,27 @@ Function signature to handle an event for the pad.
 @Returns: TRUE if the pad could handle the event.
 
 
+<!-- ##### USER_FUNCTION GstPadCheckGetRangeFunction ##### -->
+<para>
+
+</para>
+
+@pad: 
+@Returns: 
+
+
+<!-- ##### USER_FUNCTION GstPadGetRangeFunction ##### -->
+<para>
+
+</para>
+
+@pad: 
+@offset: 
+@length: 
+@buffer: 
+@Returns: 
+
+
 <!-- ##### USER_FUNCTION GstPadQueryFunction ##### -->
 <para>
 The signature of the query function.
@@ -238,6 +288,25 @@ Function signature to handle a new link on the pad.
 @pad: 
 
 
+<!-- ##### USER_FUNCTION GstPadAcceptCapsFunction ##### -->
+<para>
+
+</para>
+
+@pad: 
+@caps: 
+@Returns: 
+
+
+<!-- ##### USER_FUNCTION GstPadFixateCapsFunction ##### -->
+<para>
+
+</para>
+
+@pad: 
+@caps: 
+
+
 <!-- ##### USER_FUNCTION GstPadGetCapsFunction ##### -->
 <para>
 Returns a copy of the capabilities of the specified pad. By default this
@@ -251,6 +320,16 @@ be overridden.
 @caps: the peer's #GstCaps, can be used to filter the capabilities.
 
 
+<!-- ##### USER_FUNCTION GstPadSetCapsFunction ##### -->
+<para>
+
+</para>
+
+@pad: 
+@caps: 
+@Returns: 
+
+
 <!-- ##### USER_FUNCTION GstPadBufferAllocFunction ##### -->
 <para>
 
@@ -318,124 +397,133 @@ Indicates when this pad will become available.
 @GST_PAD_REQUEST: the pad is only available on request with 
 gst_element_request_pad_by_name() or gst_element_request_compatible_pad().
 
-<!-- ##### MACRO GST_PAD_NAME ##### -->
+<!-- ##### FUNCTION gst_pad_new ##### -->
 <para>
-Gets the name of the pad.
+
 </para>
 
-@pad: a #GstPad to get the name of.
-@Returns: the pad's name.
+@name: 
+@direction: 
+@Returns: 
 
 
-<!-- ##### MACRO GST_PAD_PARENT ##### -->
+<!-- ##### FUNCTION gst_pad_new_from_template ##### -->
 <para>
-Gets the parent element of this pad.
+
 </para>
 
-@pad: a #GstPad to get the parent of.
-@Returns: the parent #GstElement of this pad.
+@templ: 
+@name: 
+@Returns: 
 
 
-<!-- ##### MACRO GST_PAD_ELEMENT_PRIVATE ##### -->
+<!-- ##### MACRO gst_pad_get_name ##### -->
 <para>
-Gets the private data set by the element that owns the pad.
+
 </para>
 
-@pad: a #GstPad to get the private data of.
-#Returns: a gpointer to the private data.
+@pad: 
+@Returns: 
 
 
-<!-- ##### MACRO GST_PAD_PAD_TEMPLATE ##### -->
+<!-- ##### FUNCTION gst_pad_get_direction ##### -->
 <para>
-Gets the pad template that was used to create this pad.
+
 </para>
 
-@pad: a #GstPad to get the pad template of.
-#Returns: the #GstPadTemplate used to create the pad, or NULL if none was
-used.
+@pad: 
+@Returns: 
 
 
-<!-- ##### MACRO GST_PAD_DIRECTION ##### -->
+<!-- ##### MACRO gst_pad_get_parent ##### -->
 <para>
-Gets the pad's direction.
+
 </para>
 
-@pad: a #GstPad to get the direction of.
-@Returns: the #GstPadDirection of the pad.
+@pad: 
+@Returns: 
 
 
-<!-- ##### MACRO GST_PAD_CAPS ##### -->
+<!-- ##### FUNCTION gst_pad_get_parent_element ##### -->
 <para>
-Gets the capabilities of a pad.
+
 </para>
 
-@pad: a #GstPad to get the capabilities of.
-@Returns: the #GstCaps of the pad.
+@pad: 
+@Returns: 
 
 
-<!-- ##### MACRO GST_PAD_PEER ##### -->
+<!-- ##### FUNCTION gst_pad_set_active ##### -->
 <para>
-Gets the peer pad of this pad.  The peer pad is the pad on to which the parent
-element is linked through this pad.
+
 </para>
 
-@pad: a #GstPad to get the peer pad of.
-@Returns: the peer #GstPad.
+@pad: 
+@active: 
+@Returns: 
+<!-- # Unused Parameters # -->
+@mode: 
 
 
-<!-- ##### MACRO GST_PAD_IS_LINKED ##### -->
+<!-- ##### FUNCTION gst_pad_is_active ##### -->
 <para>
-Checks if the pad is linked.
+
 </para>
 
-@pad: a #GstPad to check.
+@pad: 
+@Returns: 
 
 
-<!-- ##### MACRO GST_PAD_IS_USABLE ##### -->
+<!-- ##### FUNCTION gst_pad_set_blocked ##### -->
 <para>
-Checks if a pad is usable. A usable pad is both linked and active.
+
 </para>
 
-@pad: a #GstPad to check
+@pad: 
+@blocked: 
+@Returns: 
 
 
-<!-- ##### MACRO GST_PAD_IS_SRC ##### -->
+<!-- ##### FUNCTION gst_pad_set_blocked_async ##### -->
 <para>
-Checks if the pad is a source pad.
+
 </para>
 
-@pad: a #GstPad to check.
+@pad: 
+@blocked: 
+@callback: 
+@user_data: 
+@Returns: 
 
 
-<!-- ##### MACRO GST_PAD_IS_SINK ##### -->
+<!-- ##### FUNCTION gst_pad_is_blocked ##### -->
 <para>
-Checks if the pad is a sink pad.
+
 </para>
 
-@pad: a #GstPad to check.
+@pad: 
+@Returns: 
 
 
-<!-- ##### FUNCTION gst_pad_new ##### -->
+<!-- ##### FUNCTION gst_pad_set_element_private ##### -->
 <para>
 
 </para>
 
-@name: 
-@direction: 
-@Returns: 
+@pad: 
+@priv: 
 
 
-<!-- ##### FUNCTION gst_pad_new_from_template ##### -->
+<!-- ##### FUNCTION gst_pad_get_element_private ##### -->
 <para>
 
 </para>
 
-@templ: 
-@name: 
+@pad: 
 @Returns: 
 
 
-<!-- ##### MACRO gst_pad_get_name ##### -->
+<!-- ##### FUNCTION gst_pad_get_pad_template ##### -->
 <para>
 
 </para>
@@ -444,140 +532,142 @@ Checks if the pad is a sink pad.
 @Returns: 
 
 
-<!-- ##### FUNCTION gst_pad_get_direction ##### -->
+<!-- ##### FUNCTION gst_pad_set_bufferalloc_function ##### -->
 <para>
 
 </para>
 
 @pad: 
-@Returns: 
+@bufalloc: 
+<!-- # Unused Parameters # -->
+@bufferalloc: 
 
 
-<!-- ##### FUNCTION gst_pad_set_active ##### -->
+<!-- ##### FUNCTION gst_pad_alloc_buffer ##### -->
 <para>
 
 </para>
 
 @pad: 
-@active: 
+@offset: 
+@size: 
+@caps: 
+@buf: 
 @Returns: 
-<!-- # Unused Parameters # -->
-@mode: 
 
 
-<!-- ##### FUNCTION gst_pad_is_active ##### -->
+<!-- ##### FUNCTION gst_pad_set_chain_function ##### -->
 <para>
 
 </para>
 
 @pad: 
-@Returns
+@chain
 
 
-<!-- ##### FUNCTION gst_pad_set_element_private ##### -->
+<!-- ##### FUNCTION gst_pad_chain ##### -->
 <para>
 
 </para>
 
 @pad: 
-@priv: 
+@buffer: 
+@Returns: 
 
 
-<!-- ##### FUNCTION gst_pad_get_element_private ##### -->
+<!-- ##### FUNCTION gst_pad_set_checkgetrange_function ##### -->
 <para>
 
 </para>
 
 @pad: 
-@Returns
+@check
 
 
-<!-- ##### MACRO gst_pad_get_parent ##### -->
+<!-- ##### FUNCTION gst_pad_set_getrange_function ##### -->
 <para>
 
 </para>
 
 @pad: 
-@Returns
+@get
 
 
-<!-- ##### FUNCTION gst_pad_get_pad_template ##### -->
+<!-- ##### FUNCTION gst_pad_get_range ##### -->
 <para>
 
 </para>
 
 @pad: 
+@offset: 
+@size: 
+@buffer: 
 @Returns: 
 
 
-<!-- ##### FUNCTION gst_pad_set_bufferalloc_function ##### -->
+<!-- ##### FUNCTION gst_pad_set_event_function ##### -->
 <para>
 
 </para>
 
 @pad: 
-@bufalloc: 
-<!-- # Unused Parameters # -->
-@bufferalloc: 
+@event: 
 
 
-<!-- ##### FUNCTION gst_pad_alloc_buffer ##### -->
+<!-- ##### FUNCTION gst_pad_set_unlink_function ##### -->
 <para>
 
 </para>
 
 @pad: 
-@offset: 
-@size: 
-@caps: 
-@buf: 
-@Returns: 
+@unlink: 
 
 
-<!-- ##### FUNCTION gst_pad_set_chain_function ##### -->
+<!-- ##### FUNCTION gst_pad_set_activate_function ##### -->
 <para>
 
 </para>
 
 @pad: 
-@chain
+@activate
 
 
-<!-- ##### FUNCTION gst_pad_set_event_function ##### -->
+<!-- ##### FUNCTION gst_pad_set_activatepull_function ##### -->
 <para>
 
 </para>
 
 @pad: 
-@event
+@activatepull
 
 
-<!-- ##### FUNCTION gst_pad_set_link_function ##### -->
+<!-- ##### FUNCTION gst_pad_start_task ##### -->
 <para>
 
 </para>
 
 @pad: 
-@link: 
+@func: 
+@data: 
+@Returns: 
 
 
-<!-- ##### FUNCTION gst_pad_can_link ##### -->
+<!-- ##### FUNCTION gst_pad_pause_task ##### -->
 <para>
 
 </para>
 
-@srcpad: 
-@sinkpad: 
+@pad: 
 @Returns: 
 
 
-<!-- ##### FUNCTION gst_pad_set_unlink_function ##### -->
+<!-- ##### FUNCTION gst_pad_stop_task ##### -->
 <para>
 
 </para>
 
 @pad: 
-@unlink
+@Returns
 
 
 <!-- ##### FUNCTION gst_pad_link ##### -->
@@ -609,12 +699,32 @@ Checks if the pad is a sink pad.
 @Returns: 
 
 
-<!-- ##### FUNCTION gst_pad_get_peer ##### -->
+<!-- ##### FUNCTION gst_pad_set_link_function ##### -->
+<para>
+
+</para>
+
+@pad: 
+@link: 
+
+
+<!-- ##### FUNCTION gst_pad_can_link ##### -->
+<para>
+
+</para>
+
+@srcpad: 
+@sinkpad: 
+@Returns: 
+
+
+<!-- ##### FUNCTION gst_pad_accept_caps ##### -->
 <para>
 
 </para>
 
 @pad: 
+@caps: 
 @Returns: 
 
 
@@ -636,6 +746,16 @@ Checks if the pad is a sink pad.
 @Returns: 
 
 
+<!-- ##### FUNCTION gst_pad_set_caps ##### -->
+<para>
+
+</para>
+
+@pad: 
+@caps: 
+@Returns: 
+
+
 <!-- ##### FUNCTION gst_pad_get_pad_template_caps ##### -->
 <para>
 
@@ -645,6 +765,15 @@ Checks if the pad is a sink pad.
 @Returns: 
 
 
+<!-- ##### FUNCTION gst_pad_set_acceptcaps_function ##### -->
+<para>
+
+</para>
+
+@pad: 
+@acceptcaps: 
+
+
 <!-- ##### FUNCTION gst_pad_set_getcaps_function ##### -->
 <para>
 
@@ -654,6 +783,15 @@ Checks if the pad is a sink pad.
 @getcaps: 
 
 
+<!-- ##### FUNCTION gst_pad_set_setcaps_function ##### -->
+<para>
+
+</para>
+
+@pad: 
+@setcaps: 
+
+
 <!-- ##### FUNCTION gst_pad_proxy_getcaps ##### -->
 <para>
 
@@ -663,6 +801,16 @@ Checks if the pad is a sink pad.
 @Returns: 
 
 
+<!-- ##### FUNCTION gst_pad_proxy_setcaps ##### -->
+<para>
+
+</para>
+
+@pad: 
+@caps: 
+@Returns: 
+
+
 <!-- ##### FUNCTION gst_pad_get_allowed_caps ##### -->
 <para>
 
@@ -674,6 +822,78 @@ Checks if the pad is a sink pad.
 @pad: 
 
 
+<!-- ##### FUNCTION gst_pad_get_fixed_caps_func ##### -->
+<para>
+
+</para>
+
+@pad: 
+@Returns: 
+
+
+<!-- ##### FUNCTION gst_pad_get_peer ##### -->
+<para>
+
+</para>
+
+@pad: 
+@Returns: 
+
+
+<!-- ##### FUNCTION gst_pad_peer_get_caps ##### -->
+<para>
+
+</para>
+
+@pad: 
+@Returns: 
+
+
+<!-- ##### FUNCTION gst_pad_peer_accept_caps ##### -->
+<para>
+
+</para>
+
+@pad: 
+@caps: 
+@Returns: 
+
+
+<!-- ##### FUNCTION gst_pad_use_fixed_caps ##### -->
+<para>
+
+</para>
+
+@pad: 
+
+
+<!-- ##### FUNCTION gst_pad_fixate_caps ##### -->
+<para>
+
+</para>
+
+@pad: 
+@caps: 
+
+
+<!-- ##### FUNCTION gst_pad_set_fixatecaps_function ##### -->
+<para>
+
+</para>
+
+@pad: 
+@fixatecaps: 
+
+
+<!-- ##### FUNCTION gst_pad_set_activatepush_function ##### -->
+<para>
+
+</para>
+
+@pad: 
+@activatepush: 
+
+
 <!-- ##### FUNCTION gst_pad_push ##### -->
 <para>
 
@@ -687,6 +907,57 @@ Checks if the pad is a sink pad.
 @buf: 
 
 
+<!-- ##### FUNCTION gst_pad_push_event ##### -->
+<para>
+
+</para>
+
+@pad: 
+@event: 
+@Returns: 
+
+
+<!-- ##### FUNCTION gst_pad_check_pull_range ##### -->
+<para>
+
+</para>
+
+@pad: 
+@Returns: 
+
+
+<!-- ##### FUNCTION gst_pad_pull_range ##### -->
+<para>
+
+</para>
+
+@pad: 
+@offset: 
+@size: 
+@buffer: 
+@Returns: 
+
+
+<!-- ##### FUNCTION gst_pad_activate_pull ##### -->
+<para>
+
+</para>
+
+@pad: 
+@active: 
+@Returns: 
+
+
+<!-- ##### FUNCTION gst_pad_activate_push ##### -->
+<para>
+
+</para>
+
+@pad: 
+@active: 
+@Returns: 
+
+
 <!-- ##### FUNCTION gst_pad_send_event ##### -->
 <para>
 
@@ -771,6 +1042,31 @@ Checks if the pad is a sink pad.
 @value: 
 
 
+<!-- ##### FUNCTION gst_pad_query_position ##### -->
+<para>
+
+</para>
+
+@pad: 
+@format: 
+@cur: 
+@end: 
+@Returns: 
+
+
+<!-- ##### FUNCTION gst_pad_query_convert ##### -->
+<para>
+
+</para>
+
+@pad: 
+@src_format: 
+@src_val: 
+@dest_fmt: 
+@dest_val: 
+@Returns: 
+
+
 <!-- ##### FUNCTION gst_pad_set_internal_link_function ##### -->
 <para>
 
index 08f5b40..7199a2a 100644 (file)
@@ -1,7 +1,10 @@
 lib_LTLIBRARIES = libgstreamer-@GST_MAJORMINOR@.la
-noinst_LTLIBRARIES =
 
-#GST_INSTRUMENT_FLAGS = -finstrument-functions -DGST_ENABLE_FUNC_INSTRUMENTATION
+if HAVE_CHECK
+SUBDIRS_CHECK = check
+else
+SUBDIRS_CHECK =
+endif
 
 if GST_DISABLE_LOADSAVE
 GST_LOADSAVE_SRC = 
@@ -11,11 +14,11 @@ endif
 
 if GST_DISABLE_PARSE
 GST_PARSE_SRC = 
-GST_PARSE_DIRS = 
+SUBDIRS_PARSE = 
 GST_PARSE_LA = 
 else
 GST_PARSE_SRC = gstparse.c
-GST_PARSE_DIRS = parse
+SUBDIRS_PARSE = parse
 GST_PARSE_LA = parse/libgstparse.la 
 endif
 
@@ -27,11 +30,11 @@ endif
 
 if GST_DISABLE_REGISTRY
 GST_REGISTRY_SRC = 
-GST_REGISTRY_DIRS =
+SUBDIRS_REGISTRY =
 GST_REGISTRY_LA = 
 else
 GST_REGISTRY_SRC = gstregistry.c
-GST_REGISTRY_DIRS = registries
+SUBDIRS_REGISTRY = registries
 GST_REGISTRY_LA = registries/libgstxmlregistry.la
 endif
 
@@ -43,10 +46,10 @@ endif
 
 if GST_DISABLE_INDEX
 GST_INDEX_SRC = 
-GST_INDEX_DIRS =
+SUBDIRS_INDEX =
 else
 GST_INDEX_SRC = gstindex.c
-GST_INDEX_DIRS = indexers
+SUBDIRS_INDEX = indexers
 endif
 
 if GST_DISABLE_PLUGIN
@@ -61,8 +64,8 @@ else
 GST_URI_SRC = gsturi.c
 endif
 
-SUBDIRS = $(GST_PARSE_DIRS) $(GST_REGISTRY_DIRS) . base elements $(GST_INDEX_DIRS) 
-DIST_SUBDIRS = base elements parse registries indexers
+SUBDIRS = $(SUBDIRS_PARSE) $(SUBDIRS_REGISTRY) . base elements $(SUBDIRS_INDEX) $(SUBDIRS_CHECK)
+DIST_SUBDIRS = base elements parse registries indexers $(SUBDIRS_CHECK)
 
 # make variables for all generated source and header files to make the
 # distinction clear
diff --git a/gst/check/Makefile.am b/gst/check/Makefile.am
new file mode 100644 (file)
index 0000000..7d67323
--- /dev/null
@@ -0,0 +1,17 @@
+lib_LTLIBRARIES = libgstcheck-@GST_MAJORMINOR@.la
+
+libgstcheck_@GST_MAJORMINOR@_la_DEPENDENCIES = \
+       ../libgstreamer-@GST_MAJORMINOR@.la
+libgstcheck_@GST_MAJORMINOR@_la_SOURCES =      \
+       gstcheck.c
+
+libgstcheck_@GST_MAJORMINOR@_la_CFLAGS = $(GST_OBJ_CFLAGS) $(CHECK_CFLAGS)
+libgstcheck_@GST_MAJORMINOR@_la_LIBADD = $(GST_OBJ_LIBS) $(CHECK_LIBS) \
+       ../libgstreamer-@GST_MAJORMINOR@.la
+libgstcheck_@GST_MAJORMINOR@_la_LDFLAGS = 
+
+libgstcheck_@GST_MAJORMINOR@includedir =               \
+       $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/check
+
+libgstcheck_@GST_MAJORMINOR@include_HEADERS =  \
+       gstcheck.h
similarity index 100%
rename from tests/check/gstcheck.c
rename to gst/check/gstcheck.c
similarity index 100%
rename from tests/check/gstcheck.h
rename to gst/check/gstcheck.h
index 2f89573..02ba239 100644 (file)
 #include "config.h"
 #endif
 
-#ifndef GST_DISABLE_TRACE
-#include "gsttrace.h"
-#endif
-
 #include "gst/gstminiobject.h"
 #include "gst/gstinfo.h"
 #include "gst/gst_private.h"
 #include <gobject/gvaluecollector.h>
 
+#ifndef GST_DISABLE_TRACE
+#include "gsttrace.h"
+#endif
+
+#define DEBUG_REFCOUNT
+
 static void gst_mini_object_base_init (gpointer g_class);
 static void gst_mini_object_base_finalize (gpointer g_class);
 static void gst_mini_object_class_init (gpointer g_class, gpointer class_data);
@@ -189,12 +191,18 @@ gst_mini_object_ref (GstMiniObject * mini_object)
 {
   g_return_val_if_fail (mini_object != NULL, NULL);
 
+#ifdef DEBUG_REFCOUNT
+  GST_CAT_LOG (GST_CAT_REFCOUNTING, "%p ref %d->%d",
+      mini_object,
+      GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object),
+      GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object) + 1);
+#endif
+
   g_atomic_int_inc (&mini_object->refcount);
 
   return mini_object;
 }
 
-
 static void
 gst_mini_object_free (GstMiniObject * mini_object)
 {
@@ -231,6 +239,13 @@ gst_mini_object_unref (GstMiniObject * mini_object)
   g_return_if_fail (mini_object != NULL);
   g_return_if_fail (mini_object->refcount > 0);
 
+#ifdef DEBUG_REFCOUNT
+  GST_CAT_LOG (GST_CAT_REFCOUNTING, "%p unref %d->%d",
+      mini_object,
+      GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object),
+      GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object) - 1);
+#endif
+
   if (g_atomic_int_dec_and_test (&mini_object->refcount)) {
     gst_mini_object_free (mini_object);
   }
diff --git a/libs/gst/check/Makefile.am b/libs/gst/check/Makefile.am
new file mode 100644 (file)
index 0000000..7d67323
--- /dev/null
@@ -0,0 +1,17 @@
+lib_LTLIBRARIES = libgstcheck-@GST_MAJORMINOR@.la
+
+libgstcheck_@GST_MAJORMINOR@_la_DEPENDENCIES = \
+       ../libgstreamer-@GST_MAJORMINOR@.la
+libgstcheck_@GST_MAJORMINOR@_la_SOURCES =      \
+       gstcheck.c
+
+libgstcheck_@GST_MAJORMINOR@_la_CFLAGS = $(GST_OBJ_CFLAGS) $(CHECK_CFLAGS)
+libgstcheck_@GST_MAJORMINOR@_la_LIBADD = $(GST_OBJ_LIBS) $(CHECK_LIBS) \
+       ../libgstreamer-@GST_MAJORMINOR@.la
+libgstcheck_@GST_MAJORMINOR@_la_LDFLAGS = 
+
+libgstcheck_@GST_MAJORMINOR@includedir =               \
+       $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/check
+
+libgstcheck_@GST_MAJORMINOR@include_HEADERS =  \
+       gstcheck.h
similarity index 100%
rename from check/gstcheck.c
rename to libs/gst/check/gstcheck.c
similarity index 100%
rename from check/gstcheck.h
rename to libs/gst/check/gstcheck.h
index 6229990..6963193 100644 (file)
@@ -1,13 +1,23 @@
 ### all of the standard pc files we need to generate
+if HAVE_CHECK
+CHECK_PC_I = gstreamer-check-@GST_MAJORMINOR@.pc
+CHECK_PC_U = gstreamer-check-@GST_MAJORMINOR@-uninstalled.pc
+else
+CHECK_PC_I =
+CHECK_PC_U =
+endif
+
 pcfiles =                                                      \
        gstreamer-@GST_MAJORMINOR@.pc                           \
        gstreamer-base-@GST_MAJORMINOR@.pc                      \
-       gstreamer-controller-@GST_MAJORMINOR@.pc                        \
+       $(CHECK_PC_I)                                           \
+       gstreamer-controller-@GST_MAJORMINOR@.pc                \
        gstreamer-dataprotocol-@GST_MAJORMINOR@.pc
 
 pcfiles_uninstalled =                                          \
        gstreamer-@GST_MAJORMINOR@-uninstalled.pc               \
        gstreamer-base-@GST_MAJORMINOR@-uninstalled.pc          \
+       $(CHECK_PC_U)                                           \
        gstreamer-controller-@GST_MAJORMINOR@-uninstalled.pc    \
        gstreamer-dataprotocol-@GST_MAJORMINOR@-uninstalled.pc
 
@@ -27,7 +37,9 @@ EXTRA_DIST =                                                  \
        gstreamer-uninstalled.pc.in                             \
        gstreamer-base.pc.in                                    \
        gstreamer-base-uninstalled.pc.in                        \
-       gstreamer-controller.pc.in                                      \
+       gstreamer-check.pc.in                                   \
+       gstreamer-check-uninstalled.pc.in                       \
+       gstreamer-controller.pc.in                              \
        gstreamer-controller-uninstalled.pc.in                  \
        gstreamer-dataprotocol.pc.in                            \
        gstreamer-dataprotocol-uninstalled.pc.in
diff --git a/pkgconfig/gstreamer-check-uninstalled.pc.in b/pkgconfig/gstreamer-check-uninstalled.pc.in
new file mode 100644 (file)
index 0000000..5707af0
--- /dev/null
@@ -0,0 +1,13 @@
+# the standard variables don't make sense for an uninstalled copy
+prefix=
+exec_prefix=
+libdir=${pcfiledir}/../gst/check
+includedir=${pcfiledir}/..
+
+Name: GStreamer check unittesting, uninstalled
+Description: Unit testing helper library for GStreamer modules
+Requires: gstreamer-@GST_MAJORMINOR@ = @VERSION@
+Version: @VERSION@
+
+Libs: ${libdir}/libgstcheck-@GST_MAJORMINOR@.la
+Cflags: -I${includedir}
diff --git a/pkgconfig/gstreamer-check.pc.in b/pkgconfig/gstreamer-check.pc.in
new file mode 100644 (file)
index 0000000..d1bda6d
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@/gstreamer-@GST_MAJORMINOR@
+
+Name: GStreamer check unittesting
+Description: Unit testing helper library for GStreamer modules
+Requires: gstreamer-@GST_MAJORMINOR@
+Version: @VERSION@
+Libs: -L${libdir} -lgstcheck-@GST_MAJORMINOR@
+Cflags: -I${includedir}
index d4fbc05..982a21b 100644 (file)
@@ -49,6 +49,7 @@ TESTS = $(top_builddir)/tools/gst-register    \
        gst/gsttag                              \
        gst/gstvalue                            \
        elements/gstfakesrc                     \
+       elements/identity                       \
        pipelines/simple_launch_lines           \
        pipelines/cleanup                       \
        states/sinks                            \
@@ -57,14 +58,11 @@ TESTS = $(top_builddir)/tools/gst-register  \
 
 check_PROGRAMS = $(TESTS)
 
-noinst_LTLIBRARIES = libgstcheck.la
+noinst_HEADERS = gst/capslist.h
 
-libgstcheck_la_SOURCES = gstcheck.c
-libgstcheck_la_LIBADD = $(GST_OBJ_LIBS)
-noinst_HEADERS = gstcheck.h gst/capslist.h
-
-AM_CFLAGS = $(GST_OBJ_CFLAGS) $(CHECK_CFLAGS)
-LDADD = $(GST_OBJ_LIBS) $(CHECK_LIBS) libgstcheck.la
+AM_CFLAGS = $(GST_OBJ_CFLAGS)
+LDADD = $(GST_OBJ_LIBS) \
+       $(top_builddir)/gst/check/libgstcheck-@GST_MAJORMINOR@.la
 
 gst_libs_gdp_SOURCES = \
        gst-libs/gdp.c \
@@ -72,7 +70,8 @@ gst_libs_gdp_SOURCES = \
 # remove GST_ENABLE_NEW when dataprotocol has been declared API-stable
 gst_libs_gdp_CFLAGS = $(AM_CFLAGS) -DGST_ENABLE_NEW
 
-gst_libs_controller_LDADD = $(GST_OBJ_LIBS) $(CHECK_LIBS) libgstcheck.la \
+gst_libs_controller_LDADD = $(GST_OBJ_LIBS) \
+       $(top_builddir)/gst/check/libgstcheck-@GST_MAJORMINOR@.la \
        $(top_builddir)/libs/gst/controller/libgstcontroller-@GST_MAJORMINOR@.la
 
 # valgrind testing
index a10e4f5..3bac562 100644 (file)
@@ -1,2 +1,3 @@
 .dirstamp
-gstfakesrc
+fakesrc
+identity
similarity index 99%
rename from tests/check/elements/gstfakesrc.c
rename to tests/check/elements/fakesrc.c
index e121684..f5328cc 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <unistd.h>
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 GList *buffers = NULL;
 gboolean have_eos = FALSE;
diff --git a/tests/check/elements/identity.c b/tests/check/elements/identity.c
new file mode 100644 (file)
index 0000000..3da0ce1
--- /dev/null
@@ -0,0 +1,211 @@
+/* GStreamer
+ *
+ * unit test for identity
+ *
+ * Copyright (C) <2005> Thomas Vander Stichele <thomas at apestaart dot org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <unistd.h>
+
+#include <gst/check/gstcheck.h>
+
+GList *buffers = NULL;
+gboolean have_eos = FALSE;
+
+/* For ease of programming we use globals to keep refs for our floating
+ * src and sink pads we create; otherwise we always have to do get_pad,
+ * get_peer, and then remove references in every test function */
+GstPad *mysrcpad, *mysinkpad;
+
+
+static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS_ANY);
+
+GstFlowReturn
+chain_func (GstPad * pad, GstBuffer * buffer)
+{
+  GST_DEBUG ("chain_func: received buffer %p", buffer);
+  buffers = g_list_append (buffers, buffer);
+
+  return GST_FLOW_OK;
+}
+
+gboolean
+event_func (GstPad * pad, GstEvent * event)
+{
+  if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) {
+    /* we take the lock here because it's good practice to so, even though
+     * no buffers will be pushed anymore anyway */
+    GST_STREAM_LOCK (pad);
+    have_eos = TRUE;
+    GST_STREAM_UNLOCK (pad);
+    gst_event_unref (event);
+    return TRUE;
+  }
+
+  gst_event_unref (event);
+  return FALSE;
+}
+
+GstElement *
+setup_identity ()
+{
+  GstElement *identity;
+  GstPad *srcpad, *sinkpad;
+
+  GST_DEBUG ("setup_identity");
+
+  identity = gst_element_factory_make ("identity", "identity");
+  fail_if (identity == NULL, "Could not create a identity");
+
+  /* sending pad */
+  mysrcpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
+      "src");
+  fail_if (mysrcpad == NULL, "Could not create a mysrcpad");
+  ASSERT_OBJECT_REFCOUNT (mysrcpad, "mysrcpad", 1);
+
+  sinkpad = gst_element_get_pad (identity, "sink");
+  fail_if (sinkpad == NULL, "Could not get source pad from identity");
+  ASSERT_OBJECT_REFCOUNT (sinkpad, "sinkpad", 2);
+  gst_pad_set_caps (mysrcpad, NULL);
+  fail_unless (gst_pad_link (mysrcpad, sinkpad) == GST_PAD_LINK_OK,
+      "Could not link source and identity sink pads");
+  gst_object_unref (sinkpad);   /* because we got it higher up */
+  ASSERT_OBJECT_REFCOUNT (sinkpad, "sinkpad", 1);
+
+  /* receiving pad */
+  mysinkpad =
+      gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
+      "sink");
+  fail_if (mysinkpad == NULL, "Could not create a mysinkpad");
+
+  srcpad = gst_element_get_pad (identity, "src");
+  fail_if (srcpad == NULL, "Could not get source pad from identity");
+  gst_pad_set_caps (mysinkpad, NULL);
+  gst_pad_set_chain_function (mysinkpad, chain_func);
+  gst_pad_set_event_function (mysinkpad, event_func);
+
+  fail_unless (gst_pad_link (srcpad, mysinkpad) == GST_PAD_LINK_OK,
+      "Could not link identity source and mysink pads");
+  gst_object_unref (srcpad);    /* because we got it higher up */
+  ASSERT_OBJECT_REFCOUNT (srcpad, "srcpad", 1);
+
+  return identity;
+}
+
+void
+cleanup_identity (GstElement * identity)
+{
+  GstPad *srcpad, *sinkpad;
+
+  GST_DEBUG ("cleanup_identity");
+
+  fail_unless (gst_element_set_state (identity, GST_STATE_NULL) ==
+      GST_STATE_SUCCESS, "could not set to null");
+  ASSERT_OBJECT_REFCOUNT (identity, "identity", 1);
+
+  /* clean up floating src pad */
+  sinkpad = gst_element_get_pad (identity, "sink");
+  ASSERT_OBJECT_REFCOUNT (sinkpad, "sinkpad", 2);
+
+  gst_pad_unlink (mysrcpad, sinkpad);
+
+  /* pad refs held by both creator and this function (through _get) */
+  ASSERT_OBJECT_REFCOUNT (mysrcpad, "srcpad", 1);
+  gst_object_unref (mysrcpad);
+  mysrcpad = NULL;
+
+  ASSERT_OBJECT_REFCOUNT (sinkpad, "sinkpad", 2);
+  gst_object_unref (sinkpad);
+  /* one more ref is held by identity itself */
+
+  /* clean up floating sink pad */
+  srcpad = gst_element_get_pad (identity, "src");
+  gst_pad_unlink (srcpad, mysinkpad);
+
+  /* pad refs held by both creator and this function (through _get) */
+  ASSERT_OBJECT_REFCOUNT (srcpad, "srcpad", 2);
+  gst_object_unref (srcpad);
+  /* one more ref is held by identity itself */
+
+  ASSERT_OBJECT_REFCOUNT (mysinkpad, "mysinkpad", 1);
+  gst_object_unref (mysinkpad);
+  mysinkpad = NULL;
+
+  ASSERT_OBJECT_REFCOUNT (identity, "identity", 1);
+  gst_object_unref (identity);
+}
+
+GST_START_TEST (test_one_buffer)
+{
+  GstElement *identity;
+  GstBuffer *buffer;
+
+  identity = setup_identity ();
+  fail_unless (gst_element_set_state (identity,
+          GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
+
+  buffer = gst_buffer_new_and_alloc (4);
+  ASSERT_BUFFER_REFCOUNT (buffer, "buffer", 1);
+  memcpy (GST_BUFFER_DATA (buffer), "data", 4);
+  /* pushing gives away my reference ... */
+  gst_pad_push (mysrcpad, buffer);
+  /* ... but it ends up being collected on the global buffer list */
+  ASSERT_BUFFER_REFCOUNT (buffer, "buffer", 1);
+
+  /* cleanup */
+  cleanup_identity (identity);
+}
+
+GST_END_TEST;
+
+Suite *
+identity_suite (void)
+{
+  Suite *s = suite_create ("identity");
+  TCase *tc_chain = tcase_create ("general");
+
+  suite_add_tcase (s, tc_chain);
+  tcase_add_test (tc_chain, test_one_buffer);
+
+  return s;
+}
+
+int
+main (int argc, char **argv)
+{
+  int nf;
+
+  Suite *s = identity_suite ();
+  SRunner *sr = srunner_create (s);
+
+  gst_check_init (&argc, &argv);
+
+  srunner_run_all (sr, CK_NORMAL);
+  nf = srunner_ntests_failed (sr);
+  srunner_free (sr);
+
+  return nf;
+}
index ae295be..84bd9fb 100644 (file)
@@ -20,7 +20,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 /* a sink should go ASYNC to PAUSE. forcing PLAYING is possible */
 GST_START_TEST (test_sink)
index 11ae64a..993c633 100644 (file)
@@ -19,7 +19,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 GST_START_TEST (test_init)
 {
index bf41dc0..61ae0d2 100644 (file)
@@ -20,7 +20,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 static void
 pop_messages (GstBus * bus, int count)
index 801a609..5791214 100644 (file)
@@ -20,7 +20,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 GST_START_TEST (test_caps)
 {
index f1677ed..54ea722 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 
 static GstBus *test_bus = NULL;
index df5da49..9141fce 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 #include "capslist.h"
 
 GST_START_TEST (test_from_string)
index 27bd84e..aeff42d 100644 (file)
@@ -19,7 +19,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 GST_START_TEST (test_add_remove_pad)
 {
index 2741483..455dd1f 100644 (file)
@@ -19,7 +19,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 static void
 assert_gstrefcount (gpointer p, gint i)
index 01378fc..ab64004 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 
 static GList *
index 1d6c0c5..0cfad06 100644 (file)
@@ -20,7 +20,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 static GQuark domain;
 
index 7513f34..c7e61ef 100644 (file)
@@ -20,7 +20,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 GST_START_TEST (test_copy)
 {
index a7dccb3..5d8a94f 100644 (file)
@@ -20,7 +20,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 /*
   Create a fake subclass
index 5283c20..8a46721 100644 (file)
@@ -19,7 +19,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 GST_START_TEST (test_link)
 {
index cf9eeeb..47fc72a 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 
 GST_START_TEST (test_from_string_int)
index a20e98f..f9a6a35 100644 (file)
@@ -19,7 +19,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 GST_START_TEST (test_signedness)
 {
index 1b33971..a91315d 100644 (file)
@@ -18,7 +18,7 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 #include <string.h>
 
index 4dc3dae..b492d12 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 
 GST_START_TEST (test_deserialize_buffer)
index dc1e100..23d0a00 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #include "config.h"
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 #include <gst/controller/gst-controller.h>
 
 /* LOCAL TEST ELEMENT */
index 7a44741..69e74e5 100644 (file)
@@ -20,7 +20,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 #include <gst/dataprotocol/dataprotocol.h>
 #include "libs/gst/dataprotocol/dp-private.h"   /* private header */
index 7b3a3b4..6872447 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 
 static GstElement *
index d29c88e..618d3a5 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 
-#include "../gstcheck.h"
+#include <gst/check/gstcheck.h>
 
 
 static GstElement *