update for HEADER flag changes

This commit is contained in:
Wim Taymans 2012-01-30 17:16:17 +01:00
parent fa400c372b
commit be0cadac03
14 changed files with 40 additions and 42 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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 */

View file

@ -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]);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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:

View file

@ -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 {

View file

@ -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);

View file

@ -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);

View file

@ -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");

View file

@ -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);