[gst-devel] Re: [gst-cvs] ensonic gstreamer: gstreamer/ gstreamer/docs/libs/ gstreamer/libs/gst/controller/ gstreamer/tests/check/libs/

Thomas Vander Stichele thomas at apestaart.org
Wed Apr 12 03:15:12 CEST 2006


Hi Stefan,

nice work adding docs and a test for your new method.

in the ChangeLog, could you please mark any API change with API: ? I
corrected it in CVS

Thanks

Thomas

On Tue, 2006-04-11 at 21:07 +0000, Stefan Kost wrote:
> CVS Root:       /cvs/gstreamer
> Module:         gstreamer
> Changes by:     ensonic
> Date:           Tue Apr 11 2006  21:07:38 UTC
> 
> Log message:
> * docs/libs/gstreamer-libs-sections.txt:
> * libs/gst/controller/gstcontroller.c: (gst_controller_unset),
> (gst_controller_unset_all):
> * libs/gst/controller/gstcontroller.h:
> Added new method _unset_all() and fixed _unset()
> * tests/check/libs/controller.c: (GST_START_TEST),
> (gst_controller_suite):
> Added two testcases for new and fixed method
> 
> Modified files:
>     .               : ChangeLog
>     docs/libs       : gstreamer-libs-sections.txt
>     libs/gst/controller: gstcontroller.c gstcontroller.h
>     tests/check/libs: controller.c
> 
> Links:
> http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.2433&r2=1.2434
> http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/docs/libs/gstreamer-libs-sections.txt.diff?r1=1.33&r2=1.34
> http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/libs/gst/controller/gstcontroller.c.diff?r1=1.27&r2=1.28
> http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/libs/gst/controller/gstcontroller.h.diff?r1=1.17&r2=1.18
> http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/tests/check/libs/controller.c.diff?r1=1.14&r2=1.15
> 
> ====Begin Diffs====
> Index: ChangeLog
> ===================================================================
> RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v
> retrieving revision 1.2433
> retrieving revision 1.2434
> diff -u -d -r1.2433 -r1.2434
> --- ChangeLog	11 Apr 2006 18:43:04 -0000	1.2433
> +++ ChangeLog	11 Apr 2006 21:07:26 -0000	1.2434
> @@ -1,3 +1,15 @@
> +2006-04-11  Stefan Kost  <ensonic at users.sf.net>
> +
> +	* docs/libs/gstreamer-libs-sections.txt:
> +	* libs/gst/controller/gstcontroller.c: (gst_controller_unset),
> +	(gst_controller_unset_all):
> +	* libs/gst/controller/gstcontroller.h:
> +        Added new method _unset_all() and fixed _unset()
> +	
> +	* tests/check/libs/controller.c: (GST_START_TEST),
> +	(gst_controller_suite):
> +	Added two testcases for new and fixed method
>  2006-04-11  Tim-Philipp Müller  <tim at centricular dot net>
>  
>  	* libs/gst/net/gstnettimepacket.c: (gst_net_time_packet_send):
> Index: gstreamer-libs-sections.txt
> RCS file: /cvs/gstreamer/gstreamer/docs/libs/gstreamer-libs-sections.txt,v
> retrieving revision 1.33
> retrieving revision 1.34
> diff -u -d -r1.33 -r1.34
> --- gstreamer-libs-sections.txt	4 Apr 2006 14:58:49 -0000	1.33
> +++ gstreamer-libs-sections.txt	11 Apr 2006 21:07:26 -0000	1.34
> @@ -58,6 +58,7 @@
>  gst_controller_set
>  gst_controller_set_from_list
>  gst_controller_unset
> +gst_controller_unset_all
>  gst_controller_get
>  gst_controller_get_all
>  gst_controller_sync_values
> Index: gstcontroller.c
> RCS file: /cvs/gstreamer/gstreamer/libs/gst/controller/gstcontroller.c,v
> retrieving revision 1.27
> retrieving revision 1.28
> diff -u -d -r1.27 -r1.28
> --- gstcontroller.c	8 Apr 2006 20:57:30 -0000	1.27
> +++ gstcontroller.c	11 Apr 2006 21:07:26 -0000	1.28
> @@ -787,7 +787,44 @@
>    g_mutex_lock (self->lock);
>    if ((prop = gst_controller_find_controlled_property (self, property_name))) {
> -    prop->values = g_list_remove (prop->values, prop);
> +    GList *node;
> +    /* check if a timed_value for the timestamp exists */
> +    if ((node = g_list_find_custom (prop->values, &timestamp,
> +                gst_timed_value_find))) {
> +      prop->values = g_list_delete_link (prop->values, node);
> +      res = TRUE;
> +    }
> +  }
> +  g_mutex_unlock (self->lock);
> +  return (res);
> +}
> +/**
> + * gst_controller_unset_all:
> + * @self: the controller object which handles the properties
> + * @property_name: the name of the property to unset
> + *
> + * Used to remove all time-stamped values of given controller-handled property
> + * Returns: %FALSE if the values couldn't be unset (ex : properties not handled
> + * by controller), %TRUE otherwise
> + * Since: 0.10.5
> + */
> +gboolean
> +gst_controller_unset_all (GstController * self, gchar * property_name)
> +{
> +  gboolean res = FALSE;
> +  GstControlledProperty *prop;
> +  g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE);
> +  g_return_val_if_fail (property_name, FALSE);
> +  g_mutex_lock (self->lock);
> +  if ((prop = gst_controller_find_controlled_property (self, property_name))) {
> +    g_list_free (prop->values);
> +    prop->values = NULL;
>      res = TRUE;
>    }
>    g_mutex_unlock (self->lock);
> Index: gstcontroller.h
> RCS file: /cvs/gstreamer/gstreamer/libs/gst/controller/gstcontroller.h,v
> retrieving revision 1.17
> retrieving revision 1.18
> diff -u -d -r1.17 -r1.18
> --- gstcontroller.h	13 Jan 2006 14:21:48 -0000	1.17
> +++ gstcontroller.h	11 Apr 2006 21:07:26 -0000	1.18
> @@ -159,7 +159,7 @@
>  gboolean gst_controller_unset (GstController * self, gchar * property_name,
>      GstClockTime timestamp);
> -
> +gboolean gst_controller_unset_all (GstController * self, gchar * property_name);
>  GValue *gst_controller_get (GstController * self, gchar * property_name,
> Index: controller.c
> RCS file: /cvs/gstreamer/gstreamer/tests/check/libs/controller.c,v
> retrieving revision 1.14
> retrieving revision 1.15
> diff -u -d -r1.14 -r1.15
> --- controller.c	17 Oct 2005 17:05:37 -0000	1.14
> +++ controller.c	11 Apr 2006 21:07:26 -0000	1.15
> @@ -566,6 +566,107 @@
>  GST_END_TEST;
> +/* test _unset() */
> +GST_START_TEST (controller_unset)
> +  GstController *ctrl;
> +  GstElement *elem;
> +  gboolean res;
> +  GValue val_ulong = { 0, };
> +  elem = gst_element_factory_make ("testmonosource", "test_source");
> +  /* that property should exist and should be controllable */
> +  ctrl = gst_controller_new (G_OBJECT (elem), "ulong", NULL);
> +  fail_unless (ctrl != NULL, NULL);
> +  /* set interpolation mode */
> +  gst_controller_set_interpolation_mode (ctrl, "ulong", GST_INTERPOLATE_NONE);
> +  /* set control values */
> +  g_value_init (&val_ulong, G_TYPE_ULONG);
> +  g_value_set_ulong (&val_ulong, 0);
> +  res = gst_controller_set (ctrl, "ulong", 0 * GST_SECOND, &val_ulong);
> +  fail_unless (res, NULL);
> +  g_value_set_ulong (&val_ulong, 100);
> +  res = gst_controller_set (ctrl, "ulong", 1 * GST_SECOND, &val_ulong);
> +  g_value_set_ulong (&val_ulong, 50);
> +  res = gst_controller_set (ctrl, "ulong", 2 * GST_SECOND, &val_ulong);
> +  /* verify values */
> +  gst_controller_sync_values (ctrl, 0 * GST_SECOND);
> +  fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 0, NULL);
> +  gst_controller_sync_values (ctrl, 1 * GST_SECOND);
> +  fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 100, NULL);
> +  gst_controller_sync_values (ctrl, 2 * GST_SECOND);
> +  fail_unless (GST_TEST_MONO_SOURCE (elem)->val_ulong == 50, NULL);
> +  /* unset second */
> +  res = gst_controller_unset (ctrl, "ulong", 1 * GST_SECOND);
> +  /* verify value again */
> +  GST_INFO ("controller->ref_count=%d", G_OBJECT (ctrl)->ref_count);
> +  g_object_unref (ctrl);
> +  gst_object_unref (elem);
> +GST_END_TEST;
> +/* test _unset_all() */
> +GST_START_TEST (controller_unset_all)
> +  res = gst_controller_unset_all (ctrl, "ulong");
>  /* tests if we can run helper methods against any GObject */
>  GST_START_TEST (controller_helper_any_gobject)
>  {
> @@ -605,6 +706,8 @@
>    tcase_add_test (tc, controller_interpolate_none);
>    tcase_add_test (tc, controller_interpolate_trigger);
>    tcase_add_test (tc, controller_interpolate_linear);
> +  tcase_add_test (tc, controller_unset);
> +  tcase_add_test (tc, controller_unset_all);
>    tcase_add_test (tc, controller_helper_any_gobject);
>    return s;
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> gstreamer-cvs-verbose mailing list
> gstreamer-cvs-verbose at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-cvs-verbose





More information about the gstreamer-devel mailing list