summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1c95693)
raw | patch | inline | side by side (parent: 1c95693)
author | Wim Taymans <wim.taymans@gmail.com> | |
Tue, 8 Mar 2005 17:42:29 +0000 (17:42 +0000) | ||
committer | Wim Taymans <wim.taymans@gmail.com> | |
Tue, 8 Mar 2005 17:42:29 +0000 (17:42 +0000) |
Original commit message from CVS:
Remove threadsafe properties. Fix elements because GObject
complains when installing a property before declaring a
set/get_property handler.
Rearrange gstelement.h file, use STATE macros for state locks.
Free mutexes in the finalize method instead of dispose.
Remove threadsafe properties. Fix elements because GObject
complains when installing a property before declaring a
set/get_property handler.
Rearrange gstelement.h file, use STATE macros for state locks.
Free mutexes in the finalize method instead of dispose.
34 files changed:
diff --git a/ChangeLog b/ChangeLog
index 189edca7e91f4eb6d12cb2a0f771de8bf327ba6d..1efc2fa1f259d9c6cedf003c85c3a264fb462d09 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2005-03-08 Wim Taymans <wim@fluendo.com>
+
+ * gst/elements/gstaggregator.c: (gst_aggregator_class_init):
+ * gst/elements/gstfakesink.c: (gst_fakesink_class_init):
+ * gst/elements/gstfakesrc.c: (gst_fakesrc_class_init):
+ * gst/elements/gstfdsink.c: (gst_fdsink_class_init):
+ * gst/elements/gstfdsrc.c: (gst_fdsrc_class_init):
+ * gst/elements/gstfilesink.c: (gst_filesink_class_init):
+ * gst/elements/gstfilesrc.c: (gst_filesrc_class_init):
+ * gst/elements/gstidentity.c: (gst_identity_class_init):
+ * gst/elements/gstmd5sink.c: (gst_md5sink_class_init):
+ * gst/elements/gstmultifilesrc.c: (gst_multifilesrc_class_init):
+ * gst/elements/gstshaper.c: (gst_shaper_class_init):
+ * gst/elements/gststatistics.c: (gst_statistics_class_init):
+ * gst/elements/gsttee.c: (gst_tee_class_init), (gst_tee_getcaps),
+ (gst_tee_link):
+ * gst/gstelement.c: (gst_element_class_init),
+ (gst_element_base_class_init), (gst_element_init),
+ (gst_element_get_random_pad), (gst_element_wait_state_change),
+ (gst_element_change_state), (gst_element_dispose),
+ (gst_element_finalize), (gst_element_set_loop_function):
+ * gst/gstelement.h:
+ * gst/gstqueue.c: (gst_queue_class_init), (gst_queue_link_src):
+ * gst/gstthread.c: (gst_thread_class_init),
+ (gst_thread_release_children_locks), (gst_thread_change_state):
+ * gst/schedulers/gstbasicscheduler.c:
+ (gst_basic_scheduler_loopfunc_wrapper),
+ (gst_basic_scheduler_chain_wrapper),
+ (gst_basic_scheduler_src_wrapper),
+ (gst_basic_scheduler_remove_element):
+ * gst/schedulers/gstoptimalscheduler.c: (schedule_group):
+ Remove threadsafe properties. Fix elements because GObject
+ complains when installing a property before declaring a
+ set/get_property handler.
+ Rearrange gstelement.h file, use STATE macros for state locks.
+ Free mutexes in the finalize method instead of dispose.
+
2005-03-08 Wim Taymans <wim@fluendo.com>
* check/gst/gstobject.c: (START_TEST), (gst_object_suite):
index 702bfb8144529f0d6226f966460f29603cb3fb76..ddd806cf51347a1366fb4a80cebd44ba271a8481 100644 (file)
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_aggregator_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_aggregator_get_property);
+
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NUM_PADS,
g_param_spec_int ("num_pads", "Num pads", "The number of source pads",
0, G_MAXINT, 0, G_PARAM_READABLE));
"The current state of the element", NULL, G_PARAM_READABLE));
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_aggregator_finalize);
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_aggregator_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_aggregator_get_property);
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_aggregator_request_new_pad);
index 851b6f9375732d1ae965b1c17b4825fd776f8ed3..fcf64b5d305bd248d1e9ff9ed06bf5f437fbdb1b 100644 (file)
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fakesink_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fakesink_get_property);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NUM_SINKS,
g_param_spec_int ("num_sinks", "Number of sinks",
gst_marshal_VOID__BOXED_OBJECT, G_TYPE_NONE, 2,
GST_TYPE_BUFFER | G_SIGNAL_TYPE_STATIC_SCOPE, GST_TYPE_PAD);
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fakesink_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fakesink_get_property);
-
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_fakesink_request_new_pad);
gstelement_class->set_clock = GST_DEBUG_FUNCPTR (gst_fakesink_set_clock);
index 780835e9a611ecc872ffb9e704f15aafa8212b74..82bb94f678a8ec56d9c8e60a6a1854fcf2e169a7 100644 (file)
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fakesrc_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fakesrc_get_property);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NUM_SOURCES,
g_param_spec_int ("num-sources", "num-sources", "Number of sources",
gst_marshal_VOID__BOXED_OBJECT, G_TYPE_NONE, 2,
GST_TYPE_BUFFER | G_SIGNAL_TYPE_STATIC_SCOPE, GST_TYPE_PAD);
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fakesrc_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fakesrc_get_property);
-
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_fakesrc_request_new_pad);
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_fakesrc_change_state);
index 411dd0a32e2f3314334644a752d64bf2870911e7..1fca02c387726b393a5abf5ec070a57aaf437194 100644 (file)
--- a/gst/elements/gstfdsink.c
+++ b/gst/elements/gstfdsink.c
gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->set_property = gst_fdsink_set_property;
+ gobject_class->get_property = gst_fdsink_get_property;
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD,
g_param_spec_int ("fd", "fd", "An open file descriptor to write to",
0, G_MAXINT, 1, G_PARAM_READWRITE));
-
- gobject_class->set_property = gst_fdsink_set_property;
- gobject_class->get_property = gst_fdsink_get_property;
}
static void
index ca33db3c254d8b87d7173b441e28d0f995d53c43..e658cd3a9d1847d976b20d9954ea689de93ca785 100644 (file)
--- a/gst/elements/gstfdsrc.c
+++ b/gst/elements/gstfdsrc.c
gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->set_property = gst_fdsrc_set_property;
+ gobject_class->get_property = gst_fdsrc_get_property;
+
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD,
g_param_spec_int ("fd", "fd", "An open file descriptor to read from",
0, G_MAXINT, 0, G_PARAM_READWRITE));
G_STRUCT_OFFSET (GstFdSrcClass, timeout), NULL, NULL,
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
- gobject_class->set_property = gst_fdsrc_set_property;
- gobject_class->get_property = gst_fdsrc_get_property;
-
gstelement_class->change_state = gst_fdsrc_change_state;
}
index a575d5a363826025ba24c84347659b4349b0d311..1386758a3cf836f9a8db8a5fe3df52f136f42a4b 100644 (file)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->set_property = gst_filesink_set_property;
+ gobject_class->get_property = gst_filesink_get_property;
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOCATION,
g_param_spec_string ("location", "File Location",
G_STRUCT_OFFSET (GstFileSinkClass, handoff), NULL, NULL,
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
- gobject_class->set_property = gst_filesink_set_property;
- gobject_class->get_property = gst_filesink_get_property;
gobject_class->dispose = gst_filesink_dispose;
}
static void
index 2a21eb6da0661f53c52cd382df1cceec9ac2726b..cddf90b400d6eff7b33e1fa070e6dec77ab17c18 100644 (file)
gobject_class = (GObjectClass *) klass;
+ gobject_class->set_property = gst_filesrc_set_property;
+ gobject_class->get_property = gst_filesrc_get_property;
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD,
g_param_spec_int ("fd", "File-descriptor",
"Touch data to force disk read", FALSE, G_PARAM_READWRITE));
gobject_class->dispose = gst_filesrc_dispose;
- gobject_class->set_property = gst_filesrc_set_property;
- gobject_class->get_property = gst_filesrc_get_property;
gstelement_class->change_state = gst_filesrc_change_state;
}
index 2b4c460636037e9fdb822e96d2c69d84642f25fb..909f4b9a95c77ebfe8396c01630986fbed46729b 100644 (file)
gobject_class = G_OBJECT_CLASS (klass);
gstelement_class = GST_ELEMENT_CLASS (klass);
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_identity_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_identity_get_property);
+
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOOP_BASED,
g_param_spec_boolean ("loop-based", "Loop-based",
"Set to TRUE to use loop-based rather than chain-based scheduling",
GST_TYPE_BUFFER | G_SIGNAL_TYPE_STATIC_SCOPE);
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_identity_finalize);
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_identity_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_identity_get_property);
gstelement_class->set_clock = GST_DEBUG_FUNCPTR (gst_identity_set_clock);
gstelement_class->change_state =
index 63c939e10a7c1ccfbbdaf3ea59d33507b60fd53d..4ebbb4c4f0517a1edbe6367a76ff20d965355f40 100644 (file)
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
-
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_md5sink_get_property);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MD5,
index f7818448658cb945ca084942079d85af0a937eba..ea951736c0c6aeb165af3eb752247d5b61d88160 100644 (file)
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
+ gobject_class->set_property = gst_multifilesrc_set_property;
+ gobject_class->get_property = gst_multifilesrc_get_property;
gst_multifilesrc_signals[NEW_FILE] =
g_signal_new ("new-file", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
-
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOCATIONS, g_param_spec_pointer ("locations", "locations", "locations", G_PARAM_READWRITE)); /* CHECKME */
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_HAVENEWMEDIA,
g_param_spec_boolean ("newmedia", "newmedia",
"generate new media events?", FALSE, G_PARAM_READWRITE));
-
- gobject_class->set_property = gst_multifilesrc_set_property;
- gobject_class->get_property = gst_multifilesrc_get_property;
-
gstelement_class->change_state = gst_multifilesrc_change_state;
}
index 9b4f19bb6d533d42c97a04d1f007af567af24936..c14ab36a18fc5c8ec07a5dcfa4077fb1800bce27 100644 (file)
--- a/gst/elements/gstshaper.c
+++ b/gst/elements/gstshaper.c
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_shaper_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_shaper_get_property);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_POLICY,
g_param_spec_enum ("policy", "Policy", "Shaper policy",
g_param_spec_string ("last-message", "last-message", "last-message",
NULL, G_PARAM_READABLE));
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_shaper_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_shaper_get_property);
-
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_shaper_request_new_pad);
}
index 82744ff6f4af56db0d7b5d8ce107a387396a0f6b..ef6cca3bcaa0e1e26dc016065daf83a16c72da2d 100644 (file)
gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_statistics_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_statistics_get_property);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BUFFERS,
g_param_spec_int64 ("buffers", "buffers", "total buffers count",
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_statistics_finalize);
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_statistics_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_statistics_get_property);
}
static void
diff --git a/gst/elements/gsttee.c b/gst/elements/gsttee.c
index eec45860474643d92b609a6232d96db872b645cf..94887582b54c18708fc73cfefd1e4f176bf3720c 100644 (file)
--- a/gst/elements/gsttee.c
+++ b/gst/elements/gsttee.c
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_tee_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_tee_get_property);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NUM_PADS,
g_param_spec_int ("num_pads", "num_pads", "num_pads",
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_tee_finalize);
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_tee_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_tee_get_property);
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_tee_request_new_pad);
diff --git a/gst/gstelement.c b/gst/gstelement.c
index 92b59c30a916beb08477b46ce9709603d0c7f81a..407cd6aaa111aace51053777fde47fbddee055cb 100644 (file)
--- a/gst/gstelement.c
+++ b/gst/gstelement.c
static void gst_element_base_class_init (gpointer g_class);
static void gst_element_base_class_finalize (gpointer g_class);
-static void gst_element_real_set_property (GObject * object, guint prop_id,
- const GValue * value, GParamSpec * pspec);
-static void gst_element_real_get_property (GObject * object, guint prop_id,
- GValue * value, GParamSpec * pspec);
-
static void gst_element_dispose (GObject * object);
static void gst_element_finalize (GObject * object);
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstElementClass, no_more_pads), NULL,
NULL, gst_marshal_VOID__VOID, G_TYPE_NONE, 0);
- gobject_class->set_property =
- GST_DEBUG_FUNCPTR (gst_element_real_set_property);
- gobject_class->get_property =
- GST_DEBUG_FUNCPTR (gst_element_real_get_property);
-
gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_element_dispose);
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_element_finalize);
static void
gst_element_base_class_init (gpointer g_class)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (g_class);
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
-
- gobject_class->set_property =
- GST_DEBUG_FUNCPTR (gst_element_real_set_property);
- gobject_class->get_property =
- GST_DEBUG_FUNCPTR (gst_element_real_get_property);
-
memset (&element_class->details, 0, sizeof (GstElementDetails));
element_class->padtemplates = NULL;
}
element->sched = NULL;
element->clock = NULL;
element->sched_private = NULL;
- element->state_mutex = g_mutex_new ();
+ element->state_lock = g_mutex_new ();
element->state_cond = g_cond_new ();
}
-static void
-gst_element_real_set_property (GObject * object, guint prop_id,
- const GValue * value, GParamSpec * pspec)
-{
- GstElementClass *oclass = GST_ELEMENT_GET_CLASS (object);
-
- if (oclass->set_property)
- (oclass->set_property) (object, prop_id, value, pspec);
-}
-
-static void
-gst_element_real_get_property (GObject * object, guint prop_id, GValue * value,
- GParamSpec * pspec)
-{
- GstElementClass *oclass = GST_ELEMENT_GET_CLASS (object);
-
- if (oclass->get_property)
- (oclass->get_property) (object, prop_id, value, pspec);
-}
-
/**
* gst_element_default_error:
* @object: a #GObject that signalled the error.
@@ -323,408 +286,6 @@ gst_element_default_error (GObject * object, GstObject * source, GError * error,
g_free (name);
}
-typedef struct
-{
- const GParamSpec *pspec;
- GValue value;
-}
-prop_value_t;
-
-static void
-element_set_property (GstElement * element, const GParamSpec * pspec,
- const GValue * value)
-{
- prop_value_t *prop_value = g_new0 (prop_value_t, 1);
-
- prop_value->pspec = pspec;
- prop_value->value = *value;
-
- g_async_queue_push (element->prop_value_queue, prop_value);
-}
-
-static void
-element_get_property (GstElement * element, const GParamSpec * pspec,
- GValue * value)
-{
- g_mutex_lock (element->property_mutex);
- g_object_get_property ((GObject *) element, pspec->name, value);
- g_mutex_unlock (element->property_mutex);
-}
-
-static void
-gst_element_threadsafe_properties_pre_run (GstElement * element)
-{
- /* need to ref the object because we don't want to lose the object
- * before the post run function is called */
- gst_object_ref (GST_OBJECT (element));
- GST_DEBUG ("locking element %s", GST_OBJECT_NAME (element));
- g_mutex_lock (element->property_mutex);
- gst_element_set_pending_properties (element);
-}
-
-static void
-gst_element_threadsafe_properties_post_run (GstElement * element)
-{
- GST_DEBUG ("unlocking element %s", GST_OBJECT_NAME (element));
- g_mutex_unlock (element->property_mutex);
- gst_object_unref (GST_OBJECT (element));
-}
-
-/**
- * gst_element_enable_threadsafe_properties:
- * @element: a #GstElement to enable threadsafe properties on.
- *
- * Installs an asynchronous queue, a mutex and pre- and post-run functions on
- * this element so that properties on the element can be set in a
- * threadsafe way.
- */
-void
-gst_element_enable_threadsafe_properties (GstElement * element)
-{
- g_return_if_fail (GST_IS_ELEMENT (element));
-
- GST_FLAG_SET (element, GST_ELEMENT_USE_THREADSAFE_PROPERTIES);
- element->pre_run_func = gst_element_threadsafe_properties_pre_run;
- element->post_run_func = gst_element_threadsafe_properties_post_run;
- if (!element->prop_value_queue)
- element->prop_value_queue = g_async_queue_new ();
- if (!element->property_mutex)
- element->property_mutex = g_mutex_new ();
-}
-
-/**
- * gst_element_disable_threadsafe_properties:
- * @element: a #GstElement to disable threadsafe properties on.
- *
- * Removes the threadsafe properties, post- and pre-run locks from
- * this element.
- */
-void
-gst_element_disable_threadsafe_properties (GstElement * element)
-{
- g_return_if_fail (GST_IS_ELEMENT (element));
-
- GST_FLAG_UNSET (element, GST_ELEMENT_USE_THREADSAFE_PROPERTIES);
-
- //element->pre_run_func = NULL;
- //element->post_run_func = NULL;
- /* let's keep around that async queue */
-}
-
-/**
- * gst_element_set_pending_properties:
- * @element: a #GstElement to set the pending properties on.
- *
- * Sets all pending properties on the threadsafe properties enabled
- * element.
- */
-void
-gst_element_set_pending_properties (GstElement * element)
-{
- prop_value_t *prop_value;
-
- while ((prop_value = g_async_queue_try_pop (element->prop_value_queue))) {
- g_object_set_property ((GObject *) element, prop_value->pspec->name,
- &prop_value->value);
- g_value_unset (&prop_value->value);
- g_free (prop_value);
- }
-}
-
-/* following 6 functions taken mostly from gobject.c */
-
-/**
- * gst_element_set:
- * @element: a #GstElement to set properties on.
- * @first_property_name: the first property to set.
- * @...: value of the first property, and more properties to set, ending
- * with NULL.
- *
- * Sets properties on an element. If the element uses threadsafe properties,
- * they will be queued and set on the object when it is scheduled again.
- */
-void
-gst_element_set (GstElement * element, const gchar * first_property_name, ...)
-{
- va_list var_args;
-
- g_return_if_fail (GST_IS_ELEMENT (element));
-
- va_start (var_args, first_property_name);
- gst_element_set_valist (element, first_property_name, var_args);
- va_end (var_args);
-}
-
-/**
- * gst_element_get:
- * @element: a #GstElement to get properties of.
- * @first_property_name: the first property to get.
- * @...: pointer to a variable to store the first property in, as well as
- * more properties to get, ending with NULL.
- *
- * Gets properties from an element. If the element uses threadsafe properties,
- * the element will be locked before getting the given properties.
- */
-void
-gst_element_get (GstElement * element, const gchar * first_property_name, ...)
-{
- va_list var_args;
-
- g_return_if_fail (GST_IS_ELEMENT (element));
-
- va_start (var_args, first_property_name);
- gst_element_get_valist (element, first_property_name, var_args);
- va_end (var_args);
-}
-
-/**
- * gst_element_set_valist:
- * @element: a #GstElement to set properties on.
- * @first_property_name: the first property to set.
- * @var_args: the var_args list of other properties to get.
- *
- * Sets properties on an element. If the element uses threadsafe properties,
- * the property change will be put on the async queue.
- */
-void
-gst_element_set_valist (GstElement * element, const gchar * first_property_name,
- va_list var_args)
-{
- const gchar *name;
- GObject *object;
-
- g_return_if_fail (GST_IS_ELEMENT (element));
-
- object = (GObject *) element;
-
- GST_CAT_DEBUG (GST_CAT_PROPERTIES,
- "setting valist of properties starting with %s on element %s",
- first_property_name, gst_element_get_name (element));
-
- if (!GST_FLAG_IS_SET (element, GST_ELEMENT_USE_THREADSAFE_PROPERTIES)) {
- g_object_set_valist (object, first_property_name, var_args);
- return;
- }
-
- g_object_ref (object);
-
- name = first_property_name;
-
- while (name) {
- GValue value = { 0, };
- GParamSpec *pspec;
- gchar *error = NULL;
-
- pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object), name);
-
- if (!pspec) {
- g_warning ("%s: object class `%s' has no property named `%s'",
- G_STRLOC, G_OBJECT_TYPE_NAME (object), name);
- break;
- }
- if (!(pspec->flags & G_PARAM_WRITABLE)) {
- g_warning ("%s: property `%s' of object class `%s' is not writable",
- G_STRLOC, pspec->name, G_OBJECT_TYPE_NAME (object));
- break;
- }
-
- g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
-
- G_VALUE_COLLECT (&value, var_args, 0, &error);
- if (error) {
- g_warning ("%s: %s", G_STRLOC, error);
- g_free (error);
-
- /* we purposely leak the value here, it might not be
- * in a sane state if an error condition occoured
- */
- break;
- }
-
- element_set_property (element, pspec, &value);
- g_value_unset (&value);
-
- name = va_arg (var_args, gchar *);
- }
-
- g_object_unref (object);
-}
-
-/**
- * gst_element_get_valist:
- * @element: a #GstElement to get properties of.
- * @first_property_name: the first property to get.
- * @var_args: the var_args list of other properties to get.
- *
- * Gets properties from an element. If the element uses threadsafe properties,
- * the element will be locked before getting the given properties.
- */
-void
-gst_element_get_valist (GstElement * element, const gchar * first_property_name,
- va_list var_args)
-{
- const gchar *name;
- GObject *object;
-
- g_return_if_fail (GST_IS_ELEMENT (element));
-
- object = (GObject *) element;
-
- if (!GST_FLAG_IS_SET (element, GST_ELEMENT_USE_THREADSAFE_PROPERTIES)) {
- g_object_get_valist (object, first_property_name, var_args);
- return;
- }
-
- g_object_ref (object);
-
- name = first_property_name;
-
- while (name) {
- GValue value = { 0, };
- GParamSpec *pspec;
- gchar *error;
-
- pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object), name);
-
- if (!pspec) {
- g_warning ("%s: object class `%s' has no property named `%s'",
- G_STRLOC, G_OBJECT_TYPE_NAME (object), name);
- break;
- }
- if (!(pspec->flags & G_PARAM_READABLE)) {
- g_warning ("%s: property `%s' of object class `%s' is not readable",
- G_STRLOC, pspec->name, G_OBJECT_TYPE_NAME (object));
- break;
- }
-
- g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
-
- element_get_property (element, pspec, &value);
-
- G_VALUE_LCOPY (&value, var_args, 0, &error);
- if (error) {
- g_warning ("%s: %s", G_STRLOC, error);
- g_free (error);
- g_value_unset (&value);
- break;
- }
-
- g_value_unset (&value);
-
- name = va_arg (var_args, gchar *);
- }
-
- g_object_unref (object);
-}
-
-/**
- * gst_element_set_property:
- * @element: a #GstElement to set properties on.
- * @property_name: the first property to get.
- * @value: the #GValue that holds the value to set.
- *
- * Sets a property on an element. If the element uses threadsafe properties,
- * the property will be put on the async queue.
- */
-void
-gst_element_set_property (GstElement * element, const gchar * property_name,
- const GValue * value)
-{
- GParamSpec *pspec;
- GObject *object;
-
- g_return_if_fail (GST_IS_ELEMENT (element));
- g_return_if_fail (property_name != NULL);
- g_return_if_fail (G_IS_VALUE (value));
-
- object = (GObject *) element;
-
- GST_CAT_DEBUG (GST_CAT_PROPERTIES, "setting property %s on element %s",
- property_name, gst_element_get_name (element));
- if (!GST_FLAG_IS_SET (element, GST_ELEMENT_USE_THREADSAFE_PROPERTIES)) {
- g_object_set_property (object, property_name, value);
- return;
- }
-
- g_object_ref (object);
-
- pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object),
- property_name);
-
- if (!pspec)
- g_warning ("%s: object class `%s' has no property named `%s'",
- G_STRLOC, G_OBJECT_TYPE_NAME (object), property_name);
- else
- element_set_property (element, pspec, value);
-
- g_object_unref (object);
-}
-
-/**
- * gst_element_get_property:
- * @element: a #GstElement to get properties of.
- * @property_name: the first property to get.
- * @value: the #GValue to store the property value in.
- *
- * Gets a property from an element. If the element uses threadsafe properties,
- * the element will be locked before getting the given property.
- */
-void
-gst_element_get_property (GstElement * element, const gchar * property_name,
- GValue * value)
-{
- GParamSpec *pspec;
- GObject *object;
-
- g_return_if_fail (GST_IS_ELEMENT (element));
- g_return_if_fail (property_name != NULL);
- g_return_if_fail (G_IS_VALUE (value));
-
- object = (GObject *) element;
-
- if (!GST_FLAG_IS_SET (element, GST_ELEMENT_USE_THREADSAFE_PROPERTIES)) {
- g_object_get_property (object, property_name, value);
- return;
- }
-
- g_object_ref (object);
-
- pspec =
- g_object_class_find_property (G_OBJECT_GET_CLASS (object), property_name);
-
- if (!pspec)
- g_warning ("%s: object class `%s' has no property named `%s'",
- G_STRLOC, G_OBJECT_TYPE_NAME (object), property_name);
- else {
- GValue *prop_value, tmp_value = { 0, };
-
- /* auto-conversion of the callers value type
- */
- if (G_VALUE_TYPE (value) == G_PARAM_SPEC_VALUE_TYPE (pspec)) {
- g_value_reset (value);
- prop_value = value;
- } else if (!g_value_type_transformable (G_PARAM_SPEC_VALUE_TYPE (pspec),
- G_VALUE_TYPE (value))) {
- g_warning
- ("can't retrieve property `%s' of type `%s' as value of type `%s'",
- pspec->name, g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)),
- G_VALUE_TYPE_NAME (value));
- g_object_unref (object);
- return;
- } else {
- g_value_init (&tmp_value, G_PARAM_SPEC_VALUE_TYPE (pspec));
- prop_value = &tmp_value;
- }
- element_get_property (element, pspec, prop_value);
- if (prop_value != value) {
- g_value_transform (prop_value, value);
- g_value_unset (&tmp_value);
- }
- }
-
- g_object_unref (object);
-}
-
/**
* gst_element_release_request_pad:
* @element: a #GstElement to release the request pad of.
*
* Retrieves an iterattor of @element's pads.
*
- * Returns: the #GstIterator of pads.
+ * Returns: the #GstIterator of #GstPad. unref each pad after usage.
*
* MT safe.
*/
GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "getting a random pad");
- GST_LOCK (element);
switch (dir) {
case GST_PAD_SRC:
+ GST_LOCK (element);
pads = element->srcpads;
break;
case GST_PAD_SINK:
+ GST_LOCK (element);
pads = element->sinkpads;
break;
default:
- g_warning ("unknown pad direction");
- return NULL;
+ goto wrong_direction;
}
for (; pads; pads = g_list_next (pads)) {
GstPad *pad = GST_PAD (pads->data);
GST_UNLOCK (element);
return result;
+
+ /* ERROR handling */
+wrong_direction:
+ {
+ g_warning ("unknown pad direction");
+ return NULL;
+ }
}
/**
void
gst_element_wait_state_change (GstElement * element)
{
- g_mutex_lock (element->state_mutex);
- g_cond_wait (element->state_cond, element->state_mutex);
- g_mutex_unlock (element->state_mutex);
+ GST_STATE_LOCK (element);
+ GST_STATE_WAIT (element);
+ GST_STATE_UNLOCK (element);
}
/**
0, old_state, GST_STATE (element));
/* signal the state change in case somebody is waiting for us */
- g_cond_signal (element->state_cond);
+ GST_STATE_BROADCAST (element);
gst_object_unref (GST_OBJECT (element));
return GST_STATE_SUCCESS;
element->numsrcpads = 0;
element->numsinkpads = 0;
element->numpads = 0;
- if (element->state_mutex)
- g_mutex_free (element->state_mutex);
- element->state_mutex = NULL;
- if (element->state_cond)
- g_cond_free (element->state_cond);
- element->state_cond = NULL;
-
- if (element->prop_value_queue)
- g_async_queue_unref (element->prop_value_queue);
- element->prop_value_queue = NULL;
- if (element->property_mutex)
- g_mutex_free (element->property_mutex);
- element->property_mutex = NULL;
gst_object_replace ((GstObject **) & element->sched, NULL);
gst_object_replace ((GstObject **) & element->clock, NULL);
static void
gst_element_finalize (GObject * object)
{
- //GstElement *element = GST_ELEMENT (object);
+ GstElement *element = GST_ELEMENT (object);
+
+ g_mutex_free (element->state_lock);
+ g_cond_free (element->state_cond);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
diff --git a/gst/gstelement.h b/gst/gstelement.h
index 11305664c6b536780de2638dd3fbef5c94420245..be09bb0f74801f9367a627781c124b066c8c6014 100644 (file)
--- a/gst/gstelement.h
+++ b/gst/gstelement.h
/* GStreamer
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
- * 2000 Wim Taymans <wtay@chello.be>
- * 2004 Wim Taymans <wim@fluendo.com>
+ * 2000,2004 Wim Taymans <wim@fluendo.com>
*
* gstelement.h: Header for GstElement
*
GST_ELEMENT_NEW_LOOPFUNC,
/* if this element can handle events */
GST_ELEMENT_EVENT_AWARE,
- /* use threadsafe property get/set implementation */
- GST_ELEMENT_USE_THREADSAFE_PROPERTIES,
-
/* private flags that can be used by the scheduler */
GST_ELEMENT_SCHEDULER_PRIVATE1,
#define GST_ELEMENT_NAME(obj) (GST_OBJECT_NAME(obj))
#define GST_ELEMENT_PARENT(obj) (GST_OBJECT_PARENT(obj))
-#define GST_ELEMENT_SCHEDULER(obj) (((GstElement*)(obj))->sched)
-#define GST_ELEMENT_CLOCK(obj) (((GstElement*)(obj))->clock)
-#define GST_ELEMENT_PADS(obj) ((obj)->pads)
+#define GST_ELEMENT_SCHEDULER(obj) (GST_ELEMENT_CAST(obj)->sched)
+#define GST_ELEMENT_CLOCK(obj) (GST_ELEMENT_CAST(obj)->clock)
+#define GST_ELEMENT_PADS(obj) (GST_ELEMENT_CAST(obj)->pads)
/**
* GST_ELEMENT_ERROR:
* data processing error. The pipeline will throw an error signal and the
* application will be requested to stop further media processing.
*/
-#define GST_ELEMENT_ERROR(el, domain, code, message, debug) G_STMT_START { \
- gchar *__msg = _gst_element_error_printf message; \
- gchar *__dbg = _gst_element_error_printf debug; \
- if (__msg) \
- GST_ERROR_OBJECT (el, "%s", __msg); \
- if (__dbg) \
- GST_ERROR_OBJECT (el, "%s", __dbg); \
- gst_element_error_full (GST_ELEMENT(el), \
- GST_ ## domain ## _ERROR, GST_ ## domain ## _ERROR_ ## code, \
- __msg, __dbg, __FILE__, GST_FUNCTION, __LINE__); \
+#define GST_ELEMENT_ERROR(el, domain, code, message, debug) \
+G_STMT_START { \
+ gchar *__msg = _gst_element_error_printf message; \
+ gchar *__dbg = _gst_element_error_printf debug; \
+ if (__msg) \
+ GST_ERROR_OBJECT (el, "%s", __msg); \
+ if (__dbg) \
+ GST_ERROR_OBJECT (el, "%s", __dbg); \
+ gst_element_error_full (GST_ELEMENT(el), \
+ GST_ ## domain ## _ERROR, GST_ ## domain ## _ERROR_ ## code, \
+ __msg, __dbg, __FILE__, GST_FUNCTION, __LINE__); \
} G_STMT_END
typedef struct _GstElementFactory GstElementFactory;
typedef struct _GstElementFactoryClass GstElementFactoryClass;
typedef void (*GstElementLoopFunction) (GstElement *element);
-typedef void (*GstElementPreRunFunction) (GstElement *element);
-typedef void (*GstElementPostRunFunction) (GstElement *element);
-struct _GstElement {
+/* the state change mutexes and conds */
+#define GST_STATE_GET_LOCK(elem) (GST_ELEMENT_CAST(elem)->state_lock)
+#define GST_STATE_LOCK(elem) g_mutex_lock(GST_STATE_GET_LOCK(elem))
+#define GST_STATE_TRYLOCK(elem) g_mutex_trylock(GST_STATE_GET_LOCK(elem))
+#define GST_STATE_UNLOCK(elem) g_mutex_unlock(GST_STATE_GET_LOCK(elem))
+#define GST_STATE_GET_COND(elem) (GST_ELEMENT_CAST(elem)->state_cond)
+#define GST_STATE_WAIT(elem) g_cond_wait (GST_STATE_GET_COND (elem), GST_STATE_GET_LOCK (elem))
+#define GST_STATE_TIMED_WAIT(elem, timeval) g_cond_timed_wait (GST_STATE_GET_COND (elem), GST_STATE_GET_LOCK (elem),\
+ timeval)
+#define GST_STATE_SIGNAL(elem) g_cond_signal (GST_STATE_GET_COND (elem));
+#define GST_STATE_BROADCAST(elem) g_cond_broadcast (GST_STATE_GET_COND (elem));
+
+struct _GstElement
+{
GstObject object;
- /* element state and scheduling */
- guint8 current_state;
- guint8 pending_state;
+ /*< public >*/ /* with STATE_LOCK */
+ /* element state */
+ GMutex *state_lock;
+ GCond *state_cond;
+ guint8 current_state;
+ guint8 pending_state;
+ gboolean state_error; /* flag is set when the element has an error in the last state
+ change. it is cleared when doing another state change. */
+ /*< public >*/ /* with LOCK */
+ /* scheduling */
GstElementLoopFunction loopfunc;
-
- GstScheduler *sched;
+ GstScheduler *sched;
+ /* private pointer for the scheduler */
gpointer sched_private;
/* allocated clock */
- GstClock *clock;
+ GstClock *clock;
GstClockTimeDiff base_time; /* NULL/READY: 0 - PAUSED: current time - PLAYING: difference to clock */
- /* element pads, these lists can only be iterated while holding
+ /* element pads, these lists can only be iterated while holding
* the LOCK or checking the cookie after each LOCK. */
- guint16 numpads;
- GList *pads;
- guint16 numsrcpads;
- GList *srcpads;
- guint16 numsinkpads;
- GList *sinkpads;
- guint32 pads_cookie;
-
- GMutex *state_mutex;
- GCond *state_cond;
-
- GstElementPreRunFunction pre_run_func;
- GstElementPostRunFunction post_run_func;
- GAsyncQueue *prop_value_queue;
- GMutex *property_mutex;
-
+ guint16 numpads;
+ GList *pads;
+ guint16 numsrcpads;
+ GList *srcpads;
+ guint16 numsinkpads;
+ GList *sinkpads;
+ guint32 pads_cookie;
+
+ /*< private >*/
gpointer _gst_reserved[GST_PADDING];
};
struct _GstElementClass
{
- GstObjectClass parent_class;
+ GstObjectClass parent_class;
- /*< public > */
+ /*< public >*/
/* the element details */
- GstElementDetails details;
+ GstElementDetails details;
/* factory that the element was created from */
GstElementFactory *elementfactory;
/* templates for our pads */
- GList *padtemplates;
- gint numpadtemplates;
- guint32 pad_templ_cookie;
+ GList *padtemplates;
+ gint numpadtemplates;
+ guint32 pad_templ_cookie;
/* signal callbacks */
void (*state_change) (GstElement *element, GstElementState old, GstElementState state);
void (*new_pad) (GstElement *element, GstPad *pad);
void (*pad_removed) (GstElement *element, GstPad *pad);
+ void (*no_more_pads) (GstElement *element);
void (*error) (GstElement *element, GstElement *source, GError *error, gchar *debug);
void (*eos) (GstElement *element);
void (*found_tag) (GstElement *element, GstElement *source, const GstTagList *tag_list);
- /* local pointers for get/set */
- void (*set_property) (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
- void (*get_property) (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-
+ /*< protected >*/
/* vtable*/
- gboolean (*release_locks) (GstElement *element);
-
- /* query/convert/events functions */
- const GstEventMask* (*get_event_masks) (GstElement *element);
- gboolean (*send_event) (GstElement *element, GstEvent *event);
- const GstFormat* (*get_formats) (GstElement *element);
- gboolean (*convert) (GstElement *element,
- GstFormat src_format, gint64 src_value,
- GstFormat *dest_format, gint64 *dest_value);
- const GstQueryType* (*get_query_types) (GstElement *element);
- gboolean (*query) (GstElement *element, GstQueryType type,
- GstFormat *format, gint64 *value);
-
- /* change the element state */
- GstElementStateReturn (*change_state) (GstElement *element);
/* request/release pads */
GstPad* (*request_new_pad) (GstElement *element, GstPadTemplate *templ, const gchar* name);
void (*release_pad) (GstElement *element, GstPad *pad);
+ /* state changes */
+ GstElementStateReturn (*change_state) (GstElement *element);
+ GstElementStateReturn (*set_state) (GstElement *element, GstElementState state);
+
+ /* scheduling */
+ gboolean (*release_locks) (GstElement *element);
+ void (*set_scheduler) (GstElement *element, GstScheduler *scheduler);
+
/* set/get clocks */
GstClock* (*get_clock) (GstElement *element);
void (*set_clock) (GstElement *element, GstClock *clock);
GstIndex* (*get_index) (GstElement *element);
void (*set_index) (GstElement *element, GstIndex *index);
- /* scheduler */
- void (*set_scheduler) (GstElement *element, GstScheduler *scheduler);
-
- GstElementStateReturn (*set_state) (GstElement *element, GstElementState state);
-
- /* FIXME 0.9: move up to signals */
- void (*no_more_pads) (GstElement *element);
-
- gpointer _gst_reserved[GST_PADDING - 1];
+ /* query/convert/events functions */
+ const GstEventMask* (*get_event_masks) (GstElement *element);
+ gboolean (*send_event) (GstElement *element, GstEvent *event);
+ const GstFormat* (*get_formats) (GstElement *element);
+ gboolean (*convert) (GstElement *element,
+ GstFormat src_format, gint64 src_value,
+ GstFormat *dest_format, gint64 *dest_value);
+ const GstQueryType* (*get_query_types) (GstElement *element);
+ gboolean (*query) (GstElement *element, GstQueryType type,
+ GstFormat *format, gint64 *value);
+ /*< private >*/
+ gpointer _gst_reserved[GST_PADDING];
};
-GType gst_element_get_type (void);
-
/* element class pad templates */
void gst_element_class_add_pad_template (GstElementClass *klass, GstPadTemplate *templ);
GstPadTemplate* gst_element_class_get_pad_template (GstElementClass *element_class, const gchar *name);
GList* gst_element_class_get_pad_template_list (GstElementClass *element_class);
-
-/* element class details */
void gst_element_class_set_details (GstElementClass *klass,
const GstElementDetails *details);
-#define gst_element_default_deep_notify gst_object_default_deep_notify
-
-void gst_element_default_error (GObject *object, GstObject *orig, GError *error, gchar *debug);
-
-void gst_element_set_loop_function (GstElement *element,
- GstElementLoopFunction loop);
+/* element instance */
+GType gst_element_get_type (void);
+/* basic name and parentage stuff from GstObject */
#define gst_element_get_name(elem) gst_object_get_name(GST_OBJECT(elem))
#define gst_element_set_name(elem,name) gst_object_set_name(GST_OBJECT(elem),name)
#define gst_element_get_parent(elem) gst_object_get_parent(GST_OBJECT(elem))
#define gst_element_set_parent(elem,parent) gst_object_set_parent(GST_OBJECT(elem),parent)
-/* threadsafe versions of their g_object_* counterparts */
-void gst_element_set (GstElement *element, const gchar *first_property_name, ...);
-void gst_element_get (GstElement *element, const gchar *first_property_name, ...);
-void gst_element_set_valist (GstElement *element, const gchar *first_property_name,
- va_list var_args);
-void gst_element_get_valist (GstElement *element, const gchar *first_property_name,
- va_list var_args);
-void gst_element_set_property (GstElement *element, const gchar *property_name,
- const GValue *value);
-void gst_element_get_property (GstElement *element, const gchar *property_name,
- GValue *value);
-
-void gst_element_enable_threadsafe_properties (GstElement *element);
-void gst_element_disable_threadsafe_properties (GstElement *element);
-void gst_element_set_pending_properties (GstElement *element);
-
/* clocking */
gboolean gst_element_requires_clock (GstElement *element);
gboolean gst_element_provides_clock (GstElement *element);
void gst_element_set_time_delay (GstElement *element, GstClockTime time, GstClockTime delay);
void gst_element_adjust_time (GstElement *element, GstClockTimeDiff diff);
-
-/* indexs */
+
+/* indexes */
gboolean gst_element_is_indexable (GstElement *element);
void gst_element_set_index (GstElement *element, GstIndex *index);
GstIndex* gst_element_get_index (GstElement *element);
+/* scheduling */
+void gst_element_set_loop_function (GstElement *element,
+ GstElementLoopFunction loop);
gboolean gst_element_release_locks (GstElement *element);
-
void gst_element_yield (GstElement *element);
gboolean gst_element_interrupt (GstElement *element);
void gst_element_set_scheduler (GstElement *element, GstScheduler *sched);
GstScheduler* gst_element_get_scheduler (GstElement *element);
+GstBin* gst_element_get_managing_bin (GstElement *element);
+/* pad management */
gboolean gst_element_add_pad (GstElement *element, GstPad *pad);
gboolean gst_element_remove_pad (GstElement *element, GstPad *pad);
GstPad * gst_element_add_ghost_pad (GstElement *element, GstPad *pad, const gchar *name);
GstIterator * gst_element_iterate_pads (GstElement * element);
+/* event/query/format stuff */
G_CONST_RETURN GstEventMask*
gst_element_get_event_masks (GstElement *element);
gboolean gst_element_send_event (GstElement *element, GstEvent *event);
GstFormat src_format, gint64 src_value,
GstFormat *dest_format, gint64 *dest_value);
-void gst_element_found_tags (GstElement *element, const GstTagList *tag_list);
-void gst_element_found_tags_for_pad (GstElement *element, GstPad *pad, GstClockTime timestamp,
- GstTagList *list);
-
-void gst_element_set_eos (GstElement *element);
-
+/* error handling */
gchar * _gst_element_error_printf (const gchar *format, ...);
void gst_element_error_full (GstElement *element, GQuark domain, gint code,
gchar *message, gchar *debug,
const gchar *file, const gchar *function, gint line);
+void gst_element_default_error (GObject *object, GstObject *orig, GError *error, gchar *debug);
+#define gst_element_default_deep_notify gst_object_default_deep_notify
+
+/* state management */
+void gst_element_set_eos (GstElement *element);
gboolean gst_element_is_locked_state (GstElement *element);
gboolean gst_element_set_locked_state (GstElement *element, gboolean locked_state);
GstElementStateReturn gst_element_set_state (GstElement *element, GstElementState state);
void gst_element_wait_state_change (GstElement *element);
-
-GstElementFactory* gst_element_get_factory (GstElement *element);
-GstBin* gst_element_get_managing_bin (GstElement *element);
+/* factory management */
+GstElementFactory* gst_element_get_factory (GstElement *element);
+/* misc */
+void gst_element_found_tags (GstElement *element, const GstTagList *tag_list);
+void gst_element_found_tags_for_pad (GstElement *element, GstPad *pad, GstClockTime timestamp,
+ GstTagList *list);
/*
*
* factories stuff
void __gst_element_factory_add_interface (GstElementFactory *elementfactory,
const gchar *interfacename);
-
G_END_DECLS
-
#endif /* __GST_ELEMENT_H__ */
diff --git a/gst/gstqueue.c b/gst/gstqueue.c
index 0ed213dd70d575d64887d9eed798ade8b453f1f3..ac889f4ef2af56c29faec3fd6a685a24b8de0b1e 100644 (file)
--- a/gst/gstqueue.c
+++ b/gst/gstqueue.c
parent_class = g_type_class_peek_parent (klass);
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_queue_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_queue_get_property);
+
/* signals */
gst_queue_signals[SIGNAL_UNDERRUN] =
g_signal_new ("underrun", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST,
/* set several parent class virtual functions */
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_queue_finalize);
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_queue_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_queue_get_property);
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_queue_change_state);
gstelement_class->release_locks = GST_DEBUG_FUNCPTR (gst_queue_release_locks);
diff --git a/gst/gstthread.c b/gst/gstthread.c
index cd9ba51e7b39d1b9bdeb1eb14177bf7705cd2130..2a6c5865c4f16dbd4e3935f097ebbf46492eedf2 100644 (file)
--- a/gst/gstthread.c
+++ b/gst/gstthread.c
parent_class = g_type_class_peek_parent (g_class);
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_thread_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_thread_get_property);
+
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PRIORITY,
g_param_spec_enum ("priority", "Scheduling Policy",
"The scheduling priority of the thread", GST_TYPE_THREAD_PRIORITY,
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_thread_change_state);
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_thread_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_thread_get_property);
-
gstbin_class->child_state_change =
GST_DEBUG_FUNCPTR (gst_thread_child_state_change);
}
break;
case GST_STATE_PAUSED_TO_PLAYING:
{
- /* FIXME: recurse into sub-bins. not MT safe but gstthread is going
- * away soon. */
- GList *elements = (GList *) GST_BIN (thread)->children;
-
- while (elements) {
- gst_element_enable_threadsafe_properties ((GstElement *) elements->
- data);
- elements = g_list_next (elements);
- }
/* reset self to spinning */
GST_FLAG_SET (thread, GST_THREAD_STATE_SPINNING);
break;
}
case GST_STATE_PLAYING_TO_PAUSED:
{
- GList *elements;
-
GST_FLAG_UNSET (thread, GST_THREAD_STATE_SPINNING);
-
- elements = (GList *) GST_BIN (thread)->children;
-
- while (elements) {
- gst_element_disable_threadsafe_properties ((GstElement *) elements->
- data);
- elements = g_list_next (elements);
- }
break;
}
case GST_STATE_PAUSED_TO_READY:
index c8dd004913faaf0373aaec50ed65a52295045330..45c3a5691a8633e75b0b6815ac19cc89d84c83d5 100644 (file)
* that will avoid using do_cothread_switch from within the scheduler. */
#define do_element_switch(element) G_STMT_START{ \
- GstElement *from = SCHED (element)->current; \
- if (from && from->post_run_func) \
- from->post_run_func (from); \
SCHED (element)->current = element; \
- if (element->pre_run_func) \
- element->pre_run_func (element); \
do_cothread_switch (GST_ELEMENT_THREADSTATE (element)); \
}G_STMT_END
#define do_switch_to_main(sched) G_STMT_START{ \
- GstElement *current = ((GstBasicScheduler*)sched)->current; \
- if (current && current->post_run_func) \
- current->post_run_func (current); \
((GstBasicScheduler*) sched)->current = NULL; \
do_cothread_switch \
(do_cothread_get_main \
}G_STMT_END
#define do_switch_from_main(entry) G_STMT_START{ \
- if (entry->pre_run_func) \
- entry->pre_run_func (entry); \
SCHED (entry)->current = entry; \
do_cothread_switch (GST_ELEMENT_THREADSTATE (entry)); \
}G_STMT_END
/* due to oddities in the cothreads code, when this function returns it will
* switch to the main cothread. thus, we need to unlock the current element. */
if (SCHED (element)) {
- if (SCHED (element)->current && SCHED (element)->current->post_run_func) {
- SCHED (element)->current->post_run_func (SCHED (element)->current);
- }
SCHED (element)->current = NULL;
}
/* due to oddities in the cothreads code, when this function returns it will
* switch to the main cothread. thus, we need to unlock the current element. */
if (SCHED (element)) {
- if (SCHED (element)->current && SCHED (element)->current->post_run_func) {
- SCHED (element)->current->post_run_func (SCHED (element)->current);
- }
SCHED (element)->current = NULL;
}
/* due to oddities in the cothreads code, when this function returns it will
* switch to the main cothread. thus, we need to unlock the current element. */
- if (SCHED (element)->current->post_run_func)
- SCHED (element)->current->post_run_func (SCHED (element)->current);
SCHED (element)->current = NULL;
GST_DEBUG ("leaving src wrapper of element %s", name);
@@ -1128,8 +1110,6 @@ gst_basic_scheduler_remove_element (GstScheduler * sched, GstElement * element)
/* if we are removing the currently scheduled element */
if (bsched->current == element) {
GST_FLAG_SET (element, GST_ELEMENT_COTHREAD_STOPPING);
- if (element->post_run_func)
- element->post_run_func (element);
bsched->current = NULL;
}
/* find what chain the element is in */
index 99218e9c8ba9e186cb9965d9eeb6602886891727..5c594fd661b311972743f7d476aee915dd247b5b 100644 (file)
GstElement *e = (GstElement *) l->data;
gst_object_ref (GST_OBJECT (e));
- if (e->pre_run_func)
- e->pre_run_func (e);
}
group->schedulefunc (group->argc, group->argv);
for (l = lcopy; l; l = l->next) {
GstElement *e = (GstElement *) l->data;
- if (e->post_run_func)
- e->post_run_func (e);
-
gst_object_unref (GST_OBJECT (e));
}
if (entry)
index 702bfb8144529f0d6226f966460f29603cb3fb76..ddd806cf51347a1366fb4a80cebd44ba271a8481 100644 (file)
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_aggregator_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_aggregator_get_property);
+
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NUM_PADS,
g_param_spec_int ("num_pads", "Num pads", "The number of source pads",
0, G_MAXINT, 0, G_PARAM_READABLE));
"The current state of the element", NULL, G_PARAM_READABLE));
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_aggregator_finalize);
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_aggregator_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_aggregator_get_property);
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_aggregator_request_new_pad);
index 851b6f9375732d1ae965b1c17b4825fd776f8ed3..fcf64b5d305bd248d1e9ff9ed06bf5f437fbdb1b 100644 (file)
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fakesink_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fakesink_get_property);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NUM_SINKS,
g_param_spec_int ("num_sinks", "Number of sinks",
gst_marshal_VOID__BOXED_OBJECT, G_TYPE_NONE, 2,
GST_TYPE_BUFFER | G_SIGNAL_TYPE_STATIC_SCOPE, GST_TYPE_PAD);
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fakesink_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fakesink_get_property);
-
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_fakesink_request_new_pad);
gstelement_class->set_clock = GST_DEBUG_FUNCPTR (gst_fakesink_set_clock);
index 780835e9a611ecc872ffb9e704f15aafa8212b74..82bb94f678a8ec56d9c8e60a6a1854fcf2e169a7 100644 (file)
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fakesrc_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fakesrc_get_property);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NUM_SOURCES,
g_param_spec_int ("num-sources", "num-sources", "Number of sources",
gst_marshal_VOID__BOXED_OBJECT, G_TYPE_NONE, 2,
GST_TYPE_BUFFER | G_SIGNAL_TYPE_STATIC_SCOPE, GST_TYPE_PAD);
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fakesrc_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fakesrc_get_property);
-
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_fakesrc_request_new_pad);
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_fakesrc_change_state);
index 411dd0a32e2f3314334644a752d64bf2870911e7..1fca02c387726b393a5abf5ec070a57aaf437194 100644 (file)
gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->set_property = gst_fdsink_set_property;
+ gobject_class->get_property = gst_fdsink_get_property;
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD,
g_param_spec_int ("fd", "fd", "An open file descriptor to write to",
0, G_MAXINT, 1, G_PARAM_READWRITE));
-
- gobject_class->set_property = gst_fdsink_set_property;
- gobject_class->get_property = gst_fdsink_get_property;
}
static void
index ca33db3c254d8b87d7173b441e28d0f995d53c43..e658cd3a9d1847d976b20d9954ea689de93ca785 100644 (file)
gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->set_property = gst_fdsrc_set_property;
+ gobject_class->get_property = gst_fdsrc_get_property;
+
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD,
g_param_spec_int ("fd", "fd", "An open file descriptor to read from",
0, G_MAXINT, 0, G_PARAM_READWRITE));
G_STRUCT_OFFSET (GstFdSrcClass, timeout), NULL, NULL,
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
- gobject_class->set_property = gst_fdsrc_set_property;
- gobject_class->get_property = gst_fdsrc_get_property;
-
gstelement_class->change_state = gst_fdsrc_change_state;
}
index a575d5a363826025ba24c84347659b4349b0d311..1386758a3cf836f9a8db8a5fe3df52f136f42a4b 100644 (file)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->set_property = gst_filesink_set_property;
+ gobject_class->get_property = gst_filesink_get_property;
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOCATION,
g_param_spec_string ("location", "File Location",
G_STRUCT_OFFSET (GstFileSinkClass, handoff), NULL, NULL,
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
- gobject_class->set_property = gst_filesink_set_property;
- gobject_class->get_property = gst_filesink_get_property;
gobject_class->dispose = gst_filesink_dispose;
}
static void
index 2a21eb6da0661f53c52cd382df1cceec9ac2726b..cddf90b400d6eff7b33e1fa070e6dec77ab17c18 100644 (file)
gobject_class = (GObjectClass *) klass;
+ gobject_class->set_property = gst_filesrc_set_property;
+ gobject_class->get_property = gst_filesrc_get_property;
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD,
g_param_spec_int ("fd", "File-descriptor",
"Touch data to force disk read", FALSE, G_PARAM_READWRITE));
gobject_class->dispose = gst_filesrc_dispose;
- gobject_class->set_property = gst_filesrc_set_property;
- gobject_class->get_property = gst_filesrc_get_property;
gstelement_class->change_state = gst_filesrc_change_state;
}
index 2b4c460636037e9fdb822e96d2c69d84642f25fb..909f4b9a95c77ebfe8396c01630986fbed46729b 100644 (file)
gobject_class = G_OBJECT_CLASS (klass);
gstelement_class = GST_ELEMENT_CLASS (klass);
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_identity_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_identity_get_property);
+
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOOP_BASED,
g_param_spec_boolean ("loop-based", "Loop-based",
"Set to TRUE to use loop-based rather than chain-based scheduling",
GST_TYPE_BUFFER | G_SIGNAL_TYPE_STATIC_SCOPE);
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_identity_finalize);
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_identity_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_identity_get_property);
gstelement_class->set_clock = GST_DEBUG_FUNCPTR (gst_identity_set_clock);
gstelement_class->change_state =
index 63c939e10a7c1ccfbbdaf3ea59d33507b60fd53d..4ebbb4c4f0517a1edbe6367a76ff20d965355f40 100644 (file)
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
-
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_md5sink_get_property);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MD5,
index f7818448658cb945ca084942079d85af0a937eba..ea951736c0c6aeb165af3eb752247d5b61d88160 100644 (file)
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
+ gobject_class->set_property = gst_multifilesrc_set_property;
+ gobject_class->get_property = gst_multifilesrc_get_property;
gst_multifilesrc_signals[NEW_FILE] =
g_signal_new ("new-file", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
-
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOCATIONS, g_param_spec_pointer ("locations", "locations", "locations", G_PARAM_READWRITE)); /* CHECKME */
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_HAVENEWMEDIA,
g_param_spec_boolean ("newmedia", "newmedia",
"generate new media events?", FALSE, G_PARAM_READWRITE));
-
- gobject_class->set_property = gst_multifilesrc_set_property;
- gobject_class->get_property = gst_multifilesrc_get_property;
-
gstelement_class->change_state = gst_multifilesrc_change_state;
}
index 0ed213dd70d575d64887d9eed798ade8b453f1f3..ac889f4ef2af56c29faec3fd6a685a24b8de0b1e 100644 (file)
parent_class = g_type_class_peek_parent (klass);
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_queue_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_queue_get_property);
+
/* signals */
gst_queue_signals[SIGNAL_UNDERRUN] =
g_signal_new ("underrun", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST,
/* set several parent class virtual functions */
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_queue_finalize);
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_queue_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_queue_get_property);
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_queue_change_state);
gstelement_class->release_locks = GST_DEBUG_FUNCPTR (gst_queue_release_locks);
index 9b4f19bb6d533d42c97a04d1f007af567af24936..c14ab36a18fc5c8ec07a5dcfa4077fb1800bce27 100644 (file)
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_shaper_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_shaper_get_property);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_POLICY,
g_param_spec_enum ("policy", "Policy", "Shaper policy",
g_param_spec_string ("last-message", "last-message", "last-message",
NULL, G_PARAM_READABLE));
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_shaper_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_shaper_get_property);
-
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_shaper_request_new_pad);
}
index 82744ff6f4af56db0d7b5d8ce107a387396a0f6b..ef6cca3bcaa0e1e26dc016065daf83a16c72da2d 100644 (file)
gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_statistics_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_statistics_get_property);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BUFFERS,
g_param_spec_int64 ("buffers", "buffers", "total buffers count",
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_statistics_finalize);
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_statistics_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_statistics_get_property);
}
static void
index eec45860474643d92b609a6232d96db872b645cf..94887582b54c18708fc73cfefd1e4f176bf3720c 100644 (file)
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_tee_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_tee_get_property);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NUM_PADS,
g_param_spec_int ("num_pads", "num_pads", "num_pads",
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_tee_finalize);
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_tee_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_tee_get_property);
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_tee_request_new_pad);