mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
update for HEADER flag changes
This commit is contained in:
parent
33344dc2b9
commit
f6cab316cc
5 changed files with 20 additions and 22 deletions
|
@ -155,8 +155,7 @@ gst_dp_header_from_buffer_any (const GstBuffer * buffer, GstDPHeaderFlag flags,
|
||||||
/* data flags; eats two bytes from the ABI area */
|
/* data flags; eats two bytes from the ABI area */
|
||||||
/* we copy everything but the read-only flags */
|
/* we copy everything but the read-only flags */
|
||||||
flags_mask = GST_BUFFER_FLAG_LIVE | GST_BUFFER_FLAG_DISCONT |
|
flags_mask = GST_BUFFER_FLAG_LIVE | GST_BUFFER_FLAG_DISCONT |
|
||||||
GST_BUFFER_FLAG_IN_CAPS | GST_BUFFER_FLAG_GAP |
|
GST_BUFFER_FLAG_HEADER | GST_BUFFER_FLAG_GAP | GST_BUFFER_FLAG_DELTA_UNIT;
|
||||||
GST_BUFFER_FLAG_DELTA_UNIT;
|
|
||||||
|
|
||||||
GST_WRITE_UINT16_BE (h + 42, GST_BUFFER_FLAGS (buffer) & flags_mask);
|
GST_WRITE_UINT16_BE (h + 42, GST_BUFFER_FLAGS (buffer) & flags_mask);
|
||||||
|
|
||||||
|
|
|
@ -410,9 +410,9 @@ gst_gdp_pay_reset_streamheader (GstGDPPay * this)
|
||||||
bufval = &g_array_index (buffers, GValue, i);
|
bufval = &g_array_index (buffers, GValue, i);
|
||||||
buffer = g_value_peek_pointer (bufval);
|
buffer = g_value_peek_pointer (bufval);
|
||||||
/* this buffer is deserialized by gdpdepay as a regular buffer,
|
/* 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 */
|
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 (buffer) = GST_BUFFER_OFFSET_NONE;
|
||||||
GST_BUFFER_OFFSET_END (buffer) = GST_BUFFER_OFFSET_NONE;
|
GST_BUFFER_OFFSET_END (buffer) = GST_BUFFER_OFFSET_NONE;
|
||||||
GST_BUFFER_TIMESTAMP (buffer) = GST_CLOCK_TIME_NONE;
|
GST_BUFFER_TIMESTAMP (buffer) = GST_CLOCK_TIME_NONE;
|
||||||
|
@ -423,11 +423,10 @@ gst_gdp_pay_reset_streamheader (GstGDPPay * this)
|
||||||
goto no_buffer;
|
goto no_buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Setting IN_CAPS as other GDP event buffers */
|
/* Setting HEADER as other GDP event buffers */
|
||||||
GST_DEBUG_OBJECT (this,
|
GST_DEBUG_OBJECT (this,
|
||||||
"Setting IN_CAPS flag on outgoing buffer %" GST_PTR_FORMAT,
|
"Setting HEADER flag on outgoing buffer %" GST_PTR_FORMAT, outbuffer);
|
||||||
outbuffer);
|
GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_HEADER);
|
||||||
GST_BUFFER_FLAG_SET (outbuffer, GST_BUFFER_FLAG_IN_CAPS);
|
|
||||||
GST_BUFFER_OFFSET (outbuffer) = GST_BUFFER_OFFSET_NONE;
|
GST_BUFFER_OFFSET (outbuffer) = GST_BUFFER_OFFSET_NONE;
|
||||||
GST_BUFFER_OFFSET_END (outbuffer) = GST_BUFFER_OFFSET_NONE;
|
GST_BUFFER_OFFSET_END (outbuffer) = GST_BUFFER_OFFSET_NONE;
|
||||||
GST_BUFFER_TIMESTAMP (outbuffer) = GST_CLOCK_TIME_NONE;
|
GST_BUFFER_TIMESTAMP (outbuffer) = GST_CLOCK_TIME_NONE;
|
||||||
|
@ -582,7 +581,7 @@ gst_gdp_pay_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
|
||||||
} else {
|
} else {
|
||||||
GST_BUFFER_TIMESTAMP (outbuffer) = GST_BUFFER_TIMESTAMP (buffer);
|
GST_BUFFER_TIMESTAMP (outbuffer) = GST_BUFFER_TIMESTAMP (buffer);
|
||||||
GST_BUFFER_DURATION (outbuffer) = 0;
|
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",
|
GST_DEBUG_OBJECT (this, "Storing buffer %p as new_segment_buf",
|
||||||
outbuffer);
|
outbuffer);
|
||||||
this->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_TIMESTAMP (outbuffer) = GST_BUFFER_TIMESTAMP (buffer);
|
||||||
GST_BUFFER_DURATION (outbuffer) = 0;
|
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)
|
if (this->caps_buf)
|
||||||
gst_buffer_unref (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)
|
if (!outbuffer)
|
||||||
goto no_buffer;
|
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
|
* as streamheader, and we have serialized a GDP version of it and put it
|
||||||
* on our caps */
|
* on our caps */
|
||||||
if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_IN_CAPS)) {
|
if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_HEADER)) {
|
||||||
GST_DEBUG_OBJECT (this, "Setting IN_CAPS flag on outgoing buffer %p",
|
GST_DEBUG_OBJECT (this, "Setting HEADER flag on outgoing buffer %p",
|
||||||
outbuffer);
|
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);
|
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);
|
gst_buffer_unref (this->new_segment_buf);
|
||||||
this->new_segment_buf = outbuffer;
|
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);
|
gst_gdp_pay_reset_streamheader (this);
|
||||||
break;
|
break;
|
||||||
case GST_EVENT_CAPS:{
|
case GST_EVENT_CAPS:{
|
||||||
|
@ -717,7 +716,7 @@ gst_gdp_pay_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||||
goto no_buffer_from_caps;
|
goto no_buffer_from_caps;
|
||||||
|
|
||||||
GST_BUFFER_DURATION (outbuffer) = 0;
|
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)
|
if (this->caps_buf)
|
||||||
gst_buffer_unref (this->caps_buf);
|
gst_buffer_unref (this->caps_buf);
|
||||||
this->caps_buf = outbuffer;
|
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);
|
gst_buffer_unref (this->tag_buf);
|
||||||
this->tag_buf = outbuffer;
|
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);
|
gst_gdp_pay_reset_streamheader (this);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -314,7 +314,7 @@ GST_START_TEST (test_streamheader)
|
||||||
structure = gst_caps_get_structure (caps, 0);
|
structure = gst_caps_get_structure (caps, 0);
|
||||||
buffer = gst_buffer_new_and_alloc (4);
|
buffer = gst_buffer_new_and_alloc (4);
|
||||||
gst_buffer_fill (buffer, 0, "f00d", 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 (&array, GST_TYPE_ARRAY);
|
||||||
g_value_init (&value, GST_TYPE_BUFFER);
|
g_value_init (&value, GST_TYPE_BUFFER);
|
||||||
shbuffer = gst_buffer_copy (buffer);
|
shbuffer = gst_buffer_copy (buffer);
|
||||||
|
@ -362,7 +362,7 @@ GST_START_TEST (test_streamheader)
|
||||||
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
|
fail_if ((outbuffer = (GstBuffer *) buffers->data) == NULL);
|
||||||
buffers = g_list_remove (buffers, outbuffer);
|
buffers = g_list_remove (buffers, outbuffer);
|
||||||
ASSERT_BUFFER_REFCOUNT (outbuffer, "outbuffer", 1);
|
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 */
|
/* FIXME: get streamheader, compare data with buffer */
|
||||||
gst_buffer_unref (outbuffer);
|
gst_buffer_unref (outbuffer);
|
||||||
|
|
|
@ -268,7 +268,7 @@ GST_START_TEST (test_streamheader)
|
||||||
gst_buffer_fill (inbuffer, 0, "head", 4);
|
gst_buffer_fill (inbuffer, 0, "head", 4);
|
||||||
caps = gst_caps_from_string ("application/x-gst-test-streamheader");
|
caps = gst_caps_from_string ("application/x-gst-test-streamheader");
|
||||||
structure = gst_caps_get_structure (caps, 0);
|
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 (&array, GST_TYPE_ARRAY);
|
||||||
g_value_init (&value, GST_TYPE_BUFFER);
|
g_value_init (&value, GST_TYPE_BUFFER);
|
||||||
shbuffer = gst_buffer_copy (inbuffer);
|
shbuffer = gst_buffer_copy (inbuffer);
|
||||||
|
|
|
@ -134,7 +134,7 @@ buffer_probe_cb (GstPad * pad, GstPadProbeInfo * info, gpointer user_data)
|
||||||
|
|
||||||
gst_buffer_map (buffer, &map, GST_MAP_READ);
|
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;
|
GstCaps *caps;
|
||||||
GstStructure *s;
|
GstStructure *s;
|
||||||
const GValue *sh;
|
const GValue *sh;
|
||||||
|
@ -168,7 +168,7 @@ buffer_probe_cb (GstPad * pad, GstPadProbeInfo * info, gpointer user_data)
|
||||||
}
|
}
|
||||||
gst_buffer_unmap (buf, &map2);
|
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);
|
buffer);
|
||||||
|
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
|
|
Loading…
Reference in a new issue