static GstFlowReturn
gst_app_sink_preroll (GstBaseSink * psink, GstBuffer * buffer)
{
+ GstFlowReturn res = GST_FLOW_OK;
GstAppSink *appsink = GST_APP_SINK (psink);
gboolean emit;
GST_DEBUG_OBJECT (appsink, "setting preroll buffer %p", buffer);
gst_buffer_replace (&appsink->priv->preroll, buffer);
+
g_cond_signal (appsink->priv->cond);
emit = appsink->priv->emit_signals;
g_mutex_unlock (appsink->priv->mutex);
if (appsink->priv->callbacks.new_preroll)
- appsink->priv->callbacks.new_preroll (appsink, appsink->priv->user_data);
+ res =
+ appsink->priv->callbacks.new_preroll (appsink,
+ appsink->priv->user_data);
else if (emit)
g_signal_emit (appsink, gst_app_sink_signals[SIGNAL_NEW_PREROLL], 0);
- return GST_FLOW_OK;
+ return res;
flushing:
{
static GstFlowReturn
gst_app_sink_render (GstBaseSink * psink, GstBuffer * buffer)
{
+ GstFlowReturn res = GST_FLOW_OK;
GstAppSink *appsink = GST_APP_SINK (psink);
gboolean emit;
}
/* we need to ref the buffer when pushing it in the queue */
g_queue_push_tail (appsink->priv->queue, gst_buffer_ref (buffer));
+
g_cond_signal (appsink->priv->cond);
emit = appsink->priv->emit_signals;
g_mutex_unlock (appsink->priv->mutex);
if (appsink->priv->callbacks.new_buffer)
- appsink->priv->callbacks.new_buffer (appsink, appsink->priv->user_data);
+ res =
+ appsink->priv->callbacks.new_buffer (appsink, appsink->priv->user_data);
else if (emit)
g_signal_emit (appsink, gst_app_sink_signals[SIGNAL_NEW_BUFFER], 0);
- return GST_FLOW_OK;
+ return res;
flushing:
{
/**
* GstAppSinkCallbacks:
- * @eos: Signal that the end-of-stream has been reached. This signal is
- * emited from the steaming thread.
- * @new_preroll: Signal that a new preroll buffer is available.
- * This signal is emited from the steaming thread.
+ * @eos: Called when the end-of-stream has been reached. This callback
+ * is called from the steaming thread.
+ * @new_preroll: Called when a new preroll buffer is available.
+ * This callback is called from the steaming thread.
* The new preroll buffer can be retrieved with
* gst_app_sink_pull_preroll() either from this callback
* or from any other thread.
- * @new_buffer: Signal that a new buffer is available.
- * This signal is emited from the steaming thread.
+ * @new_buffer: Called when a new buffer is available.
+ * This callback is called from the steaming thread.
* The new buffer can be retrieved with
* gst_app_sink_pull_buffer() either from this callback
* or from any other thread.
* Since: 0.10.23
*/
typedef struct {
- void (*eos) (GstAppSink *sink, gpointer user_data);
- void (*new_preroll) (GstAppSink *sink, gpointer user_data);
- void (*new_buffer) (GstAppSink *sink, gpointer user_data);
+ void (*eos) (GstAppSink *sink, gpointer user_data);
+ GstFlowReturn (*new_preroll) (GstAppSink *sink, gpointer user_data);
+ GstFlowReturn (*new_buffer) (GstAppSink *sink, gpointer user_data);
/*< private >*/
gpointer _gst_reserved[GST_PADDING];