update for HEADER flag

This commit is contained in:
Wim Taymans 2012-01-30 17:16:51 +01:00
parent a7c27e1aaa
commit bb2bd604e0
12 changed files with 30 additions and 32 deletions

View file

@ -338,9 +338,9 @@ gst_cmml_enc_set_header_on_caps (GstCmmlEnc * enc, GstCaps * caps,
gst_value_array_append_value (&array, &value); gst_value_array_append_value (&array, &value);
gst_buffer_unref (buffer); gst_buffer_unref (buffer);
GST_BUFFER_FLAG_SET (ident, GST_BUFFER_FLAG_IN_CAPS); GST_BUFFER_FLAG_SET (ident, GST_BUFFER_FLAG_HEADER);
GST_BUFFER_FLAG_SET (preamble, GST_BUFFER_FLAG_IN_CAPS); GST_BUFFER_FLAG_SET (preamble, GST_BUFFER_FLAG_HEADER);
GST_BUFFER_FLAG_SET (head, GST_BUFFER_FLAG_IN_CAPS); GST_BUFFER_FLAG_SET (head, GST_BUFFER_FLAG_HEADER);
gst_structure_set_value (structure, "streamheader", &array); gst_structure_set_value (structure, "streamheader", &array);

View file

@ -885,7 +885,7 @@ notgst_value_array_append_buffer (GValue * array_val, GstBuffer * buf)
/* copy buffer to avoid problems with circular refcounts */ /* copy buffer to avoid problems with circular refcounts */
buf = gst_buffer_copy (buf); buf = gst_buffer_copy (buf);
/* again, for good measure */ /* again, for good measure */
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_value_set_buffer (&value, buf);
gst_buffer_unref (buf); gst_buffer_unref (buf);
gst_value_array_append_value (array_val, &value); gst_value_array_append_value (array_val, &value);
@ -923,7 +923,7 @@ gst_flac_enc_process_stream_headers (GstFlacEnc * enc)
l->data = gst_buffer_make_writable (GST_BUFFER_CAST (l->data)); l->data = gst_buffer_make_writable (GST_BUFFER_CAST (l->data));
buf = GST_BUFFER_CAST (l->data); buf = GST_BUFFER_CAST (l->data);
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_IN_CAPS); GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_HEADER);
gst_buffer_map (buf, &map, GST_MAP_READ); gst_buffer_map (buf, &map, GST_MAP_READ);
data = map.data; data = map.data;

View file

@ -636,7 +636,7 @@ send_message_locked (GstSoupHttpClientSink * souphttpsink)
for (g = souphttpsink->queued_buffers; g; g = g_list_next (g)) { for (g = souphttpsink->queued_buffers; g; g = g_list_next (g)) {
GstBuffer *buffer = g->data; GstBuffer *buffer = g->data;
if (!GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_IN_CAPS)) { if (!GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_HEADER)) {
GstMapInfo map; GstMapInfo map;
/* FIXME, lifetime of the buffer? */ /* FIXME, lifetime of the buffer? */

View file

@ -661,11 +661,11 @@ _gst_caps_set_buffer_array (GstCaps * caps, const gchar * field,
g_assert (gst_buffer_is_writable (buf)); g_assert (gst_buffer_is_writable (buf));
/* mark buffer */ /* 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); g_value_init (&value, GST_TYPE_BUFFER);
buf = gst_buffer_copy (buf); 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_value_set_buffer (&value, buf);
gst_buffer_unref (buf); gst_buffer_unref (buf);
gst_value_array_append_value (&array, &value); gst_value_array_append_value (&array, &value);

View file

@ -1042,7 +1042,7 @@ _value_array_append_buffer (GValue * array_val, GstBuffer * buf)
/* copy buffer to avoid problems with circular refcounts */ /* copy buffer to avoid problems with circular refcounts */
buf = gst_buffer_copy (buf); buf = gst_buffer_copy (buf);
/* again, for good measure */ /* again, for good measure */
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_value_set_buffer (&value, buf);
gst_buffer_unref (buf); gst_buffer_unref (buf);
gst_value_array_append_value (array_val, &value); gst_value_array_append_value (array_val, &value);
@ -1074,7 +1074,7 @@ gst_flac_parse_handle_headers (GstFlacParse * flacparse)
gst_buffer_map (header, &map, GST_MAP_READ); gst_buffer_map (header, &map, GST_MAP_READ);
GST_BUFFER_FLAG_SET (header, GST_BUFFER_FLAG_IN_CAPS); GST_BUFFER_FLAG_SET (header, GST_BUFFER_FLAG_HEADER);
if (map.size == 4 && memcmp (map.data, "fLaC", 4) == 0) { if (map.size == 4 && memcmp (map.data, "fLaC", 4) == 0) {
marker = header; marker = header;

View file

@ -1177,16 +1177,16 @@ gst_flv_mux_write_header (GstFlvMux * mux)
} }
/* mark buffers that will go in the streamheader */ /* mark buffers that will go in the streamheader */
GST_BUFFER_FLAG_SET (header, GST_BUFFER_FLAG_IN_CAPS); GST_BUFFER_FLAG_SET (header, GST_BUFFER_FLAG_HEADER);
GST_BUFFER_FLAG_SET (metadata, GST_BUFFER_FLAG_IN_CAPS); GST_BUFFER_FLAG_SET (metadata, GST_BUFFER_FLAG_HEADER);
if (video_codec_data != NULL) { if (video_codec_data != NULL) {
GST_BUFFER_FLAG_SET (video_codec_data, GST_BUFFER_FLAG_IN_CAPS); GST_BUFFER_FLAG_SET (video_codec_data, GST_BUFFER_FLAG_HEADER);
/* mark as a delta unit, so downstream will not try to synchronize on that /* mark as a delta unit, so downstream will not try to synchronize on that
* buffer - to actually start playback you need a real video keyframe */ * buffer - to actually start playback you need a real video keyframe */
GST_BUFFER_FLAG_SET (video_codec_data, GST_BUFFER_FLAG_DELTA_UNIT); GST_BUFFER_FLAG_SET (video_codec_data, GST_BUFFER_FLAG_DELTA_UNIT);
} }
if (audio_codec_data != NULL) { if (audio_codec_data != NULL) {
GST_BUFFER_FLAG_SET (audio_codec_data, GST_BUFFER_FLAG_IN_CAPS); GST_BUFFER_FLAG_SET (audio_codec_data, GST_BUFFER_FLAG_HEADER);
} }
/* put buffers in streamheader */ /* put buffers in streamheader */

View file

@ -1503,7 +1503,7 @@ gst_qt_mux_set_header_on_caps (GstQTMux * mux, GstBuffer * buf)
g_value_init (&array, GST_TYPE_ARRAY); g_value_init (&array, GST_TYPE_ARRAY);
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); g_value_init (&value, GST_TYPE_BUFFER);
gst_value_take_buffer (&value, gst_buffer_ref (buf)); gst_value_take_buffer (&value, gst_buffer_ref (buf));
gst_value_array_append_value (&array, &value); gst_value_array_append_value (&array, &value);

View file

@ -257,7 +257,7 @@ gst_ebml_write_flush_cache (GstEbmlWrite * ebml, gboolean is_keyframe,
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT); GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT);
} }
if (ebml->writing_streamheader) { if (ebml->writing_streamheader) {
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_IN_CAPS); GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_HEADER);
} }
if (!is_keyframe) { if (!is_keyframe) {
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT); GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT);
@ -449,7 +449,7 @@ gst_ebml_write_element_push (GstEbmlWrite * ebml, GstBuffer * buf,
GST_BUFFER_OFFSET (buf) = ebml->pos - data_size; GST_BUFFER_OFFSET (buf) = ebml->pos - data_size;
GST_BUFFER_OFFSET_END (buf) = ebml->pos; GST_BUFFER_OFFSET_END (buf) = ebml->pos;
if (ebml->writing_streamheader) { if (ebml->writing_streamheader) {
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_IN_CAPS); GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_HEADER);
} }
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT); GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT);

View file

@ -2859,7 +2859,7 @@ gst_matroska_mux_stop_streamheader (GstMatroskaMux * mux)
s = gst_caps_get_structure (caps, 0); s = gst_caps_get_structure (caps, 0);
g_value_init (&streamheader, GST_TYPE_ARRAY); g_value_init (&streamheader, GST_TYPE_ARRAY);
g_value_init (&bufval, GST_TYPE_BUFFER); g_value_init (&bufval, GST_TYPE_BUFFER);
GST_BUFFER_FLAG_SET (streamheader_buffer, GST_BUFFER_FLAG_IN_CAPS); GST_BUFFER_FLAG_SET (streamheader_buffer, GST_BUFFER_FLAG_HEADER);
gst_value_set_buffer (&bufval, streamheader_buffer); gst_value_set_buffer (&bufval, streamheader_buffer);
gst_value_array_append_value (&streamheader, &bufval); gst_value_array_append_value (&streamheader, &bufval);
g_value_unset (&bufval); g_value_unset (&bufval);

View file

@ -2532,7 +2532,7 @@ gst_matroska_parse_output (GstMatroskaParse * parse, GstBuffer * buffer,
g_value_init (&streamheader, GST_TYPE_ARRAY); g_value_init (&streamheader, GST_TYPE_ARRAY);
g_value_init (&bufval, GST_TYPE_BUFFER); g_value_init (&bufval, GST_TYPE_BUFFER);
buf = gst_buffer_copy (parse->streamheader); buf = gst_buffer_copy (parse->streamheader);
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_IN_CAPS); GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_HEADER);
gst_value_set_buffer (&bufval, buf); gst_value_set_buffer (&bufval, buf);
gst_buffer_unref (buf); gst_buffer_unref (buf);
gst_value_array_append_value (&streamheader, &bufval); gst_value_array_append_value (&streamheader, &bufval);
@ -2546,7 +2546,7 @@ gst_matroska_parse_output (GstMatroskaParse * parse, GstBuffer * buffer,
gst_caps_unref (caps); gst_caps_unref (caps);
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT); GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_IN_CAPS); GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_HEADER);
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT); GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
ret = gst_pad_push (parse->srcpad, buf); ret = gst_pad_push (parse->srcpad, buf);

View file

@ -179,8 +179,7 @@ check_output_buffer_is_equal (const gchar * name,
const gchar * data, gint refcount) const gchar * data, gint refcount)
{ {
GstBuffer *buffer; GstBuffer *buffer;
gpointer buf_data; GstMapInfo map;
gsize size;
if (current_buf == NULL) if (current_buf == NULL)
current_buf = buffers; current_buf = buffers;
@ -190,13 +189,13 @@ check_output_buffer_is_equal (const gchar * name,
fail_unless (current_buf != NULL); fail_unless (current_buf != NULL);
buffer = GST_BUFFER (current_buf->data); buffer = GST_BUFFER (current_buf->data);
buf_data = gst_buffer_map (buffer, &size, NULL, GST_MAP_READ); gst_buffer_map (buffer, &map, GST_MAP_READ);
ASSERT_OBJECT_REFCOUNT (buffer, name, refcount); ASSERT_OBJECT_REFCOUNT (buffer, name, refcount);
fail_unless (memcmp (buf_data, data, size) == 0, fail_unless (memcmp (map.data, data, map.size) == 0,
"'%s' (%s) is not equal to (%s)", name, buf_data, data); "'%s' (%s) is not equal to (%s)", name, map.data, data);
gst_buffer_unmap (buffer, buf_data, size); gst_buffer_unmap (buffer, &map);
} }
static GstFlowReturn static GstFlowReturn

View file

@ -201,8 +201,7 @@ check_output_buffer_is_equal (const gchar * name,
const gchar * data, gint refcount) const gchar * data, gint refcount)
{ {
GstBuffer *buffer; GstBuffer *buffer;
gpointer buf_data; GstMapInfo map;
gsize size;
if (current_buf == NULL) if (current_buf == NULL)
current_buf = buffers; current_buf = buffers;
@ -211,13 +210,13 @@ check_output_buffer_is_equal (const gchar * name,
fail_unless (current_buf != NULL); fail_unless (current_buf != NULL);
buffer = GST_BUFFER (current_buf->data); buffer = GST_BUFFER (current_buf->data);
buf_data = gst_buffer_map (buffer, &size, NULL, GST_MAP_READ); gst_buffer_map (buffer, &map, GST_MAP_READ);
ASSERT_OBJECT_REFCOUNT (buffer, name, refcount); ASSERT_OBJECT_REFCOUNT (buffer, name, refcount);
fail_unless (memcmp (buf_data, data, size) == 0, fail_unless (memcmp (map.data, data, map.size) == 0,
"'%s' (%s) is not equal to (%s)", name, buf_data, data); "'%s' (%s) is not equal to (%s)", name, map.data, data);
gst_buffer_unmap (buffer, buf_data, size); gst_buffer_unmap (buffer, &map);
} }
static GstFlowReturn static GstFlowReturn