diff options
author | Andy Wingo <wingo@pobox.com> | 2005-09-26 15:43:30 +0000 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2005-09-26 15:43:30 +0000 |
commit | 2f46ef713ddd10d29bf0b35be16a77b82796ba33 (patch) | |
tree | 972aba463514a5105d344c6ce1e503e8a001b0d4 /libs | |
parent | b98900a0a0d7ff995973068f08b3d6fec6210d99 (diff) |
Remove memchunk benchmark stuff, this is taken over by GLib bug 118439.
Original commit message from CVS:
2005-09-26 Andy Wingo <wingo@pobox.com>
* configure.ac:
* tests/Makefile.am:
* tests/memchunk: Remove memchunk benchmark stuff, this is taken
over by GLib bug 118439.
* gst/base/gstbasesink.c (gst_base_sink_wait): Factor out the wait
routines to a function.
* docs/libs/gstreamer-libs-sections.txt: I am a good person today.
* libs/gst/controller/gsthelper.c:
* libs/gst/controller/gstcontroller.h (gst_controller_sync_values)
(gst_object_sync_values): Renamed from sink_values. Ugh.
* libs/gst/controller/gsthelper.c: Update for __gst_controller_key.
* libs/gst/controller/gstcontroller.c (__gst_controller_key):
Renamed from controller_key, as it is exported.
* gst/gstvalue.c (_gst_value_initialize): Fake out the compiler.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gst/base/gstbasesink.c | 47 | ||||
-rw-r--r-- | libs/gst/controller/gstcontroller.c | 20 | ||||
-rw-r--r-- | libs/gst/controller/gstcontroller.h | 4 | ||||
-rw-r--r-- | libs/gst/controller/gsthelper.c | 24 |
4 files changed, 50 insertions, 45 deletions
diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index 7c8c1387b..7b6811a25 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -886,6 +886,29 @@ gst_base_sink_get_times (GstBaseSink * basesink, GstBuffer * buffer, } } +/* with STREAM_LOCK and LOCK*/ +static GstClockReturn +gst_base_sink_wait (GstBaseSink * basesink, GstClockTime time) +{ + GstClockReturn ret; + + /* clock_id should be NULL outside of this function */ + g_assert (basesink->clock_id == NULL); + g_assert (GST_CLOCK_TIME_IS_VALID (time)); + + basesink->clock_id = gst_clock_new_single_shot_id (basesink->clock, time); + + /* release the object lock while waiting */ + GST_UNLOCK (basesink); + ret = gst_clock_id_wait (basesink->clock_id, NULL); + GST_LOCK (basesink); + + gst_clock_id_unref (basesink->clock_id); + basesink->clock_id = NULL; + + return ret; +} + /* perform synchronisation on a buffer * * 1) check if we have a clock, if not, do nothing @@ -957,30 +980,22 @@ gst_base_sink_do_sync (GstBaseSink * basesink, GstBuffer * buffer) GstClockTime base_time; GST_LOCK (basesink); + base_time = GST_ELEMENT (basesink)->base_time; GST_LOG_OBJECT (basesink, "waiting for clock, base time %" GST_TIME_FORMAT, GST_TIME_ARGS (base_time)); - /* save clock id so that we can unlock it if needed */ - basesink->clock_id = gst_clock_new_single_shot_id (basesink->clock, - stream_start + base_time); /* also save end_time of this buffer so that we can wait * to signal EOS */ if (end_valid) basesink->end_time = stream_end + base_time; else basesink->end_time = GST_CLOCK_TIME_NONE; - GST_UNLOCK (basesink); - ret = gst_clock_id_wait (basesink->clock_id, NULL); + ret = gst_base_sink_wait (basesink, stream_start + base_time); - GST_LOCK (basesink); - if (basesink->clock_id) { - gst_clock_id_unref (basesink->clock_id); - basesink->clock_id = NULL; - } GST_UNLOCK (basesink); GST_LOG_OBJECT (basesink, "clock entry done: %d", ret); @@ -1016,17 +1031,7 @@ gst_base_sink_handle_event (GstBaseSink * basesink, GstEvent * event) if (basesink->clock) { /* wait for last buffer to finish if we have a valid end time */ if (GST_CLOCK_TIME_IS_VALID (basesink->end_time)) { - basesink->clock_id = gst_clock_new_single_shot_id (basesink->clock, - basesink->end_time); - GST_UNLOCK (basesink); - - gst_clock_id_wait (basesink->clock_id, NULL); - - GST_LOCK (basesink); - if (basesink->clock_id) { - gst_clock_id_unref (basesink->clock_id); - basesink->clock_id = NULL; - } + gst_base_sink_wait (basesink, basesink->end_time); basesink->end_time = GST_CLOCK_TIME_NONE; } } diff --git a/libs/gst/controller/gstcontroller.c b/libs/gst/controller/gstcontroller.c index 61046a67c..d09d34e26 100644 --- a/libs/gst/controller/gstcontroller.c +++ b/libs/gst/controller/gstcontroller.c @@ -38,7 +38,7 @@ * </para></listitem> * <listitem><para> * when processing data (get, chain, loop function) at the beginning call - * gst_object_sink_values(element,timestamp). + * gst_object_sync_values(element,timestamp). * This will made the controller to update all gobject properties that are under * control with the current values based on timestamp. * </para></listitem> @@ -73,7 +73,7 @@ GST_DEBUG_CATEGORY_EXTERN (GST_CAT_DEFAULT); static GObjectClass *parent_class = NULL; -GQuark controller_key; +GQuark __gst_controller_key; /* imports from gst-interpolation.c */ @@ -94,7 +94,7 @@ on_object_controlled_property_changed (const GObject * object, GParamSpec * arg, GST_INFO ("notify for '%s'", prop->name); - ctrl = g_object_get_qdata (G_OBJECT (object), controller_key); + ctrl = g_object_get_qdata (G_OBJECT (object), __gst_controller_key); g_return_if_fail (ctrl); if (g_mutex_trylock (ctrl->lock)) { @@ -420,7 +420,7 @@ gst_controller_new_valist (GObject * object, va_list var_args) GstParent will be in core after all. */ - self = g_object_get_qdata (object, controller_key); + self = g_object_get_qdata (object, __gst_controller_key); // create GstControlledProperty for each property while ((name = va_arg (var_args, gchar *))) { // test if this property isn't yet controlled @@ -432,7 +432,7 @@ gst_controller_new_valist (GObject * object, va_list var_args) self = g_object_new (GST_TYPE_CONTROLLER, NULL); self->object = object; // store the controller - g_object_set_qdata (object, controller_key, self); + g_object_set_qdata (object, __gst_controller_key, self); } else { // increment ref-count (this causes red-count-leaks //self = g_object_ref (self); @@ -730,7 +730,7 @@ gst_controller_get_all (GstController * self, gchar * property_name) } /** - * gst_controller_sink_values: + * gst_controller_sync_values: * @self: the controller that handles the values * @timestamp: the time that should be processed * @@ -742,7 +742,7 @@ gst_controller_get_all (GstController * self, gchar * property_name) * Since: 0.9 */ gboolean -gst_controller_sink_values (GstController * self, GstClockTime timestamp) +gst_controller_sync_values (GstController * self, GstClockTime timestamp) { GstControlledProperty *prop; GList *node; @@ -752,7 +752,7 @@ gst_controller_sink_values (GstController * self, GstClockTime timestamp) g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE); g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE); - GST_INFO ("sink_values"); + GST_INFO ("sync_values"); g_mutex_lock (self->lock); // go over the controlled properties of the controller @@ -954,7 +954,7 @@ _gst_controller_finalize (GObject * object) } g_mutex_free (self->lock); /* remove controller from objects qdata list */ - g_object_set_qdata (self->object, controller_key, NULL); + g_object_set_qdata (self->object, __gst_controller_key, NULL); if (G_OBJECT_CLASS (parent_class)->finalize) (G_OBJECT_CLASS (parent_class)->finalize) (object); @@ -978,7 +978,7 @@ _gst_controller_class_init (GstControllerClass * klass) gobject_class->finalize = _gst_controller_finalize; - controller_key = g_quark_from_string ("gst::controller"); + __gst_controller_key = g_quark_from_string ("gst::controller"); // register properties // register signals diff --git a/libs/gst/controller/gstcontroller.h b/libs/gst/controller/gstcontroller.h index 95fa19d91..ddc4a2d03 100644 --- a/libs/gst/controller/gstcontroller.h +++ b/libs/gst/controller/gstcontroller.h @@ -225,7 +225,7 @@ const GList *gst_controller_get_all (GstController * self, gchar * property_name); -gboolean gst_controller_sink_values (GstController * self, +gboolean gst_controller_sync_values (GstController * self, GstClockTime timestamp); gboolean gst_controller_get_value_arrays (GstController * self, @@ -245,7 +245,7 @@ gboolean gst_object_uncontrol_properties (GObject * object, ...); GstController *gst_object_get_controller (GObject * object); gboolean gst_object_set_controller (GObject * object, GstController * controller); -gboolean gst_object_sink_values (GObject * object, GstClockTime timestamp); +gboolean gst_object_sync_values (GObject * object, GstClockTime timestamp); gboolean gst_object_get_value_arrays (GObject * object, GstClockTime timestamp, GSList * value_arrays); diff --git a/libs/gst/controller/gsthelper.c b/libs/gst/controller/gsthelper.c index 67b19c5f9..7693984b2 100644 --- a/libs/gst/controller/gsthelper.c +++ b/libs/gst/controller/gsthelper.c @@ -35,7 +35,7 @@ #define GST_CAT_DEFAULT gst_controller_debug GST_DEBUG_CATEGORY_EXTERN (GST_CAT_DEFAULT); -extern GQuark controller_key; +extern GQuark __gst_controller_key; /** * gst_object_control_properties: @@ -88,7 +88,7 @@ gst_object_uncontrol_properties (GObject * object, ...) g_return_val_if_fail (G_IS_OBJECT (object), FALSE); - if ((ctrl = g_object_get_qdata (object, controller_key))) { + if ((ctrl = g_object_get_qdata (object, __gst_controller_key))) { va_list var_args; va_start (var_args, object); @@ -110,7 +110,7 @@ gst_object_get_controller (GObject * object) { g_return_val_if_fail (G_IS_OBJECT (object), FALSE); - return (g_object_get_qdata (object, controller_key)); + return (g_object_get_qdata (object, __gst_controller_key)); } /** @@ -131,33 +131,33 @@ gst_object_set_controller (GObject * object, GstController * controller) g_return_val_if_fail (G_IS_OBJECT (object), FALSE); g_return_val_if_fail (controller, FALSE); - if (!(ctrl = g_object_get_qdata (object, controller_key))) { - g_object_set_qdata (object, controller_key, controller); + if (!(ctrl = g_object_get_qdata (object, __gst_controller_key))) { + g_object_set_qdata (object, __gst_controller_key, controller); return (TRUE); } return (FALSE); } /** - * gst_object_sink_values: + * gst_object_sync_values: * @object: the object that has controlled properties * @timestamp: the time that should be processed * * Convenience function for GObject * - * Returns: same thing as gst_controller_sink_values() + * Returns: same thing as gst_controller_sync_values() * Since: 0.9 */ gboolean -gst_object_sink_values (GObject * object, GstClockTime timestamp) +gst_object_sync_values (GObject * object, GstClockTime timestamp) { GstController *ctrl = NULL; g_return_val_if_fail (G_IS_OBJECT (object), FALSE); g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE); - if ((ctrl = g_object_get_qdata (object, controller_key))) { - return gst_controller_sink_values (ctrl, timestamp); + if ((ctrl = g_object_get_qdata (object, __gst_controller_key))) { + return gst_controller_sync_values (ctrl, timestamp); } return (FALSE); } @@ -189,7 +189,7 @@ gst_object_get_value_arrays (GObject * object, GstClockTime timestamp, g_return_val_if_fail (G_IS_OBJECT (object), FALSE); g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE); - if ((ctrl = g_object_get_qdata (object, controller_key))) { + if ((ctrl = g_object_get_qdata (object, __gst_controller_key))) { return gst_controller_get_value_arrays (ctrl, timestamp, value_arrays); } return (FALSE); @@ -220,7 +220,7 @@ gst_object_get_value_array (GObject * object, GstClockTime timestamp, g_return_val_if_fail (G_IS_OBJECT (object), FALSE); g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE); - if ((ctrl = g_object_get_qdata (object, controller_key))) { + if ((ctrl = g_object_get_qdata (object, __gst_controller_key))) { return gst_controller_get_value_array (ctrl, timestamp, value_array); } return (FALSE); |