diff options
author | Andoni Morales Alastruey <amorales@flumotion.com> | 2010-04-26 13:33:48 +0200 |
---|---|---|
committer | Thiago Santos <thiago.sousa.santos@collabora.co.uk> | 2010-06-08 14:49:30 -0300 |
commit | 003949422786af7652925bdf7d6f0c252dcf61ec (patch) | |
tree | b4dadfb4b6da6891be1a5ca186fcbe5fa7bc3332 /gst/asfmux/gstasfmux.c | |
parent | 43f8e926e75116bf21f96cc1ca4b812767bbf161 (diff) | |
download | gstreamer-plugins-bad-003949422786af7652925bdf7d6f0c252dcf61ec.tar.gz |
asfmux: put headers in streamheader for streaming
Fixes #618522
Diffstat (limited to 'gst/asfmux/gstasfmux.c')
-rw-r--r-- | gst/asfmux/gstasfmux.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gst/asfmux/gstasfmux.c b/gst/asfmux/gstasfmux.c index 7374acc28..cb070e782 100644 --- a/gst/asfmux/gstasfmux.c +++ b/gst/asfmux/gstasfmux.c @@ -1220,6 +1220,21 @@ gst_asf_mux_write_data_object (GstAsfMux * asfmux, guint8 ** buf) *buf += ASF_DATA_OBJECT_SIZE; } +static void +gst_asf_mux_put_buffer_in_streamheader (GValue * streamheader, + GstBuffer * buffer) +{ + GValue value = { 0 }; + GstBuffer *buf; + + g_value_init (&value, GST_TYPE_BUFFER); + buf = gst_buffer_copy (buffer); + gst_value_set_buffer (&value, buf); + gst_buffer_unref (buf); + gst_value_array_append_value (streamheader, &value); + g_value_unset (&value); +} + static guint gst_asf_mux_find_payload_parsing_info_size (GstAsfMux * asfmux) { @@ -1255,6 +1270,9 @@ gst_asf_mux_start_file (GstAsfMux * asfmux) guint stream_num = g_slist_length (asfmux->collect->data); guint metadata_obj_size = 0; GstAsfTags *asftags; + GValue streamheader = { 0 }; + GstCaps *caps; + GstStructure *structure; guint64 padding = asfmux->prop_padding; if (padding < ASF_PADDING_OBJECT_SIZE) padding = 0; @@ -1334,6 +1352,21 @@ gst_asf_mux_start_file (GstAsfMux * asfmux) asfmux->data_object_position = bufdata - GST_BUFFER_DATA (buf); gst_asf_mux_write_data_object (asfmux, &bufdata); + /* set streamheader in source pad if 'is-live' */ + if (asfmux->prop_is_live) { + g_value_init (&streamheader, GST_TYPE_ARRAY); + gst_asf_mux_put_buffer_in_streamheader (&streamheader, buf); + + caps = gst_caps_ref (GST_PAD_CAPS (asfmux->srcpad)); + caps = gst_caps_make_writable (caps); + structure = gst_caps_get_structure (caps, 0); + gst_structure_set_value (structure, "streamheader", &streamheader); + gst_pad_set_caps (asfmux->srcpad, caps); + GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_IN_CAPS); + g_value_unset (&streamheader); + gst_caps_unref (caps); + } + g_assert (bufdata - GST_BUFFER_DATA (buf) == GST_BUFFER_SIZE (buf)); return gst_asf_mux_push_buffer (asfmux, buf); } |