mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 03:31:05 +00:00
event: Remove CONTEXT downstream event
This is going to be implemented with an upstream query instead for consistency and simplicity.
This commit is contained in:
parent
8501fbd216
commit
113c9fa277
4 changed files with 10 additions and 72 deletions
|
@ -116,7 +116,6 @@ static GstEventQuarks event_quarks[] = {
|
|||
{GST_EVENT_BUFFERSIZE, "buffersize", 0},
|
||||
{GST_EVENT_SINK_MESSAGE, "sink-message", 0},
|
||||
{GST_EVENT_EOS, "eos", 0},
|
||||
{GST_EVENT_CONTEXT, "context", 0},
|
||||
{GST_EVENT_SEGMENT_DONE, "segment-done", 0},
|
||||
{GST_EVENT_GAP, "gap", 0},
|
||||
{GST_EVENT_QOS, "qos", 0},
|
||||
|
@ -1687,56 +1686,3 @@ gst_event_parse_segment_done (GstEvent * event, GstFormat * format,
|
|||
if (position != NULL)
|
||||
*position = g_value_get_int64 (val);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_event_new_context:
|
||||
* @context: (transfer full): the #GstContext
|
||||
*
|
||||
* Create a new context event. The purpose of the context event is
|
||||
* to pass a pipeline-local context to downstream elements.
|
||||
*
|
||||
* Returns: (transfer full): a new #GstEvent
|
||||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
GstEvent *
|
||||
gst_event_new_context (GstContext * context)
|
||||
{
|
||||
GstEvent *event;
|
||||
GstStructure *structure;
|
||||
|
||||
g_return_val_if_fail (context != NULL, NULL);
|
||||
|
||||
GST_CAT_INFO (GST_CAT_EVENT, "creating context event");
|
||||
|
||||
structure = gst_structure_new_id (GST_QUARK (EVENT_SEEK),
|
||||
GST_QUARK (CONTEXT), GST_TYPE_CONTEXT, context, NULL);
|
||||
event = gst_event_new_custom (GST_EVENT_CONTEXT, structure);
|
||||
gst_context_unref (context);
|
||||
|
||||
return event;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_event_parse_context:
|
||||
* @event: The event to query
|
||||
* @context: (out) (transfer full): a pointer to store the #GstContext in.
|
||||
*
|
||||
* Parse the context event. Unref @context after usage.
|
||||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
void
|
||||
gst_event_parse_context (GstEvent * event, GstContext ** context)
|
||||
{
|
||||
const GstStructure *structure;
|
||||
|
||||
g_return_if_fail (GST_IS_EVENT (event));
|
||||
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_CONTEXT);
|
||||
|
||||
structure = GST_EVENT_STRUCTURE (event);
|
||||
if (context)
|
||||
*context =
|
||||
GST_CONTEXT (g_value_dup_boxed (gst_structure_id_get_value
|
||||
(structure, GST_QUARK (CONTEXT))));
|
||||
}
|
||||
|
|
|
@ -99,8 +99,6 @@ typedef enum {
|
|||
* @GST_EVENT_GAP: Marks a gap in the datastream.
|
||||
* @GST_EVENT_TOC: An event which indicates that a new table of contents (TOC)
|
||||
* was found or updated.
|
||||
* @GST_EVENT_CONTEXT: An event to communicate a #GstContext to other
|
||||
* elements (Since 1.2)
|
||||
* @GST_EVENT_QOS: A quality message. Used to indicate to upstream elements
|
||||
* that the downstream elements should adjust their processing
|
||||
* rate.
|
||||
|
@ -149,7 +147,6 @@ typedef enum {
|
|||
GST_EVENT_SINK_MESSAGE = GST_EVENT_MAKE_TYPE (100, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY) | FLAG(STICKY_MULTI)),
|
||||
GST_EVENT_EOS = GST_EVENT_MAKE_TYPE (110, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY)),
|
||||
GST_EVENT_TOC = GST_EVENT_MAKE_TYPE (120, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY) | FLAG(STICKY_MULTI)),
|
||||
GST_EVENT_CONTEXT = GST_EVENT_MAKE_TYPE (130, FLAG(DOWNSTREAM) | FLAG(SERIALIZED) | FLAG(STICKY) | FLAG(STICKY_MULTI)),
|
||||
|
||||
/* non-sticky downstream serialized */
|
||||
GST_EVENT_SEGMENT_DONE = GST_EVENT_MAKE_TYPE (150, FLAG(DOWNSTREAM) | FLAG(SERIALIZED)),
|
||||
|
@ -579,10 +576,6 @@ void gst_event_parse_toc_select (GstEvent *event, gchar **uid);
|
|||
GstEvent* gst_event_new_segment_done (GstFormat format, gint64 position) G_GNUC_MALLOC;
|
||||
void gst_event_parse_segment_done (GstEvent *event, GstFormat *format, gint64 *position);
|
||||
|
||||
/* context */
|
||||
GstEvent* gst_event_new_context (GstContext * context) G_GNUC_MALLOC;
|
||||
void gst_event_parse_context (GstEvent *event, GstContext **context);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_EVENT_H__ */
|
||||
|
|
|
@ -66,7 +66,7 @@ static const gchar *_quark_strings[] = {
|
|||
"GstMessageResetTime",
|
||||
"GstMessageToc", "GstEventTocGlobal", "GstEventTocCurrent",
|
||||
"GstEventSegmentDone",
|
||||
"GstEventStreamStart", "stream-id", "GstEventContext", "GstQueryContext",
|
||||
"GstEventStreamStart", "stream-id", "GstQueryContext",
|
||||
"GstMessageNeedContext", "GstMessageHaveContext", "context", "context-types",
|
||||
"GstMessageStreamStart", "group-id", "uri-redirection"
|
||||
};
|
||||
|
|
|
@ -188,16 +188,15 @@ typedef enum _GstQuarkId
|
|||
GST_QUARK_EVENT_SEGMENT_DONE = 159,
|
||||
GST_QUARK_EVENT_STREAM_START = 160,
|
||||
GST_QUARK_STREAM_ID = 161,
|
||||
GST_QUARK_EVENT_CONTEXT = 162,
|
||||
GST_QUARK_QUERY_CONTEXT = 163,
|
||||
GST_QUARK_MESSAGE_NEED_CONTEXT = 164,
|
||||
GST_QUARK_MESSAGE_HAVE_CONTEXT = 165,
|
||||
GST_QUARK_CONTEXT = 166,
|
||||
GST_QUARK_CONTEXT_TYPES = 167,
|
||||
GST_QUARK_MESSAGE_STREAM_START = 168,
|
||||
GST_QUARK_GROUP_ID = 169,
|
||||
GST_QUARK_URI_REDIRECTION = 170,
|
||||
GST_QUARK_MAX = 171
|
||||
GST_QUARK_QUERY_CONTEXT = 162,
|
||||
GST_QUARK_MESSAGE_NEED_CONTEXT = 163,
|
||||
GST_QUARK_MESSAGE_HAVE_CONTEXT = 164,
|
||||
GST_QUARK_CONTEXT = 165,
|
||||
GST_QUARK_CONTEXT_TYPES = 166,
|
||||
GST_QUARK_MESSAGE_STREAM_START = 167,
|
||||
GST_QUARK_GROUP_ID = 168,
|
||||
GST_QUARK_URI_REDIRECTION = 169,
|
||||
GST_QUARK_MAX = 170
|
||||
} GstQuarkId;
|
||||
|
||||
extern GQuark _priv_gst_quark_table[GST_QUARK_MAX];
|
||||
|
|
Loading…
Reference in a new issue