gst/gstevent.*: New event for future idea.

Original commit message from CVS:
* gst/gstevent.c: (gst_event_new_buffersize),
(gst_event_parse_buffersize):
* gst/gstevent.h:
New event for future idea.
This commit is contained in:
Wim Taymans 2005-10-07 18:02:14 +00:00
parent 7fe57d86a0
commit c6ae655d0a
3 changed files with 67 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2005-10-07 Wim Taymans <wim@fluendo.com>
* gst/gstevent.c: (gst_event_new_buffersize),
(gst_event_parse_buffersize):
* gst/gstevent.h:
New event for future idea.
2005-10-07 Andy Wingo <wingo@pobox.com>
* gst/gstelement.c (gst_element_post_message): Doc update.

View file

@ -469,6 +469,56 @@ gst_event_new_filler (void)
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

View file

@ -56,6 +56,7 @@ G_BEGIN_DECLS
* @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.
@ -88,10 +89,11 @@ typedef enum {
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),
@ -269,6 +271,11 @@ void gst_event_parse_tag (GstEvent *event, GstTagList **taglist);
/* 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 */