Commit 8461453b authored by Benjamin Otte's avatar Benjamin Otte

add valist function for gst_event_new_discontinuous original patch from Brett...

add valist function for gst_event_new_discontinuous original patch from Brett Kosinski fixes #117348

Original commit message from CVS:
add valist function for gst_event_new_discontinuous
original patch from Brett Kosinski
fixes #117348
parent 73f2d452
......@@ -184,10 +184,10 @@ gst_event_new_seek (GstSeekType type, gint64 offset)
}
/**
* gst_event_new_discontinuous:
* gst_event_new_discontinuousv:
* @new_media: A flag indicating a new media type starts
* @format1: The format of the discont value
* @...: more discont values and formats
* @var_args: more discont values and formats
*
* Allocate a new discontinuous event with the given format/value pairs. Note
* that the values are of type gint64 - you may not use simple integers such
......@@ -197,17 +197,14 @@ gst_event_new_seek (GstSeekType type, gint64 offset)
* Returns: A new discontinuous event.
*/
GstEvent*
gst_event_new_discontinuous (gboolean new_media, GstFormat format1, ...)
gst_event_new_discontinuousv (gboolean new_media, GstFormat format1, va_list var_args)
{
va_list var_args;
GstEvent *event;
gint count = 0;
event = gst_event_new (GST_EVENT_DISCONTINUOUS);
GST_EVENT_DISCONT_NEW_MEDIA (event) = new_media;
va_start (var_args, format1);
while (format1 != GST_FORMAT_UNDEFINED && count < 8) {
GST_EVENT_DISCONT_OFFSET (event, count).format = format1 & GST_SEEK_FORMAT_MASK;
......@@ -217,13 +214,40 @@ gst_event_new_discontinuous (gboolean new_media, GstFormat format1, ...)
count++;
}
va_end (var_args);
GST_EVENT_DISCONT_OFFSET_LEN (event) = count;
return event;
}
/**
* gst_event_new_discontinuous:
* @new_media: A flag indicating a new media type starts
* @format1: The format of the discont value
* @...: more discont values and formats
*
* Allocate a new discontinuous event with the given format/value pairs. Note
* that the values are of type gint64 - you may not use simple integers such
* as "0" when calling this function, always cast them like "(gint64) 0".
* Terminate the list with #GST_FORMAT_UNDEFINED.
*
* Returns: A new discontinuous event.
*/
GstEvent*
gst_event_new_discontinuous (gboolean new_media, GstFormat format1, ...)
{
va_list var_args;
GstEvent *event;
va_start (var_args, format1);
event = gst_event_new_discontinuousv (new_media, format1, var_args);
va_end (var_args);
return event;
}
/**
* gst_event_discont_get_value:
* @event: The event to query
......
......@@ -207,6 +207,9 @@ GstEvent* gst_event_new_size (GstFormat format, gint64 value);
/* discontinous event */
GstEvent* gst_event_new_discontinuous (gboolean new_media,
GstFormat format1, ...);
GstEvent* gst_event_new_discontinuousv (gboolean new_media,
GstFormat format1,
va_list var_args);
gboolean gst_event_discont_get_value (GstEvent *event, GstFormat format, gint64 *value);
#define gst_event_new_filler() gst_event_new(GST_EVENT_FILLER)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment