qtmux: add mvex/trex in header if fragmented
One "trex" is added per "trak". We don't support default values,
but the "trex" box is mandatory.
diff --git a/gst/quicktime/atoms.h b/gst/quicktime/atoms.h
index 387904b..54e57bc 100644
--- a/gst/quicktime/atoms.h
+++ b/gst/quicktime/atoms.h
@@ -595,6 +595,35 @@
gboolean is_h264;
} AtomTRAK;
+typedef struct _AtomTREX
+{
+ AtomFull header;
+
+ guint32 track_ID;
+ guint32 default_sample_description_index;
+ guint32 default_sample_duration;
+ guint32 default_sample_size;
+ guint32 default_sample_flags;
+} AtomTREX;
+
+typedef struct _AtomMEHD
+{
+ AtomFull header;
+
+ guint64 fragment_duration;
+} AtomMEHD;
+
+
+typedef struct _AtomMVEX
+{
+ Atom header;
+
+ AtomMEHD mehd;
+
+ /* list of AtomTREX */
+ GList *trexs;
+} AtomMVEX;
+
typedef struct _AtomMOOV
{
/* style */
@@ -603,10 +632,13 @@
Atom header;
AtomMVHD mvhd;
+ AtomMVEX mvex;
/* list of AtomTRAK */
GList *traks;
AtomUDTA *udta;
+
+ gboolean fragmented;
} AtomMOOV;
typedef struct _AtomWAVE
@@ -662,14 +694,20 @@
guint64 chunk_offset, gboolean sync,
gboolean do_pts, gint64 pts_offset);
+AtomTREX* atom_trex_new (AtomsContext *context, AtomTRAK *trak,
+ guint32 default_sample_description_index,
+ guint32 default_sample_duration, guint32 default_sample_size,
+ guint32 default_sample_flags);
AtomMOOV* atom_moov_new (AtomsContext *context);
void atom_moov_free (AtomMOOV *moov);
guint64 atom_moov_copy_data (AtomMOOV *atom, guint8 **buffer, guint64 *size, guint64* offset);
void atom_moov_update_timescale (AtomMOOV *moov, guint32 timescale);
void atom_moov_update_duration (AtomMOOV *moov);
void atom_moov_set_64bits (AtomMOOV *moov, gboolean large_file);
+void atom_moov_set_fragmented (AtomMOOV *moov, gboolean fragmented);
void atom_moov_chunks_add_offset (AtomMOOV *moov, guint32 offset);
void atom_moov_add_trak (AtomMOOV *moov, AtomTRAK *trak);
+void atom_moov_add_trex (AtomMOOV *moov, AtomTREX *trex);
guint64 atom_mvhd_copy_data (AtomMVHD * atom, guint8 ** buffer,
guint64 * size, guint64 * offset);