mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-02 16:52:42 +00:00
event: rename gst_event_{set,parse}_stream_config_codec_data() to _setup_data()
More generic.
This commit is contained in:
parent
5fbdd763bb
commit
4d937fafbb
6 changed files with 24 additions and 24 deletions
|
@ -974,8 +974,8 @@ GstStreamConfigFlags
|
|||
gst_event_new_stream_config
|
||||
gst_event_parse_stream_config
|
||||
|
||||
gst_event_set_stream_config_codec_data
|
||||
gst_event_parse_stream_config_codec_data
|
||||
gst_event_set_stream_config_setup_data
|
||||
gst_event_parse_stream_config_setup_data
|
||||
|
||||
gst_event_add_stream_config_header
|
||||
gst_event_get_n_stream_config_headers
|
||||
|
|
|
@ -675,7 +675,7 @@ gst_event_parse_caps (GstEvent * event, GstCaps ** caps)
|
|||
* Create a new STREAM CONFIG event. The stream config event travels
|
||||
* downstream synchronized with the buffer flow and contains stream
|
||||
* configuration information for the stream, such as stream-headers
|
||||
* or codec-data. It is optional and should be sent after the CAPS
|
||||
* or setup-data. It is optional and should be sent after the CAPS
|
||||
* event.
|
||||
*
|
||||
* Returns: (transfer full): the new STREAM CONFIG event.
|
||||
|
@ -718,18 +718,18 @@ gst_event_parse_stream_config (GstEvent * event, GstStreamConfigFlags * flags)
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_event_set_stream_config_codec_data:
|
||||
* gst_event_set_stream_config_setup_data:
|
||||
* @event: a stream config event
|
||||
* @buf: a #GstBuffer with codec data
|
||||
* @buf: a #GstBuffer with setup data
|
||||
*
|
||||
* Set codec data on the stream info event to signal out of bound setup data
|
||||
* to downstream elements. Unlike stream headers, codec data contains data
|
||||
* Set setup data on the stream info event to signal out of bound setup data
|
||||
* to downstream elements. Unlike stream headers, setup data contains data
|
||||
* that is required to interpret the data stream, but is not valid as-is
|
||||
* inside the data stream and thus can't just be prepended to or inserted
|
||||
* into the data stream.
|
||||
*/
|
||||
void
|
||||
gst_event_set_stream_config_codec_data (GstEvent * event, GstBuffer * buf)
|
||||
gst_event_set_stream_config_setup_data (GstEvent * event, GstBuffer * buf)
|
||||
{
|
||||
GstStructure *s;
|
||||
|
||||
|
@ -738,21 +738,21 @@ gst_event_set_stream_config_codec_data (GstEvent * event, GstBuffer * buf)
|
|||
g_return_if_fail (GST_IS_BUFFER (buf) && gst_buffer_get_size (buf) > 0);
|
||||
|
||||
s = GST_EVENT_STRUCTURE (event);
|
||||
gst_structure_id_set (s, GST_QUARK (CODEC_DATA), GST_TYPE_BUFFER, buf, NULL);
|
||||
gst_structure_id_set (s, GST_QUARK (SETUP_DATA), GST_TYPE_BUFFER, buf, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_event_set_stream_config_codec_data:
|
||||
* gst_event_set_stream_config_setup_data:
|
||||
* @event: a stream config event
|
||||
* @buf: (out) (transfer none): location where to store the #GstBuffer with codec data
|
||||
* @buf: (out) (transfer none): location where to store the #GstBuffer with setup data
|
||||
*
|
||||
* Extracts the codec data buffer from the stream info event. Will store
|
||||
* %NULL in @buf if the event contains no codec data. The buffer returned
|
||||
* Extracts the setup data buffer from the stream info event. Will store
|
||||
* %NULL in @buf if the event contains no setup data. The buffer returned
|
||||
* will remain valid as long as @event remains valid. The caller should
|
||||
* acquire a reference to to @buf if needed.
|
||||
*/
|
||||
void
|
||||
gst_event_parse_stream_config_codec_data (GstEvent * event, GstBuffer ** buf)
|
||||
gst_event_parse_stream_config_setup_data (GstEvent * event, GstBuffer ** buf)
|
||||
{
|
||||
const GValue *val;
|
||||
GstStructure *s;
|
||||
|
@ -762,7 +762,7 @@ gst_event_parse_stream_config_codec_data (GstEvent * event, GstBuffer ** buf)
|
|||
g_return_if_fail (buf != NULL);
|
||||
|
||||
s = GST_EVENT_STRUCTURE (event);
|
||||
val = gst_structure_id_get_value (s, GST_QUARK (CODEC_DATA));
|
||||
val = gst_structure_id_get_value (s, GST_QUARK (SETUP_DATA));
|
||||
if (val != NULL)
|
||||
*buf = g_value_get_boxed (val);
|
||||
else
|
||||
|
|
|
@ -501,9 +501,9 @@ GstEvent * gst_event_new_stream_config (GstStreamConfigFlags
|
|||
void gst_event_parse_stream_config (GstEvent * event, GstStreamConfigFlags * flags);
|
||||
|
||||
|
||||
void gst_event_set_stream_config_codec_data (GstEvent * event, GstBuffer * buf);
|
||||
void gst_event_set_stream_config_setup_data (GstEvent * event, GstBuffer * buf);
|
||||
|
||||
void gst_event_parse_stream_config_codec_data (GstEvent * event, GstBuffer ** buf);
|
||||
void gst_event_parse_stream_config_setup_data (GstEvent * event, GstBuffer ** buf);
|
||||
|
||||
|
||||
void gst_event_add_stream_config_header (GstEvent * event, GstBuffer * buf);
|
||||
|
|
|
@ -56,7 +56,7 @@ static const gchar *_quark_strings[] = {
|
|||
"GstEventReconfigure", "segment", "GstQueryScheduling", "pull-mode",
|
||||
"allocator", "GstEventFlushStop", "options", "GstQueryAcceptCaps",
|
||||
"result", "GstQueryCaps", "filter", "modes", "GstEventStreamConfig",
|
||||
"codec-data", "stream-headers", "GstEventGap"
|
||||
"setup-data", "stream-headers", "GstEventGap"
|
||||
};
|
||||
|
||||
GQuark _priv_gst_quark_table[GST_QUARK_MAX];
|
||||
|
|
|
@ -159,7 +159,7 @@ typedef enum _GstQuarkId
|
|||
GST_QUARK_FILTER = 130,
|
||||
GST_QUARK_MODES = 131,
|
||||
GST_QUARK_EVENT_STREAM_CONFIG = 132,
|
||||
GST_QUARK_CODEC_DATA = 133,
|
||||
GST_QUARK_SETUP_DATA = 133,
|
||||
GST_QUARK_STREAM_HEADERS = 134,
|
||||
GST_QUARK_EVENT_GAP = 135,
|
||||
GST_QUARK_MAX = 136
|
||||
|
|
|
@ -124,7 +124,7 @@ GST_START_TEST (create_events)
|
|||
|
||||
/* set buf to something random but guaranteed to be non-NULL */
|
||||
buf = (GstBuffer *) & dummy;
|
||||
gst_event_parse_stream_config_codec_data (event, &buf);
|
||||
gst_event_parse_stream_config_setup_data (event, &buf);
|
||||
fail_unless (buf == NULL);
|
||||
|
||||
buf = (GstBuffer *) & dummy;
|
||||
|
@ -135,17 +135,17 @@ GST_START_TEST (create_events)
|
|||
gst_event_parse_nth_stream_config_header (event, 98416, &buf);
|
||||
fail_unless (buf == NULL);
|
||||
|
||||
ASSERT_CRITICAL (gst_event_set_stream_config_codec_data (event, NULL));
|
||||
ASSERT_CRITICAL (gst_event_set_stream_config_setup_data (event, NULL));
|
||||
ASSERT_CRITICAL (gst_event_add_stream_config_header (event, NULL));
|
||||
|
||||
cd = gst_buffer_new_wrapped_full ((gpointer) "SetMeUpScottie", NULL, 0, 14);
|
||||
gst_event_set_stream_config_codec_data (event, cd);
|
||||
gst_event_set_stream_config_setup_data (event, cd);
|
||||
gst_buffer_unref (cd);
|
||||
|
||||
buf = (GstBuffer *) & dummy;
|
||||
gst_event_parse_nth_stream_config_header (event, 0, &buf);
|
||||
fail_unless (buf == NULL);
|
||||
gst_event_parse_stream_config_codec_data (event, &buf);
|
||||
gst_event_parse_stream_config_setup_data (event, &buf);
|
||||
fail_unless (buf == cd);
|
||||
fail_unless (GST_IS_BUFFER (buf));
|
||||
|
||||
|
|
Loading…
Reference in a new issue