return gst_event_new (GST_EVENT_FILLER);
}
+/* buffersize event */
+/**
+ * gst_event_new_buffersize:
+ *
+ * Create a new buffersize event. The event is sent downstream and notifies
+ * elements that they should provide a buffer of the specified dimensions.
+ *
+ * When the async flag is set, a thread boundary is prefered.
+ *
+ * Returns: a new #GstEvent
+ */
+GstEvent *
+gst_event_new_buffersize (GstFormat format, gint64 minsize,
+ gint64 maxsize, gboolean async)
+{
+ GST_CAT_INFO (GST_CAT_EVENT,
+ "creating buffersize format %d, minsize %" G_GINT64_FORMAT
+ ", maxsize %" G_GINT64_FORMAT ", async %d", format,
+ minsize, maxsize, async);
+
+ return gst_event_new_custom (GST_EVENT_BUFFERSIZE,
+ gst_structure_new ("GstEventBufferSize",
+ "format", GST_TYPE_FORMAT, format,
+ "minsize", G_TYPE_INT64, minsize,
+ "maxsize", G_TYPE_INT64, maxsize,
+ "async", G_TYPE_BOOLEAN, async, NULL));
+}
+
+void
+gst_event_parse_buffersize (GstEvent * event, GstFormat * format,
+ gint64 * minsize, gint64 * maxsize, gboolean * async)
+{
+ const GstStructure *structure;
+
+ g_return_if_fail (GST_IS_EVENT (event));
+ g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_BUFFERSIZE);
+
+ structure = gst_event_get_structure (event);
+ if (format)
+ *format = g_value_get_enum (gst_structure_get_value (structure, "format"));
+ if (minsize)
+ *minsize =
+ g_value_get_int64 (gst_structure_get_value (structure, "minsize"));
+ if (maxsize)
+ *maxsize =
+ g_value_get_int64 (gst_structure_get_value (structure, "maxsize"));
+ if (async)
+ *async = g_value_get_boolean (gst_structure_get_value (structure, "async"));
+}
+
/**
* gst_event_new_qos:
* @proportion: the proportion of the qos message
* @GST_EVENT_NEWSEGMENT: A new media segment follows in the dataflow.
* @GST_EVENT_TAG: A new set of metadata tags has been found in the stream.
* @GST_EVENT_FILLER: Filler for sparse data streams.
+ * @GST_EVENT_BUFFERSIZE: Notification of buffering requirements
* @GST_EVENT_QOS: A quality message. Used to indicate to upstream elements
* that the downstream elements are being starved of or
* flooded with data.
GST_EVENT_NEWSEGMENT = GST_EVENT_MAKE_TYPE (4, GST_EVDIR_DS | GST_EVSER),
GST_EVENT_TAG = GST_EVENT_MAKE_TYPE (5, GST_EVDIR_DS | GST_EVSER),
GST_EVENT_FILLER = GST_EVENT_MAKE_TYPE (6, GST_EVDIR_DS | GST_EVSER),
+ GST_EVENT_BUFFERSIZE = GST_EVENT_MAKE_TYPE (7, GST_EVDIR_DS | GST_EVSER),
/* upstream events */
- GST_EVENT_QOS = GST_EVENT_MAKE_TYPE (7, GST_EVDIR_US),
- GST_EVENT_SEEK = GST_EVENT_MAKE_TYPE (8, GST_EVDIR_US),
- GST_EVENT_NAVIGATION = GST_EVENT_MAKE_TYPE (9, GST_EVDIR_US),
+ GST_EVENT_QOS = GST_EVENT_MAKE_TYPE (8, GST_EVDIR_US),
+ GST_EVENT_SEEK = GST_EVENT_MAKE_TYPE (9, GST_EVDIR_US),
+ GST_EVENT_NAVIGATION = GST_EVENT_MAKE_TYPE (10, GST_EVDIR_US),
/* custom events start here */
GST_EVENT_CUSTOM_UP = GST_EVENT_MAKE_TYPE (32, GST_EVDIR_US),
/* FIXME: FILLER events need to be fully specified and implemented */
GstEvent * gst_event_new_filler (void);
+/* buffer */
+GstEvent * gst_event_new_buffersize (GstFormat format, gint64 minsize, gint64 maxsize,
+ gboolean async);
+void gst_event_parse_buffersize (GstEvent *event, GstFormat *format, gint64 *minsize,
+ gint64 *maxsize, gboolean *async);
/* QOS events */
/* FIXME: QOS events need to be fully specified and implemented */