2005-05-06 Wim Taymans <wim@fluendo.com>
+ * gst/base/gstbasesink.c: (gst_basesink_preroll_queue_empty),
+ (gst_basesink_handle_buffer), (gst_basesink_chain_unlocked),
+ (gst_basesink_activate):
+ Actually do something with error codes returned from the push
+ functions.
+
+2005-05-06 Wim Taymans <wim@fluendo.com>
+
* docs/design/part-element-sink.txt:
* docs/design/part-element-source.txt:
* gst/base/gstbasesink.c: (gst_basesink_class_init),
static GstFlowReturn gst_basesink_chain (GstPad * pad, GstBuffer * buffer);
static gboolean gst_basesink_activate (GstPad * pad, GstActivateMode mode);
static gboolean gst_basesink_event (GstPad * pad, GstEvent * event);
-static inline void gst_basesink_handle_buffer (GstBaseSink * basesink,
+static inline GstFlowReturn gst_basesink_handle_buffer (GstBaseSink * basesink,
GstBuffer * buf);
static void
}
/* with PREROLL_LOCK */
-static void
+static GstFlowReturn
gst_basesink_preroll_queue_empty (GstBaseSink * basesink, GstPad * pad)
{
GstBuffer *buf;
GQueue *q = basesink->preroll_queue;
+ GstFlowReturn ret;
+
+ ret = GST_FLOW_OK;
if (q) {
DEBUG ("empty queue\n");
while ((buf = g_queue_pop_head (q))) {
DEBUG ("pop %p\n", buf);
- gst_basesink_handle_buffer (basesink, buf);
+ ret = gst_basesink_handle_buffer (basesink, buf);
}
DEBUG ("queue len %p %d\n", basesink, q->length);
}
+ return ret;
}
/* with PREROLL_LOCK */
* 2) render the buffer
* 3) unref the buffer
*/
-static inline void
+static inline GstFlowReturn
gst_basesink_handle_buffer (GstBaseSink * basesink, GstBuffer * buf)
{
GstBaseSinkClass *bclass;
+ GstFlowReturn ret;
gst_basesink_do_sync (basesink, buf);
bclass = GST_BASESINK_GET_CLASS (basesink);
if (bclass->render)
- bclass->render (basesink, buf);
+ ret = bclass->render (basesink, buf);
+ else
+ ret = GST_FLOW_OK;
DEBUG ("unref %p %p\n", basesink, buf);
gst_buffer_unref (buf);
+
+ return ret;
}
static GstFlowReturn
case PREROLL_QUEUEING:
return GST_FLOW_OK;
case PREROLL_PLAYING:
- gst_basesink_handle_buffer (basesink, buf);
- return GST_FLOW_OK;
+ return gst_basesink_handle_buffer (basesink, buf);
case PREROLL_FLUSHING:
return GST_FLOW_UNEXPECTED;
default:
static GstFlowReturn gst_basesink_chain (GstPad * pad, GstBuffer * buffer);
static gboolean gst_basesink_activate (GstPad * pad, GstActivateMode mode);
static gboolean gst_basesink_event (GstPad * pad, GstEvent * event);
-static inline void gst_basesink_handle_buffer (GstBaseSink * basesink,
+static inline GstFlowReturn gst_basesink_handle_buffer (GstBaseSink * basesink,
GstBuffer * buf);
static void
}
/* with PREROLL_LOCK */
-static void
+static GstFlowReturn
gst_basesink_preroll_queue_empty (GstBaseSink * basesink, GstPad * pad)
{
GstBuffer *buf;
GQueue *q = basesink->preroll_queue;
+ GstFlowReturn ret;
+
+ ret = GST_FLOW_OK;
if (q) {
DEBUG ("empty queue\n");
while ((buf = g_queue_pop_head (q))) {
DEBUG ("pop %p\n", buf);
- gst_basesink_handle_buffer (basesink, buf);
+ ret = gst_basesink_handle_buffer (basesink, buf);
}
DEBUG ("queue len %p %d\n", basesink, q->length);
}
+ return ret;
}
/* with PREROLL_LOCK */
* 2) render the buffer
* 3) unref the buffer
*/
-static inline void
+static inline GstFlowReturn
gst_basesink_handle_buffer (GstBaseSink * basesink, GstBuffer * buf)
{
GstBaseSinkClass *bclass;
+ GstFlowReturn ret;
gst_basesink_do_sync (basesink, buf);
bclass = GST_BASESINK_GET_CLASS (basesink);
if (bclass->render)
- bclass->render (basesink, buf);
+ ret = bclass->render (basesink, buf);
+ else
+ ret = GST_FLOW_OK;
DEBUG ("unref %p %p\n", basesink, buf);
gst_buffer_unref (buf);
+
+ return ret;
}
static GstFlowReturn
case PREROLL_QUEUEING:
return GST_FLOW_OK;
case PREROLL_PLAYING:
- gst_basesink_handle_buffer (basesink, buf);
- return GST_FLOW_OK;
+ return gst_basesink_handle_buffer (basesink, buf);
case PREROLL_FLUSHING:
return GST_FLOW_UNEXPECTED;
default: