libs/gst/check/gstcheck.*: Make the declaration in the header for gst_check_element_p...
authorJan Schmidt <thaytan@mad.scientist.com>
Tue, 19 Feb 2008 12:56:28 +0000 (12:56 +0000)
committerJan Schmidt <thaytan@mad.scientist.com>
Tue, 19 Feb 2008 12:56:28 +0000 (12:56 +0000)
Original commit message from CVS:
* libs/gst/check/gstcheck.c: (gst_check_drop_buffers),
(gst_check_element_push_buffer_list):
* libs/gst/check/gstcheck.h:
Make the declaration in the header for
gst_check_element_push_buffer_list match the implementation.
Fix up spelling, grammar and wording of the documentation in a few
places, and add the Since keyword to new API functions.
Use g_list_delete_link instead of g_list_remove in
gst_check_drop_buffers, since it's immeasurably more efficient.
* tests/check/elements/fakesrc.c: (GST_START_TEST):
Use new gst_check_drop_buffers function where appropriate.
* win32/common/libgstbase.def:
* win32/common/libgstreamer.def:
Add new symbols gst_collect_pads_take_buffer,
gst_collect_pads_read_buffer, gst_index_set_resolver_full to the
exports
Changelog surgery to add API keyword to new gst_check API.

ChangeLog
libs/gst/check/gstcheck.c
libs/gst/check/gstcheck.h
tests/check/elements/fakesrc.c
win32/common/libgstbase.def
win32/common/libgstreamer.def

index 1388282..ebe790c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2008-02-19  Jan Schmidt  <Jan.Schmidt@sun.com>
+
+       * libs/gst/check/gstcheck.c: (gst_check_drop_buffers),
+       (gst_check_element_push_buffer_list):
+       * libs/gst/check/gstcheck.h:
+       Make the declaration in the header for
+       gst_check_element_push_buffer_list match the implementation.
+
+       Fix up spelling, grammar and wording of the documentation in a few
+       places, and add the Since keyword to new API functions.
+       Use g_list_delete_link instead of g_list_remove in
+       gst_check_drop_buffers, since it's immeasurably more efficient.
+
+       * tests/check/elements/fakesrc.c: (GST_START_TEST):
+       Use new gst_check_drop_buffers function where appropriate.
+
+       * win32/common/libgstbase.def:
+       * win32/common/libgstreamer.def:
+       Add new symbols gst_collect_pads_take_buffer, 
+       gst_collect_pads_read_buffer, gst_index_set_resolver_full to the
+       exports
+
+       Changelog surgery to add API keyword to new gst_check API.
+
 2008-02-19  Sebastian Dröge  <slomo@circular-chaos.org>
 
        * gst/parse/lex._gst_parse_yy.pre.c: (yy_get_next_buffer),
        Add more functions for unit testing: gst_check_drop_buffers,
        gst_check_caps_equal, gst_check_element_push_buffer_list,
        gst_check_element_push_buffer
+       API: gst_check_drop_buffers
+       API: gst_check_caps_equal
+       API: gst_check_element_push_buffer_list
+       API: gst_check_element_push_buffer
 
 2008-02-01  Julien Moutte  <julien@fluendo.com>
 
index 3a410d3..0932bc9 100644 (file)
@@ -274,8 +274,10 @@ gst_check_teardown_sink_pad (GstElement * element)
 /**
  * gst_check_drop_buffers:
  *
- * unref all buffers created by the check element that are in the @buffers GList
+ * Unref and remove all buffers that are in the global @buffers GList,
+ * emptying the list.
  *
+ * Since: 0.10.18
  */
 void
 gst_check_drop_buffers ()
@@ -284,8 +286,8 @@ gst_check_drop_buffers ()
 
   while (g_list_length (buffers)) {
     temp_buffer = GST_BUFFER (buffers->data);
-    buffers = g_list_remove (buffers, temp_buffer);
     gst_buffer_unref (temp_buffer);
+    buffers = g_list_delete_link (buffers, buffers);
   }
 }
 
@@ -295,9 +297,10 @@ gst_check_drop_buffers ()
  * @caps1: first caps to compare
  * @caps2: second caps to compare
  *
- * Check if the caps are equal, just a wrapper
- * around gst_caps_is_equal with some more logging
+ * Compare two caps with gst_caps_is_equal and fail unless they are
+ * equal.
  *
+ * Since: 0.10.18
  */
 void
 gst_check_caps_equal (GstCaps * caps1, GstCaps * caps2)
@@ -319,13 +322,15 @@ gst_check_caps_equal (GstCaps * caps1, GstCaps * caps2)
  * @last_flow_return: the last buffer push needs to give this GstFlowReturn
  *
  * Create an @element with the factory with the name and push the buffers in
- * @buffer_in to this element. The element should create the buffers equal to the
- * buffers in @buffer_out. We only check the caps, size and the data of the buffers.
- * This function unrefs the buffers in the GList's.
- * with @last_failing you can create a test that the last buffer should not be accepted.
- * This can be handy if you need to setup the element with some previous buffers and than
- * check for failing.
- *
+ * @buffer_in to this element. The element should create the buffers equal to
+ * the buffers in @buffer_out. We only check the caps, size and the data of the
+ * buffers. This function unrefs the buffers in the two lists.
+ * The last_flow_return parameter indicates the expected flow return value from
+ * pushing the final buffer in the list.
+ * This can be used to set up a test which pushes some buffers and then an
+ * invalid buffer, when the final buffer is expected to fail, for example.
+ * 
+ * Since: 0.10.18
  */
 void
 gst_check_element_push_buffer_list (const gchar * element_name,
@@ -397,7 +402,7 @@ gst_check_element_push_buffer_list (const gchar * element_name,
     buffer_in = g_list_remove (buffer_in, next_buffer);
     if (g_list_length (buffer_in) == 0) {
       fail_unless (gst_pad_push (src_pad, next_buffer) == last_flow_return,
-          "we expext something else from the last buffer");
+          "we expect something else from the last buffer");
     } else {
       fail_unless (gst_pad_push (src_pad, next_buffer) == GST_FLOW_OK,
           "Failed to push buffer in");
@@ -442,6 +447,8 @@ gst_check_element_push_buffer_list (const gchar * element_name,
  * @buffer_in to this element. The element should create one buffer
  * and this will be compared with @buffer_out. We only check the caps
  * and the data of the buffers. This function unrefs the buffers.
+ * 
+ * Since: 0.10.18
  */
 void
 gst_check_element_push_buffer (const gchar * element_name,
index a21d98f..8c02e71 100644 (file)
@@ -77,7 +77,7 @@ void gst_check_teardown_src_pad (GstElement * element);
 void gst_check_drop_buffers ();
 void gst_check_caps_equal (GstCaps * caps1, GstCaps * caps2);
 void gst_check_element_push_buffer_list (const gchar * element_name,
-    GList * buffer_in, GList * buffer_out, gboolean last_failing);
+    GList * buffer_in, GList * buffer_out, GstFlowReturn last_flow_return);
 void gst_check_element_push_buffer (const gchar * element_name,
     GstBuffer * buffer_in, GstBuffer * buffer_out);
 GstPad *gst_check_setup_sink_pad (GstElement * element,
index b4a2825..ee35321 100644 (file)
@@ -82,8 +82,7 @@ GST_START_TEST (test_num_buffers)
   }
 
   fail_unless (g_list_length (buffers) == 3);
-  g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL);
-  g_list_free (buffers);
+  gst_check_drop_buffers ();
 
   fail_unless (gst_element_set_state (src,
           GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS, "could not set to null");
@@ -120,8 +119,7 @@ GST_START_TEST (test_sizetype_empty)
     fail_unless (GST_BUFFER_SIZE (buf) == 0);
     l = l->next;
   }
-  g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL);
-  g_list_free (buffers);
+  gst_check_drop_buffers ();
 
   fail_unless (gst_element_set_state (src,
           GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS, "could not set to null");
@@ -159,8 +157,7 @@ GST_START_TEST (test_sizetype_fixed)
     fail_unless (GST_BUFFER_SIZE (buf) == 8192);
     l = l->next;
   }
-  g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL);
-  g_list_free (buffers);
+  gst_check_drop_buffers ();
 
   fail_unless (gst_element_set_state (src,
           GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS, "could not set to null");
@@ -200,8 +197,7 @@ GST_START_TEST (test_sizetype_random)
     fail_if (GST_BUFFER_SIZE (buf) < 4096);
     l = l->next;
   }
-  g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL);
-  g_list_free (buffers);
+  gst_check_drop_buffers ();
 
   fail_unless (gst_element_set_state (src,
           GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS, "could not set to null");
index cd4d8cc..82e3c65 100644 (file)
@@ -55,11 +55,13 @@ EXPORTS
        gst_collect_pads_peek
        gst_collect_pads_pop
        gst_collect_pads_read
+       gst_collect_pads_read_buffer
        gst_collect_pads_remove_pad
        gst_collect_pads_set_flushing
        gst_collect_pads_set_function
        gst_collect_pads_start
        gst_collect_pads_stop
+       gst_collect_pads_take_buffer
        gst_data_queue_drop_head
        gst_data_queue_flush
        gst_data_queue_get_level
index ceb6344..fd46057 100644 (file)
@@ -399,6 +399,7 @@ EXPORTS
        gst_index_set_filter_full
        gst_index_set_group
        gst_index_set_resolver
+       gst_index_set_resolver_full
        gst_init
        gst_init_check
        gst_init_get_option_group