+2005-11-22 Wim Taymans <wim@fluendo.com>
+
+ * gst/base/gstbasesink.c: (gst_base_sink_handle_object):
+ Make sure the GstFlowReturn is returned.
+
+ * gst/gstbus.c: (gst_bus_add_signal_watch_full),
+ (gst_bus_add_signal_watch):
+ * gst/gstbus.h:
+ add gst_bus_add_signal_watch_full.
+
+ * gst/gstplugin.c: (gst_plugin_load_file):
+ Small style cleanup.
+
2005-11-22 Jan Schmidt <thaytan@mad.scientist.com>
* check/gst/gstevent.c: (test_event), (GST_START_TEST):
{
gint length;
gboolean have_event;
+ GstFlowReturn ret;
GST_PAD_PREROLL_LOCK (pad);
/* push object on the queue */
/* if it's a buffer, we need to call the preroll method */
if (GST_IS_BUFFER (obj)) {
GstBaseSinkClass *bclass;
- GstFlowReturn pres;
GstBuffer *buf = GST_BUFFER (obj);
GST_DEBUG_OBJECT (basesink, "preroll buffer %" GST_TIME_FORMAT,
bclass = GST_BASE_SINK_GET_CLASS (basesink);
if (bclass->preroll)
- if ((pres = bclass->preroll (basesink, buf)) != GST_FLOW_OK)
+ if ((ret = bclass->preroll (basesink, buf)) != GST_FLOW_OK)
goto preroll_failed;
}
}
no_preroll:
{
- GstFlowReturn ret;
-
GST_DEBUG_OBJECT (basesink, "no preroll needed");
/* maybe it was another sink that blocked in preroll, need to check for
buffers to drain */
GST_DEBUG_OBJECT (basesink, "abort state");
gst_element_abort_state (GST_ELEMENT (basesink));
- return GST_FLOW_ERROR;
+ return ret;
}
}
}
/**
- * gst_bus_add_signal_watch:
+ * gst_bus_add_signal_watch_full:
* @bus: a #GstBus on which you want to recieve the "message" signal
+ * @priority: The priority of the watch.
*
- * Adds a bus signal watch to the default main context with the default priority.
+ * Adds a bus signal watch to the default main context with the given priority.
* After calling this statement, the bus will emit the message signal for each
* message posted on the bus.
*
* MT safe.
*/
void
-gst_bus_add_signal_watch (GstBus * bus)
+gst_bus_add_signal_watch_full (GstBus * bus, gint priority)
{
g_return_if_fail (GST_IS_BUS (bus));
g_assert (bus->signal_watch_id == 0);
bus->signal_watch_id =
- gst_bus_add_watch (bus, gst_bus_async_signal_func, NULL);
+ gst_bus_add_watch_full (bus, priority, gst_bus_async_signal_func, NULL,
+ NULL);
done:
}
/**
+ * gst_bus_add_signal_watch:
+ * @bus: a #GstBus on which you want to recieve the "message" signal
+ *
+ * Adds a bus signal watch to the default main context with the default priority.
+ * After calling this statement, the bus will emit the message signal for each
+ * message posted on the bus.
+ *
+ * This function may be called multiple times. To clean up, the caller is
+ * responsible for calling gst_bus_remove_signal_watch() as many times as this
+ * function is called.
+ *
+ * MT safe.
+ */
+void
+gst_bus_add_signal_watch (GstBus * bus)
+{
+ gst_bus_add_signal_watch_full (bus, G_PRIORITY_DEFAULT);
+}
+
+/**
* gst_bus_remove_signal_watch:
* @bus: a #GstBus you previously added a signal watch to
*
/* convenience api to add/remove a gsource that emits the async signals */
void gst_bus_add_signal_watch (GstBus * bus);
+void gst_bus_add_signal_watch_full (GstBus * bus, gint priority);
void gst_bus_remove_signal_watch (GstBus * bus);
G_END_DECLS
g_static_mutex_unlock (&gst_plugin_loading_mutex);
return plugin;
+
return_error:
- if (plugin)
- gst_object_unref (plugin);
- g_static_mutex_unlock (&gst_plugin_loading_mutex);
- return NULL;
+ {
+ if (plugin)
+ gst_object_unref (plugin);
+ g_static_mutex_unlock (&gst_plugin_loading_mutex);
+ return NULL;
+ }
}
static void
{
gint length;
gboolean have_event;
+ GstFlowReturn ret;
GST_PAD_PREROLL_LOCK (pad);
/* push object on the queue */
/* if it's a buffer, we need to call the preroll method */
if (GST_IS_BUFFER (obj)) {
GstBaseSinkClass *bclass;
- GstFlowReturn pres;
GstBuffer *buf = GST_BUFFER (obj);
GST_DEBUG_OBJECT (basesink, "preroll buffer %" GST_TIME_FORMAT,
bclass = GST_BASE_SINK_GET_CLASS (basesink);
if (bclass->preroll)
- if ((pres = bclass->preroll (basesink, buf)) != GST_FLOW_OK)
+ if ((ret = bclass->preroll (basesink, buf)) != GST_FLOW_OK)
goto preroll_failed;
}
}
no_preroll:
{
- GstFlowReturn ret;
-
GST_DEBUG_OBJECT (basesink, "no preroll needed");
/* maybe it was another sink that blocked in preroll, need to check for
buffers to drain */
GST_DEBUG_OBJECT (basesink, "abort state");
gst_element_abort_state (GST_ELEMENT (basesink));
- return GST_FLOW_ERROR;
+ return ret;
}
}