From be0cadac03feb740369eb8b1c821c5b1630b4c91 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 30 Jan 2012 17:16:17 +0100 Subject: [PATCH] update for HEADER flag changes --- ext/ogg/gstoggdemux.c | 2 +- ext/ogg/gstoggmux.c | 6 +++--- ext/ogg/gstoggparse.c | 2 +- ext/theora/gsttheoraenc.c | 2 +- ext/theora/gsttheoraparse.c | 2 +- ext/vorbis/gstvorbisenc.c | 4 ++-- ext/vorbis/gstvorbisparse.c | 6 +++--- gst/gdp/dataprotocol.c | 3 +-- gst/gdp/gstgdppay.c | 29 ++++++++++++++--------------- gst/tcp/gstmultisocketsink.c | 12 ++++++------ tests/check/elements/gdpdepay.c | 4 ++-- tests/check/elements/gdppay.c | 2 +- tests/check/pipelines/oggmux.c | 4 ++-- tests/check/pipelines/streamheader.c | 4 ++-- 14 files changed, 40 insertions(+), 42 deletions(-) diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index 9c378f3..79b3877 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -2447,7 +2447,7 @@ gst_ogg_demux_set_header_on_caps (GstOggDemux * ogg, GstCaps * caps, buffer = gst_buffer_new_and_alloc (op->bytes); if (op->bytes) gst_buffer_fill (buffer, 0, op->packet, op->bytes); - GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_IN_CAPS); + GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_HEADER); g_value_init (&value, GST_TYPE_BUFFER); gst_value_take_buffer (&value, buffer); gst_value_array_append_value (&array, &value); diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c index f56a906..bcb02d3 100644 --- a/ext/ogg/gstoggmux.c +++ b/ext/ogg/gstoggmux.c @@ -989,7 +989,7 @@ gst_ogg_mux_queue_pads (GstOggMux * ogg_mux, gboolean * popped) if (pad->have_type) is_header = gst_ogg_stream_packet_is_header (&pad->map, &packet); else /* fallback (FIXME 0.11: remove IN_CAPS hack) */ - is_header = GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_IN_CAPS); + is_header = GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_HEADER); gst_buffer_unmap (buf, &map); @@ -1122,9 +1122,9 @@ gst_ogg_mux_set_header_on_caps (GstCaps * caps, GList * buffers) walk = walk->next; /* mark buffer */ - GST_LOG ("Setting IN_CAPS on buffer of length %" G_GSIZE_FORMAT, + GST_LOG ("Setting HEADER on buffer of length %" G_GSIZE_FORMAT, gst_buffer_get_size (buf)); - GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_IN_CAPS); + GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_HEADER); g_value_init (&value, GST_TYPE_BUFFER); copy = gst_buffer_copy (buf); diff --git a/ext/ogg/gstoggparse.c b/ext/ogg/gstoggparse.c index a0e9cfb..6a0c969 100644 --- a/ext/ogg/gstoggparse.c +++ b/ext/ogg/gstoggparse.c @@ -325,7 +325,7 @@ gst_ogg_parse_append_header (GValue * array, GstBuffer * buf) /* We require a copy to avoid circular refcounts */ GstBuffer *buffer = gst_buffer_copy (buf); - GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_IN_CAPS); + GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_HEADER); g_value_init (&value, GST_TYPE_BUFFER); gst_value_set_buffer (&value, buffer); diff --git a/ext/theora/gsttheoraenc.c b/ext/theora/gsttheoraenc.c index 327ce23..6455991 100644 --- a/ext/theora/gsttheoraenc.c +++ b/ext/theora/gsttheoraenc.c @@ -882,7 +882,7 @@ theora_set_header_on_caps (GstCaps * caps, GSList * buffers) buffer = walk->data; /* mark buffer */ - GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_IN_CAPS); + GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_HEADER); /* Copy buffer, because we can't use the original - * it creates a circular refcount with the caps<->buffers */ diff --git a/ext/theora/gsttheoraparse.c b/ext/theora/gsttheoraparse.c index 85d6b61..cda2f1a 100644 --- a/ext/theora/gsttheoraparse.c +++ b/ext/theora/gsttheoraparse.c @@ -273,7 +273,7 @@ theora_parse_set_header_on_caps (GstTheoraParse * parse, GstCaps * caps) continue; bufs[i] = gst_buffer_make_writable (bufs[i]); - GST_BUFFER_FLAG_SET (bufs[i], GST_BUFFER_FLAG_IN_CAPS); + GST_BUFFER_FLAG_SET (bufs[i], GST_BUFFER_FLAG_HEADER); g_value_init (&value, GST_TYPE_BUFFER); gst_value_set_buffer (&value, bufs[i]); diff --git a/ext/vorbis/gstvorbisenc.c b/ext/vorbis/gstvorbisenc.c index 44ea535..91ace3b 100644 --- a/ext/vorbis/gstvorbisenc.c +++ b/ext/vorbis/gstvorbisenc.c @@ -655,11 +655,11 @@ _gst_caps_set_buffer_array (GstCaps * caps, const gchar * field, g_assert (gst_buffer_is_writable (buf)); /* mark buffer */ - GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_IN_CAPS); + GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_HEADER); g_value_init (&value, GST_TYPE_BUFFER); buf = gst_buffer_copy (buf); - GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_IN_CAPS); + GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_HEADER); gst_value_set_buffer (&value, buf); gst_buffer_unref (buf); gst_value_array_append_value (&array, &value); diff --git a/ext/vorbis/gstvorbisparse.c b/ext/vorbis/gstvorbisparse.c index adc128d..97f7eae 100644 --- a/ext/vorbis/gstvorbisparse.c +++ b/ext/vorbis/gstvorbisparse.c @@ -147,9 +147,9 @@ vorbis_parse_set_header_on_caps (GstVorbisParse * parse, GstCaps * caps) structure = gst_caps_get_structure (caps, 0); /* mark buffers */ - GST_BUFFER_FLAG_SET (buf1, GST_BUFFER_FLAG_IN_CAPS); - GST_BUFFER_FLAG_SET (buf2, GST_BUFFER_FLAG_IN_CAPS); - GST_BUFFER_FLAG_SET (buf3, GST_BUFFER_FLAG_IN_CAPS); + GST_BUFFER_FLAG_SET (buf1, GST_BUFFER_FLAG_HEADER); + GST_BUFFER_FLAG_SET (buf2, GST_BUFFER_FLAG_HEADER); + GST_BUFFER_FLAG_SET (buf3, GST_BUFFER_FLAG_HEADER); /* put buffers in a fixed list */ g_value_init (&array, GST_TYPE_ARRAY); diff --git a/gst/gdp/dataprotocol.c b/gst/gdp/dataprotocol.c index e17583d..c19fd9a 100644 --- a/gst/gdp/dataprotocol.c +++ b/gst/gdp/dataprotocol.c @@ -155,8 +155,7 @@ gst_dp_header_from_buffer_any (const GstBuffer * buffer, GstDPHeaderFlag flags, /* data flags; eats two bytes from the ABI area */ /* we copy everything but the read-only flags */ flags_mask = GST_BUFFER_FLAG_LIVE | GST_BUFFER_FLAG_DISCONT | - GST_BUFFER_FLAG_IN_CAPS | GST_BUFFER_FLAG_GAP | - GST_BUFFER_FLAG_DELTA_UNIT; + GST_BUFFER_FLAG_HEADER | GST_BUFFER_FLAG_GAP | GST_BUFFER_FLAG_DELTA_UNIT; GST_WRITE_UINT16_BE (h + 42, GST_BUFFER_FLAGS (buffer) & flags_mask); diff --git a/gst/gdp/gstgdppay.c b/gst/gdp/gstgdppay.c index 5cc59d6..e587759 100644 --- a/gst/gdp/gstgdppay.c +++ b/gst/gdp/gstgdppay.c @@ -410,9 +410,9 @@ gst_gdp_pay_reset_streamheader (GstGDPPay * this) bufval = &g_array_index (buffers, GValue, i); buffer = g_value_peek_pointer (bufval); /* this buffer is deserialized by gdpdepay as a regular buffer, - it needs IN_CAPS, because it's a streamheader - otherwise it + it needs HEADER, because it's a streamheader - otherwise it is mixed with regular data buffers */ - GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_IN_CAPS); + GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_HEADER); GST_BUFFER_OFFSET (buffer) = GST_BUFFER_OFFSET_NONE; GST_BUFFER_OFFSET_END (buffer) = GST_BUFFER_OFFSET_NONE; GST_BUFFER_TIMESTAMP (buffer) = GST_CLOCK_TIME_NONE; @@ -423,11 +423,10 @@ gst_gdp_pay_reset_streamheader (GstGDPPay * this) goto no_buffer; } - /* Setting IN_CAPS as other GDP event buffers */ + /* Setting HEADER as other GDP event buffers */ GST_DEBUG_OBJECT (this, - "Setting IN_CAPS flag on outgoing buffer %" GST_PTR_FORMAT, - outbuffer); - GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_IN_CAPS); + "Setting HEADER flag on outgoing buffer %" GST_PTR_FORMAT, outbuffer); + GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_HEADER); GST_BUFFER_OFFSET (outbuffer) = GST_BUFFER_OFFSET_NONE; GST_BUFFER_OFFSET_END (outbuffer) = GST_BUFFER_OFFSET_NONE; GST_BUFFER_TIMESTAMP (outbuffer) = GST_CLOCK_TIME_NONE; @@ -582,7 +581,7 @@ gst_gdp_pay_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) } else { GST_BUFFER_TIMESTAMP (outbuffer) = GST_BUFFER_TIMESTAMP (buffer); GST_BUFFER_DURATION (outbuffer) = 0; - GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_IN_CAPS); + GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_HEADER); GST_DEBUG_OBJECT (this, "Storing buffer %p as new_segment_buf", outbuffer); this->new_segment_buf = outbuffer; @@ -604,7 +603,7 @@ gst_gdp_pay_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) GST_BUFFER_TIMESTAMP (outbuffer) = GST_BUFFER_TIMESTAMP (buffer); GST_BUFFER_DURATION (outbuffer) = 0; - GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_IN_CAPS); + GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_HEADER); if (this->caps_buf) gst_buffer_unref (this->caps_buf); @@ -622,13 +621,13 @@ gst_gdp_pay_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) if (!outbuffer) goto no_buffer; - /* If the incoming buffer is IN_CAPS, that means we have it on the caps + /* If the incoming buffer is HEADER, that means we have it on the caps * as streamheader, and we have serialized a GDP version of it and put it * on our caps */ - if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_IN_CAPS)) { - GST_DEBUG_OBJECT (this, "Setting IN_CAPS flag on outgoing buffer %p", + if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_HEADER)) { + GST_DEBUG_OBJECT (this, "Setting HEADER flag on outgoing buffer %p", outbuffer); - GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_IN_CAPS); + GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_HEADER); } gst_gdp_stamp_buffer (this, outbuffer); @@ -704,7 +703,7 @@ gst_gdp_pay_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) gst_buffer_unref (this->new_segment_buf); this->new_segment_buf = outbuffer; - GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_IN_CAPS); + GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_HEADER); gst_gdp_pay_reset_streamheader (this); break; case GST_EVENT_CAPS:{ @@ -717,7 +716,7 @@ gst_gdp_pay_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) goto no_buffer_from_caps; GST_BUFFER_DURATION (outbuffer) = 0; - GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_IN_CAPS); + GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_HEADER); if (this->caps_buf) gst_buffer_unref (this->caps_buf); this->caps_buf = outbuffer; @@ -733,7 +732,7 @@ gst_gdp_pay_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) gst_buffer_unref (this->tag_buf); this->tag_buf = outbuffer; - GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_IN_CAPS); + GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_HEADER); gst_gdp_pay_reset_streamheader (this); break; default: diff --git a/gst/tcp/gstmultisocketsink.c b/gst/tcp/gstmultisocketsink.c index 16d5180..0b4dcd5 100644 --- a/gst/tcp/gstmultisocketsink.c +++ b/gst/tcp/gstmultisocketsink.c @@ -1193,7 +1193,7 @@ is_sync_frame (GstMultiSocketSink * sink, GstBuffer * buffer) { if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT)) { return FALSE; - } else if (!GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_IN_CAPS)) { + } else if (!GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_HEADER)) { return TRUE; } @@ -2354,8 +2354,8 @@ gst_multi_socket_sink_render (GstBaseSink * bsink, GstBuffer * buf) goto no_caps; #endif - /* get IN_CAPS first, code below might mess with the flags */ - in_caps = GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_IN_CAPS); + /* get HEADER first, code below might mess with the flags */ + in_caps = GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_HEADER); #if 0 /* stamp the buffer with previous caps if no caps set */ @@ -2391,12 +2391,12 @@ gst_multi_socket_sink_render (GstBaseSink * bsink, GstBuffer * buf) GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)), GST_TIME_ARGS (GST_BUFFER_DURATION (buf))); - /* if we get IN_CAPS buffers, but the previous buffer was not IN_CAPS, + /* if we get HEADER buffers, but the previous buffer was not HEADER, * it means we're getting new streamheader buffers, and we should clear * the old ones */ if (in_caps && sink->previous_buffer_in_caps == FALSE) { GST_DEBUG_OBJECT (sink, - "receiving new IN_CAPS buffers, clearing old streamheader"); + "receiving new HEADER buffers, clearing old streamheader"); g_slist_foreach (sink->streamheader, (GFunc) gst_mini_object_unref, NULL); g_slist_free (sink->streamheader); sink->streamheader = NULL; @@ -2414,7 +2414,7 @@ gst_multi_socket_sink_render (GstBaseSink * bsink, GstBuffer * buf) * We don't send the buffer to the client, since streamheaders are sent * separately when necessary. */ if (in_caps) { - GST_DEBUG_OBJECT (sink, "appending IN_CAPS buffer with length %" + GST_DEBUG_OBJECT (sink, "appending HEADER buffer with length %" G_GSIZE_FORMAT " to streamheader", gst_buffer_get_size (buf)); sink->streamheader = g_slist_append (sink->streamheader, buf); } else { diff --git a/tests/check/elements/gdpdepay.c b/tests/check/elements/gdpdepay.c index a736d01..31d142e 100644 --- a/tests/check/elements/gdpdepay.c +++ b/tests/check/elements/gdpdepay.c @@ -314,7 +314,7 @@ GST_START_TEST (test_streamheader) structure = gst_caps_get_structure (caps, 0); buffer = gst_buffer_new_and_alloc (4); gst_buffer_fill (buffer, 0, "f00d", 4); - GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_IN_CAPS); + GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_HEADER); g_value_init (&array, GST_TYPE_ARRAY); g_value_init (&value, GST_TYPE_BUFFER); shbuffer = gst_buffer_copy (buffer); @@ -362,7 +362,7 @@ GST_START_TEST (test_streamheader) fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL); buffers = g_list_remove (buffers, outbuffer); ASSERT_BUFFER_REFCOUNT (outbuffer, "outbuffer", 1); - fail_unless (GST_BUFFER_FLAG_IS_SET (outbuffer, GST_BUFFER_FLAG_IN_CAPS)); + fail_unless (GST_BUFFER_FLAG_IS_SET (outbuffer, GST_BUFFER_FLAG_HEADER)); /* FIXME: get streamheader, compare data with buffer */ gst_buffer_unref (outbuffer); diff --git a/tests/check/elements/gdppay.c b/tests/check/elements/gdppay.c index 84384ea..69cdc71 100644 --- a/tests/check/elements/gdppay.c +++ b/tests/check/elements/gdppay.c @@ -268,7 +268,7 @@ GST_START_TEST (test_streamheader) gst_buffer_fill (inbuffer, 0, "head", 4); caps = gst_caps_from_string ("application/x-gst-test-streamheader"); structure = gst_caps_get_structure (caps, 0); - GST_BUFFER_FLAG_SET (inbuffer, GST_BUFFER_FLAG_IN_CAPS); + GST_BUFFER_FLAG_SET (inbuffer, GST_BUFFER_FLAG_HEADER); g_value_init (&array, GST_TYPE_ARRAY); g_value_init (&value, GST_TYPE_BUFFER); shbuffer = gst_buffer_copy (inbuffer); diff --git a/tests/check/pipelines/oggmux.c b/tests/check/pipelines/oggmux.c index 0e3a6ea..68204e2 100644 --- a/tests/check/pipelines/oggmux.c +++ b/tests/check/pipelines/oggmux.c @@ -185,11 +185,11 @@ eos_buffer_probe (GstPad * pad, GstPadProbeInfo * info, gpointer unused) if (state) { /* Now, we can do buffer-level checks... * If we have video somewhere, then we should have DELTA_UNIT set on all - * non-header (not IN_CAPS), non-video buffers + * non-header (not HEADER), non-video buffers */ g_hash_table_foreach (eos_chain_states, (GHFunc) is_video, &has_video); if (has_video && state->codec != CODEC_THEORA) { - if (!GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_IN_CAPS)) + if (!GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_HEADER)) fail_unless (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT), "Non-video buffer doesn't have DELTA_UNIT in stream with video"); diff --git a/tests/check/pipelines/streamheader.c b/tests/check/pipelines/streamheader.c index 69dc29a..77e998c 100644 --- a/tests/check/pipelines/streamheader.c +++ b/tests/check/pipelines/streamheader.c @@ -134,7 +134,7 @@ buffer_probe_cb (GstPad * pad, GstPadProbeInfo * info, gpointer user_data) gst_buffer_map (buffer, &map, GST_MAP_READ); - if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_IN_CAPS)) { + if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_HEADER)) { GstCaps *caps; GstStructure *s; const GValue *sh; @@ -168,7 +168,7 @@ buffer_probe_cb (GstPad * pad, GstPadProbeInfo * info, gpointer user_data) } gst_buffer_unmap (buf, &map2); } - fail_unless (found, "Did not find incoming IN_CAPS buffer %p on caps", + fail_unless (found, "Did not find incoming HEADER buffer %p on caps", buffer); gst_caps_unref (caps); -- 2.7.4