2001-10-17 10:21:27 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* 2000 Wim Taymans <wim.taymans@chello.be>
|
2006-01-26 06:57:14 +00:00
|
|
|
* 2005 Wim Taymans <wim@fluendo.com>
|
2001-10-17 10:21:27 +00:00
|
|
|
*
|
2004-03-12 17:59:00 +00:00
|
|
|
* gstevent.c: GstEvent subsystem
|
2001-10-17 10:21:27 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-03 20:44:48 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2001-10-17 10:21:27 +00:00
|
|
|
*/
|
2005-10-15 16:01:57 +00:00
|
|
|
|
2005-08-22 10:37:02 +00:00
|
|
|
/**
|
|
|
|
* SECTION:gstevent
|
2005-10-10 09:48:21 +00:00
|
|
|
* @short_description: Structure describing events that are passed up and down
|
|
|
|
* a pipeline
|
2005-08-22 10:37:02 +00:00
|
|
|
* @see_also: #GstPad, #GstElement
|
|
|
|
*
|
2010-04-06 15:46:36 +00:00
|
|
|
* The event class provides factory methods to construct events for sending
|
2010-04-04 12:21:16 +00:00
|
|
|
* and functions to query (parse) received events.
|
2005-08-22 10:37:02 +00:00
|
|
|
*
|
2006-01-26 06:57:14 +00:00
|
|
|
* Events are usually created with gst_event_new_*() which takes event-type
|
|
|
|
* specific parameters as arguments.
|
2006-01-27 22:34:51 +00:00
|
|
|
* To send an event application will usually use gst_element_send_event() and
|
|
|
|
* elements will use gst_pad_send_event() or gst_pad_push_event().
|
2006-01-26 06:57:14 +00:00
|
|
|
* The event should be unreffed with gst_event_unref() if it has not been sent.
|
|
|
|
*
|
2012-03-28 16:12:23 +00:00
|
|
|
* Events that have been received can be parsed with their respective
|
2007-11-17 17:50:21 +00:00
|
|
|
* gst_event_parse_*() functions. It is valid to pass %NULL for unwanted details.
|
2005-08-22 10:37:02 +00:00
|
|
|
*
|
2005-10-21 11:36:32 +00:00
|
|
|
* Events are passed between elements in parallel to the data stream. Some events
|
|
|
|
* are serialized with buffers, others are not. Some events only travel downstream,
|
2012-03-28 16:12:23 +00:00
|
|
|
* others only upstream. Some events can travel both upstream and downstream.
|
|
|
|
*
|
2006-01-26 06:57:14 +00:00
|
|
|
* The events are used to signal special conditions in the datastream such as
|
|
|
|
* EOS (end of stream) or the start of a new stream-segment.
|
|
|
|
* Events are also used to flush the pipeline of any pending data.
|
2005-10-21 11:36:32 +00:00
|
|
|
*
|
2012-03-28 16:12:23 +00:00
|
|
|
* Most of the event API is used inside plugins. Applications usually only
|
|
|
|
* construct and use seek events.
|
2006-01-26 06:57:14 +00:00
|
|
|
* To do that gst_event_new_seek() is used to create a seek event. It takes
|
2011-09-07 11:14:38 +00:00
|
|
|
* the needed parameters to specify seeking time and mode.
|
2014-06-05 20:27:28 +00:00
|
|
|
* |[<!-- language="C" -->
|
2005-10-21 11:36:32 +00:00
|
|
|
* GstEvent *event;
|
|
|
|
* gboolean result;
|
|
|
|
* ...
|
|
|
|
* // construct a seek event to play the media from second 2 to 5, flush
|
|
|
|
* // the pipeline to decrease latency.
|
|
|
|
* event = gst_event_new_seek (1.0,
|
|
|
|
* GST_FORMAT_TIME,
|
2005-12-06 19:29:15 +00:00
|
|
|
* GST_SEEK_FLAG_FLUSH,
|
|
|
|
* GST_SEEK_TYPE_SET, 2 * GST_SECOND,
|
|
|
|
* GST_SEEK_TYPE_SET, 5 * GST_SECOND);
|
2005-10-21 11:36:32 +00:00
|
|
|
* ...
|
|
|
|
* result = gst_element_send_event (pipeline, event);
|
|
|
|
* if (!result)
|
|
|
|
* g_warning ("seek failed");
|
|
|
|
* ...
|
2014-02-27 17:06:56 +00:00
|
|
|
* ]|
|
2005-08-22 10:37:02 +00:00
|
|
|
*/
|
2005-11-24 09:44:07 +00:00
|
|
|
|
2001-10-17 10:21:27 +00:00
|
|
|
|
2003-06-29 14:05:49 +00:00
|
|
|
#include "gst_private.h"
|
2006-05-04 15:20:14 +00:00
|
|
|
#include <string.h> /* memcpy */
|
2003-06-29 14:05:49 +00:00
|
|
|
|
|
|
|
#include "gstinfo.h"
|
2002-07-08 19:22:02 +00:00
|
|
|
#include "gstevent.h"
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
#include "gstenumtypes.h"
|
2005-04-24 22:49:45 +00:00
|
|
|
#include "gstutils.h"
|
2008-10-13 17:19:25 +00:00
|
|
|
#include "gstquark.h"
|
2012-01-27 17:39:12 +00:00
|
|
|
#include "gstvalue.h"
|
2003-11-24 02:09:23 +00:00
|
|
|
|
2011-05-11 10:04:43 +00:00
|
|
|
GType _gst_event_type = 0;
|
2008-02-12 12:04:43 +00:00
|
|
|
|
2011-05-10 09:50:16 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GstEvent event;
|
|
|
|
|
|
|
|
GstStructure *structure;
|
2014-04-04 15:06:18 +00:00
|
|
|
gint64 running_time_offset;
|
2011-05-10 09:50:16 +00:00
|
|
|
} GstEventImpl;
|
|
|
|
|
2011-05-17 09:45:46 +00:00
|
|
|
#define GST_EVENT_STRUCTURE(e) (((GstEventImpl *)(e))->structure)
|
2011-05-10 09:50:16 +00:00
|
|
|
|
2005-10-06 13:55:43 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2006-06-12 09:28:35 +00:00
|
|
|
const gint type;
|
|
|
|
const gchar *name;
|
2005-10-06 13:55:43 +00:00
|
|
|
GQuark quark;
|
|
|
|
} GstEventQuarks;
|
|
|
|
|
|
|
|
static GstEventQuarks event_quarks[] = {
|
|
|
|
{GST_EVENT_UNKNOWN, "unknown", 0},
|
|
|
|
{GST_EVENT_FLUSH_START, "flush-start", 0},
|
|
|
|
{GST_EVENT_FLUSH_STOP, "flush-stop", 0},
|
2015-06-12 08:53:23 +00:00
|
|
|
{GST_EVENT_SELECT_STREAMS, "select-streams", 0},
|
2012-01-26 15:31:50 +00:00
|
|
|
{GST_EVENT_STREAM_START, "stream-start", 0},
|
2015-06-12 08:53:23 +00:00
|
|
|
{GST_EVENT_STREAM_COLLECTION, "stream-collection", 0},
|
2011-05-04 09:03:05 +00:00
|
|
|
{GST_EVENT_CAPS, "caps", 0},
|
2011-05-13 16:07:24 +00:00
|
|
|
{GST_EVENT_SEGMENT, "segment", 0},
|
2005-10-06 13:55:43 +00:00
|
|
|
{GST_EVENT_TAG, "tag", 0},
|
2012-03-14 16:40:32 +00:00
|
|
|
{GST_EVENT_TOC, "toc", 0},
|
2015-03-16 12:35:27 +00:00
|
|
|
{GST_EVENT_PROTECTION, "protection", 0},
|
2005-10-08 16:13:50 +00:00
|
|
|
{GST_EVENT_BUFFERSIZE, "buffersize", 0},
|
2009-11-18 06:52:24 +00:00
|
|
|
{GST_EVENT_SINK_MESSAGE, "sink-message", 0},
|
2012-01-26 15:31:50 +00:00
|
|
|
{GST_EVENT_EOS, "eos", 0},
|
|
|
|
{GST_EVENT_SEGMENT_DONE, "segment-done", 0},
|
2012-01-27 09:54:56 +00:00
|
|
|
{GST_EVENT_GAP, "gap", 0},
|
2005-10-06 13:55:43 +00:00
|
|
|
{GST_EVENT_QOS, "qos", 0},
|
|
|
|
{GST_EVENT_SEEK, "seek", 0},
|
|
|
|
{GST_EVENT_NAVIGATION, "navigation", 0},
|
2007-02-02 11:48:48 +00:00
|
|
|
{GST_EVENT_LATENCY, "latency", 0},
|
2009-11-17 17:35:55 +00:00
|
|
|
{GST_EVENT_STEP, "step", 0},
|
2011-05-03 11:05:06 +00:00
|
|
|
{GST_EVENT_RECONFIGURE, "reconfigure", 0},
|
2012-03-14 16:40:32 +00:00
|
|
|
{GST_EVENT_TOC_SELECT, "toc-select", 0},
|
2005-11-21 11:06:42 +00:00
|
|
|
{GST_EVENT_CUSTOM_UPSTREAM, "custom-upstream", 0},
|
|
|
|
{GST_EVENT_CUSTOM_DOWNSTREAM, "custom-downstream", 0},
|
|
|
|
{GST_EVENT_CUSTOM_DOWNSTREAM_OOB, "custom-downstream-oob", 0},
|
2011-11-28 14:35:21 +00:00
|
|
|
{GST_EVENT_CUSTOM_DOWNSTREAM_STICKY, "custom-downstream-sticky", 0},
|
2005-10-08 16:13:50 +00:00
|
|
|
{GST_EVENT_CUSTOM_BOTH, "custom-both", 0},
|
|
|
|
{GST_EVENT_CUSTOM_BOTH_OOB, "custom-both-oob", 0},
|
2016-03-14 03:20:42 +00:00
|
|
|
{GST_EVENT_STREAM_GROUP_DONE, "stream-group-done", 0},
|
2005-10-08 16:13:50 +00:00
|
|
|
|
2005-10-06 13:55:43 +00:00
|
|
|
{0, NULL, 0}
|
|
|
|
};
|
|
|
|
|
2011-08-29 15:06:18 +00:00
|
|
|
GST_DEFINE_MINI_OBJECT_TYPE (GstEvent, gst_event);
|
2011-08-29 13:34:30 +00:00
|
|
|
|
2009-12-04 21:32:38 +00:00
|
|
|
void
|
2011-08-29 11:27:26 +00:00
|
|
|
_priv_gst_event_initialize (void)
|
2009-12-04 21:32:38 +00:00
|
|
|
{
|
|
|
|
gint i;
|
2009-12-04 22:52:32 +00:00
|
|
|
|
2011-08-29 13:34:30 +00:00
|
|
|
_gst_event_type = gst_event_get_type ();
|
2011-05-11 10:04:43 +00:00
|
|
|
|
2009-12-04 21:32:38 +00:00
|
|
|
g_type_class_ref (gst_seek_flags_get_type ());
|
|
|
|
g_type_class_ref (gst_seek_type_get_type ());
|
|
|
|
|
|
|
|
for (i = 0; event_quarks[i].name; i++) {
|
|
|
|
event_quarks[i].quark = g_quark_from_static_string (event_quarks[i].name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-10-08 18:07:20 +00:00
|
|
|
/**
|
|
|
|
* gst_event_type_get_name:
|
|
|
|
* @type: the event type
|
|
|
|
*
|
|
|
|
* Get a printable name for the given event type. Do not modify or free.
|
|
|
|
*
|
2005-10-15 15:30:24 +00:00
|
|
|
* Returns: a reference to the static name of the event.
|
2005-10-08 18:07:20 +00:00
|
|
|
*/
|
2005-10-06 13:55:43 +00:00
|
|
|
const gchar *
|
|
|
|
gst_event_type_get_name (GstEventType type)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; event_quarks[i].name; i++) {
|
|
|
|
if (type == event_quarks[i].type)
|
|
|
|
return event_quarks[i].name;
|
|
|
|
}
|
|
|
|
return "unknown";
|
|
|
|
}
|
|
|
|
|
2005-10-08 18:07:20 +00:00
|
|
|
/**
|
|
|
|
* gst_event_type_to_quark:
|
|
|
|
* @type: the event type
|
|
|
|
*
|
|
|
|
* Get the unique quark for the given event type.
|
|
|
|
*
|
|
|
|
* Returns: the quark associated with the event type
|
|
|
|
*/
|
2005-10-06 13:55:43 +00:00
|
|
|
GQuark
|
|
|
|
gst_event_type_to_quark (GstEventType type)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; event_quarks[i].name; i++) {
|
|
|
|
if (type == event_quarks[i].type)
|
|
|
|
return event_quarks[i].quark;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2005-11-21 11:06:42 +00:00
|
|
|
/**
|
|
|
|
* gst_event_type_get_flags:
|
|
|
|
* @type: a #GstEventType
|
|
|
|
*
|
|
|
|
* Gets the #GstEventTypeFlags associated with @type.
|
|
|
|
*
|
|
|
|
* Returns: a #GstEventTypeFlags.
|
|
|
|
*/
|
|
|
|
GstEventTypeFlags
|
|
|
|
gst_event_type_get_flags (GstEventType type)
|
|
|
|
{
|
|
|
|
GstEventTypeFlags ret;
|
|
|
|
|
2012-01-26 12:24:44 +00:00
|
|
|
ret = type & ((1 << GST_EVENT_NUM_SHIFT) - 1);
|
2005-11-21 11:06:42 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2002-07-08 19:22:02 +00:00
|
|
|
static void
|
2009-12-03 19:49:30 +00:00
|
|
|
_gst_event_free (GstEvent * event)
|
2001-10-17 10:21:27 +00:00
|
|
|
{
|
2011-05-10 09:50:16 +00:00
|
|
|
GstStructure *s;
|
|
|
|
|
check/Makefile.am: remove GstData checks
Original commit message from CVS:
* check/Makefile.am: remove GstData checks
* check/gst-libs/gdp.c: (START_TEST): fix for API changes
* gst/Makefile.am: add miniobject, remove data
* gst/gst.h: add miniobject, remove data
* gst/gstdata.c: remove
* gst/gstdata.h: remove
* gst/gstdata_private.h: remove
* gst/gsttypes.h: remove GstEvent and GstMessage
* gst/gstelement.c: (gst_element_post_message): fix for API changes
* gst/gstmarshal.list: change BOXED -> OBJECT
Implement GstMiniObject.
* gst/gstminiobject.c:
* gst/gstminiobject.h:
Modify to be subclasses of GstMiniObject.
* gst/gstbuffer.c: (_gst_buffer_initialize), (gst_buffer_get_type),
(gst_buffer_class_init), (gst_buffer_finalize), (_gst_buffer_copy),
(gst_buffer_init), (gst_buffer_new), (gst_buffer_new_and_alloc),
(gst_subbuffer_get_type), (gst_subbuffer_init),
(gst_buffer_create_sub), (gst_buffer_is_span_fast),
(gst_buffer_span):
* gst/gstbuffer.h:
* gst/gstevent.c: (_gst_event_initialize), (gst_event_get_type),
(gst_event_class_init), (gst_event_init), (gst_event_finalize),
(_gst_event_copy), (gst_event_new):
* gst/gstevent.h:
* gst/gstmessage.c: (_gst_message_initialize),
(gst_message_get_type), (gst_message_class_init),
(gst_message_init), (gst_message_finalize), (_gst_message_copy),
(gst_message_new), (gst_message_new_error),
(gst_message_new_warning), (gst_message_new_tag),
(gst_message_new_state_changed), (gst_message_new_application):
* gst/gstmessage.h:
* gst/gstprobe.c: (gst_probe_perform),
(gst_probe_dispatcher_dispatch):
* gst/gstprobe.h:
* gst/gstquery.c: (_gst_query_initialize), (gst_query_get_type),
(gst_query_class_init), (gst_query_finalize), (gst_query_init),
(_gst_query_copy), (gst_query_new):
Update elements for GstData -> GstMiniObject changes
* gst/gstquery.h:
* gst/gstqueue.c: (gst_queue_finalize), (gst_queue_locked_flush),
(gst_queue_chain), (gst_queue_loop):
* gst/elements/gstbufferstore.c:
(gst_buffer_store_add_buffer_func),
(gst_buffer_store_cleared_func), (gst_buffer_store_get_buffer):
* gst/elements/gstfakesink.c: (gst_fakesink_class_init),
(gst_fakesink_render):
* gst/elements/gstfakesrc.c: (gst_fakesrc_class_init):
* gst/elements/gstfilesrc.c: (gst_mmap_buffer_get_type),
(gst_mmap_buffer_class_init), (gst_mmap_buffer_init),
(gst_mmap_buffer_finalize), (gst_filesrc_map_region),
(gst_filesrc_create_read):
* gst/elements/gstidentity.c: (gst_identity_class_init):
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_src_event), (free_entry_buffers),
(gst_type_find_element_handle_event):
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_header_from_buffer):
* libs/gst/dataprotocol/dataprotocol.h:
* libs/gst/dataprotocol/dp-private.h:
2005-05-16 20:21:55 +00:00
|
|
|
g_return_if_fail (event != NULL);
|
|
|
|
g_return_if_fail (GST_IS_EVENT (event));
|
|
|
|
|
2005-10-17 18:09:32 +00:00
|
|
|
GST_CAT_LOG (GST_CAT_EVENT, "freeing event %p type %s", event,
|
2006-02-13 11:52:43 +00:00
|
|
|
GST_EVENT_TYPE_NAME (event));
|
2001-12-23 14:50:44 +00:00
|
|
|
|
2011-05-10 09:50:16 +00:00
|
|
|
s = GST_EVENT_STRUCTURE (event);
|
|
|
|
|
|
|
|
if (s) {
|
|
|
|
gst_structure_set_parent_refcount (s, NULL);
|
|
|
|
gst_structure_free (s);
|
2001-12-18 19:03:07 +00:00
|
|
|
}
|
2008-02-12 12:04:43 +00:00
|
|
|
|
2012-06-14 22:52:41 +00:00
|
|
|
g_slice_free1 (sizeof (GstEventImpl), event);
|
check/Makefile.am: remove GstData checks
Original commit message from CVS:
* check/Makefile.am: remove GstData checks
* check/gst-libs/gdp.c: (START_TEST): fix for API changes
* gst/Makefile.am: add miniobject, remove data
* gst/gst.h: add miniobject, remove data
* gst/gstdata.c: remove
* gst/gstdata.h: remove
* gst/gstdata_private.h: remove
* gst/gsttypes.h: remove GstEvent and GstMessage
* gst/gstelement.c: (gst_element_post_message): fix for API changes
* gst/gstmarshal.list: change BOXED -> OBJECT
Implement GstMiniObject.
* gst/gstminiobject.c:
* gst/gstminiobject.h:
Modify to be subclasses of GstMiniObject.
* gst/gstbuffer.c: (_gst_buffer_initialize), (gst_buffer_get_type),
(gst_buffer_class_init), (gst_buffer_finalize), (_gst_buffer_copy),
(gst_buffer_init), (gst_buffer_new), (gst_buffer_new_and_alloc),
(gst_subbuffer_get_type), (gst_subbuffer_init),
(gst_buffer_create_sub), (gst_buffer_is_span_fast),
(gst_buffer_span):
* gst/gstbuffer.h:
* gst/gstevent.c: (_gst_event_initialize), (gst_event_get_type),
(gst_event_class_init), (gst_event_init), (gst_event_finalize),
(_gst_event_copy), (gst_event_new):
* gst/gstevent.h:
* gst/gstmessage.c: (_gst_message_initialize),
(gst_message_get_type), (gst_message_class_init),
(gst_message_init), (gst_message_finalize), (_gst_message_copy),
(gst_message_new), (gst_message_new_error),
(gst_message_new_warning), (gst_message_new_tag),
(gst_message_new_state_changed), (gst_message_new_application):
* gst/gstmessage.h:
* gst/gstprobe.c: (gst_probe_perform),
(gst_probe_dispatcher_dispatch):
* gst/gstprobe.h:
* gst/gstquery.c: (_gst_query_initialize), (gst_query_get_type),
(gst_query_class_init), (gst_query_finalize), (gst_query_init),
(_gst_query_copy), (gst_query_new):
Update elements for GstData -> GstMiniObject changes
* gst/gstquery.h:
* gst/gstqueue.c: (gst_queue_finalize), (gst_queue_locked_flush),
(gst_queue_chain), (gst_queue_loop):
* gst/elements/gstbufferstore.c:
(gst_buffer_store_add_buffer_func),
(gst_buffer_store_cleared_func), (gst_buffer_store_get_buffer):
* gst/elements/gstfakesink.c: (gst_fakesink_class_init),
(gst_fakesink_render):
* gst/elements/gstfakesrc.c: (gst_fakesrc_class_init):
* gst/elements/gstfilesrc.c: (gst_mmap_buffer_get_type),
(gst_mmap_buffer_class_init), (gst_mmap_buffer_init),
(gst_mmap_buffer_finalize), (gst_filesrc_map_region),
(gst_filesrc_create_read):
* gst/elements/gstidentity.c: (gst_identity_class_init):
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_src_event), (free_entry_buffers),
(gst_type_find_element_handle_event):
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_header_from_buffer):
* libs/gst/dataprotocol/dataprotocol.h:
* libs/gst/dataprotocol/dp-private.h:
2005-05-16 20:21:55 +00:00
|
|
|
}
|
|
|
|
|
2012-06-14 22:52:41 +00:00
|
|
|
static void gst_event_init (GstEventImpl * event, GstEventType type);
|
2011-05-17 09:45:46 +00:00
|
|
|
|
check/Makefile.am: remove GstData checks
Original commit message from CVS:
* check/Makefile.am: remove GstData checks
* check/gst-libs/gdp.c: (START_TEST): fix for API changes
* gst/Makefile.am: add miniobject, remove data
* gst/gst.h: add miniobject, remove data
* gst/gstdata.c: remove
* gst/gstdata.h: remove
* gst/gstdata_private.h: remove
* gst/gsttypes.h: remove GstEvent and GstMessage
* gst/gstelement.c: (gst_element_post_message): fix for API changes
* gst/gstmarshal.list: change BOXED -> OBJECT
Implement GstMiniObject.
* gst/gstminiobject.c:
* gst/gstminiobject.h:
Modify to be subclasses of GstMiniObject.
* gst/gstbuffer.c: (_gst_buffer_initialize), (gst_buffer_get_type),
(gst_buffer_class_init), (gst_buffer_finalize), (_gst_buffer_copy),
(gst_buffer_init), (gst_buffer_new), (gst_buffer_new_and_alloc),
(gst_subbuffer_get_type), (gst_subbuffer_init),
(gst_buffer_create_sub), (gst_buffer_is_span_fast),
(gst_buffer_span):
* gst/gstbuffer.h:
* gst/gstevent.c: (_gst_event_initialize), (gst_event_get_type),
(gst_event_class_init), (gst_event_init), (gst_event_finalize),
(_gst_event_copy), (gst_event_new):
* gst/gstevent.h:
* gst/gstmessage.c: (_gst_message_initialize),
(gst_message_get_type), (gst_message_class_init),
(gst_message_init), (gst_message_finalize), (_gst_message_copy),
(gst_message_new), (gst_message_new_error),
(gst_message_new_warning), (gst_message_new_tag),
(gst_message_new_state_changed), (gst_message_new_application):
* gst/gstmessage.h:
* gst/gstprobe.c: (gst_probe_perform),
(gst_probe_dispatcher_dispatch):
* gst/gstprobe.h:
* gst/gstquery.c: (_gst_query_initialize), (gst_query_get_type),
(gst_query_class_init), (gst_query_finalize), (gst_query_init),
(_gst_query_copy), (gst_query_new):
Update elements for GstData -> GstMiniObject changes
* gst/gstquery.h:
* gst/gstqueue.c: (gst_queue_finalize), (gst_queue_locked_flush),
(gst_queue_chain), (gst_queue_loop):
* gst/elements/gstbufferstore.c:
(gst_buffer_store_add_buffer_func),
(gst_buffer_store_cleared_func), (gst_buffer_store_get_buffer):
* gst/elements/gstfakesink.c: (gst_fakesink_class_init),
(gst_fakesink_render):
* gst/elements/gstfakesrc.c: (gst_fakesrc_class_init):
* gst/elements/gstfilesrc.c: (gst_mmap_buffer_get_type),
(gst_mmap_buffer_class_init), (gst_mmap_buffer_init),
(gst_mmap_buffer_finalize), (gst_filesrc_map_region),
(gst_filesrc_create_read):
* gst/elements/gstidentity.c: (gst_identity_class_init):
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_src_event), (free_entry_buffers),
(gst_type_find_element_handle_event):
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_header_from_buffer):
* libs/gst/dataprotocol/dataprotocol.h:
* libs/gst/dataprotocol/dp-private.h:
2005-05-16 20:21:55 +00:00
|
|
|
static GstEvent *
|
2011-05-17 09:45:46 +00:00
|
|
|
_gst_event_copy (GstEvent * event)
|
check/Makefile.am: remove GstData checks
Original commit message from CVS:
* check/Makefile.am: remove GstData checks
* check/gst-libs/gdp.c: (START_TEST): fix for API changes
* gst/Makefile.am: add miniobject, remove data
* gst/gst.h: add miniobject, remove data
* gst/gstdata.c: remove
* gst/gstdata.h: remove
* gst/gstdata_private.h: remove
* gst/gsttypes.h: remove GstEvent and GstMessage
* gst/gstelement.c: (gst_element_post_message): fix for API changes
* gst/gstmarshal.list: change BOXED -> OBJECT
Implement GstMiniObject.
* gst/gstminiobject.c:
* gst/gstminiobject.h:
Modify to be subclasses of GstMiniObject.
* gst/gstbuffer.c: (_gst_buffer_initialize), (gst_buffer_get_type),
(gst_buffer_class_init), (gst_buffer_finalize), (_gst_buffer_copy),
(gst_buffer_init), (gst_buffer_new), (gst_buffer_new_and_alloc),
(gst_subbuffer_get_type), (gst_subbuffer_init),
(gst_buffer_create_sub), (gst_buffer_is_span_fast),
(gst_buffer_span):
* gst/gstbuffer.h:
* gst/gstevent.c: (_gst_event_initialize), (gst_event_get_type),
(gst_event_class_init), (gst_event_init), (gst_event_finalize),
(_gst_event_copy), (gst_event_new):
* gst/gstevent.h:
* gst/gstmessage.c: (_gst_message_initialize),
(gst_message_get_type), (gst_message_class_init),
(gst_message_init), (gst_message_finalize), (_gst_message_copy),
(gst_message_new), (gst_message_new_error),
(gst_message_new_warning), (gst_message_new_tag),
(gst_message_new_state_changed), (gst_message_new_application):
* gst/gstmessage.h:
* gst/gstprobe.c: (gst_probe_perform),
(gst_probe_dispatcher_dispatch):
* gst/gstprobe.h:
* gst/gstquery.c: (_gst_query_initialize), (gst_query_get_type),
(gst_query_class_init), (gst_query_finalize), (gst_query_init),
(_gst_query_copy), (gst_query_new):
Update elements for GstData -> GstMiniObject changes
* gst/gstquery.h:
* gst/gstqueue.c: (gst_queue_finalize), (gst_queue_locked_flush),
(gst_queue_chain), (gst_queue_loop):
* gst/elements/gstbufferstore.c:
(gst_buffer_store_add_buffer_func),
(gst_buffer_store_cleared_func), (gst_buffer_store_get_buffer):
* gst/elements/gstfakesink.c: (gst_fakesink_class_init),
(gst_fakesink_render):
* gst/elements/gstfakesrc.c: (gst_fakesrc_class_init):
* gst/elements/gstfilesrc.c: (gst_mmap_buffer_get_type),
(gst_mmap_buffer_class_init), (gst_mmap_buffer_init),
(gst_mmap_buffer_finalize), (gst_filesrc_map_region),
(gst_filesrc_create_read):
* gst/elements/gstidentity.c: (gst_identity_class_init):
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_src_event), (free_entry_buffers),
(gst_type_find_element_handle_event):
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_header_from_buffer):
* libs/gst/dataprotocol/dataprotocol.h:
* libs/gst/dataprotocol/dp-private.h:
2005-05-16 20:21:55 +00:00
|
|
|
{
|
2011-05-10 09:50:16 +00:00
|
|
|
GstEventImpl *copy;
|
|
|
|
GstStructure *s;
|
check/Makefile.am: remove GstData checks
Original commit message from CVS:
* check/Makefile.am: remove GstData checks
* check/gst-libs/gdp.c: (START_TEST): fix for API changes
* gst/Makefile.am: add miniobject, remove data
* gst/gst.h: add miniobject, remove data
* gst/gstdata.c: remove
* gst/gstdata.h: remove
* gst/gstdata_private.h: remove
* gst/gsttypes.h: remove GstEvent and GstMessage
* gst/gstelement.c: (gst_element_post_message): fix for API changes
* gst/gstmarshal.list: change BOXED -> OBJECT
Implement GstMiniObject.
* gst/gstminiobject.c:
* gst/gstminiobject.h:
Modify to be subclasses of GstMiniObject.
* gst/gstbuffer.c: (_gst_buffer_initialize), (gst_buffer_get_type),
(gst_buffer_class_init), (gst_buffer_finalize), (_gst_buffer_copy),
(gst_buffer_init), (gst_buffer_new), (gst_buffer_new_and_alloc),
(gst_subbuffer_get_type), (gst_subbuffer_init),
(gst_buffer_create_sub), (gst_buffer_is_span_fast),
(gst_buffer_span):
* gst/gstbuffer.h:
* gst/gstevent.c: (_gst_event_initialize), (gst_event_get_type),
(gst_event_class_init), (gst_event_init), (gst_event_finalize),
(_gst_event_copy), (gst_event_new):
* gst/gstevent.h:
* gst/gstmessage.c: (_gst_message_initialize),
(gst_message_get_type), (gst_message_class_init),
(gst_message_init), (gst_message_finalize), (_gst_message_copy),
(gst_message_new), (gst_message_new_error),
(gst_message_new_warning), (gst_message_new_tag),
(gst_message_new_state_changed), (gst_message_new_application):
* gst/gstmessage.h:
* gst/gstprobe.c: (gst_probe_perform),
(gst_probe_dispatcher_dispatch):
* gst/gstprobe.h:
* gst/gstquery.c: (_gst_query_initialize), (gst_query_get_type),
(gst_query_class_init), (gst_query_finalize), (gst_query_init),
(_gst_query_copy), (gst_query_new):
Update elements for GstData -> GstMiniObject changes
* gst/gstquery.h:
* gst/gstqueue.c: (gst_queue_finalize), (gst_queue_locked_flush),
(gst_queue_chain), (gst_queue_loop):
* gst/elements/gstbufferstore.c:
(gst_buffer_store_add_buffer_func),
(gst_buffer_store_cleared_func), (gst_buffer_store_get_buffer):
* gst/elements/gstfakesink.c: (gst_fakesink_class_init),
(gst_fakesink_render):
* gst/elements/gstfakesrc.c: (gst_fakesrc_class_init):
* gst/elements/gstfilesrc.c: (gst_mmap_buffer_get_type),
(gst_mmap_buffer_class_init), (gst_mmap_buffer_init),
(gst_mmap_buffer_finalize), (gst_filesrc_map_region),
(gst_filesrc_create_read):
* gst/elements/gstidentity.c: (gst_identity_class_init):
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_src_event), (free_entry_buffers),
(gst_type_find_element_handle_event):
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_header_from_buffer):
* libs/gst/dataprotocol/dataprotocol.h:
* libs/gst/dataprotocol/dp-private.h:
2005-05-16 20:21:55 +00:00
|
|
|
|
2011-05-17 09:45:46 +00:00
|
|
|
copy = g_slice_new0 (GstEventImpl);
|
|
|
|
|
2012-06-14 22:52:41 +00:00
|
|
|
gst_event_init (copy, GST_EVENT_TYPE (event));
|
check/Makefile.am: remove GstData checks
Original commit message from CVS:
* check/Makefile.am: remove GstData checks
* check/gst-libs/gdp.c: (START_TEST): fix for API changes
* gst/Makefile.am: add miniobject, remove data
* gst/gst.h: add miniobject, remove data
* gst/gstdata.c: remove
* gst/gstdata.h: remove
* gst/gstdata_private.h: remove
* gst/gsttypes.h: remove GstEvent and GstMessage
* gst/gstelement.c: (gst_element_post_message): fix for API changes
* gst/gstmarshal.list: change BOXED -> OBJECT
Implement GstMiniObject.
* gst/gstminiobject.c:
* gst/gstminiobject.h:
Modify to be subclasses of GstMiniObject.
* gst/gstbuffer.c: (_gst_buffer_initialize), (gst_buffer_get_type),
(gst_buffer_class_init), (gst_buffer_finalize), (_gst_buffer_copy),
(gst_buffer_init), (gst_buffer_new), (gst_buffer_new_and_alloc),
(gst_subbuffer_get_type), (gst_subbuffer_init),
(gst_buffer_create_sub), (gst_buffer_is_span_fast),
(gst_buffer_span):
* gst/gstbuffer.h:
* gst/gstevent.c: (_gst_event_initialize), (gst_event_get_type),
(gst_event_class_init), (gst_event_init), (gst_event_finalize),
(_gst_event_copy), (gst_event_new):
* gst/gstevent.h:
* gst/gstmessage.c: (_gst_message_initialize),
(gst_message_get_type), (gst_message_class_init),
(gst_message_init), (gst_message_finalize), (_gst_message_copy),
(gst_message_new), (gst_message_new_error),
(gst_message_new_warning), (gst_message_new_tag),
(gst_message_new_state_changed), (gst_message_new_application):
* gst/gstmessage.h:
* gst/gstprobe.c: (gst_probe_perform),
(gst_probe_dispatcher_dispatch):
* gst/gstprobe.h:
* gst/gstquery.c: (_gst_query_initialize), (gst_query_get_type),
(gst_query_class_init), (gst_query_finalize), (gst_query_init),
(_gst_query_copy), (gst_query_new):
Update elements for GstData -> GstMiniObject changes
* gst/gstquery.h:
* gst/gstqueue.c: (gst_queue_finalize), (gst_queue_locked_flush),
(gst_queue_chain), (gst_queue_loop):
* gst/elements/gstbufferstore.c:
(gst_buffer_store_add_buffer_func),
(gst_buffer_store_cleared_func), (gst_buffer_store_get_buffer):
* gst/elements/gstfakesink.c: (gst_fakesink_class_init),
(gst_fakesink_render):
* gst/elements/gstfakesrc.c: (gst_fakesrc_class_init):
* gst/elements/gstfilesrc.c: (gst_mmap_buffer_get_type),
(gst_mmap_buffer_class_init), (gst_mmap_buffer_init),
(gst_mmap_buffer_finalize), (gst_filesrc_map_region),
(gst_filesrc_create_read):
* gst/elements/gstidentity.c: (gst_identity_class_init):
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_src_event), (free_entry_buffers),
(gst_type_find_element_handle_event):
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_header_from_buffer):
* libs/gst/dataprotocol/dataprotocol.h:
* libs/gst/dataprotocol/dp-private.h:
2005-05-16 20:21:55 +00:00
|
|
|
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
GST_EVENT_TIMESTAMP (copy) = GST_EVENT_TIMESTAMP (event);
|
2008-11-04 12:22:53 +00:00
|
|
|
GST_EVENT_SEQNUM (copy) = GST_EVENT_SEQNUM (event);
|
check/Makefile.am: remove GstData checks
Original commit message from CVS:
* check/Makefile.am: remove GstData checks
* check/gst-libs/gdp.c: (START_TEST): fix for API changes
* gst/Makefile.am: add miniobject, remove data
* gst/gst.h: add miniobject, remove data
* gst/gstdata.c: remove
* gst/gstdata.h: remove
* gst/gstdata_private.h: remove
* gst/gsttypes.h: remove GstEvent and GstMessage
* gst/gstelement.c: (gst_element_post_message): fix for API changes
* gst/gstmarshal.list: change BOXED -> OBJECT
Implement GstMiniObject.
* gst/gstminiobject.c:
* gst/gstminiobject.h:
Modify to be subclasses of GstMiniObject.
* gst/gstbuffer.c: (_gst_buffer_initialize), (gst_buffer_get_type),
(gst_buffer_class_init), (gst_buffer_finalize), (_gst_buffer_copy),
(gst_buffer_init), (gst_buffer_new), (gst_buffer_new_and_alloc),
(gst_subbuffer_get_type), (gst_subbuffer_init),
(gst_buffer_create_sub), (gst_buffer_is_span_fast),
(gst_buffer_span):
* gst/gstbuffer.h:
* gst/gstevent.c: (_gst_event_initialize), (gst_event_get_type),
(gst_event_class_init), (gst_event_init), (gst_event_finalize),
(_gst_event_copy), (gst_event_new):
* gst/gstevent.h:
* gst/gstmessage.c: (_gst_message_initialize),
(gst_message_get_type), (gst_message_class_init),
(gst_message_init), (gst_message_finalize), (_gst_message_copy),
(gst_message_new), (gst_message_new_error),
(gst_message_new_warning), (gst_message_new_tag),
(gst_message_new_state_changed), (gst_message_new_application):
* gst/gstmessage.h:
* gst/gstprobe.c: (gst_probe_perform),
(gst_probe_dispatcher_dispatch):
* gst/gstprobe.h:
* gst/gstquery.c: (_gst_query_initialize), (gst_query_get_type),
(gst_query_class_init), (gst_query_finalize), (gst_query_init),
(_gst_query_copy), (gst_query_new):
Update elements for GstData -> GstMiniObject changes
* gst/gstquery.h:
* gst/gstqueue.c: (gst_queue_finalize), (gst_queue_locked_flush),
(gst_queue_chain), (gst_queue_loop):
* gst/elements/gstbufferstore.c:
(gst_buffer_store_add_buffer_func),
(gst_buffer_store_cleared_func), (gst_buffer_store_get_buffer):
* gst/elements/gstfakesink.c: (gst_fakesink_class_init),
(gst_fakesink_render):
* gst/elements/gstfakesrc.c: (gst_fakesrc_class_init):
* gst/elements/gstfilesrc.c: (gst_mmap_buffer_get_type),
(gst_mmap_buffer_class_init), (gst_mmap_buffer_init),
(gst_mmap_buffer_finalize), (gst_filesrc_map_region),
(gst_filesrc_create_read):
* gst/elements/gstidentity.c: (gst_identity_class_init):
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_src_event), (free_entry_buffers),
(gst_type_find_element_handle_event):
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_header_from_buffer):
* libs/gst/dataprotocol/dataprotocol.h:
* libs/gst/dataprotocol/dp-private.h:
2005-05-16 20:21:55 +00:00
|
|
|
|
2011-05-10 09:50:16 +00:00
|
|
|
s = GST_EVENT_STRUCTURE (event);
|
|
|
|
if (s) {
|
|
|
|
GST_EVENT_STRUCTURE (copy) = gst_structure_copy (s);
|
2011-05-18 13:43:20 +00:00
|
|
|
gst_structure_set_parent_refcount (GST_EVENT_STRUCTURE (copy),
|
|
|
|
©->event.mini_object.refcount);
|
2012-02-10 13:58:13 +00:00
|
|
|
} else {
|
|
|
|
GST_EVENT_STRUCTURE (copy) = NULL;
|
check/Makefile.am: remove GstData checks
Original commit message from CVS:
* check/Makefile.am: remove GstData checks
* check/gst-libs/gdp.c: (START_TEST): fix for API changes
* gst/Makefile.am: add miniobject, remove data
* gst/gst.h: add miniobject, remove data
* gst/gstdata.c: remove
* gst/gstdata.h: remove
* gst/gstdata_private.h: remove
* gst/gsttypes.h: remove GstEvent and GstMessage
* gst/gstelement.c: (gst_element_post_message): fix for API changes
* gst/gstmarshal.list: change BOXED -> OBJECT
Implement GstMiniObject.
* gst/gstminiobject.c:
* gst/gstminiobject.h:
Modify to be subclasses of GstMiniObject.
* gst/gstbuffer.c: (_gst_buffer_initialize), (gst_buffer_get_type),
(gst_buffer_class_init), (gst_buffer_finalize), (_gst_buffer_copy),
(gst_buffer_init), (gst_buffer_new), (gst_buffer_new_and_alloc),
(gst_subbuffer_get_type), (gst_subbuffer_init),
(gst_buffer_create_sub), (gst_buffer_is_span_fast),
(gst_buffer_span):
* gst/gstbuffer.h:
* gst/gstevent.c: (_gst_event_initialize), (gst_event_get_type),
(gst_event_class_init), (gst_event_init), (gst_event_finalize),
(_gst_event_copy), (gst_event_new):
* gst/gstevent.h:
* gst/gstmessage.c: (_gst_message_initialize),
(gst_message_get_type), (gst_message_class_init),
(gst_message_init), (gst_message_finalize), (_gst_message_copy),
(gst_message_new), (gst_message_new_error),
(gst_message_new_warning), (gst_message_new_tag),
(gst_message_new_state_changed), (gst_message_new_application):
* gst/gstmessage.h:
* gst/gstprobe.c: (gst_probe_perform),
(gst_probe_dispatcher_dispatch):
* gst/gstprobe.h:
* gst/gstquery.c: (_gst_query_initialize), (gst_query_get_type),
(gst_query_class_init), (gst_query_finalize), (gst_query_init),
(_gst_query_copy), (gst_query_new):
Update elements for GstData -> GstMiniObject changes
* gst/gstquery.h:
* gst/gstqueue.c: (gst_queue_finalize), (gst_queue_locked_flush),
(gst_queue_chain), (gst_queue_loop):
* gst/elements/gstbufferstore.c:
(gst_buffer_store_add_buffer_func),
(gst_buffer_store_cleared_func), (gst_buffer_store_get_buffer):
* gst/elements/gstfakesink.c: (gst_fakesink_class_init),
(gst_fakesink_render):
* gst/elements/gstfakesrc.c: (gst_fakesrc_class_init):
* gst/elements/gstfilesrc.c: (gst_mmap_buffer_get_type),
(gst_mmap_buffer_class_init), (gst_mmap_buffer_init),
(gst_mmap_buffer_finalize), (gst_filesrc_map_region),
(gst_filesrc_create_read):
* gst/elements/gstidentity.c: (gst_identity_class_init):
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_src_event), (free_entry_buffers),
(gst_type_find_element_handle_event):
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_header_from_buffer):
* libs/gst/dataprotocol/dataprotocol.h:
* libs/gst/dataprotocol/dp-private.h:
2005-05-16 20:21:55 +00:00
|
|
|
}
|
2014-04-04 15:06:18 +00:00
|
|
|
|
|
|
|
((GstEventImpl *) copy)->running_time_offset =
|
|
|
|
((GstEventImpl *) event)->running_time_offset;
|
|
|
|
|
2011-05-10 09:50:16 +00:00
|
|
|
return GST_EVENT_CAST (copy);
|
2002-07-08 19:22:02 +00:00
|
|
|
}
|
|
|
|
|
2009-12-05 13:16:57 +00:00
|
|
|
static void
|
2012-06-14 22:52:41 +00:00
|
|
|
gst_event_init (GstEventImpl * event, GstEventType type)
|
2009-12-05 13:16:57 +00:00
|
|
|
{
|
2012-07-04 14:38:15 +00:00
|
|
|
gst_mini_object_init (GST_MINI_OBJECT_CAST (event), 0, _gst_event_type,
|
2012-06-23 18:56:12 +00:00
|
|
|
(GstMiniObjectCopyFunction) _gst_event_copy, NULL,
|
|
|
|
(GstMiniObjectFreeFunction) _gst_event_free);
|
2009-12-05 13:16:57 +00:00
|
|
|
|
|
|
|
GST_EVENT_TYPE (event) = type;
|
|
|
|
GST_EVENT_TIMESTAMP (event) = GST_CLOCK_TIME_NONE;
|
|
|
|
GST_EVENT_SEQNUM (event) = gst_util_seqnum_next ();
|
2014-04-04 15:06:18 +00:00
|
|
|
event->running_time_offset = 0;
|
2009-12-05 13:16:57 +00:00
|
|
|
}
|
|
|
|
|
2002-12-30 17:42:11 +00:00
|
|
|
|
2002-07-08 19:22:02 +00:00
|
|
|
/**
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* gst_event_new_custom:
|
2002-07-08 19:22:02 +00:00
|
|
|
* @type: The type of the new event
|
2010-12-07 18:35:04 +00:00
|
|
|
* @structure: (transfer full): the structure for the event. The event will
|
|
|
|
* take ownership of the structure.
|
2002-07-08 19:22:02 +00:00
|
|
|
*
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* Create a new custom-typed event. This can be used for anything not
|
|
|
|
* handled by other event-specific functions to pass an event to another
|
|
|
|
* element.
|
2002-07-08 19:22:02 +00:00
|
|
|
*
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* Make sure to allocate an event type with the #GST_EVENT_MAKE_TYPE macro,
|
|
|
|
* assigning a free number and filling in the correct direction and
|
|
|
|
* serialization flags.
|
|
|
|
*
|
|
|
|
* New custom events can also be created by subclassing the event type if
|
|
|
|
* needed.
|
|
|
|
*
|
2010-12-07 18:35:04 +00:00
|
|
|
* Returns: (transfer full): the new custom event.
|
2002-07-08 19:22:02 +00:00
|
|
|
*/
|
2004-03-13 15:27:01 +00:00
|
|
|
GstEvent *
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
gst_event_new_custom (GstEventType type, GstStructure * structure)
|
2002-07-08 19:22:02 +00:00
|
|
|
{
|
2012-02-10 13:58:13 +00:00
|
|
|
GstEventImpl *event;
|
|
|
|
|
|
|
|
event = g_slice_new0 (GstEventImpl);
|
|
|
|
|
|
|
|
GST_CAT_DEBUG (GST_CAT_EVENT, "creating new event %p %s %d", event,
|
|
|
|
gst_event_type_get_name (type), type);
|
2002-07-08 19:22:02 +00:00
|
|
|
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
if (structure) {
|
2012-02-10 13:58:13 +00:00
|
|
|
/* structure must not have a parent */
|
2011-05-11 16:17:45 +00:00
|
|
|
if (!gst_structure_set_parent_refcount (structure,
|
2012-02-10 13:58:13 +00:00
|
|
|
&event->event.mini_object.refcount))
|
2011-05-11 16:17:45 +00:00
|
|
|
goto had_parent;
|
|
|
|
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
}
|
2012-06-14 22:52:41 +00:00
|
|
|
gst_event_init (event, type);
|
2012-02-10 13:58:13 +00:00
|
|
|
|
|
|
|
GST_EVENT_STRUCTURE (event) = structure;
|
|
|
|
|
|
|
|
return GST_EVENT_CAST (event);
|
2011-05-11 16:17:45 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
had_parent:
|
|
|
|
{
|
2012-06-14 22:52:41 +00:00
|
|
|
g_slice_free1 (sizeof (GstEventImpl), event);
|
2011-05-11 16:17:45 +00:00
|
|
|
g_warning ("structure is already owned by another object");
|
|
|
|
return NULL;
|
|
|
|
}
|
2001-10-17 10:21:27 +00:00
|
|
|
}
|
|
|
|
|
2001-10-21 18:00:31 +00:00
|
|
|
/**
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* gst_event_get_structure:
|
|
|
|
* @event: The #GstEvent.
|
2001-10-21 18:00:31 +00:00
|
|
|
*
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* Access the structure of the event.
|
2001-10-21 18:00:31 +00:00
|
|
|
*
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* Returns: The structure of the event. The structure is still
|
|
|
|
* owned by the event, which means that you should not free it and
|
|
|
|
* that the pointer becomes invalid when you free the event.
|
|
|
|
*
|
|
|
|
* MT safe.
|
2001-10-21 18:00:31 +00:00
|
|
|
*/
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
const GstStructure *
|
|
|
|
gst_event_get_structure (GstEvent * event)
|
2001-10-17 10:21:27 +00:00
|
|
|
{
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
g_return_val_if_fail (GST_IS_EVENT (event), NULL);
|
2002-07-08 19:22:02 +00:00
|
|
|
|
2011-05-17 09:45:42 +00:00
|
|
|
return GST_EVENT_STRUCTURE (event);
|
2011-05-10 09:50:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_writable_structure:
|
|
|
|
* @event: The #GstEvent.
|
|
|
|
*
|
|
|
|
* Get a writable version of the structure.
|
|
|
|
*
|
2014-06-11 23:28:51 +00:00
|
|
|
* Returns: (transfer none): The structure of the event. The structure
|
|
|
|
* is still owned by the event, which means that you should not free
|
|
|
|
* it and that the pointer becomes invalid when you free the event.
|
|
|
|
* This function checks if @event is writable and will never return
|
|
|
|
* %NULL.
|
2011-05-10 09:50:16 +00:00
|
|
|
*
|
|
|
|
* MT safe.
|
|
|
|
*/
|
|
|
|
GstStructure *
|
|
|
|
gst_event_writable_structure (GstEvent * event)
|
|
|
|
{
|
|
|
|
GstStructure *structure;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GST_IS_EVENT (event), NULL);
|
|
|
|
g_return_val_if_fail (gst_event_is_writable (event), NULL);
|
|
|
|
|
2011-05-17 09:45:42 +00:00
|
|
|
structure = GST_EVENT_STRUCTURE (event);
|
2011-05-10 09:50:16 +00:00
|
|
|
|
2011-05-17 09:45:42 +00:00
|
|
|
if (structure == NULL) {
|
2011-05-10 09:50:16 +00:00
|
|
|
structure =
|
2011-10-29 07:02:00 +00:00
|
|
|
gst_structure_new_id_empty (gst_event_type_to_quark (GST_EVENT_TYPE
|
2011-05-17 09:45:42 +00:00
|
|
|
(event)));
|
|
|
|
gst_structure_set_parent_refcount (structure, &event->mini_object.refcount);
|
|
|
|
GST_EVENT_STRUCTURE (event) = structure;
|
|
|
|
}
|
2011-05-10 09:50:16 +00:00
|
|
|
return structure;
|
2001-10-17 10:21:27 +00:00
|
|
|
}
|
2001-12-18 19:03:07 +00:00
|
|
|
|
2008-04-29 11:23:51 +00:00
|
|
|
/**
|
|
|
|
* gst_event_has_name:
|
|
|
|
* @event: The #GstEvent.
|
|
|
|
* @name: name to check
|
|
|
|
*
|
|
|
|
* Checks if @event has the given @name. This function is usually used to
|
|
|
|
* check the name of a custom event.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if @name matches the name of the event structure.
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gst_event_has_name (GstEvent * event, const gchar * name)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_EVENT (event), FALSE);
|
|
|
|
|
2011-05-10 09:50:16 +00:00
|
|
|
if (GST_EVENT_STRUCTURE (event) == NULL)
|
2008-04-29 11:23:51 +00:00
|
|
|
return FALSE;
|
|
|
|
|
2011-05-10 09:50:16 +00:00
|
|
|
return gst_structure_has_name (GST_EVENT_STRUCTURE (event), name);
|
2008-04-29 11:23:51 +00:00
|
|
|
}
|
|
|
|
|
2008-11-04 12:22:53 +00:00
|
|
|
/**
|
|
|
|
* gst_event_get_seqnum:
|
|
|
|
* @event: A #GstEvent.
|
|
|
|
*
|
|
|
|
* Retrieve the sequence number of a event.
|
|
|
|
*
|
|
|
|
* Events have ever-incrementing sequence numbers, which may also be set
|
|
|
|
* explicitly via gst_event_set_seqnum(). Sequence numbers are typically used to
|
|
|
|
* indicate that a event corresponds to some other set of events or messages,
|
|
|
|
* for example an EOS event corresponding to a SEEK event. It is considered good
|
|
|
|
* practice to make this correspondence when possible, though it is not
|
|
|
|
* required.
|
|
|
|
*
|
|
|
|
* Note that events and messages share the same sequence number incrementor;
|
2011-07-16 19:00:15 +00:00
|
|
|
* two events or messages will never have the same sequence number unless
|
2008-11-04 12:22:53 +00:00
|
|
|
* that correspondence was made explicitly.
|
|
|
|
*
|
|
|
|
* Returns: The event's sequence number.
|
|
|
|
*
|
|
|
|
* MT safe.
|
|
|
|
*/
|
|
|
|
guint32
|
|
|
|
gst_event_get_seqnum (GstEvent * event)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_EVENT (event), -1);
|
|
|
|
|
|
|
|
return GST_EVENT_SEQNUM (event);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_set_seqnum:
|
|
|
|
* @event: A #GstEvent.
|
|
|
|
* @seqnum: A sequence number.
|
|
|
|
*
|
|
|
|
* Set the sequence number of a event.
|
|
|
|
*
|
|
|
|
* This function might be called by the creator of a event to indicate that the
|
|
|
|
* event relates to other events or messages. See gst_event_get_seqnum() for
|
|
|
|
* more information.
|
|
|
|
*
|
|
|
|
* MT safe.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_event_set_seqnum (GstEvent * event, guint32 seqnum)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GST_IS_EVENT (event));
|
|
|
|
|
|
|
|
GST_EVENT_SEQNUM (event) = seqnum;
|
|
|
|
}
|
2014-04-04 15:06:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_get_running_time_offset:
|
|
|
|
* @event: A #GstEvent.
|
|
|
|
*
|
|
|
|
* Retrieve the accumulated running time offset of the event.
|
|
|
|
*
|
|
|
|
* Events passing through #GstPads that have a running time
|
|
|
|
* offset set via gst_pad_set_offset() will get their offset
|
|
|
|
* adjusted according to the pad's offset.
|
|
|
|
*
|
|
|
|
* If the event contains any information that related to the
|
|
|
|
* running time, this information will need to be updated
|
|
|
|
* before usage with this offset.
|
|
|
|
*
|
|
|
|
* Returns: The event's running time offset
|
|
|
|
*
|
|
|
|
* MT safe.
|
|
|
|
*
|
|
|
|
* Since: 1.4
|
|
|
|
*/
|
|
|
|
gint64
|
|
|
|
gst_event_get_running_time_offset (GstEvent * event)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_EVENT (event), 0);
|
|
|
|
|
|
|
|
return ((GstEventImpl *) event)->running_time_offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_set_running_time_offset:
|
|
|
|
* @event: A #GstEvent.
|
|
|
|
* @offset: A the new running time offset
|
|
|
|
*
|
|
|
|
* Set the running time offset of a event. See
|
|
|
|
* gst_event_get_running_time_offset() for more information.
|
|
|
|
*
|
|
|
|
* MT safe.
|
|
|
|
*
|
|
|
|
* Since: 1.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_event_set_running_time_offset (GstEvent * event, gint64 offset)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GST_IS_EVENT (event));
|
|
|
|
|
|
|
|
((GstEventImpl *) event)->running_time_offset = offset;
|
|
|
|
}
|
2008-11-04 12:22:53 +00:00
|
|
|
|
2002-06-12 22:26:36 +00:00
|
|
|
/**
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* gst_event_new_flush_start:
|
|
|
|
*
|
2007-04-28 11:29:54 +00:00
|
|
|
* Allocate a new flush start event. The flush start event can be sent
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* upstream and downstream and travels out-of-bounds with the dataflow.
|
gst/gstbin.c: Update documentation.
Original commit message from CVS:
* gst/gstbin.c:
Update documentation.
* gst/gstelement.c: (gst_element_class_init),
(gst_element_release_request_pad), (gst_element_set_clock),
(gst_element_get_index), (gst_element_add_pad),
(gst_element_remove_pad), (gst_element_get_random_pad),
(gst_element_send_event), (gst_element_get_query_types),
(gst_element_query), (gst_element_post_message),
(gst_element_message_full), (gst_element_continue_state),
(gst_element_lost_state), (gst_element_save_thyself),
(gst_element_restore_thyself):
Documentation updates.
Rename last bit of the new-pad -> pad-added signal rename.
Fix the case where an element query would only work if the source
pad was linked.
Avoid some useless type checking in message handling.
* gst/gstevent.c:
* gst/gstevent.h:
* gst/gstutils.c:
Documentation updates.
2006-09-15 08:32:57 +00:00
|
|
|
*
|
|
|
|
* It marks pads as being flushing and will make them return
|
2012-02-08 14:16:46 +00:00
|
|
|
* #GST_FLOW_FLUSHING when used for data flow with gst_pad_push(),
|
2012-03-16 17:39:08 +00:00
|
|
|
* gst_pad_chain(), gst_pad_get_range() and gst_pad_pull_range().
|
|
|
|
* Any event (except a #GST_EVENT_FLUSH_STOP) received
|
2007-04-28 11:29:54 +00:00
|
|
|
* on a flushing pad will return %FALSE immediately.
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
*
|
2007-01-10 10:21:47 +00:00
|
|
|
* Elements should unlock any blocking functions and exit their streaming
|
|
|
|
* functions as fast as possible when this event is received.
|
2002-06-12 22:26:36 +00:00
|
|
|
*
|
2007-01-10 10:21:47 +00:00
|
|
|
* This event is typically generated after a seek to flush out all queued data
|
|
|
|
* in the pipeline so that the new media is played as soon as possible.
|
2002-06-12 22:26:36 +00:00
|
|
|
*
|
2010-12-07 18:35:04 +00:00
|
|
|
* Returns: (transfer full): a new flush start event.
|
2002-06-12 22:26:36 +00:00
|
|
|
*/
|
2004-03-13 15:27:01 +00:00
|
|
|
GstEvent *
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
gst_event_new_flush_start (void)
|
2002-05-26 21:54:27 +00:00
|
|
|
{
|
2012-02-10 13:58:13 +00:00
|
|
|
return gst_event_new_custom (GST_EVENT_FLUSH_START, NULL);
|
2002-05-26 21:54:27 +00:00
|
|
|
}
|
|
|
|
|
2003-07-16 19:25:11 +00:00
|
|
|
/**
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* gst_event_new_flush_stop:
|
2011-06-10 09:55:08 +00:00
|
|
|
* @reset_time: if time should be reset
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
*
|
2007-04-28 11:29:54 +00:00
|
|
|
* Allocate a new flush stop event. The flush stop event can be sent
|
2009-11-27 16:42:36 +00:00
|
|
|
* upstream and downstream and travels serialized with the dataflow.
|
2007-04-28 11:29:54 +00:00
|
|
|
* It is typically sent after sending a FLUSH_START event to make the
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* pads accept data again.
|
2003-07-16 19:25:11 +00:00
|
|
|
*
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* Elements can process this event synchronized with the dataflow since
|
2013-12-07 14:38:19 +00:00
|
|
|
* the preceding FLUSH_START event stopped the dataflow.
|
2003-07-16 19:25:11 +00:00
|
|
|
*
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* This event is typically generated to complete a seek and to resume
|
|
|
|
* dataflow.
|
|
|
|
*
|
2010-12-07 18:35:04 +00:00
|
|
|
* Returns: (transfer full): a new flush stop event.
|
2003-07-16 19:25:11 +00:00
|
|
|
*/
|
2004-03-13 15:27:01 +00:00
|
|
|
GstEvent *
|
2011-06-10 09:55:08 +00:00
|
|
|
gst_event_new_flush_stop (gboolean reset_time)
|
2003-07-16 19:25:11 +00:00
|
|
|
{
|
2011-06-10 09:55:08 +00:00
|
|
|
GstEvent *event;
|
|
|
|
|
|
|
|
GST_CAT_INFO (GST_CAT_EVENT, "creating flush stop %d", reset_time);
|
|
|
|
|
|
|
|
event = gst_event_new_custom (GST_EVENT_FLUSH_STOP,
|
2011-10-29 07:02:00 +00:00
|
|
|
gst_structure_new_id (GST_QUARK (EVENT_FLUSH_STOP),
|
2011-06-10 09:55:08 +00:00
|
|
|
GST_QUARK (RESET_TIME), G_TYPE_BOOLEAN, reset_time, NULL));
|
|
|
|
|
|
|
|
return event;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_parse_flush_stop:
|
|
|
|
* @event: The event to parse
|
|
|
|
* @reset_time: (out): if time should be reset
|
|
|
|
*
|
|
|
|
* Parse the FLUSH_STOP event and retrieve the @reset_time member.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_event_parse_flush_stop (GstEvent * event, gboolean * reset_time)
|
|
|
|
{
|
|
|
|
GstStructure *structure;
|
|
|
|
|
|
|
|
g_return_if_fail (GST_IS_EVENT (event));
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_FLUSH_STOP);
|
|
|
|
|
|
|
|
structure = GST_EVENT_STRUCTURE (event);
|
|
|
|
if (G_LIKELY (reset_time))
|
|
|
|
*reset_time =
|
|
|
|
g_value_get_boolean (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (RESET_TIME)));
|
2003-07-16 19:25:11 +00:00
|
|
|
}
|
|
|
|
|
2015-06-12 08:53:23 +00:00
|
|
|
/**
|
|
|
|
* gst_event_new_select_streams:
|
|
|
|
* @streams: (element-type gchar) (transfer none): the list of streams to
|
|
|
|
* activate
|
|
|
|
*
|
|
|
|
* Allocate a new select-streams event.
|
|
|
|
*
|
|
|
|
* The select-streams event requests the specified @streams to be activated.
|
|
|
|
*
|
|
|
|
* The list of @streams corresponds to the "Stream ID" of each stream to be
|
|
|
|
* activated. Those ID can be obtained via the #GstStream objects present
|
|
|
|
* in #GST_EVENT_STREAM_START, #GST_EVENT_STREAM_COLLECTION or
|
|
|
|
* #GST_MESSSAGE_STREAM_COLLECTION.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): a new select-streams event.
|
2016-06-30 14:07:28 +00:00
|
|
|
*
|
|
|
|
* Since: 1.10
|
2015-06-12 08:53:23 +00:00
|
|
|
*/
|
|
|
|
GstEvent *
|
|
|
|
gst_event_new_select_streams (GList * streams)
|
|
|
|
{
|
|
|
|
GstEvent *event;
|
|
|
|
GValue val = G_VALUE_INIT;
|
|
|
|
GstStructure *struc;
|
|
|
|
GList *tmpl;
|
|
|
|
|
|
|
|
GST_CAT_INFO (GST_CAT_EVENT, "Creating new select-streams event");
|
|
|
|
struc = gst_structure_new_id_empty (GST_QUARK (EVENT_SELECT_STREAMS));
|
|
|
|
g_value_init (&val, GST_TYPE_LIST);
|
|
|
|
/* Fill struc with streams */
|
|
|
|
for (tmpl = streams; tmpl; tmpl = tmpl->next) {
|
|
|
|
GValue strval = G_VALUE_INIT;
|
|
|
|
const gchar *str = (const gchar *) tmpl->data;
|
|
|
|
g_value_init (&strval, G_TYPE_STRING);
|
|
|
|
g_value_set_string (&strval, str);
|
|
|
|
gst_value_list_append_and_take_value (&val, &strval);
|
|
|
|
}
|
|
|
|
gst_structure_id_take_value (struc, GST_QUARK (STREAMS), &val);
|
|
|
|
event = gst_event_new_custom (GST_EVENT_SELECT_STREAMS, struc);
|
|
|
|
|
|
|
|
return event;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_parse_select_streams:
|
|
|
|
* @event: The event to parse
|
|
|
|
* @streams: (out) (element-type gchar) (transfer full): the streams
|
|
|
|
*
|
|
|
|
* Parse the SELECT_STREAMS event and retrieve the contained streams.
|
2016-06-30 14:07:28 +00:00
|
|
|
*
|
|
|
|
* Since: 1.10
|
2015-06-12 08:53:23 +00:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_event_parse_select_streams (GstEvent * event, GList ** streams)
|
|
|
|
{
|
|
|
|
GstStructure *structure;
|
|
|
|
GList *res = NULL;
|
|
|
|
|
|
|
|
g_return_if_fail (GST_IS_EVENT (event));
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_SELECT_STREAMS);
|
|
|
|
|
|
|
|
structure = GST_EVENT_STRUCTURE (event);
|
|
|
|
if (G_LIKELY (streams)) {
|
|
|
|
const GValue *vlist =
|
|
|
|
gst_structure_id_get_value (structure, GST_QUARK (STREAMS));
|
|
|
|
guint i, sz = gst_value_list_get_size (vlist);
|
|
|
|
for (i = 0; i < sz; i++) {
|
|
|
|
const GValue *strv = gst_value_list_get_value (vlist, i);
|
|
|
|
res = g_list_append (res, g_value_dup_string (strv));
|
|
|
|
}
|
|
|
|
*streams = res;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-03-14 03:20:42 +00:00
|
|
|
/**
|
|
|
|
* gst_event_new_stream_group_done:
|
|
|
|
* @group_id: the group id of the stream group which is ending
|
|
|
|
*
|
|
|
|
* Create a new Stream Group Done event. The stream-group-done event can
|
|
|
|
* only travel downstream synchronized with the buffer flow. Elements
|
|
|
|
* that receive the event on a pad should handle it mostly like EOS,
|
|
|
|
* and emit any data or pending buffers that would depend on more data
|
|
|
|
* arriving and unblock, since there won't be any more data.
|
|
|
|
*
|
|
|
|
* This event is followed by EOS at some point in the future, and is
|
|
|
|
* generally used when switching pads - to unblock downstream so that
|
|
|
|
* new pads can be exposed before sending EOS on the existing pads.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): the new stream-group-done event.
|
|
|
|
*
|
|
|
|
* Since: 1.10
|
|
|
|
*/
|
|
|
|
GstEvent *
|
|
|
|
gst_event_new_stream_group_done (guint group_id)
|
|
|
|
{
|
|
|
|
GstStructure *s;
|
|
|
|
|
|
|
|
s = gst_structure_new_id (GST_QUARK (EVENT_STREAM_GROUP_DONE),
|
|
|
|
GST_QUARK (GROUP_ID), G_TYPE_UINT, group_id, NULL);
|
|
|
|
|
|
|
|
return gst_event_new_custom (GST_EVENT_STREAM_GROUP_DONE, s);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_parse_stream_group_done:
|
|
|
|
* @event: a stream-group-done event.
|
|
|
|
* @group_id: (out): address of variable to store the group id into
|
|
|
|
*
|
|
|
|
* Parse a stream-group-done @event and store the result in the given
|
|
|
|
* @group_id location.
|
|
|
|
*
|
|
|
|
* Since: 1.10
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_event_parse_stream_group_done (GstEvent * event, guint * group_id)
|
|
|
|
{
|
|
|
|
g_return_if_fail (event != NULL);
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_STREAM_GROUP_DONE);
|
|
|
|
|
|
|
|
if (group_id) {
|
|
|
|
gst_structure_id_get (GST_EVENT_STRUCTURE (event),
|
|
|
|
GST_QUARK (GROUP_ID), G_TYPE_UINT, group_id, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-06-12 22:26:36 +00:00
|
|
|
/**
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* gst_event_new_eos:
|
2002-06-12 22:26:36 +00:00
|
|
|
*
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* Create a new EOS event. The eos event can only travel downstream
|
|
|
|
* synchronized with the buffer flow. Elements that receive the EOS
|
2012-03-28 16:12:23 +00:00
|
|
|
* event on a pad can return #GST_FLOW_EOS as a #GstFlowReturn
|
gst/gstbin.c: Update documentation.
Original commit message from CVS:
* gst/gstbin.c:
Update documentation.
* gst/gstelement.c: (gst_element_class_init),
(gst_element_release_request_pad), (gst_element_set_clock),
(gst_element_get_index), (gst_element_add_pad),
(gst_element_remove_pad), (gst_element_get_random_pad),
(gst_element_send_event), (gst_element_get_query_types),
(gst_element_query), (gst_element_post_message),
(gst_element_message_full), (gst_element_continue_state),
(gst_element_lost_state), (gst_element_save_thyself),
(gst_element_restore_thyself):
Documentation updates.
Rename last bit of the new-pad -> pad-added signal rename.
Fix the case where an element query would only work if the source
pad was linked.
Avoid some useless type checking in message handling.
* gst/gstevent.c:
* gst/gstevent.h:
* gst/gstutils.c:
Documentation updates.
2006-09-15 08:32:57 +00:00
|
|
|
* when data after the EOS event arrives.
|
2002-06-12 22:26:36 +00:00
|
|
|
*
|
2006-01-19 13:30:31 +00:00
|
|
|
* The EOS event will travel down to the sink elements in the pipeline
|
gst/gstbin.c: Update documentation.
Original commit message from CVS:
* gst/gstbin.c:
Update documentation.
* gst/gstelement.c: (gst_element_class_init),
(gst_element_release_request_pad), (gst_element_set_clock),
(gst_element_get_index), (gst_element_add_pad),
(gst_element_remove_pad), (gst_element_get_random_pad),
(gst_element_send_event), (gst_element_get_query_types),
(gst_element_query), (gst_element_post_message),
(gst_element_message_full), (gst_element_continue_state),
(gst_element_lost_state), (gst_element_save_thyself),
(gst_element_restore_thyself):
Documentation updates.
Rename last bit of the new-pad -> pad-added signal rename.
Fix the case where an element query would only work if the source
pad was linked.
Avoid some useless type checking in message handling.
* gst/gstevent.c:
* gst/gstevent.h:
* gst/gstutils.c:
Documentation updates.
2006-09-15 08:32:57 +00:00
|
|
|
* which will then post the #GST_MESSAGE_EOS on the bus after they have
|
2006-01-19 13:30:31 +00:00
|
|
|
* finished playing any buffered data.
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
*
|
2007-01-10 10:21:47 +00:00
|
|
|
* When all sinks have posted an EOS message, an EOS message is
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* forwarded to the application.
|
|
|
|
*
|
2010-04-06 15:46:36 +00:00
|
|
|
* The EOS event itself will not cause any state transitions of the pipeline.
|
2010-04-04 12:21:16 +00:00
|
|
|
*
|
2010-12-07 18:35:04 +00:00
|
|
|
* Returns: (transfer full): the new EOS event.
|
2002-06-12 22:26:36 +00:00
|
|
|
*/
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
GstEvent *
|
|
|
|
gst_event_new_eos (void)
|
2002-05-26 21:54:27 +00:00
|
|
|
{
|
2012-02-10 13:58:13 +00:00
|
|
|
return gst_event_new_custom (GST_EVENT_EOS, NULL);
|
2002-05-26 21:54:27 +00:00
|
|
|
}
|
|
|
|
|
2012-01-27 18:56:01 +00:00
|
|
|
/**
|
|
|
|
* gst_event_new_gap:
|
2012-01-28 18:50:23 +00:00
|
|
|
* @timestamp: the start time (pts) of the gap
|
|
|
|
* @duration: the duration of the gap
|
2012-01-27 18:56:01 +00:00
|
|
|
*
|
|
|
|
* Create a new GAP event. A gap event can be thought of as conceptually
|
|
|
|
* equivalent to a buffer to signal that there is no data for a certain
|
|
|
|
* amount of time. This is useful to signal a gap to downstream elements
|
|
|
|
* which may wait for data, such as muxers or mixers or overlays, especially
|
|
|
|
* for sparse streams such as subtitle streams.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): the new GAP event.
|
|
|
|
*/
|
|
|
|
GstEvent *
|
|
|
|
gst_event_new_gap (GstClockTime timestamp, GstClockTime duration)
|
|
|
|
{
|
|
|
|
GstEvent *event;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), NULL);
|
|
|
|
|
|
|
|
GST_CAT_TRACE (GST_CAT_EVENT, "creating gap %" GST_TIME_FORMAT " - "
|
|
|
|
"%" GST_TIME_FORMAT " (duration: %" GST_TIME_FORMAT ")",
|
2012-01-28 18:50:23 +00:00
|
|
|
GST_TIME_ARGS (timestamp), GST_TIME_ARGS (timestamp + duration),
|
|
|
|
GST_TIME_ARGS (duration));
|
2012-01-27 18:56:01 +00:00
|
|
|
|
|
|
|
event = gst_event_new_custom (GST_EVENT_GAP,
|
|
|
|
gst_structure_new_id (GST_QUARK (EVENT_GAP),
|
|
|
|
GST_QUARK (TIMESTAMP), GST_TYPE_CLOCK_TIME, timestamp,
|
|
|
|
GST_QUARK (DURATION), GST_TYPE_CLOCK_TIME, duration, NULL));
|
|
|
|
|
|
|
|
return event;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_parse_gap:
|
2012-03-29 11:34:50 +00:00
|
|
|
* @event: a #GstEvent of type #GST_EVENT_GAP
|
2012-01-28 18:50:23 +00:00
|
|
|
* @timestamp: (out) (allow-none): location where to store the
|
|
|
|
* start time (pts) of the gap, or %NULL
|
2012-01-27 18:56:01 +00:00
|
|
|
* @duration: (out) (allow-none): location where to store the duration of
|
|
|
|
* the gap, or %NULL
|
|
|
|
*
|
|
|
|
* Extract timestamp and duration from a new GAP event.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_event_parse_gap (GstEvent * event, GstClockTime * timestamp,
|
|
|
|
GstClockTime * duration)
|
|
|
|
{
|
|
|
|
GstStructure *structure;
|
|
|
|
|
|
|
|
g_return_if_fail (GST_IS_EVENT (event));
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_GAP);
|
|
|
|
|
|
|
|
structure = GST_EVENT_STRUCTURE (event);
|
|
|
|
gst_structure_id_get (structure,
|
|
|
|
GST_QUARK (TIMESTAMP), GST_TYPE_CLOCK_TIME, timestamp,
|
|
|
|
GST_QUARK (DURATION), GST_TYPE_CLOCK_TIME, duration, NULL);
|
|
|
|
}
|
|
|
|
|
2011-05-04 09:03:05 +00:00
|
|
|
/**
|
|
|
|
* gst_event_new_caps:
|
2011-10-12 12:37:31 +00:00
|
|
|
* @caps: (transfer none): a #GstCaps
|
2011-05-04 09:03:05 +00:00
|
|
|
*
|
|
|
|
* Create a new CAPS event for @caps. The caps event can only travel downstream
|
2011-05-13 16:07:24 +00:00
|
|
|
* synchronized with the buffer flow and contains the format of the buffers
|
2011-05-04 09:03:05 +00:00
|
|
|
* that will follow after the event.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): the new CAPS event.
|
|
|
|
*/
|
|
|
|
GstEvent *
|
|
|
|
gst_event_new_caps (GstCaps * caps)
|
|
|
|
{
|
|
|
|
GstEvent *event;
|
|
|
|
|
2011-05-13 16:07:24 +00:00
|
|
|
g_return_val_if_fail (caps != NULL, NULL);
|
|
|
|
g_return_val_if_fail (gst_caps_is_fixed (caps), NULL);
|
2011-05-06 13:51:11 +00:00
|
|
|
|
2011-05-04 09:03:05 +00:00
|
|
|
GST_CAT_INFO (GST_CAT_EVENT, "creating caps event %" GST_PTR_FORMAT, caps);
|
|
|
|
|
2011-05-04 13:53:21 +00:00
|
|
|
event = gst_event_new_custom (GST_EVENT_CAPS,
|
2011-10-29 07:02:00 +00:00
|
|
|
gst_structure_new_id (GST_QUARK (EVENT_CAPS),
|
2011-05-04 09:03:05 +00:00
|
|
|
GST_QUARK (CAPS), GST_TYPE_CAPS, caps, NULL));
|
|
|
|
|
|
|
|
return event;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_parse_caps:
|
|
|
|
* @event: The event to parse
|
2012-07-11 10:40:10 +00:00
|
|
|
* @caps: (out) (transfer none): A pointer to the caps
|
2011-05-04 09:03:05 +00:00
|
|
|
*
|
2011-05-06 13:51:11 +00:00
|
|
|
* Get the caps from @event. The caps remains valid as long as @event remains
|
|
|
|
* valid.
|
2011-05-04 09:03:05 +00:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_event_parse_caps (GstEvent * event, GstCaps ** caps)
|
|
|
|
{
|
2011-05-08 10:38:05 +00:00
|
|
|
GstStructure *structure;
|
|
|
|
|
2011-05-04 09:03:05 +00:00
|
|
|
g_return_if_fail (GST_IS_EVENT (event));
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_CAPS);
|
|
|
|
|
2011-05-10 09:50:16 +00:00
|
|
|
structure = GST_EVENT_STRUCTURE (event);
|
2011-05-08 10:38:05 +00:00
|
|
|
if (G_LIKELY (caps))
|
|
|
|
*caps =
|
|
|
|
g_value_get_boxed (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (CAPS)));
|
2011-05-04 09:03:05 +00:00
|
|
|
}
|
|
|
|
|
2002-07-08 19:22:02 +00:00
|
|
|
/**
|
2011-05-13 16:07:24 +00:00
|
|
|
* gst_event_new_segment:
|
2011-10-12 11:31:48 +00:00
|
|
|
* @segment: (transfer none): a #GstSegment
|
docs/design/part-overview.txt: Make upsteam/downstream concepts more clear.
Original commit message from CVS:
* docs/design/part-overview.txt:
Make upsteam/downstream concepts more clear.
Give an example of serialized/non-serialized events.
* docs/design/part-events.txt:
* docs/design/part-streams.txt:
Mention applied_rate.
* docs/design/part-trickmodes.txt:
Mention applied rate, flesh out some more use cases.
* gst/gstevent.c: (gst_event_new_new_segment),
(gst_event_parse_new_segment), (gst_event_new_new_segment_full),
(gst_event_parse_new_segment_full), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_buffer_size),
(gst_event_parse_buffer_size), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_parse_seek),
(gst_event_new_navigation):
* gst/gstevent.h:
Add applied_rate field to NEWSEGMENT event.
API: gst_event_new_new_segment_full()
API: gst_event_parse_new_segment_full()
* gst/gstsegment.c: (gst_segment_init), (gst_segment_set_seek),
(gst_segment_set_newsegment), (gst_segment_set_newsegment_full),
(gst_segment_to_stream_time), (gst_segment_to_running_time):
* gst/gstsegment.h:
Add applied_rate to GstSegment structure.
Make calculation of stream_time and running_time more correct
wrt rate/applied_rate.
Add some more docs.
API: GstSegment::applied_rate field
API: gst_segment_set_newsegment_full();
* libs/gst/base/gstbasesink.c: (gst_base_sink_configure_segment),
(gst_base_sink_get_sync_times), (gst_base_sink_get_position):
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_sink_eventfunc),
(gst_base_transform_handle_buffer):
Parse and use applied_rate in the GstSegment field.
* tests/check/gst/gstevent.c: (GST_START_TEST):
Add check for applied_rate field.
* tests/check/gst/gstsegment.c: (GST_START_TEST),
(gstsegments_suite):
Add more checks for various GstSegment operations.
2006-05-08 09:52:33 +00:00
|
|
|
*
|
2011-05-13 16:07:24 +00:00
|
|
|
* Create a new SEGMENT event for @segment. The segment event can only travel
|
|
|
|
* downstream synchronized with the buffer flow and contains timing information
|
|
|
|
* and playback properties for the buffers that will follow.
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
*
|
2014-09-25 19:04:23 +00:00
|
|
|
* The segment event marks the range of buffers to be processed. All
|
2005-09-01 18:12:18 +00:00
|
|
|
* data not within the segment range is not to be processed. This can be
|
docs/design/part-overview.txt: Make upsteam/downstream concepts more clear.
Original commit message from CVS:
* docs/design/part-overview.txt:
Make upsteam/downstream concepts more clear.
Give an example of serialized/non-serialized events.
* docs/design/part-events.txt:
* docs/design/part-streams.txt:
Mention applied_rate.
* docs/design/part-trickmodes.txt:
Mention applied rate, flesh out some more use cases.
* gst/gstevent.c: (gst_event_new_new_segment),
(gst_event_parse_new_segment), (gst_event_new_new_segment_full),
(gst_event_parse_new_segment_full), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_buffer_size),
(gst_event_parse_buffer_size), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_parse_seek),
(gst_event_new_navigation):
* gst/gstevent.h:
Add applied_rate field to NEWSEGMENT event.
API: gst_event_new_new_segment_full()
API: gst_event_parse_new_segment_full()
* gst/gstsegment.c: (gst_segment_init), (gst_segment_set_seek),
(gst_segment_set_newsegment), (gst_segment_set_newsegment_full),
(gst_segment_to_stream_time), (gst_segment_to_running_time):
* gst/gstsegment.h:
Add applied_rate to GstSegment structure.
Make calculation of stream_time and running_time more correct
wrt rate/applied_rate.
Add some more docs.
API: GstSegment::applied_rate field
API: gst_segment_set_newsegment_full();
* libs/gst/base/gstbasesink.c: (gst_base_sink_configure_segment),
(gst_base_sink_get_sync_times), (gst_base_sink_get_position):
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_sink_eventfunc),
(gst_base_transform_handle_buffer):
Parse and use applied_rate in the GstSegment field.
* tests/check/gst/gstevent.c: (GST_START_TEST):
Add check for applied_rate field.
* tests/check/gst/gstsegment.c: (GST_START_TEST),
(gstsegments_suite):
Add more checks for various GstSegment operations.
2006-05-08 09:52:33 +00:00
|
|
|
* used intelligently by plugins to apply more efficient methods of skipping
|
2009-05-21 15:32:00 +00:00
|
|
|
* unneeded data. The valid range is expressed with the @start and @stop
|
|
|
|
* values.
|
2002-07-08 19:22:02 +00:00
|
|
|
*
|
2011-04-27 15:55:20 +00:00
|
|
|
* The time value of the segment is used in conjunction with the start
|
2011-05-13 16:07:24 +00:00
|
|
|
* value to convert the buffer timestamps into the stream time. This is
|
|
|
|
* usually done in sinks to report the current stream_time.
|
|
|
|
* @time represents the stream_time of a buffer carrying a timestamp of
|
2011-04-27 15:55:20 +00:00
|
|
|
* @start. @time cannot be -1.
|
2002-07-08 19:22:02 +00:00
|
|
|
*
|
2005-11-29 17:23:56 +00:00
|
|
|
* @start cannot be -1, @stop can be -1. If there
|
2011-05-13 16:07:24 +00:00
|
|
|
* is a valid @stop given, it must be greater or equal the @start, including
|
2006-10-13 13:27:46 +00:00
|
|
|
* when the indicated playback @rate is < 0.
|
docs/design/part-overview.txt: Make upsteam/downstream concepts more clear.
Original commit message from CVS:
* docs/design/part-overview.txt:
Make upsteam/downstream concepts more clear.
Give an example of serialized/non-serialized events.
* docs/design/part-events.txt:
* docs/design/part-streams.txt:
Mention applied_rate.
* docs/design/part-trickmodes.txt:
Mention applied rate, flesh out some more use cases.
* gst/gstevent.c: (gst_event_new_new_segment),
(gst_event_parse_new_segment), (gst_event_new_new_segment_full),
(gst_event_parse_new_segment_full), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_buffer_size),
(gst_event_parse_buffer_size), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_parse_seek),
(gst_event_new_navigation):
* gst/gstevent.h:
Add applied_rate field to NEWSEGMENT event.
API: gst_event_new_new_segment_full()
API: gst_event_parse_new_segment_full()
* gst/gstsegment.c: (gst_segment_init), (gst_segment_set_seek),
(gst_segment_set_newsegment), (gst_segment_set_newsegment_full),
(gst_segment_to_stream_time), (gst_segment_to_running_time):
* gst/gstsegment.h:
Add applied_rate to GstSegment structure.
Make calculation of stream_time and running_time more correct
wrt rate/applied_rate.
Add some more docs.
API: GstSegment::applied_rate field
API: gst_segment_set_newsegment_full();
* libs/gst/base/gstbasesink.c: (gst_base_sink_configure_segment),
(gst_base_sink_get_sync_times), (gst_base_sink_get_position):
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_sink_eventfunc),
(gst_base_transform_handle_buffer):
Parse and use applied_rate in the GstSegment field.
* tests/check/gst/gstevent.c: (GST_START_TEST):
Add check for applied_rate field.
* tests/check/gst/gstsegment.c: (GST_START_TEST),
(gstsegments_suite):
Add more checks for various GstSegment operations.
2006-05-08 09:52:33 +00:00
|
|
|
*
|
|
|
|
* The @applied_rate value provides information about any rate adjustment that
|
2011-05-13 16:07:24 +00:00
|
|
|
* has already been made to the timestamps and content on the buffers of the
|
|
|
|
* stream. (@rate * @applied_rate) should always equal the rate that has been
|
|
|
|
* requested for playback. For example, if an element has an input segment
|
|
|
|
* with intended playback @rate of 2.0 and applied_rate of 1.0, it can adjust
|
2014-09-25 19:04:23 +00:00
|
|
|
* incoming timestamps and buffer content by half and output a segment event
|
docs/design/part-overview.txt: Make upsteam/downstream concepts more clear.
Original commit message from CVS:
* docs/design/part-overview.txt:
Make upsteam/downstream concepts more clear.
Give an example of serialized/non-serialized events.
* docs/design/part-events.txt:
* docs/design/part-streams.txt:
Mention applied_rate.
* docs/design/part-trickmodes.txt:
Mention applied rate, flesh out some more use cases.
* gst/gstevent.c: (gst_event_new_new_segment),
(gst_event_parse_new_segment), (gst_event_new_new_segment_full),
(gst_event_parse_new_segment_full), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_buffer_size),
(gst_event_parse_buffer_size), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_parse_seek),
(gst_event_new_navigation):
* gst/gstevent.h:
Add applied_rate field to NEWSEGMENT event.
API: gst_event_new_new_segment_full()
API: gst_event_parse_new_segment_full()
* gst/gstsegment.c: (gst_segment_init), (gst_segment_set_seek),
(gst_segment_set_newsegment), (gst_segment_set_newsegment_full),
(gst_segment_to_stream_time), (gst_segment_to_running_time):
* gst/gstsegment.h:
Add applied_rate to GstSegment structure.
Make calculation of stream_time and running_time more correct
wrt rate/applied_rate.
Add some more docs.
API: GstSegment::applied_rate field
API: gst_segment_set_newsegment_full();
* libs/gst/base/gstbasesink.c: (gst_base_sink_configure_segment),
(gst_base_sink_get_sync_times), (gst_base_sink_get_position):
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_sink_eventfunc),
(gst_base_transform_handle_buffer):
Parse and use applied_rate in the GstSegment field.
* tests/check/gst/gstevent.c: (GST_START_TEST):
Add check for applied_rate field.
* tests/check/gst/gstsegment.c: (GST_START_TEST),
(gstsegments_suite):
Add more checks for various GstSegment operations.
2006-05-08 09:52:33 +00:00
|
|
|
* with @rate of 1.0 and @applied_rate of 2.0
|
2005-09-01 18:12:18 +00:00
|
|
|
*
|
2014-09-25 19:04:23 +00:00
|
|
|
* After a segment event, the buffer stream time is calculated with:
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
*
|
2011-04-27 15:55:20 +00:00
|
|
|
* time + (TIMESTAMP(buf) - start) * ABS (rate * applied_rate)
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
*
|
2011-05-13 16:07:24 +00:00
|
|
|
* Returns: (transfer full): the new SEGMENT event.
|
2002-07-08 19:22:02 +00:00
|
|
|
*/
|
2004-03-13 15:27:01 +00:00
|
|
|
GstEvent *
|
2011-10-29 07:43:04 +00:00
|
|
|
gst_event_new_segment (const GstSegment * segment)
|
2002-06-13 22:27:40 +00:00
|
|
|
{
|
2008-10-13 17:19:25 +00:00
|
|
|
GstEvent *event;
|
|
|
|
|
2011-05-13 16:07:24 +00:00
|
|
|
g_return_val_if_fail (segment != NULL, NULL);
|
2011-12-01 23:35:26 +00:00
|
|
|
g_return_val_if_fail (segment->rate != 0.0, NULL);
|
|
|
|
g_return_val_if_fail (segment->applied_rate != 0.0, NULL);
|
|
|
|
g_return_val_if_fail (segment->format != GST_FORMAT_UNDEFINED, NULL);
|
docs/design/part-overview.txt: Make upsteam/downstream concepts more clear.
Original commit message from CVS:
* docs/design/part-overview.txt:
Make upsteam/downstream concepts more clear.
Give an example of serialized/non-serialized events.
* docs/design/part-events.txt:
* docs/design/part-streams.txt:
Mention applied_rate.
* docs/design/part-trickmodes.txt:
Mention applied rate, flesh out some more use cases.
* gst/gstevent.c: (gst_event_new_new_segment),
(gst_event_parse_new_segment), (gst_event_new_new_segment_full),
(gst_event_parse_new_segment_full), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_buffer_size),
(gst_event_parse_buffer_size), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_parse_seek),
(gst_event_new_navigation):
* gst/gstevent.h:
Add applied_rate field to NEWSEGMENT event.
API: gst_event_new_new_segment_full()
API: gst_event_parse_new_segment_full()
* gst/gstsegment.c: (gst_segment_init), (gst_segment_set_seek),
(gst_segment_set_newsegment), (gst_segment_set_newsegment_full),
(gst_segment_to_stream_time), (gst_segment_to_running_time):
* gst/gstsegment.h:
Add applied_rate to GstSegment structure.
Make calculation of stream_time and running_time more correct
wrt rate/applied_rate.
Add some more docs.
API: GstSegment::applied_rate field
API: gst_segment_set_newsegment_full();
* libs/gst/base/gstbasesink.c: (gst_base_sink_configure_segment),
(gst_base_sink_get_sync_times), (gst_base_sink_get_position):
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_sink_eventfunc),
(gst_base_transform_handle_buffer):
Parse and use applied_rate in the GstSegment field.
* tests/check/gst/gstevent.c: (GST_START_TEST):
Add check for applied_rate field.
* tests/check/gst/gstsegment.c: (GST_START_TEST),
(gstsegments_suite):
Add more checks for various GstSegment operations.
2006-05-08 09:52:33 +00:00
|
|
|
|
2011-05-23 16:30:19 +00:00
|
|
|
GST_CAT_INFO (GST_CAT_EVENT, "creating segment event %" GST_SEGMENT_FORMAT,
|
2011-05-13 16:07:24 +00:00
|
|
|
segment);
|
|
|
|
|
|
|
|
event = gst_event_new_custom (GST_EVENT_SEGMENT,
|
2011-10-29 07:02:00 +00:00
|
|
|
gst_structure_new_id (GST_QUARK (EVENT_SEGMENT),
|
2011-05-13 16:07:24 +00:00
|
|
|
GST_QUARK (SEGMENT), GST_TYPE_SEGMENT, segment, NULL));
|
2008-10-13 17:19:25 +00:00
|
|
|
|
|
|
|
return event;
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
}
|
2002-06-13 22:27:40 +00:00
|
|
|
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
/**
|
2011-05-18 14:56:13 +00:00
|
|
|
* gst_event_parse_segment:
|
|
|
|
* @event: The event to parse
|
|
|
|
* @segment: (out) (transfer none): a pointer to a #GstSegment
|
2011-05-13 16:07:24 +00:00
|
|
|
*
|
2011-05-18 14:56:13 +00:00
|
|
|
* Parses a segment @event and stores the result in the given @segment location.
|
|
|
|
* @segment remains valid only until the @event is freed. Don't modify the segment
|
|
|
|
* and make a copy if you want to modify it or store it for later use.
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
*/
|
2011-05-18 14:56:13 +00:00
|
|
|
void
|
|
|
|
gst_event_parse_segment (GstEvent * event, const GstSegment ** segment)
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
{
|
2011-05-13 16:07:24 +00:00
|
|
|
GstStructure *structure;
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
|
2011-05-18 14:56:13 +00:00
|
|
|
g_return_if_fail (GST_IS_EVENT (event));
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_SEGMENT);
|
2011-05-13 16:07:24 +00:00
|
|
|
|
2011-05-18 14:56:13 +00:00
|
|
|
if (segment) {
|
|
|
|
structure = GST_EVENT_STRUCTURE (event);
|
|
|
|
*segment = g_value_get_boxed (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (SEGMENT)));
|
|
|
|
}
|
2011-05-13 16:07:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2011-05-18 14:56:13 +00:00
|
|
|
* gst_event_copy_segment:
|
2011-05-13 16:07:24 +00:00
|
|
|
* @event: The event to parse
|
2011-05-18 14:56:13 +00:00
|
|
|
* @segment: a pointer to a #GstSegment
|
2011-05-13 16:07:24 +00:00
|
|
|
*
|
2011-05-18 14:56:13 +00:00
|
|
|
* Parses a segment @event and copies the #GstSegment into the location
|
|
|
|
* given by @segment.
|
2011-05-13 16:07:24 +00:00
|
|
|
*/
|
|
|
|
void
|
2011-05-18 14:56:13 +00:00
|
|
|
gst_event_copy_segment (GstEvent * event, GstSegment * segment)
|
2011-05-13 16:07:24 +00:00
|
|
|
{
|
|
|
|
const GstSegment *src;
|
|
|
|
|
2011-05-18 14:56:13 +00:00
|
|
|
g_return_if_fail (GST_IS_EVENT (event));
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_SEGMENT);
|
2011-05-13 16:07:24 +00:00
|
|
|
|
2011-05-18 14:56:13 +00:00
|
|
|
if (segment) {
|
|
|
|
gst_event_parse_segment (event, &src);
|
|
|
|
gst_segment_copy_into (src, segment);
|
|
|
|
}
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
}
|
2004-03-13 15:27:01 +00:00
|
|
|
|
2005-08-22 10:37:02 +00:00
|
|
|
/**
|
|
|
|
* gst_event_new_tag:
|
2011-02-10 10:19:38 +00:00
|
|
|
* @taglist: (transfer full): metadata list. The event will take ownership
|
|
|
|
* of the taglist.
|
2005-08-22 10:37:02 +00:00
|
|
|
*
|
|
|
|
* Generates a metadata tag event from the given @taglist.
|
2005-10-10 09:48:21 +00:00
|
|
|
*
|
2012-07-27 21:52:12 +00:00
|
|
|
* The scope of the taglist specifies if the taglist applies to the
|
|
|
|
* complete medium or only to this specific stream. As the tag event
|
|
|
|
* is a sticky event, elements should merge tags received from
|
|
|
|
* upstream with a given scope with their own tags with the same
|
|
|
|
* scope and create a new tag event from it.
|
2012-06-06 10:52:09 +00:00
|
|
|
*
|
2010-12-07 18:35:04 +00:00
|
|
|
* Returns: (transfer full): a new #GstEvent
|
2005-08-22 10:37:02 +00:00
|
|
|
*/
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
GstEvent *
|
2012-07-27 21:52:12 +00:00
|
|
|
gst_event_new_tag (GstTagList * taglist)
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
{
|
2012-05-26 10:37:49 +00:00
|
|
|
GstStructure *s;
|
|
|
|
GValue val = G_VALUE_INIT;
|
2012-07-27 21:52:12 +00:00
|
|
|
const gchar *names[] = { "GstTagList-stream", "GstTagList-global" };
|
2012-05-26 10:37:49 +00:00
|
|
|
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
g_return_val_if_fail (taglist != NULL, NULL);
|
2006-08-11 13:05:30 +00:00
|
|
|
|
2012-07-27 21:52:12 +00:00
|
|
|
s = gst_structure_new_empty (names[gst_tag_list_get_scope (taglist)]);
|
2012-05-26 10:37:49 +00:00
|
|
|
g_value_init (&val, GST_TYPE_TAG_LIST);
|
|
|
|
g_value_take_boxed (&val, taglist);
|
|
|
|
gst_structure_id_take_value (s, GST_QUARK (TAGLIST), &val);
|
|
|
|
return gst_event_new_custom (GST_EVENT_TAG, s);
|
2002-06-13 22:27:40 +00:00
|
|
|
}
|
|
|
|
|
2005-08-22 10:37:02 +00:00
|
|
|
/**
|
|
|
|
* gst_event_parse_tag:
|
|
|
|
* @event: a tag event
|
2010-12-07 18:35:04 +00:00
|
|
|
* @taglist: (out) (transfer none): pointer to metadata list
|
2005-08-22 10:37:02 +00:00
|
|
|
*
|
|
|
|
* Parses a tag @event and stores the results in the given @taglist location.
|
2011-02-10 10:19:38 +00:00
|
|
|
* No reference to the taglist will be returned, it remains valid only until
|
|
|
|
* the @event is freed. Don't modify or free the taglist, make a copy if you
|
|
|
|
* want to modify it or store it for later use.
|
2005-08-22 10:37:02 +00:00
|
|
|
*/
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
void
|
|
|
|
gst_event_parse_tag (GstEvent * event, GstTagList ** taglist)
|
|
|
|
{
|
2012-05-26 10:37:49 +00:00
|
|
|
const GValue *val;
|
|
|
|
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
g_return_if_fail (GST_IS_EVENT (event));
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_TAG);
|
2006-08-11 13:05:30 +00:00
|
|
|
|
2012-05-26 10:37:49 +00:00
|
|
|
val = gst_structure_id_get_value (GST_EVENT_STRUCTURE (event),
|
|
|
|
GST_QUARK (TAGLIST));
|
|
|
|
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
if (taglist)
|
2012-05-26 10:37:49 +00:00
|
|
|
*taglist = (GstTagList *) g_value_get_boxed (val);
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
}
|
|
|
|
|
2005-10-07 18:02:14 +00:00
|
|
|
/* buffersize event */
|
|
|
|
/**
|
2005-11-22 11:48:58 +00:00
|
|
|
* gst_event_new_buffer_size:
|
2005-10-09 20:49:46 +00:00
|
|
|
* @format: buffer format
|
|
|
|
* @minsize: minimum buffer size
|
|
|
|
* @maxsize: maximum buffer size
|
|
|
|
* @async: thread behavior
|
2005-10-07 18:02:14 +00:00
|
|
|
*
|
|
|
|
* Create a new buffersize event. The event is sent downstream and notifies
|
|
|
|
* elements that they should provide a buffer of the specified dimensions.
|
|
|
|
*
|
2011-09-07 11:14:38 +00:00
|
|
|
* When the @async flag is set, a thread boundary is preferred.
|
2005-10-07 18:02:14 +00:00
|
|
|
*
|
2010-12-07 18:35:04 +00:00
|
|
|
* Returns: (transfer full): a new #GstEvent
|
2005-10-07 18:02:14 +00:00
|
|
|
*/
|
|
|
|
GstEvent *
|
2005-11-22 11:48:58 +00:00
|
|
|
gst_event_new_buffer_size (GstFormat format, gint64 minsize,
|
2005-10-07 18:02:14 +00:00
|
|
|
gint64 maxsize, gboolean async)
|
|
|
|
{
|
2008-10-13 17:19:25 +00:00
|
|
|
GstEvent *event;
|
|
|
|
GstStructure *structure;
|
|
|
|
|
2005-10-07 18:02:14 +00:00
|
|
|
GST_CAT_INFO (GST_CAT_EVENT,
|
2008-07-01 05:53:32 +00:00
|
|
|
"creating buffersize format %s, minsize %" G_GINT64_FORMAT
|
|
|
|
", maxsize %" G_GINT64_FORMAT ", async %d", gst_format_get_name (format),
|
2005-10-07 18:02:14 +00:00
|
|
|
minsize, maxsize, async);
|
2006-08-11 13:05:30 +00:00
|
|
|
|
2011-10-29 07:02:00 +00:00
|
|
|
structure = gst_structure_new_id (GST_QUARK (EVENT_BUFFER_SIZE),
|
2008-10-13 17:19:25 +00:00
|
|
|
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
|
|
|
|
GST_QUARK (MINSIZE), G_TYPE_INT64, minsize,
|
|
|
|
GST_QUARK (MAXSIZE), G_TYPE_INT64, maxsize,
|
|
|
|
GST_QUARK (ASYNC), G_TYPE_BOOLEAN, async, NULL);
|
|
|
|
event = gst_event_new_custom (GST_EVENT_BUFFERSIZE, structure);
|
|
|
|
|
|
|
|
return event;
|
2005-10-07 18:02:14 +00:00
|
|
|
}
|
|
|
|
|
2005-10-09 20:49:46 +00:00
|
|
|
/**
|
2005-11-22 11:48:58 +00:00
|
|
|
* gst_event_parse_buffer_size:
|
2005-10-09 20:49:46 +00:00
|
|
|
* @event: The event to query
|
2010-06-16 16:10:13 +00:00
|
|
|
* @format: (out): A pointer to store the format in
|
|
|
|
* @minsize: (out): A pointer to store the minsize in
|
|
|
|
* @maxsize: (out): A pointer to store the maxsize in
|
|
|
|
* @async: (out): A pointer to store the async-flag in
|
2005-10-09 20:49:46 +00:00
|
|
|
*
|
|
|
|
* Get the format, minsize, maxsize and async-flag in the buffersize event.
|
|
|
|
*/
|
2005-10-07 18:02:14 +00:00
|
|
|
void
|
2005-11-22 11:48:58 +00:00
|
|
|
gst_event_parse_buffer_size (GstEvent * event, GstFormat * format,
|
2005-10-07 18:02:14 +00:00
|
|
|
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);
|
2006-08-11 13:05:30 +00:00
|
|
|
|
2011-05-10 09:50:16 +00:00
|
|
|
structure = GST_EVENT_STRUCTURE (event);
|
2005-10-07 18:02:14 +00:00
|
|
|
if (format)
|
2011-08-09 21:42:26 +00:00
|
|
|
*format = (GstFormat)
|
2008-10-13 17:19:25 +00:00
|
|
|
g_value_get_enum (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (FORMAT)));
|
2005-10-07 18:02:14 +00:00
|
|
|
if (minsize)
|
|
|
|
*minsize =
|
2008-10-13 17:19:25 +00:00
|
|
|
g_value_get_int64 (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (MINSIZE)));
|
2005-10-07 18:02:14 +00:00
|
|
|
if (maxsize)
|
|
|
|
*maxsize =
|
2008-10-13 17:19:25 +00:00
|
|
|
g_value_get_int64 (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (MAXSIZE)));
|
2005-10-07 18:02:14 +00:00
|
|
|
if (async)
|
2008-10-13 17:19:25 +00:00
|
|
|
*async =
|
|
|
|
g_value_get_boolean (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (ASYNC)));
|
2005-10-07 18:02:14 +00:00
|
|
|
}
|
|
|
|
|
2002-07-13 23:12:22 +00:00
|
|
|
/**
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* gst_event_new_qos:
|
2011-02-10 11:02:03 +00:00
|
|
|
* @type: the QoS type
|
|
|
|
* @proportion: the proportion of the qos message
|
|
|
|
* @diff: The time difference of the last Clock sync
|
|
|
|
* @timestamp: The timestamp of the buffer
|
|
|
|
*
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* Allocate a new qos event with the given values.
|
|
|
|
* The QOS event is generated in an element that wants an upstream
|
|
|
|
* element to either reduce or increase its rate because of
|
2011-02-10 11:02:03 +00:00
|
|
|
* high/low CPU load or other resource usage such as network performance or
|
|
|
|
* throttling. Typically sinks generate these events for each buffer
|
|
|
|
* they receive.
|
|
|
|
*
|
|
|
|
* @type indicates the reason for the QoS event. #GST_QOS_TYPE_OVERFLOW is
|
|
|
|
* used when a buffer arrived in time or when the sink cannot keep up with
|
|
|
|
* the upstream datarate. #GST_QOS_TYPE_UNDERFLOW is when the sink is not
|
|
|
|
* receiving buffers fast enough and thus has to drop late buffers.
|
|
|
|
* #GST_QOS_TYPE_THROTTLE is used when the datarate is artificially limited
|
|
|
|
* by the application, for example to reduce power consumption.
|
2006-08-11 13:05:30 +00:00
|
|
|
*
|
|
|
|
* @proportion indicates the real-time performance of the streaming in the
|
|
|
|
* element that generated the QoS event (usually the sink). The value is
|
|
|
|
* generally computed based on more long term statistics about the streams
|
|
|
|
* timestamps compared to the clock.
|
|
|
|
* A value < 1.0 indicates that the upstream element is producing data faster
|
|
|
|
* than real-time. A value > 1.0 indicates that the upstream element is not
|
|
|
|
* producing data fast enough. 1.0 is the ideal @proportion value. The
|
|
|
|
* proportion value can safely be used to lower or increase the quality of
|
|
|
|
* the element.
|
|
|
|
*
|
|
|
|
* @diff is the difference against the clock in running time of the last
|
|
|
|
* buffer that caused the element to generate the QOS event. A negative value
|
|
|
|
* means that the buffer with @timestamp arrived in time. A positive value
|
2011-02-10 11:02:03 +00:00
|
|
|
* indicates how late the buffer with @timestamp was. When throttling is
|
|
|
|
* enabled, @diff will be set to the requested throttling interval.
|
2002-07-13 23:12:22 +00:00
|
|
|
*
|
2006-03-07 16:21:02 +00:00
|
|
|
* @timestamp is the timestamp of the last buffer that cause the element
|
2006-08-11 13:05:30 +00:00
|
|
|
* to generate the QOS event. It is expressed in running time and thus an ever
|
|
|
|
* increasing value.
|
2006-03-07 16:21:02 +00:00
|
|
|
*
|
|
|
|
* The upstream element can use the @diff and @timestamp values to decide
|
2013-12-07 14:38:19 +00:00
|
|
|
* whether to process more buffers. For positive @diff, all buffers with
|
2006-08-11 13:05:30 +00:00
|
|
|
* timestamp <= @timestamp + @diff will certainly arrive late in the sink
|
2008-06-04 11:31:15 +00:00
|
|
|
* as well. A (negative) @diff value so that @timestamp + @diff would yield a
|
|
|
|
* result smaller than 0 is not allowed.
|
2006-03-07 16:21:02 +00:00
|
|
|
*
|
|
|
|
* The application can use general event probes to intercept the QoS
|
|
|
|
* event and implement custom application specific QoS handling.
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
*
|
2010-12-07 18:35:04 +00:00
|
|
|
* Returns: (transfer full): a new QOS event.
|
2002-07-13 23:12:22 +00:00
|
|
|
*/
|
2004-03-13 15:27:01 +00:00
|
|
|
GstEvent *
|
2011-05-09 16:48:55 +00:00
|
|
|
gst_event_new_qos (GstQOSType type, gdouble proportion,
|
2011-02-10 11:02:03 +00:00
|
|
|
GstClockTimeDiff diff, GstClockTime timestamp)
|
2002-07-13 23:12:22 +00:00
|
|
|
{
|
2008-10-13 17:19:25 +00:00
|
|
|
GstEvent *event;
|
2011-05-17 09:45:46 +00:00
|
|
|
GstStructure *structure;
|
2008-10-13 17:19:25 +00:00
|
|
|
|
2008-06-04 11:31:15 +00:00
|
|
|
/* diff must be positive or timestamp + diff must be positive */
|
|
|
|
g_return_val_if_fail (diff >= 0 || -diff <= timestamp, NULL);
|
|
|
|
|
2011-11-08 07:26:29 +00:00
|
|
|
GST_CAT_LOG (GST_CAT_EVENT,
|
2011-02-10 11:02:03 +00:00
|
|
|
"creating qos type %d, proportion %lf, diff %" G_GINT64_FORMAT
|
|
|
|
", timestamp %" GST_TIME_FORMAT, type, proportion,
|
docs/design/part-overview.txt: Make upsteam/downstream concepts more clear.
Original commit message from CVS:
* docs/design/part-overview.txt:
Make upsteam/downstream concepts more clear.
Give an example of serialized/non-serialized events.
* docs/design/part-events.txt:
* docs/design/part-streams.txt:
Mention applied_rate.
* docs/design/part-trickmodes.txt:
Mention applied rate, flesh out some more use cases.
* gst/gstevent.c: (gst_event_new_new_segment),
(gst_event_parse_new_segment), (gst_event_new_new_segment_full),
(gst_event_parse_new_segment_full), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_buffer_size),
(gst_event_parse_buffer_size), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_parse_seek),
(gst_event_new_navigation):
* gst/gstevent.h:
Add applied_rate field to NEWSEGMENT event.
API: gst_event_new_new_segment_full()
API: gst_event_parse_new_segment_full()
* gst/gstsegment.c: (gst_segment_init), (gst_segment_set_seek),
(gst_segment_set_newsegment), (gst_segment_set_newsegment_full),
(gst_segment_to_stream_time), (gst_segment_to_running_time):
* gst/gstsegment.h:
Add applied_rate to GstSegment structure.
Make calculation of stream_time and running_time more correct
wrt rate/applied_rate.
Add some more docs.
API: GstSegment::applied_rate field
API: gst_segment_set_newsegment_full();
* libs/gst/base/gstbasesink.c: (gst_base_sink_configure_segment),
(gst_base_sink_get_sync_times), (gst_base_sink_get_position):
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_sink_eventfunc),
(gst_base_transform_handle_buffer):
Parse and use applied_rate in the GstSegment field.
* tests/check/gst/gstevent.c: (GST_START_TEST):
Add check for applied_rate field.
* tests/check/gst/gstsegment.c: (GST_START_TEST),
(gstsegments_suite):
Add more checks for various GstSegment operations.
2006-05-08 09:52:33 +00:00
|
|
|
diff, GST_TIME_ARGS (timestamp));
|
2005-08-23 18:17:01 +00:00
|
|
|
|
2011-10-29 07:02:00 +00:00
|
|
|
structure = gst_structure_new_id (GST_QUARK (EVENT_QOS),
|
2011-05-17 09:45:46 +00:00
|
|
|
GST_QUARK (TYPE), GST_TYPE_QOS_TYPE, type,
|
|
|
|
GST_QUARK (PROPORTION), G_TYPE_DOUBLE, proportion,
|
|
|
|
GST_QUARK (DIFF), G_TYPE_INT64, diff,
|
|
|
|
GST_QUARK (TIMESTAMP), G_TYPE_UINT64, timestamp, NULL);
|
|
|
|
event = gst_event_new_custom (GST_EVENT_QOS, structure);
|
2008-10-13 17:19:25 +00:00
|
|
|
|
|
|
|
return event;
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
}
|
2002-07-13 23:12:22 +00:00
|
|
|
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
/**
|
|
|
|
* gst_event_parse_qos:
|
|
|
|
* @event: The event to query
|
2011-02-10 11:02:03 +00:00
|
|
|
* @type: (out): A pointer to store the QoS type in
|
|
|
|
* @proportion: (out): A pointer to store the proportion in
|
|
|
|
* @diff: (out): A pointer to store the diff in
|
|
|
|
* @timestamp: (out): A pointer to store the timestamp in
|
|
|
|
*
|
|
|
|
* Get the type, proportion, diff and timestamp in the qos event. See
|
2011-05-09 16:48:55 +00:00
|
|
|
* gst_event_new_qos() for more information about the different QoS values.
|
2014-04-04 15:28:23 +00:00
|
|
|
*
|
|
|
|
* @timestamp will be adjusted for any pad offsets of pads it was passing through.
|
2011-02-10 11:02:03 +00:00
|
|
|
*/
|
|
|
|
void
|
2011-05-09 16:48:55 +00:00
|
|
|
gst_event_parse_qos (GstEvent * event, GstQOSType * type,
|
2011-02-10 11:02:03 +00:00
|
|
|
gdouble * proportion, GstClockTimeDiff * diff, GstClockTime * timestamp)
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
{
|
2011-05-17 09:45:46 +00:00
|
|
|
const GstStructure *structure;
|
|
|
|
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
g_return_if_fail (GST_IS_EVENT (event));
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_QOS);
|
2006-08-11 13:05:30 +00:00
|
|
|
|
2011-05-17 09:45:46 +00:00
|
|
|
structure = GST_EVENT_STRUCTURE (event);
|
2011-02-10 11:02:03 +00:00
|
|
|
if (type)
|
2011-08-09 21:42:26 +00:00
|
|
|
*type = (GstQOSType)
|
2011-05-17 09:45:46 +00:00
|
|
|
g_value_get_enum (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (TYPE)));
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
if (proportion)
|
2011-05-17 09:45:46 +00:00
|
|
|
*proportion =
|
|
|
|
g_value_get_double (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (PROPORTION)));
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
if (diff)
|
2011-05-17 09:45:46 +00:00
|
|
|
*diff =
|
|
|
|
g_value_get_int64 (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (DIFF)));
|
2014-04-04 15:28:23 +00:00
|
|
|
if (timestamp) {
|
|
|
|
gint64 offset = gst_event_get_running_time_offset (event);
|
2015-08-31 12:35:11 +00:00
|
|
|
GstClockTimeDiff diff_ =
|
|
|
|
g_value_get_int64 (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (DIFF)));
|
2014-04-04 15:28:23 +00:00
|
|
|
|
2011-05-17 09:45:46 +00:00
|
|
|
*timestamp =
|
|
|
|
g_value_get_uint64 (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (TIMESTAMP)));
|
2014-04-04 15:28:23 +00:00
|
|
|
/* Catch underflows */
|
|
|
|
if (*timestamp > -offset)
|
|
|
|
*timestamp += offset;
|
|
|
|
else
|
|
|
|
*timestamp = 0;
|
2015-08-31 12:35:11 +00:00
|
|
|
|
|
|
|
/* Make sure that timestamp + diff is always >= 0. Because
|
|
|
|
* of the running time offset this might not be true */
|
|
|
|
if (diff_ < 0 && *timestamp < -diff_)
|
|
|
|
*timestamp = (GstClockTime) - diff_;
|
2014-04-04 15:28:23 +00:00
|
|
|
}
|
2002-07-13 23:12:22 +00:00
|
|
|
}
|
2005-01-08 18:10:50 +00:00
|
|
|
|
|
|
|
/**
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* gst_event_new_seek:
|
|
|
|
* @rate: The new playback rate
|
|
|
|
* @format: The format of the seek values
|
2005-10-10 09:48:21 +00:00
|
|
|
* @flags: The optional seek flags
|
2006-10-09 16:33:29 +00:00
|
|
|
* @start_type: The type and flags for the new start position
|
|
|
|
* @start: The value of the new start position
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* @stop_type: The type and flags for the new stop position
|
|
|
|
* @stop: The value of the new stop position
|
|
|
|
*
|
|
|
|
* Allocate a new seek event with the given parameters.
|
|
|
|
*
|
2006-10-09 16:33:29 +00:00
|
|
|
* The seek event configures playback of the pipeline between @start to @stop
|
|
|
|
* at the speed given in @rate, also called a playback segment.
|
|
|
|
* The @start and @stop values are expressed in @format.
|
2005-01-08 18:10:50 +00:00
|
|
|
*
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
* A @rate of 1.0 means normal playback rate, 2.0 means double speed.
|
|
|
|
* Negatives values means backwards playback. A value of 0.0 for the
|
gst/gstbin.c: Update documentation.
Original commit message from CVS:
* gst/gstbin.c:
Update documentation.
* gst/gstelement.c: (gst_element_class_init),
(gst_element_release_request_pad), (gst_element_set_clock),
(gst_element_get_index), (gst_element_add_pad),
(gst_element_remove_pad), (gst_element_get_random_pad),
(gst_element_send_event), (gst_element_get_query_types),
(gst_element_query), (gst_element_post_message),
(gst_element_message_full), (gst_element_continue_state),
(gst_element_lost_state), (gst_element_save_thyself),
(gst_element_restore_thyself):
Documentation updates.
Rename last bit of the new-pad -> pad-added signal rename.
Fix the case where an element query would only work if the source
pad was linked.
Avoid some useless type checking in message handling.
* gst/gstevent.c:
* gst/gstevent.h:
* gst/gstutils.c:
Documentation updates.
2006-09-15 08:32:57 +00:00
|
|
|
* rate is not allowed and should be accomplished instead by PAUSING the
|
|
|
|
* pipeline.
|
|
|
|
*
|
2006-10-09 16:33:29 +00:00
|
|
|
* A pipeline has a default playback segment configured with a start
|
|
|
|
* position of 0, a stop position of -1 and a rate of 1.0. The currently
|
|
|
|
* configured playback segment can be queried with #GST_QUERY_SEGMENT.
|
2005-01-08 18:10:50 +00:00
|
|
|
*
|
2006-10-09 16:33:29 +00:00
|
|
|
* @start_type and @stop_type specify how to adjust the currently configured
|
2008-10-13 17:19:25 +00:00
|
|
|
* start and stop fields in playback segment. Adjustments can be made relative
|
|
|
|
* or absolute to the last configured values. A type of #GST_SEEK_TYPE_NONE
|
|
|
|
* means that the position should not be updated.
|
gst/gstbin.c: Update documentation.
Original commit message from CVS:
* gst/gstbin.c:
Update documentation.
* gst/gstelement.c: (gst_element_class_init),
(gst_element_release_request_pad), (gst_element_set_clock),
(gst_element_get_index), (gst_element_add_pad),
(gst_element_remove_pad), (gst_element_get_random_pad),
(gst_element_send_event), (gst_element_get_query_types),
(gst_element_query), (gst_element_post_message),
(gst_element_message_full), (gst_element_continue_state),
(gst_element_lost_state), (gst_element_save_thyself),
(gst_element_restore_thyself):
Documentation updates.
Rename last bit of the new-pad -> pad-added signal rename.
Fix the case where an element query would only work if the source
pad was linked.
Avoid some useless type checking in message handling.
* gst/gstevent.c:
* gst/gstevent.h:
* gst/gstutils.c:
Documentation updates.
2006-09-15 08:32:57 +00:00
|
|
|
*
|
2006-10-09 16:33:29 +00:00
|
|
|
* When the rate is positive and @start has been updated, playback will start
|
2006-10-16 11:46:04 +00:00
|
|
|
* from the newly configured start position.
|
|
|
|
*
|
|
|
|
* For negative rates, playback will start from the newly configured stop
|
2012-05-21 11:17:21 +00:00
|
|
|
* position (if any). If the stop position is updated, it must be different from
|
|
|
|
* -1 (#GST_CLOCK_TIME_NONE) for negative rates.
|
gst/gstbin.c: Update documentation.
Original commit message from CVS:
* gst/gstbin.c:
Update documentation.
* gst/gstelement.c: (gst_element_class_init),
(gst_element_release_request_pad), (gst_element_set_clock),
(gst_element_get_index), (gst_element_add_pad),
(gst_element_remove_pad), (gst_element_get_random_pad),
(gst_element_send_event), (gst_element_get_query_types),
(gst_element_query), (gst_element_post_message),
(gst_element_message_full), (gst_element_continue_state),
(gst_element_lost_state), (gst_element_save_thyself),
(gst_element_restore_thyself):
Documentation updates.
Rename last bit of the new-pad -> pad-added signal rename.
Fix the case where an element query would only work if the source
pad was linked.
Avoid some useless type checking in message handling.
* gst/gstevent.c:
* gst/gstevent.h:
* gst/gstutils.c:
Documentation updates.
2006-09-15 08:32:57 +00:00
|
|
|
*
|
|
|
|
* It is not possible to seek relative to the current playback position, to do
|
|
|
|
* this, PAUSE the pipeline, query the current playback position with
|
|
|
|
* #GST_QUERY_POSITION and update the playback segment current position with a
|
2012-05-21 11:17:21 +00:00
|
|
|
* #GST_SEEK_TYPE_SET to the desired position.
|
2005-11-15 18:34:28 +00:00
|
|
|
*
|
2010-12-07 18:35:04 +00:00
|
|
|
* Returns: (transfer full): a new seek event.
|
2005-01-08 18:10:50 +00:00
|
|
|
*/
|
|
|
|
GstEvent *
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
gst_event_new_seek (gdouble rate, GstFormat format, GstSeekFlags flags,
|
2006-10-09 17:15:39 +00:00
|
|
|
GstSeekType start_type, gint64 start, GstSeekType stop_type, gint64 stop)
|
2005-01-08 18:10:50 +00:00
|
|
|
{
|
2008-10-13 17:19:25 +00:00
|
|
|
GstEvent *event;
|
|
|
|
GstStructure *structure;
|
|
|
|
|
2006-08-11 13:05:30 +00:00
|
|
|
g_return_val_if_fail (rate != 0.0, NULL);
|
|
|
|
|
2005-08-23 18:17:01 +00:00
|
|
|
if (format == GST_FORMAT_TIME) {
|
|
|
|
GST_CAT_INFO (GST_CAT_EVENT,
|
|
|
|
"creating seek rate %lf, format TIME, flags %d, "
|
2006-10-09 17:15:39 +00:00
|
|
|
"start_type %d, start %" GST_TIME_FORMAT ", "
|
2005-08-23 18:17:01 +00:00
|
|
|
"stop_type %d, stop %" GST_TIME_FORMAT,
|
2006-10-09 17:15:39 +00:00
|
|
|
rate, flags, start_type, GST_TIME_ARGS (start),
|
2005-08-23 18:17:01 +00:00
|
|
|
stop_type, GST_TIME_ARGS (stop));
|
|
|
|
} else {
|
|
|
|
GST_CAT_INFO (GST_CAT_EVENT,
|
2008-07-01 05:53:32 +00:00
|
|
|
"creating seek rate %lf, format %s, flags %d, "
|
2006-10-09 17:15:39 +00:00
|
|
|
"start_type %d, start %" G_GINT64_FORMAT ", "
|
2005-08-23 18:17:01 +00:00
|
|
|
"stop_type %d, stop %" G_GINT64_FORMAT,
|
2008-07-01 05:53:32 +00:00
|
|
|
rate, gst_format_get_name (format), flags, start_type, start, stop_type,
|
|
|
|
stop);
|
2005-08-23 18:17:01 +00:00
|
|
|
}
|
|
|
|
|
2011-10-29 07:02:00 +00:00
|
|
|
structure = gst_structure_new_id (GST_QUARK (EVENT_SEEK),
|
2008-10-13 17:19:25 +00:00
|
|
|
GST_QUARK (RATE), G_TYPE_DOUBLE, rate,
|
|
|
|
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
|
|
|
|
GST_QUARK (FLAGS), GST_TYPE_SEEK_FLAGS, flags,
|
|
|
|
GST_QUARK (CUR_TYPE), GST_TYPE_SEEK_TYPE, start_type,
|
|
|
|
GST_QUARK (CUR), G_TYPE_INT64, start,
|
|
|
|
GST_QUARK (STOP_TYPE), GST_TYPE_SEEK_TYPE, stop_type,
|
|
|
|
GST_QUARK (STOP), G_TYPE_INT64, stop, NULL);
|
|
|
|
event = gst_event_new_custom (GST_EVENT_SEEK, structure);
|
|
|
|
|
|
|
|
return event;
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
}
|
2005-01-08 18:10:50 +00:00
|
|
|
|
2005-08-22 10:37:02 +00:00
|
|
|
/**
|
|
|
|
* gst_event_parse_seek:
|
|
|
|
* @event: a seek event
|
2010-06-16 16:10:13 +00:00
|
|
|
* @rate: (out): result location for the rate
|
|
|
|
* @format: (out): result location for the stream format
|
|
|
|
* @flags: (out): result location for the #GstSeekFlags
|
|
|
|
* @start_type: (out): result location for the #GstSeekType of the start position
|
2013-12-07 14:38:19 +00:00
|
|
|
* @start: (out): result location for the start position expressed in @format
|
2010-06-16 16:10:13 +00:00
|
|
|
* @stop_type: (out): result location for the #GstSeekType of the stop position
|
2013-12-07 14:38:19 +00:00
|
|
|
* @stop: (out): result location for the stop position expressed in @format
|
2005-08-22 10:37:02 +00:00
|
|
|
*
|
|
|
|
* Parses a seek @event and stores the results in the given result locations.
|
|
|
|
*/
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
void
|
docs/design/part-overview.txt: Make upsteam/downstream concepts more clear.
Original commit message from CVS:
* docs/design/part-overview.txt:
Make upsteam/downstream concepts more clear.
Give an example of serialized/non-serialized events.
* docs/design/part-events.txt:
* docs/design/part-streams.txt:
Mention applied_rate.
* docs/design/part-trickmodes.txt:
Mention applied rate, flesh out some more use cases.
* gst/gstevent.c: (gst_event_new_new_segment),
(gst_event_parse_new_segment), (gst_event_new_new_segment_full),
(gst_event_parse_new_segment_full), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_buffer_size),
(gst_event_parse_buffer_size), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_parse_seek),
(gst_event_new_navigation):
* gst/gstevent.h:
Add applied_rate field to NEWSEGMENT event.
API: gst_event_new_new_segment_full()
API: gst_event_parse_new_segment_full()
* gst/gstsegment.c: (gst_segment_init), (gst_segment_set_seek),
(gst_segment_set_newsegment), (gst_segment_set_newsegment_full),
(gst_segment_to_stream_time), (gst_segment_to_running_time):
* gst/gstsegment.h:
Add applied_rate to GstSegment structure.
Make calculation of stream_time and running_time more correct
wrt rate/applied_rate.
Add some more docs.
API: GstSegment::applied_rate field
API: gst_segment_set_newsegment_full();
* libs/gst/base/gstbasesink.c: (gst_base_sink_configure_segment),
(gst_base_sink_get_sync_times), (gst_base_sink_get_position):
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_sink_eventfunc),
(gst_base_transform_handle_buffer):
Parse and use applied_rate in the GstSegment field.
* tests/check/gst/gstevent.c: (GST_START_TEST):
Add check for applied_rate field.
* tests/check/gst/gstsegment.c: (GST_START_TEST),
(gstsegments_suite):
Add more checks for various GstSegment operations.
2006-05-08 09:52:33 +00:00
|
|
|
gst_event_parse_seek (GstEvent * event, gdouble * rate,
|
2006-10-09 17:15:39 +00:00
|
|
|
GstFormat * format, GstSeekFlags * flags, GstSeekType * start_type,
|
|
|
|
gint64 * start, GstSeekType * stop_type, gint64 * stop)
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
{
|
|
|
|
const GstStructure *structure;
|
2005-01-08 18:10:50 +00:00
|
|
|
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
g_return_if_fail (GST_IS_EVENT (event));
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_SEEK);
|
2006-08-11 13:05:30 +00:00
|
|
|
|
2011-05-10 09:50:16 +00:00
|
|
|
structure = GST_EVENT_STRUCTURE (event);
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
if (rate)
|
2008-10-13 17:19:25 +00:00
|
|
|
*rate =
|
|
|
|
g_value_get_double (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (RATE)));
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
if (format)
|
2011-08-09 21:42:26 +00:00
|
|
|
*format = (GstFormat)
|
2008-10-13 17:19:25 +00:00
|
|
|
g_value_get_enum (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (FORMAT)));
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
if (flags)
|
2011-08-09 21:42:26 +00:00
|
|
|
*flags = (GstSeekFlags)
|
2008-10-13 17:19:25 +00:00
|
|
|
g_value_get_flags (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (FLAGS)));
|
2006-10-09 17:15:39 +00:00
|
|
|
if (start_type)
|
2011-08-09 21:42:26 +00:00
|
|
|
*start_type = (GstSeekType)
|
2008-10-13 17:19:25 +00:00
|
|
|
g_value_get_enum (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (CUR_TYPE)));
|
2006-10-09 17:15:39 +00:00
|
|
|
if (start)
|
2008-10-13 17:19:25 +00:00
|
|
|
*start =
|
|
|
|
g_value_get_int64 (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (CUR)));
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
if (stop_type)
|
2011-08-09 21:42:26 +00:00
|
|
|
*stop_type = (GstSeekType)
|
2008-10-13 17:19:25 +00:00
|
|
|
g_value_get_enum (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (STOP_TYPE)));
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
if (stop)
|
2008-10-13 17:19:25 +00:00
|
|
|
*stop =
|
|
|
|
g_value_get_int64 (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (STOP)));
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
}
|
|
|
|
|
2005-08-22 10:37:02 +00:00
|
|
|
/**
|
|
|
|
* gst_event_new_navigation:
|
2010-12-07 18:35:04 +00:00
|
|
|
* @structure: (transfer full): description of the event. The event will take
|
|
|
|
* ownership of the structure.
|
2005-08-22 10:37:02 +00:00
|
|
|
*
|
|
|
|
* Create a new navigation event from the given description.
|
|
|
|
*
|
2010-12-07 18:35:04 +00:00
|
|
|
* Returns: (transfer full): a new #GstEvent
|
2005-08-22 10:37:02 +00:00
|
|
|
*/
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
GstEvent *
|
|
|
|
gst_event_new_navigation (GstStructure * structure)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (structure != NULL, NULL);
|
2006-08-11 13:05:30 +00:00
|
|
|
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
return gst_event_new_custom (GST_EVENT_NAVIGATION, structure);
|
2005-01-08 18:10:50 +00:00
|
|
|
}
|
2007-02-02 11:48:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_new_latency:
|
|
|
|
* @latency: the new latency value
|
|
|
|
*
|
|
|
|
* Create a new latency event. The event is sent upstream from the sinks and
|
|
|
|
* notifies elements that they should add an additional @latency to the
|
2009-05-21 15:32:00 +00:00
|
|
|
* running time before synchronising against the clock.
|
2007-02-02 11:48:48 +00:00
|
|
|
*
|
|
|
|
* The latency is mostly used in live sinks and is always expressed in
|
|
|
|
* the time format.
|
|
|
|
*
|
2010-12-07 18:35:04 +00:00
|
|
|
* Returns: (transfer full): a new #GstEvent
|
2007-02-02 11:48:48 +00:00
|
|
|
*/
|
|
|
|
GstEvent *
|
|
|
|
gst_event_new_latency (GstClockTime latency)
|
|
|
|
{
|
2008-10-13 17:19:25 +00:00
|
|
|
GstEvent *event;
|
|
|
|
GstStructure *structure;
|
|
|
|
|
2007-02-02 11:48:48 +00:00
|
|
|
GST_CAT_INFO (GST_CAT_EVENT,
|
|
|
|
"creating latency event %" GST_TIME_FORMAT, GST_TIME_ARGS (latency));
|
|
|
|
|
2011-10-29 07:02:00 +00:00
|
|
|
structure = gst_structure_new_id (GST_QUARK (EVENT_LATENCY),
|
2008-10-13 17:19:25 +00:00
|
|
|
GST_QUARK (LATENCY), G_TYPE_UINT64, latency, NULL);
|
|
|
|
event = gst_event_new_custom (GST_EVENT_LATENCY, structure);
|
|
|
|
|
|
|
|
return event;
|
2007-02-02 11:48:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_parse_latency:
|
|
|
|
* @event: The event to query
|
2010-06-16 16:10:13 +00:00
|
|
|
* @latency: (out): A pointer to store the latency in.
|
2007-02-02 11:48:48 +00:00
|
|
|
*
|
|
|
|
* Get the latency in the latency event.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_event_parse_latency (GstEvent * event, GstClockTime * latency)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GST_IS_EVENT (event));
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_LATENCY);
|
|
|
|
|
|
|
|
if (latency)
|
|
|
|
*latency =
|
2011-05-10 09:50:16 +00:00
|
|
|
g_value_get_uint64 (gst_structure_id_get_value (GST_EVENT_STRUCTURE
|
|
|
|
(event), GST_QUARK (LATENCY)));
|
2007-02-02 11:48:48 +00:00
|
|
|
}
|
2009-06-01 10:19:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_new_step:
|
|
|
|
* @format: the format of @amount
|
|
|
|
* @amount: the amount of data to step
|
|
|
|
* @rate: the step rate
|
|
|
|
* @flush: flushing steps
|
|
|
|
* @intermediate: intermediate steps
|
|
|
|
*
|
|
|
|
* Create a new step event. The purpose of the step event is to instruct a sink
|
|
|
|
* to skip @amount (expressed in @format) of media. It can be used to implement
|
|
|
|
* stepping through the video frame by frame or for doing fast trick modes.
|
|
|
|
*
|
2011-10-26 10:23:07 +00:00
|
|
|
* A rate of <= 0.0 is not allowed. Pause the pipeline, for the effect of rate
|
|
|
|
* = 0.0 or first reverse the direction of playback using a seek event to get
|
|
|
|
* the same effect as rate < 0.0.
|
2009-06-01 10:19:52 +00:00
|
|
|
*
|
|
|
|
* The @flush flag will clear any pending data in the pipeline before starting
|
|
|
|
* the step operation.
|
|
|
|
*
|
|
|
|
* The @intermediate flag instructs the pipeline that this step operation is
|
|
|
|
* part of a larger step operation.
|
|
|
|
*
|
2010-12-07 18:35:04 +00:00
|
|
|
* Returns: (transfer full): a new #GstEvent
|
2009-06-01 10:19:52 +00:00
|
|
|
*/
|
|
|
|
GstEvent *
|
|
|
|
gst_event_new_step (GstFormat format, guint64 amount, gdouble rate,
|
|
|
|
gboolean flush, gboolean intermediate)
|
|
|
|
{
|
|
|
|
GstEvent *event;
|
|
|
|
GstStructure *structure;
|
|
|
|
|
|
|
|
g_return_val_if_fail (rate > 0.0, NULL);
|
|
|
|
|
|
|
|
GST_CAT_INFO (GST_CAT_EVENT, "creating step event");
|
|
|
|
|
2011-10-29 07:02:00 +00:00
|
|
|
structure = gst_structure_new_id (GST_QUARK (EVENT_STEP),
|
2009-06-01 10:19:52 +00:00
|
|
|
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
|
|
|
|
GST_QUARK (AMOUNT), G_TYPE_UINT64, amount,
|
|
|
|
GST_QUARK (RATE), G_TYPE_DOUBLE, rate,
|
|
|
|
GST_QUARK (FLUSH), G_TYPE_BOOLEAN, flush,
|
|
|
|
GST_QUARK (INTERMEDIATE), G_TYPE_BOOLEAN, intermediate, NULL);
|
|
|
|
event = gst_event_new_custom (GST_EVENT_STEP, structure);
|
|
|
|
|
|
|
|
return event;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_parse_step:
|
|
|
|
* @event: The event to query
|
2010-12-07 18:35:04 +00:00
|
|
|
* @format: (out) (allow-none): a pointer to store the format in
|
|
|
|
* @amount: (out) (allow-none): a pointer to store the amount in
|
|
|
|
* @rate: (out) (allow-none): a pointer to store the rate in
|
|
|
|
* @flush: (out) (allow-none): a pointer to store the flush boolean in
|
|
|
|
* @intermediate: (out) (allow-none): a pointer to store the intermediate
|
|
|
|
* boolean in
|
2009-06-01 10:19:52 +00:00
|
|
|
*
|
|
|
|
* Parse the step event.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_event_parse_step (GstEvent * event, GstFormat * format, guint64 * amount,
|
|
|
|
gdouble * rate, gboolean * flush, gboolean * intermediate)
|
|
|
|
{
|
|
|
|
const GstStructure *structure;
|
|
|
|
|
|
|
|
g_return_if_fail (GST_IS_EVENT (event));
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_STEP);
|
|
|
|
|
2011-05-10 09:50:16 +00:00
|
|
|
structure = GST_EVENT_STRUCTURE (event);
|
2009-06-01 10:19:52 +00:00
|
|
|
if (format)
|
2011-08-09 21:42:26 +00:00
|
|
|
*format =
|
|
|
|
(GstFormat) g_value_get_enum (gst_structure_id_get_value (structure,
|
2009-06-01 10:19:52 +00:00
|
|
|
GST_QUARK (FORMAT)));
|
|
|
|
if (amount)
|
|
|
|
*amount = g_value_get_uint64 (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (AMOUNT)));
|
|
|
|
if (rate)
|
|
|
|
*rate = g_value_get_double (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (RATE)));
|
|
|
|
if (flush)
|
|
|
|
*flush = g_value_get_boolean (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (FLUSH)));
|
|
|
|
if (intermediate)
|
|
|
|
*intermediate = g_value_get_boolean (gst_structure_id_get_value (structure,
|
|
|
|
GST_QUARK (INTERMEDIATE)));
|
|
|
|
}
|
2009-11-18 06:52:24 +00:00
|
|
|
|
2011-01-17 14:51:49 +00:00
|
|
|
/**
|
2011-05-03 11:05:06 +00:00
|
|
|
* gst_event_new_reconfigure:
|
2011-01-17 14:51:49 +00:00
|
|
|
|
2013-12-07 14:38:19 +00:00
|
|
|
* Create a new reconfigure event. The purpose of the reconfigure event is
|
2011-05-06 11:01:24 +00:00
|
|
|
* to travel upstream and make elements renegotiate their caps or reconfigure
|
|
|
|
* their buffer pools. This is useful when changing properties on elements
|
|
|
|
* or changing the topology of the pipeline.
|
2011-01-17 14:51:49 +00:00
|
|
|
*
|
|
|
|
* Returns: (transfer full): a new #GstEvent
|
|
|
|
*/
|
|
|
|
GstEvent *
|
2011-05-03 11:05:06 +00:00
|
|
|
gst_event_new_reconfigure (void)
|
2011-01-17 14:51:49 +00:00
|
|
|
{
|
|
|
|
GstEvent *event;
|
|
|
|
|
2011-05-03 11:05:06 +00:00
|
|
|
GST_CAT_INFO (GST_CAT_EVENT, "creating reconfigure event");
|
2011-01-17 14:51:49 +00:00
|
|
|
|
2011-05-03 11:05:06 +00:00
|
|
|
event = gst_event_new_custom (GST_EVENT_RECONFIGURE, NULL);
|
2011-01-17 14:51:49 +00:00
|
|
|
|
|
|
|
return event;
|
|
|
|
}
|
|
|
|
|
2009-11-18 06:52:24 +00:00
|
|
|
/**
|
|
|
|
* gst_event_new_sink_message:
|
2012-06-06 10:52:09 +00:00
|
|
|
* @name: a name for the event
|
2010-12-07 18:35:04 +00:00
|
|
|
* @msg: (transfer none): the #GstMessage to be posted
|
2009-11-18 06:52:24 +00:00
|
|
|
*
|
|
|
|
* Create a new sink-message event. The purpose of the sink-message event is
|
|
|
|
* to instruct a sink to post the message contained in the event synchronized
|
|
|
|
* with the stream.
|
|
|
|
*
|
2012-06-06 10:52:09 +00:00
|
|
|
* @name is used to store multiple sticky events on one pad.
|
|
|
|
*
|
2010-12-07 18:35:04 +00:00
|
|
|
* Returns: (transfer full): a new #GstEvent
|
2009-11-18 06:52:24 +00:00
|
|
|
*/
|
2014-09-25 19:21:09 +00:00
|
|
|
/* FIXME 2.0: take ownership of msg for consistency? */
|
2009-11-18 06:52:24 +00:00
|
|
|
GstEvent *
|
2012-06-06 10:52:09 +00:00
|
|
|
gst_event_new_sink_message (const gchar * name, GstMessage * msg)
|
2009-11-18 06:52:24 +00:00
|
|
|
{
|
|
|
|
GstEvent *event;
|
|
|
|
GstStructure *structure;
|
|
|
|
|
|
|
|
g_return_val_if_fail (msg != NULL, NULL);
|
|
|
|
|
|
|
|
GST_CAT_INFO (GST_CAT_EVENT, "creating sink-message event");
|
|
|
|
|
2012-06-06 10:52:09 +00:00
|
|
|
structure = gst_structure_new_id (g_quark_from_string (name),
|
2009-11-18 06:52:24 +00:00
|
|
|
GST_QUARK (MESSAGE), GST_TYPE_MESSAGE, msg, NULL);
|
|
|
|
event = gst_event_new_custom (GST_EVENT_SINK_MESSAGE, structure);
|
|
|
|
|
|
|
|
return event;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_parse_sink_message:
|
|
|
|
* @event: The event to query
|
2010-12-07 18:35:04 +00:00
|
|
|
* @msg: (out) (transfer full): a pointer to store the #GstMessage in.
|
2009-11-18 06:52:24 +00:00
|
|
|
*
|
|
|
|
* Parse the sink-message event. Unref @msg after usage.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_event_parse_sink_message (GstEvent * event, GstMessage ** msg)
|
|
|
|
{
|
2011-02-22 18:30:59 +00:00
|
|
|
const GstStructure *structure;
|
|
|
|
|
2009-11-18 06:52:24 +00:00
|
|
|
g_return_if_fail (GST_IS_EVENT (event));
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_SINK_MESSAGE);
|
|
|
|
|
2011-05-10 09:50:16 +00:00
|
|
|
structure = GST_EVENT_STRUCTURE (event);
|
2009-11-18 06:52:24 +00:00
|
|
|
if (msg)
|
|
|
|
*msg =
|
2009-12-03 19:49:30 +00:00
|
|
|
GST_MESSAGE (g_value_dup_boxed (gst_structure_id_get_value
|
|
|
|
(structure, GST_QUARK (MESSAGE))));
|
2009-11-18 06:52:24 +00:00
|
|
|
}
|
2012-01-27 09:30:43 +00:00
|
|
|
|
|
|
|
/**
|
2012-06-15 23:43:30 +00:00
|
|
|
* gst_event_new_stream_start:
|
2012-07-28 06:37:00 +00:00
|
|
|
* @stream_id: Identifier for this stream
|
2012-01-27 09:30:43 +00:00
|
|
|
*
|
|
|
|
* Create a new STREAM_START event. The stream start event can only
|
|
|
|
* travel downstream synchronized with the buffer flow. It is expected
|
|
|
|
* to be the first event that is sent for a new stream.
|
|
|
|
*
|
|
|
|
* Source elements, demuxers and other elements that create new streams
|
|
|
|
* are supposed to send this event as the first event of a new stream. It
|
2015-01-20 13:35:47 +00:00
|
|
|
* should not be sent after a flushing seek or in similar situations
|
2012-01-27 09:42:09 +00:00
|
|
|
* and is used to mark the beginning of a new logical stream. Elements
|
|
|
|
* combining multiple streams must ensure that this event is only forwarded
|
|
|
|
* downstream once and not for every single input stream.
|
2012-01-27 09:30:43 +00:00
|
|
|
*
|
2012-07-28 06:37:00 +00:00
|
|
|
* The @stream_id should be a unique string that consists of the upstream
|
|
|
|
* stream-id, / as separator and a unique stream-id for this specific
|
|
|
|
* stream. A new stream-id should only be created for a stream if the upstream
|
|
|
|
* stream is split into (potentially) multiple new streams, e.g. in a demuxer,
|
|
|
|
* but not for every single element in the pipeline.
|
2012-08-11 21:19:32 +00:00
|
|
|
* gst_pad_create_stream_id() or gst_pad_create_stream_id_printf() can be
|
2016-02-22 13:09:56 +00:00
|
|
|
* used to create a stream-id. There are no particular semantics for the
|
|
|
|
* stream-id, though it should be deterministic (to support stream matching)
|
|
|
|
* and it might be used to order streams (besides any information conveyed by
|
|
|
|
* stream flags).
|
2012-07-28 06:37:00 +00:00
|
|
|
*
|
2012-01-27 09:30:43 +00:00
|
|
|
* Returns: (transfer full): the new STREAM_START event.
|
|
|
|
*/
|
|
|
|
GstEvent *
|
2012-07-28 06:37:00 +00:00
|
|
|
gst_event_new_stream_start (const gchar * stream_id)
|
2012-01-27 09:30:43 +00:00
|
|
|
{
|
2012-07-28 06:37:00 +00:00
|
|
|
GstStructure *s;
|
|
|
|
|
|
|
|
g_return_val_if_fail (stream_id != NULL, NULL);
|
|
|
|
|
|
|
|
s = gst_structure_new_id (GST_QUARK (EVENT_STREAM_START),
|
2013-01-06 20:27:54 +00:00
|
|
|
GST_QUARK (STREAM_ID), G_TYPE_STRING, stream_id,
|
|
|
|
GST_QUARK (FLAGS), GST_TYPE_STREAM_FLAGS, GST_STREAM_FLAG_NONE, NULL);
|
2012-07-28 06:37:00 +00:00
|
|
|
|
|
|
|
return gst_event_new_custom (GST_EVENT_STREAM_START, s);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_parse_stream_start:
|
|
|
|
* @event: a stream-start event.
|
2012-11-23 20:09:45 +00:00
|
|
|
* @stream_id: (out) (transfer none): pointer to store the stream-id
|
2012-07-28 06:37:00 +00:00
|
|
|
*
|
2012-08-12 17:31:13 +00:00
|
|
|
* Parse a stream-id @event and store the result in the given @stream_id
|
|
|
|
* location. The string stored in @stream_id must not be modified and will
|
|
|
|
* remain valid only until @event gets freed. Make a copy if you want to
|
|
|
|
* modify it or store it for later use.
|
2012-07-28 06:37:00 +00:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_event_parse_stream_start (GstEvent * event, const gchar ** stream_id)
|
|
|
|
{
|
|
|
|
const GstStructure *structure;
|
2012-08-12 17:31:13 +00:00
|
|
|
const GValue *val;
|
2012-07-28 06:37:00 +00:00
|
|
|
|
|
|
|
g_return_if_fail (event != NULL);
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START);
|
|
|
|
|
|
|
|
structure = gst_event_get_structure (event);
|
2012-08-12 17:31:13 +00:00
|
|
|
val = gst_structure_id_get_value (structure, GST_QUARK (STREAM_ID));
|
2012-07-28 06:37:00 +00:00
|
|
|
|
|
|
|
if (stream_id)
|
2012-08-12 17:31:13 +00:00
|
|
|
*stream_id = g_value_get_string (val);
|
2012-01-27 09:30:43 +00:00
|
|
|
}
|
2012-03-14 16:40:32 +00:00
|
|
|
|
2015-06-12 08:53:23 +00:00
|
|
|
/**
|
|
|
|
* gst_event_set_stream:
|
|
|
|
* @event: a stream-start event
|
|
|
|
* @stream: (transfer none): the stream object to set
|
|
|
|
*
|
|
|
|
* Set the @stream on the stream-start @event
|
2016-06-30 14:07:28 +00:00
|
|
|
*
|
|
|
|
* Since: 1.10
|
|
|
|
*/
|
2015-06-12 08:53:23 +00:00
|
|
|
void
|
|
|
|
gst_event_set_stream (GstEvent * event, GstStream * stream)
|
|
|
|
{
|
|
|
|
g_return_if_fail (event != NULL);
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START);
|
|
|
|
g_return_if_fail (gst_event_is_writable (event));
|
|
|
|
|
|
|
|
gst_structure_id_set (GST_EVENT_STRUCTURE (event),
|
|
|
|
GST_QUARK (STREAM), GST_TYPE_STREAM, stream, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_parse_stream:
|
|
|
|
* @event: a stream-start event
|
|
|
|
* @stream: (out) (transfer full): adress of variable to store the stream
|
|
|
|
*
|
|
|
|
* Parse a stream-start @event and extract the #GstStream from it.
|
2016-06-30 14:07:28 +00:00
|
|
|
*
|
|
|
|
* Since: 1.10
|
|
|
|
*/
|
2015-06-12 08:53:23 +00:00
|
|
|
void
|
|
|
|
gst_event_parse_stream (GstEvent * event, GstStream ** stream)
|
|
|
|
{
|
|
|
|
g_return_if_fail (event != NULL);
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START);
|
|
|
|
|
|
|
|
if (stream) {
|
|
|
|
gst_structure_id_get (GST_EVENT_STRUCTURE (event),
|
|
|
|
GST_QUARK (STREAM), GST_TYPE_STREAM, stream, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-01-06 20:27:54 +00:00
|
|
|
/**
|
|
|
|
* gst_event_set_stream_flags:
|
|
|
|
* @event: a stream-start event
|
|
|
|
* @flags: the stream flags to set
|
|
|
|
*
|
|
|
|
* Since: 1.2
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_event_set_stream_flags (GstEvent * event, GstStreamFlags flags)
|
|
|
|
{
|
|
|
|
g_return_if_fail (event != NULL);
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START);
|
|
|
|
g_return_if_fail (gst_event_is_writable (event));
|
|
|
|
|
|
|
|
gst_structure_id_set (GST_EVENT_STRUCTURE (event),
|
|
|
|
GST_QUARK (FLAGS), GST_TYPE_STREAM_FLAGS, flags, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_parse_stream_flags:
|
|
|
|
* @event: a stream-start event
|
|
|
|
* @flags: (out): address of variable where to store the stream flags
|
|
|
|
*
|
|
|
|
* Since: 1.2
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_event_parse_stream_flags (GstEvent * event, GstStreamFlags * flags)
|
|
|
|
{
|
|
|
|
g_return_if_fail (event != NULL);
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START);
|
|
|
|
|
|
|
|
if (flags) {
|
|
|
|
gst_structure_id_get (GST_EVENT_STRUCTURE (event),
|
|
|
|
GST_QUARK (FLAGS), GST_TYPE_STREAM_FLAGS, flags, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-22 09:41:35 +00:00
|
|
|
/**
|
|
|
|
* gst_event_set_group_id:
|
|
|
|
* @event: a stream-start event
|
|
|
|
* @group_id: the group id to set
|
|
|
|
*
|
|
|
|
* All streams that have the same group id are supposed to be played
|
|
|
|
* together, i.e. all streams inside a container file should have the
|
|
|
|
* same group id but different stream ids. The group id should change
|
|
|
|
* each time the stream is started, resulting in different group ids
|
|
|
|
* each time a file is played for example.
|
|
|
|
*
|
|
|
|
* Use gst_util_group_id_next() to get a new group id.
|
|
|
|
*
|
|
|
|
* Since: 1.2
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_event_set_group_id (GstEvent * event, guint group_id)
|
|
|
|
{
|
|
|
|
g_return_if_fail (event != NULL);
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START);
|
|
|
|
g_return_if_fail (gst_event_is_writable (event));
|
|
|
|
|
|
|
|
gst_structure_id_set (GST_EVENT_STRUCTURE (event),
|
|
|
|
GST_QUARK (GROUP_ID), G_TYPE_UINT, group_id, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_parse_group_id:
|
|
|
|
* @event: a stream-start event
|
|
|
|
* @group_id: (out): address of variable where to store the group id
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if a group id was set on the event and could be parsed,
|
|
|
|
* %FALSE otherwise.
|
|
|
|
*
|
|
|
|
* Since: 1.2
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gst_event_parse_group_id (GstEvent * event, guint * group_id)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START,
|
|
|
|
FALSE);
|
|
|
|
|
|
|
|
if (group_id) {
|
|
|
|
return gst_structure_id_get (GST_EVENT_STRUCTURE (event),
|
|
|
|
GST_QUARK (GROUP_ID), G_TYPE_UINT, group_id, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2015-06-12 08:53:23 +00:00
|
|
|
/**
|
|
|
|
* gst_event_new_stream_collection:
|
|
|
|
* @collection: Active collection for this data flow
|
|
|
|
*
|
|
|
|
* Create a new STREAM_COLLECTION event. The stream collection event can only
|
|
|
|
* travel downstream synchronized with the buffer flow.
|
|
|
|
*
|
|
|
|
* Source elements, demuxers and other elements that manage collections
|
|
|
|
* of streams and post #GstStreamCollection messages on the bus also send
|
|
|
|
* this event downstream on each pad involved in the collection, so that
|
|
|
|
* activation of a new collection can be tracked through the downstream
|
|
|
|
* data flow.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): the new STREAM_COLLECTION event.
|
2016-06-30 14:07:28 +00:00
|
|
|
*
|
|
|
|
* Since: 1.10
|
2015-06-12 08:53:23 +00:00
|
|
|
*/
|
|
|
|
GstEvent *
|
|
|
|
gst_event_new_stream_collection (GstStreamCollection * collection)
|
|
|
|
{
|
|
|
|
GstStructure *s;
|
|
|
|
|
|
|
|
g_return_val_if_fail (collection != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GST_IS_STREAM_COLLECTION (collection), NULL);
|
|
|
|
|
|
|
|
s = gst_structure_new_id (GST_QUARK (EVENT_STREAM_COLLECTION),
|
|
|
|
GST_QUARK (COLLECTION), GST_TYPE_STREAM_COLLECTION, collection, NULL);
|
|
|
|
|
|
|
|
return gst_event_new_custom (GST_EVENT_STREAM_COLLECTION, s);
|
|
|
|
}
|
|
|
|
|
2016-06-30 14:07:28 +00:00
|
|
|
/**
|
|
|
|
* gst_event_parse_stream_collection:
|
|
|
|
* @event: a stream-collection event
|
|
|
|
* @collection: (out): pointer to store the collection
|
|
|
|
*
|
|
|
|
* Retrieve new #GstStreamCollection from STREAM_COLLECTION event @event.
|
|
|
|
*
|
|
|
|
* Since: 1.10
|
|
|
|
*/
|
2015-06-12 08:53:23 +00:00
|
|
|
void
|
|
|
|
gst_event_parse_stream_collection (GstEvent * event,
|
|
|
|
GstStreamCollection ** collection)
|
|
|
|
{
|
|
|
|
const GstStructure *structure;
|
|
|
|
|
|
|
|
g_return_if_fail (event != NULL);
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_STREAM_COLLECTION);
|
|
|
|
|
|
|
|
structure = gst_event_get_structure (event);
|
|
|
|
|
|
|
|
if (collection) {
|
|
|
|
gst_structure_id_get (structure,
|
|
|
|
GST_QUARK (COLLECTION), GST_TYPE_STREAM_COLLECTION, collection, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-14 16:40:32 +00:00
|
|
|
/**
|
|
|
|
* gst_event_new_toc:
|
2012-06-26 19:41:18 +00:00
|
|
|
* @toc: (transfer none): #GstToc structure.
|
2012-03-14 16:40:32 +00:00
|
|
|
* @updated: whether @toc was updated or not.
|
|
|
|
*
|
|
|
|
* Generate a TOC event from the given @toc. The purpose of the TOC event is to
|
|
|
|
* inform elements that some kind of the TOC was found.
|
|
|
|
*
|
2012-06-26 19:41:18 +00:00
|
|
|
* Returns: (transfer full): a new #GstEvent.
|
2012-03-14 16:40:32 +00:00
|
|
|
*/
|
|
|
|
GstEvent *
|
2012-06-06 12:14:31 +00:00
|
|
|
gst_event_new_toc (GstToc * toc, gboolean updated)
|
2012-03-14 16:40:32 +00:00
|
|
|
{
|
|
|
|
GstStructure *toc_struct;
|
2012-07-28 08:41:30 +00:00
|
|
|
GQuark id;
|
2012-03-14 16:40:32 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (toc != NULL, NULL);
|
|
|
|
|
|
|
|
GST_CAT_INFO (GST_CAT_EVENT, "creating toc event");
|
|
|
|
|
2012-07-28 08:41:30 +00:00
|
|
|
/* need different structure names so sticky_multi event stuff on pads
|
|
|
|
* works, i.e. both TOC events are kept around */
|
|
|
|
if (gst_toc_get_scope (toc) == GST_TOC_SCOPE_GLOBAL)
|
|
|
|
id = GST_QUARK (EVENT_TOC_GLOBAL);
|
|
|
|
else
|
|
|
|
id = GST_QUARK (EVENT_TOC_CURRENT);
|
|
|
|
|
|
|
|
toc_struct = gst_structure_new_id (id,
|
2012-06-26 19:41:18 +00:00
|
|
|
GST_QUARK (TOC), GST_TYPE_TOC, toc,
|
|
|
|
GST_QUARK (UPDATED), G_TYPE_BOOLEAN, updated, NULL);
|
2012-03-14 16:40:32 +00:00
|
|
|
|
2012-06-26 19:41:18 +00:00
|
|
|
return gst_event_new_custom (GST_EVENT_TOC, toc_struct);
|
2012-03-14 16:40:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_parse_toc:
|
|
|
|
* @event: a TOC event.
|
2012-06-26 19:41:18 +00:00
|
|
|
* @toc: (out) (transfer full): pointer to #GstToc structure.
|
2012-03-14 16:40:32 +00:00
|
|
|
* @updated: (out): pointer to store TOC updated flag.
|
|
|
|
*
|
|
|
|
* Parse a TOC @event and store the results in the given @toc and @updated locations.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_event_parse_toc (GstEvent * event, GstToc ** toc, gboolean * updated)
|
|
|
|
{
|
|
|
|
const GstStructure *structure;
|
|
|
|
|
|
|
|
g_return_if_fail (event != NULL);
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_TOC);
|
|
|
|
g_return_if_fail (toc != NULL);
|
|
|
|
|
|
|
|
structure = gst_event_get_structure (event);
|
|
|
|
|
2012-06-26 19:41:18 +00:00
|
|
|
gst_structure_id_get (structure,
|
|
|
|
GST_QUARK (TOC), GST_TYPE_TOC, toc,
|
|
|
|
GST_QUARK (UPDATED), G_TYPE_BOOLEAN, updated, NULL);
|
2012-03-14 16:40:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_new_toc_select:
|
|
|
|
* @uid: UID in the TOC to start playback from.
|
|
|
|
*
|
|
|
|
* Generate a TOC select event with the given @uid. The purpose of the
|
|
|
|
* TOC select event is to start playback based on the TOC's entry with the
|
|
|
|
* given @uid.
|
|
|
|
*
|
|
|
|
* Returns: a new #GstEvent.
|
|
|
|
*/
|
|
|
|
GstEvent *
|
|
|
|
gst_event_new_toc_select (const gchar * uid)
|
|
|
|
{
|
|
|
|
GstStructure *structure;
|
|
|
|
|
|
|
|
g_return_val_if_fail (uid != NULL, NULL);
|
|
|
|
|
|
|
|
GST_CAT_INFO (GST_CAT_EVENT, "creating toc select event for UID: %s", uid);
|
|
|
|
|
2012-04-02 20:09:07 +00:00
|
|
|
structure = gst_structure_new_id (GST_QUARK (EVENT_TOC_SELECT),
|
2012-03-14 16:40:32 +00:00
|
|
|
GST_QUARK (UID), G_TYPE_STRING, uid, NULL);
|
|
|
|
|
|
|
|
return gst_event_new_custom (GST_EVENT_TOC_SELECT, structure);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_parse_toc_select:
|
|
|
|
* @event: a TOC select event.
|
2014-09-16 11:48:18 +00:00
|
|
|
* @uid: (out) (transfer full) (allow-none): storage for the selection UID.
|
2012-03-14 16:40:32 +00:00
|
|
|
*
|
|
|
|
* Parse a TOC select @event and store the results in the given @uid location.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_event_parse_toc_select (GstEvent * event, gchar ** uid)
|
|
|
|
{
|
|
|
|
const GstStructure *structure;
|
|
|
|
const GValue *val;
|
|
|
|
|
|
|
|
g_return_if_fail (event != NULL);
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_TOC_SELECT);
|
|
|
|
|
|
|
|
structure = gst_event_get_structure (event);
|
|
|
|
val = gst_structure_id_get_value (structure, GST_QUARK (UID));
|
|
|
|
|
|
|
|
if (uid != NULL)
|
|
|
|
*uid = g_strdup (g_value_get_string (val));
|
|
|
|
|
|
|
|
}
|
2012-07-05 10:52:51 +00:00
|
|
|
|
2015-03-16 12:35:27 +00:00
|
|
|
/**
|
2015-06-13 17:14:30 +00:00
|
|
|
* gst_event_new_protection:
|
|
|
|
* @system_id: (transfer none): a string holding a UUID that uniquely
|
|
|
|
* identifies a protection system.
|
|
|
|
* @data: (transfer none): a #GstBuffer holding protection system specific
|
|
|
|
* information. The reference count of the buffer will be incremented by one.
|
|
|
|
* @origin: a string indicating where the protection
|
|
|
|
* information carried in the event was extracted from. The allowed values
|
|
|
|
* of this string will depend upon the protection scheme.
|
|
|
|
*
|
|
|
|
* Creates a new event containing information specific to a particular
|
|
|
|
* protection system (uniquely identified by @system_id), by which that
|
|
|
|
* protection system can acquire key(s) to decrypt a protected stream.
|
2015-03-16 12:35:27 +00:00
|
|
|
*
|
|
|
|
* In order for a decryption element to decrypt media
|
|
|
|
* protected using a specific system, it first needs all the
|
|
|
|
* protection system specific information necessary to acquire the decryption
|
|
|
|
* key(s) for that stream. The functions defined here enable this information
|
|
|
|
* to be passed in events from elements that extract it
|
|
|
|
* (e.g., ISOBMFF demuxers, MPEG DASH demuxers) to protection decrypter
|
|
|
|
* elements that use it.
|
|
|
|
*
|
|
|
|
* Events containing protection system specific information are created using
|
|
|
|
* #gst_event_new_protection, and they can be parsed by downstream elements
|
|
|
|
* using #gst_event_parse_protection.
|
|
|
|
*
|
|
|
|
* In Common Encryption, protection system specific information may be located
|
|
|
|
* within ISOBMFF files, both in movie (moov) boxes and movie fragment (moof)
|
|
|
|
* boxes; it may also be contained in ContentProtection elements within MPEG
|
|
|
|
* DASH MPDs. The events created by #gst_event_new_protection contain data
|
|
|
|
* identifying from which of these locations the encapsulated protection system
|
|
|
|
* specific information originated. This origin information is required as
|
|
|
|
* some protection systems use different encodings depending upon where the
|
|
|
|
* information originates.
|
|
|
|
*
|
2015-06-13 17:14:30 +00:00
|
|
|
* The events returned by gst_event_new_protection() are implemented
|
2015-03-16 12:35:27 +00:00
|
|
|
* in such a way as to ensure that the most recently-pushed protection info
|
|
|
|
* event of a particular @origin and @system_id will
|
|
|
|
* be stuck to the output pad of the sending element.
|
|
|
|
*
|
|
|
|
* Returns: a #GST_EVENT_PROTECTION event, if successful; %NULL
|
|
|
|
* if unsuccessful.
|
|
|
|
*
|
|
|
|
* Since: 1.6
|
|
|
|
*/
|
|
|
|
GstEvent *
|
|
|
|
gst_event_new_protection (const gchar * system_id,
|
|
|
|
GstBuffer * data, const gchar * origin)
|
|
|
|
{
|
|
|
|
gchar *event_name;
|
|
|
|
GstEvent *event;
|
|
|
|
GstStructure *s;
|
|
|
|
|
|
|
|
g_return_val_if_fail (system_id != NULL, NULL);
|
|
|
|
g_return_val_if_fail (data != NULL, NULL);
|
|
|
|
|
|
|
|
event_name =
|
|
|
|
g_strconcat ("GstProtectionEvent", origin ? "-" : "",
|
|
|
|
origin ? origin : "", "-", system_id, NULL);
|
|
|
|
|
|
|
|
GST_CAT_INFO (GST_CAT_EVENT, "creating protection event %s", event_name);
|
|
|
|
|
|
|
|
s = gst_structure_new (event_name, "data", GST_TYPE_BUFFER, data,
|
|
|
|
"system_id", G_TYPE_STRING, system_id, NULL);
|
|
|
|
if (origin)
|
|
|
|
gst_structure_set (s, "origin", G_TYPE_STRING, origin, NULL);
|
|
|
|
event = gst_event_new_custom (GST_EVENT_PROTECTION, s);
|
|
|
|
|
|
|
|
g_free (event_name);
|
|
|
|
return event;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_parse_protection:
|
|
|
|
* @event: a #GST_EVENT_PROTECTION event.
|
|
|
|
* @system_id: (out) (allow-none) (transfer none): pointer to store the UUID
|
|
|
|
* string uniquely identifying a content protection system.
|
|
|
|
* @data: (out) (allow-none) (transfer none): pointer to store a #GstBuffer
|
|
|
|
* holding protection system specific information.
|
|
|
|
* @origin: (allow-none) (transfer none): pointer to store a value that
|
|
|
|
* indicates where the protection information carried by @event was extracted
|
|
|
|
* from.
|
|
|
|
*
|
|
|
|
* Parses an event containing protection system specific information and stores
|
|
|
|
* the results in @system_id, @data and @origin. The data stored in @system_id,
|
|
|
|
* @origin and @data are valid until @event is released.
|
|
|
|
*
|
|
|
|
* Since: 1.6
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_event_parse_protection (GstEvent * event, const gchar ** system_id,
|
|
|
|
GstBuffer ** data, const gchar ** origin)
|
|
|
|
{
|
|
|
|
const GstStructure *s;
|
|
|
|
|
|
|
|
g_return_if_fail (event != NULL);
|
|
|
|
g_return_if_fail (GST_IS_EVENT (event));
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_PROTECTION);
|
|
|
|
|
|
|
|
s = gst_event_get_structure (event);
|
|
|
|
|
|
|
|
if (origin)
|
|
|
|
*origin = gst_structure_get_string (s, "origin");
|
|
|
|
|
|
|
|
if (system_id)
|
|
|
|
*system_id = gst_structure_get_string (s, "system_id");
|
|
|
|
|
|
|
|
if (data) {
|
|
|
|
const GValue *value = gst_structure_get_value (s, "data");
|
|
|
|
*data = gst_value_get_buffer (value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-05 10:52:51 +00:00
|
|
|
/**
|
|
|
|
* gst_event_new_segment_done:
|
2012-07-05 11:03:10 +00:00
|
|
|
* @format: The format of the position being done
|
|
|
|
* @position: The position of the segment being done
|
|
|
|
*
|
2012-07-05 10:52:51 +00:00
|
|
|
* Create a new segment-done event. This event is sent by elements that
|
|
|
|
* finish playback of a segment as a result of a segment seek.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): a new #GstEvent
|
|
|
|
*/
|
|
|
|
GstEvent *
|
2012-07-05 11:03:10 +00:00
|
|
|
gst_event_new_segment_done (GstFormat format, gint64 position)
|
2012-07-05 10:52:51 +00:00
|
|
|
{
|
|
|
|
GstEvent *event;
|
2012-07-05 11:03:10 +00:00
|
|
|
GstStructure *structure;
|
2012-07-05 10:52:51 +00:00
|
|
|
|
|
|
|
GST_CAT_INFO (GST_CAT_EVENT, "creating segment-done event");
|
|
|
|
|
2012-07-05 11:03:10 +00:00
|
|
|
structure = gst_structure_new_id (GST_QUARK (EVENT_SEGMENT_DONE),
|
|
|
|
GST_QUARK (FORMAT), GST_TYPE_FORMAT, format,
|
|
|
|
GST_QUARK (POSITION), G_TYPE_INT64, position, NULL);
|
|
|
|
|
|
|
|
event = gst_event_new_custom (GST_EVENT_SEGMENT_DONE, structure);
|
2012-07-05 10:52:51 +00:00
|
|
|
|
|
|
|
return event;
|
|
|
|
}
|
2012-07-05 11:03:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_event_parse_segment_done:
|
|
|
|
* @event: A valid #GstEvent of type GST_EVENT_SEGMENT_DONE.
|
2014-05-29 21:54:34 +00:00
|
|
|
* @format: (out) (allow-none): Result location for the format, or %NULL
|
|
|
|
* @position: (out) (allow-none): Result location for the position, or %NULL
|
2012-07-05 11:03:10 +00:00
|
|
|
*
|
|
|
|
* Extracts the position and format from the segment done message.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_event_parse_segment_done (GstEvent * event, GstFormat * format,
|
|
|
|
gint64 * position)
|
|
|
|
{
|
|
|
|
const GstStructure *structure;
|
|
|
|
const GValue *val;
|
|
|
|
|
|
|
|
g_return_if_fail (event != NULL);
|
|
|
|
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_SEGMENT_DONE);
|
|
|
|
|
|
|
|
structure = gst_event_get_structure (event);
|
|
|
|
|
|
|
|
val = gst_structure_id_get_value (structure, GST_QUARK (FORMAT));
|
|
|
|
if (format != NULL)
|
|
|
|
*format = g_value_get_enum (val);
|
|
|
|
|
|
|
|
val = gst_structure_id_get_value (structure, GST_QUARK (POSITION));
|
|
|
|
if (position != NULL)
|
|
|
|
*position = g_value_get_int64 (val);
|
|
|
|
}
|