klass->get_times = GST_DEBUG_FUNCPTR (gst_base_sink_default_get_times);
klass->query = GST_DEBUG_FUNCPTR (gst_base_sink_default_query);
klass->event = GST_DEBUG_FUNCPTR (gst_base_sink_default_event);
- klass->wait_eos = GST_DEBUG_FUNCPTR (gst_base_sink_default_wait_event);
+ klass->wait_event = GST_DEBUG_FUNCPTR (gst_base_sink_default_wait_event);
/* Registering debug symbols for function pointers */
GST_DEBUG_REGISTER_FUNCPTR (gst_base_sink_fixate);
/* FIXME: Casting to GstClockEntry only works because the types
* are the same */
if (G_LIKELY (sink->priv->cached_clock_id != NULL
- && GST_CLOCK_ENTRY_CLOCK ((GstClockEntry *) sink->
- priv->cached_clock_id) == clock)) {
+ && GST_CLOCK_ENTRY_CLOCK ((GstClockEntry *) sink->priv->
+ cached_clock_id) == clock)) {
if (!gst_clock_single_shot_id_reinit (clock, sink->priv->cached_clock_id,
time)) {
gst_clock_id_unref (sink->priv->cached_clock_id);
return ret;
}
+static GstFlowReturn
+gst_base_sink_wait_event (GstBaseSink * basesink, GstEvent * event)
+{
+ GstFlowReturn ret;
+ GstBaseSinkClass *bclass;
+
+ bclass = GST_BASE_SINK_GET_CLASS (basesink);
+
+ if (G_LIKELY (bclass->wait_event))
+ ret = bclass->wait_event (basesink, event);
+ else
+ ret = GST_FLOW_NOT_SUPPORTED;
+
+ return ret;
+}
+
static gboolean
gst_base_sink_default_event (GstBaseSink * basesink, GstEvent * event)
{
basesink->priv->received_eos = TRUE;
/* wait for EOS */
- if (G_LIKELY (bclass->wait_eos)) {
- GstFlowReturn ret;
-
- ret = bclass->wait_eos (basesink, event);
- if (G_UNLIKELY (ret != GST_FLOW_OK)) {
- result = FALSE;
- goto done;
- }
+ if (G_UNLIKELY (gst_base_sink_wait_event (basesink,
+ event) != GST_FLOW_OK)) {
+ result = FALSE;
+ goto done;
}
/* the EOS event is completely handled so we mark
break;
case GST_EVENT_GAP:
{
- /* FIXME: Rename ->wait_eos to wait_event() and pass GAP to subclass? */
- gst_base_sink_default_wait_event (basesink, event);
-#if 0
- if (G_LIKELY (bclass->wait_eos)) {
- GstFlowReturn ret;
-
- ret = bclass->wait_eos (basesink, event);
- if (G_UNLIKELY (ret != GST_FLOW_OK)) {
- result = FALSE;
- goto done;
- }
- }
-#endif
+ if (G_UNLIKELY (gst_base_sink_wait_event (basesink,
+ event) != GST_FLOW_OK))
+ result = FALSE;
break;
}
case GST_EVENT_TAG:
* any state they set during unlock(), such as clearing command queues.
* @query: perform a #GstQuery on the element.
* @event: Override this to handle events arriving on the sink pad
- * @wait_eos: Override this to implement custom logic to wait for the EOS time.
- * subclasses should always first chain up to the default implementation.
+ * @wait_event: Override this to implement custom logic to wait for the event
+ * time (for events like EOS and GAP). Subclasses should always first
+ * chain up to the default implementation.
* @prepare: Called to prepare the buffer for @render and @preroll. This
* function is called before synchronisation is performed.
* @prepare_list: Called to prepare the buffer list for @render_list. This
/* notify subclass of event */
gboolean (*event) (GstBaseSink *sink, GstEvent *event);
- /* wait for eos, subclasses should chain up to parent first */
- GstFlowReturn (*wait_eos) (GstBaseSink *sink, GstEvent *event);
+ /* wait for eos or gap, subclasses should chain up to parent first */
+ GstFlowReturn (*wait_event) (GstBaseSink *sink, GstEvent *event);
/* notify subclass of buffer or list before doing sync */
GstFlowReturn (*prepare) (GstBaseSink *sink, GstBuffer *buffer);