/* for the pad cache */
#include "gstpad.h"
+/* for GstBus */
+#include "gstbus.h"
+
G_BEGIN_DECLS
/* used by gstparse.c and grammar.y */
gboolean gst_registry_binary_read_cache (GstRegistry * registry, const char *location);
gboolean gst_registry_binary_write_cache (GstRegistry * registry, const char *location);
-
/* used in gstvalue.c and gststructure.c */
#define GST_ASCII_IS_STRING(c) (g_ascii_isalnum((c)) || ((c) == '_') || \
((c) == '-') || ((c) == '+') || ((c) == '/') || ((c) == ':') || \
extern gboolean _gst_disable_registry_cache;
#endif
+/* Secret API used by GstBin to set the bus in child bus mode
+ * without sockets and everything. See bug #646624.
+ */
+void _priv_gst_bus_set_child_mode (GstBus * bus);
+
/* provide inline gst_g_value_get_foo_unchecked(), used in gststructure.c */
#define DEFINE_INLINE_G_VALUE_GET_UNCHECKED(ret_type,name_type,v_field) \
static inline ret_type \
GST_DEBUG_OBJECT (bin, "using bus %" GST_PTR_FORMAT " to listen to children",
bus);
gst_bus_set_sync_handler (bus, (GstBusSyncHandler) bin_bus_handler, bin);
+ _priv_gst_bus_set_child_mode (bus);
bin->priv = GST_BIN_GET_PRIVATE (bin);
bin->priv->asynchandling = DEFAULT_ASYNC_HANDLING;
g_cond_free (bus->priv->queue_cond);
bus->priv->queue_cond = NULL;
- gst_poll_free (bus->priv->poll);
+ if (bus->priv->poll)
+ gst_poll_free (bus->priv->poll);
+ bus->priv->poll = NULL;
}
G_OBJECT_CLASS (parent_class)->dispose (object);
/* pass the message to the async queue, refcount passed in the queue */
GST_DEBUG_OBJECT (bus, "[msg %p] pushing on async queue", message);
gst_atomic_queue_push (bus->queue, message);
- gst_poll_write_control (bus->priv->poll);
+ if (bus->priv->poll)
+ gst_poll_write_control (bus->priv->poll);
GST_DEBUG_OBJECT (bus, "[msg %p] pushed on async queue", message);
break;
g_mutex_lock (lock);
gst_atomic_queue_push (bus->queue, message);
- gst_poll_write_control (bus->priv->poll);
+ if (bus->priv->poll)
+ gst_poll_write_control (bus->priv->poll);
/* now block till the message is freed */
g_cond_wait (cond, lock);
g_return_val_if_fail (GST_IS_BUS (bus), NULL);
g_return_val_if_fail (types != 0, NULL);
+ g_return_val_if_fail (bus->priv->poll != NULL, NULL);
g_mutex_lock (bus->queue_lock);
GstBusSource *source;
g_return_val_if_fail (GST_IS_BUS (bus), NULL);
+ g_return_val_if_fail (bus->priv->poll != NULL, NULL);
source = (GstBusSource *) g_source_new (&gst_bus_source_funcs,
sizeof (GstBusSource));
return;
}
}
+
+/* Secret API used by GstBin to set the bus in child bus mode
+ * without sockets and everything. See bug #646624.
+ */
+void
+_priv_gst_bus_set_child_mode (GstBus * bus)
+{
+ if (bus->priv->poll)
+ gst_poll_free (bus->priv->poll);
+ bus->priv->poll = NULL;
+}