flow_ret = gst_video_decoder_drain_out (decoder, TRUE);
ret = (flow_ret == GST_FLOW_OK);
+ /* Forward EOS immediately. This is required because no
+ * buffer or serialized event will come after EOS and
+ * nothing could trigger another _finish_frame() call.
+ *
+ * The subclass can override this behaviour by overriding
+ * the ::sink_event() vfunc and not chaining up to the
+ * parent class' ::sink_event() until a later time.
+ */
forward_immediate = TRUE;
break;
}
flow_ret = gst_video_decoder_drain_out (decoder, FALSE);
ret = (flow_ret == GST_FLOW_OK);
+
+ /* Forward GAP immediately. Everything is drained after
+ * the GAP event and we can forward this event immediately
+ * now without having buffers out of order.
+ */
forward_immediate = TRUE;
break;
}
flow_ret = gst_video_decoder_drain_out (decoder, FALSE);
ret = (flow_ret == GST_FLOW_OK);
}
+ /* Forward STILL_FRAME immediately. Everything is drained after
+ * the STILL_FRAME event and we can forward this event immediately
+ * now without having buffers out of order.
+ */
forward_immediate = TRUE;
}
break;
/* well, this is kind of worse than a DISCONT */
gst_video_decoder_flush (decoder, TRUE);
GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
+ /* Forward FLUSH_STOP immediately. This is required because it is
+ * expected to be forwarded immediately and no buffers are queued
+ * anyway.
+ */
forward_immediate = TRUE;
break;
}
break;
}
- /* Forward non-serialized events and EOS/FLUSH_STOP immediately.
- * For EOS this is required because no buffer or serialized event
- * will come after EOS and nothing could trigger another
- * _finish_frame() call. *
- * If the subclass handles sending of EOS manually it can return
- * _DROPPED from ::finish() and all other subclasses should have
- * decoded/flushed all remaining data before this
- *
- * For FLUSH_STOP this is required because it is expected
- * to be forwarded immediately and no buffers are queued anyway.
+ /* Forward non-serialized events immediately, and all other
+ * events which can be forwarded immediately without potentially
+ * causing the event to go out of order with other events and
+ * buffers as decided above.
*/
if (event) {
if (!GST_EVENT_IS_SERIALIZED (event) || forward_immediate) {