PAD_REMOVED,
ERROR,
EOS,
+ DEEP_NOTIFY,
LAST_SIGNAL
};
const GValue *value, GParamSpec *pspec);
static void gst_element_get_property (GObject *object, guint prop_id, GValue *value,
GParamSpec *pspec);
+static void gst_element_dispatch_properties_changed (GObject * object, guint n_pspecs, GParamSpec **pspecs);
static void gst_element_dispose (GObject *object);
g_signal_new ("eos", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstElementClass,eos), NULL, NULL,
gst_marshal_VOID__VOID, G_TYPE_NONE, 0);
-
+ gst_element_signals[DEEP_NOTIFY] =
+ g_signal_new ("deep_notify", G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE | G_SIGNAL_DETAILED | G_SIGNAL_NO_HOOKS,
+ G_STRUCT_OFFSET (GstElementClass, deep_notify), NULL, NULL,
+ gst_marshal_VOID__OBJECT_PARAM, G_TYPE_NONE,
+ 2, G_TYPE_OBJECT, G_TYPE_PARAM);
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_element_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_element_get_property);
+
+ /* see the comments at gst_element_dispatch_properties_changed */
+ gobject_class->dispatch_properties_changed
+ = GST_DEBUG_FUNCPTR (gst_element_dispatch_properties_changed);
+
gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_element_dispose);
#ifndef GST_DISABLE_LOADSAVE
(oclass->get_property) (object, prop_id, value, pspec);
}
+/* Changing a GObject property of an element will result in "deep_notify"
+ * signals being emitted by the element itself, as well as in each parent
+ * element. This is so that an application can connect a listener to the
+ * top-level bin to catch property-change notifications for all contained
+ * elements. */
+static void
+gst_element_dispatch_properties_changed (GObject *object,
+ guint n_pspecs,
+ GParamSpec **pspecs)
+{
+ GstObject *gst_object;
+ guint i;
+
+ /* do the standard dispatching */
+ G_OBJECT_CLASS (parent_class)->dispatch_properties_changed (object, n_pspecs, pspecs);
+
+ /* now let the parent dispatch those, too */
+ gst_object = GST_OBJECT (object);
+ while (gst_object)
+ {
+ /* need own category? */
+ for (i = 0; i < n_pspecs; i++) {
+ GST_DEBUG (GST_CAT_EVENT, "deep notification from %s to %s (%s)", GST_OBJECT_NAME (object),
+ GST_OBJECT_NAME (gst_object), pspecs[i]->name);
+ g_signal_emit (gst_object, gst_element_signals[DEEP_NOTIFY], g_quark_from_string (pspecs[i]->name),
+ (GstObject *) object, pspecs[i]);
+ }
+
+ gst_object = GST_OBJECT_PARENT (gst_object);
+ }
+}
+
static GstPad*
gst_element_request_pad (GstElement *element, GstPadTemplate *templ, const gchar* name)
{
if (curpending != state) {
GST_DEBUG_ELEMENT (GST_CAT_STATES, element,
"intermediate: setting state from %s to %s",
- gst_element_state_get_name (state),
+ gst_element_state_get_name (GST_STATE (element)),
gst_element_state_get_name (curpending));
}
void (*pad_removed) (GstElement *element, GstPad *pad);
void (*error) (GstElement *element, GstElement *source, gchar *error);
void (*eos) (GstElement *element);
+ void (*deep_notify) (GstObject *object, GstObject *orig, GParamSpec *pspec);
/* local pointers for get/set */
void (*set_property) (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
/* Object signals and args */
enum {
PARENT_SET,
- DEEP_NOTIFY,
#ifndef GST_DISABLE_LOADSAVE_REGISTRY
OBJECT_SAVED,
#endif
GParamSpec * pspec);
static void gst_object_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec);
-static void gst_object_dispatch_properties_changed (GObject * object, guint n_pspecs, GParamSpec **pspecs);
static void gst_object_dispose (GObject *object);
static void gst_object_finalize (GObject *object);
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_object_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_object_get_property);
- /* CR1: we override the signal property so that an object can propagate the
- * signal to the parent object */
- gobject_class->dispatch_properties_changed = GST_DEBUG_FUNCPTR (gst_object_dispatch_properties_changed);
-
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NAME,
g_param_spec_string ("name", "Name", "The name of the object",
NULL, G_PARAM_READWRITE));
G_STRUCT_OFFSET (GstObjectClass, parent_set), NULL, NULL,
g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
G_TYPE_OBJECT);
- gst_object_signals[DEEP_NOTIFY] =
- g_signal_new ("deep_notify", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE | G_SIGNAL_DETAILED | G_SIGNAL_NO_HOOKS,
- G_STRUCT_OFFSET (GstObjectClass, deep_notify), NULL, NULL,
- gst_marshal_VOID__OBJECT_PARAM, G_TYPE_NONE,
- 2, G_TYPE_OBJECT, G_TYPE_PARAM);
#ifndef GST_DISABLE_LOADSAVE_REGISTRY
gst_object_signals[OBJECT_SAVED] =
g_signal_new ("object_saved", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
}
}
-/* CR1: the GObject changing a property emits signals to it's parents
- * so that the app can connect a listener to the top-level bin */
-
-static void
-gst_object_dispatch_properties_changed (GObject *object,
- guint n_pspecs,
- GParamSpec **pspecs)
-{
- GstObject *gst_object;
- guint i;
-
- /* do the standard dispatching */
- parent_class->dispatch_properties_changed (object, n_pspecs, pspecs);
-
- /* now let the parent dispatch those, too */
- gst_object = GST_OBJECT (object);
- while (gst_object)
- {
- /* need own category? */
- for (i = 0; i < n_pspecs; i++) {
- GST_DEBUG (GST_CAT_EVENT, "deep notification from %s to %s (%s)", GST_OBJECT_NAME (object),
- GST_OBJECT_NAME (gst_object), pspecs[i]->name);
- g_signal_emit (gst_object, gst_object_signals[DEEP_NOTIFY], g_quark_from_string (pspecs[i]->name),
- (GstObject *) object, pspecs[i]);
- }
-
- gst_object = GST_OBJECT_PARENT (gst_object);
- }
-}
-
/**
* gst_object_get_path_string:
* @object: GstObject to get the path from
/* signals */
void (*parent_set) (GstObject *object, GstObject *parent);
- void (*deep_notify) (GstObject *object, GstObject *orig, GParamSpec *pspec);
#ifndef GST_DISABLE_LOADSAVE_REGISTRY
void (*object_saved) (GstObject *object, xmlNodePtr parent);
#endif
/* we cannot use the temp dir since the move needs to be on same device */
gst_reg->tmp_file = g_strdup_printf ("%s.tmp", gst_registry_option);
}
+ else if (g_getenv ("GST_REGISTRY"))
+ {
+ gst_reg->dir = NULL;
+ gst_reg->file = g_strdup (g_getenv ("GST_REGISTRY"));
+ gst_reg->tmp_file = g_strdup_printf ("%s.tmp", g_getenv ("GST_REGISTRY"));
+ }
else
{
if (gst_registry_use_global ())
/* FIXME: maybe parse the dir from file ? */
gst_reg->local_reg = NULL;
gst_reg->global_reg = gst_registry_option;
+ }
+ else if (g_getenv ("GST_REGISTRY"))
+ {
+ gst_reg->local_reg = NULL;
+ gst_reg->global_reg = g_strdup (g_getenv ("GST_REGISTRY"));
}
else
{
g_free (dstr);
+ /* if the toplevel only contains one bin, make that bin top-level */
+ if (g->elements == NULL && g->bins && g->bins->next == NULL) {
+ g = (graph_t*)g->bins->data;
+ g_free (g->parent);
+ g->parent = NULL;
+ }
+
return g;
}