mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-03 09:12:19 +00:00
parent
43f8e926e7
commit
0039494227
1 changed files with 33 additions and 0 deletions
|
@ -1220,6 +1220,21 @@ gst_asf_mux_write_data_object (GstAsfMux * asfmux, guint8 ** buf)
|
||||||
*buf += ASF_DATA_OBJECT_SIZE;
|
*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
|
static guint
|
||||||
gst_asf_mux_find_payload_parsing_info_size (GstAsfMux * asfmux)
|
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 stream_num = g_slist_length (asfmux->collect->data);
|
||||||
guint metadata_obj_size = 0;
|
guint metadata_obj_size = 0;
|
||||||
GstAsfTags *asftags;
|
GstAsfTags *asftags;
|
||||||
|
GValue streamheader = { 0 };
|
||||||
|
GstCaps *caps;
|
||||||
|
GstStructure *structure;
|
||||||
guint64 padding = asfmux->prop_padding;
|
guint64 padding = asfmux->prop_padding;
|
||||||
if (padding < ASF_PADDING_OBJECT_SIZE)
|
if (padding < ASF_PADDING_OBJECT_SIZE)
|
||||||
padding = 0;
|
padding = 0;
|
||||||
|
@ -1334,6 +1352,21 @@ gst_asf_mux_start_file (GstAsfMux * asfmux)
|
||||||
asfmux->data_object_position = bufdata - GST_BUFFER_DATA (buf);
|
asfmux->data_object_position = bufdata - GST_BUFFER_DATA (buf);
|
||||||
gst_asf_mux_write_data_object (asfmux, &bufdata);
|
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));
|
g_assert (bufdata - GST_BUFFER_DATA (buf) == GST_BUFFER_SIZE (buf));
|
||||||
return gst_asf_mux_push_buffer (asfmux, buf);
|
return gst_asf_mux_push_buffer (asfmux, buf);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue