mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-09 00:45:56 +00:00
Added gst_event_copy
Original commit message from CVS: Added gst_event_copy
This commit is contained in:
parent
7835b75f0a
commit
b792a2af1f
2 changed files with 26 additions and 1 deletions
|
@ -83,6 +83,30 @@ gst_event_new (GstEventType type)
|
|||
return event;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_event_copy:
|
||||
* @event: The event to copy
|
||||
*
|
||||
* Copy the event
|
||||
*
|
||||
* Returns: A copy of the event.
|
||||
*/
|
||||
GstEvent*
|
||||
gst_event_copy (GstEvent *event)
|
||||
{
|
||||
GstEvent *copy;
|
||||
|
||||
g_mutex_lock (_gst_event_chunk_lock);
|
||||
copy = g_mem_chunk_alloc (_gst_event_chunk);
|
||||
g_mutex_unlock (_gst_event_chunk_lock);
|
||||
|
||||
memcpy (copy, event, sizeof (GstEvent));
|
||||
|
||||
/* FIXME copy/ref additional fields */
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_event_free:
|
||||
* @event: The event to free
|
||||
|
|
|
@ -99,7 +99,8 @@ struct _GstEvent {
|
|||
void _gst_event_initialize (void);
|
||||
|
||||
GstEvent* gst_event_new (GstEventType type);
|
||||
void gst_event_free (GstEvent* event);
|
||||
GstEvent* gst_event_copy (GstEvent *event);
|
||||
void gst_event_free (GstEvent *event);
|
||||
|
||||
/* seek events */
|
||||
GstEvent* gst_event_new_seek (GstSeekType type, gint64 offset, gboolean flush);
|
||||
|
|
Loading…
Reference in a new issue