mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
qtmux: add moov in streamheader
This commit is contained in:
parent
61964eb109
commit
bd0d320d6c
1 changed files with 26 additions and 0 deletions
|
@ -1351,6 +1351,31 @@ gst_qt_mux_prepare_and_send_ftyp (GstQTMux * qtmux)
|
|||
return gst_qt_mux_send_ftyp (qtmux, &qtmux->header_size);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_qt_mux_set_header_on_caps (GstQTMux * mux, GstBuffer * buf)
|
||||
{
|
||||
GstStructure *structure;
|
||||
GValue array = { 0 };
|
||||
GValue value = { 0 };
|
||||
GstCaps *caps = GST_PAD_CAPS (mux->srcpad);
|
||||
|
||||
caps = gst_caps_copy (GST_PAD_CAPS (mux->srcpad));
|
||||
structure = gst_caps_get_structure (caps, 0);
|
||||
|
||||
g_value_init (&array, GST_TYPE_ARRAY);
|
||||
|
||||
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_IN_CAPS);
|
||||
g_value_init (&value, GST_TYPE_BUFFER);
|
||||
gst_value_take_buffer (&value, gst_buffer_ref (buf));
|
||||
gst_value_array_append_value (&array, &value);
|
||||
g_value_unset (&value);
|
||||
|
||||
gst_structure_set_value (structure, "streamheader", &array);
|
||||
g_value_unset (&array);
|
||||
gst_pad_set_caps (mux->srcpad, caps);
|
||||
gst_caps_unref (caps);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_qt_mux_configure_moov (GstQTMux * qtmux, guint32 * _timescale)
|
||||
{
|
||||
|
@ -1396,6 +1421,7 @@ gst_qt_mux_send_moov (GstQTMux * qtmux, guint64 * _offset, gboolean mind_fast)
|
|||
|
||||
buf = _gst_buffer_new_take_data (data, offset);
|
||||
GST_DEBUG_OBJECT (qtmux, "Pushing moov atoms");
|
||||
gst_qt_mux_set_header_on_caps (qtmux, buf);
|
||||
ret = gst_qt_mux_send_buffer (qtmux, buf, _offset, mind_fast);
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue