mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-27 10:40:34 +00:00
added new function gst_event_has_new_media
Original commit message from CVS: added new function gst_event_has_new_media
This commit is contained in:
parent
0b3a5d14db
commit
17b8c5d004
2 changed files with 20 additions and 0 deletions
|
@ -240,6 +240,25 @@ gst_event_discont_get_value (GstEvent *event, GstFormat format, gint64 *value)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* gst_event_has_new_media:
|
||||
* @event: The event to check
|
||||
*
|
||||
* Checks if a given event indicates a new media.
|
||||
*
|
||||
* Returns: True if the event indicates a new media
|
||||
*/
|
||||
gboolean
|
||||
gst_event_has_new_media (GstEvent *event)
|
||||
{
|
||||
g_return_val_if_fail (GST_IS_EVENT (event), FALSE);
|
||||
g_return_val_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_DISCONTINUOUS ||
|
||||
GST_EVENT_TYPE (event) == GST_EVENT_NEW_MEDIA, FALSE);
|
||||
if (GST_EVENT_TYPE (event) == GST_EVENT_NEW_MEDIA)
|
||||
return TRUE;
|
||||
|
||||
return GST_EVENT_DISCONT_NEW_MEDIA (event);
|
||||
}
|
||||
/**
|
||||
* gst_event_new_size:
|
||||
* @format: The format of the size value
|
||||
|
|
|
@ -207,6 +207,7 @@ GstEvent* gst_event_new_size (GstFormat format, gint64 value);
|
|||
GstEvent* gst_event_new_discontinuous (gboolean new_media,
|
||||
GstFormat format1, ...);
|
||||
gboolean gst_event_discont_get_value (GstEvent *event, GstFormat format, gint64 *value);
|
||||
gboolean gst_event_has_new_media (GstEvent *event);
|
||||
|
||||
#define gst_event_new_filler() gst_event_new(GST_EVENT_FILLER)
|
||||
|
||||
|
|
Loading…
Reference in a new issue