From 60c8ed21d5687b8e1427e9614f60ca9122d9429f Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Fri, 3 Dec 2010 15:23:00 +0100 Subject: [PATCH] qtmux: remove large-file property Rather, auto-determine if 64-bits fields are needed for a valid result, and stick to plain 32-bits if not needed. API: GstQTMux:large-file (removed) --- gst/quicktime/atoms.c | 39 +++------------------------------------ gst/quicktime/atoms.h | 1 - gst/quicktime/gstqtmux.c | 18 +----------------- gst/quicktime/gstqtmux.h | 1 - 4 files changed, 4 insertions(+), 55 deletions(-) diff --git a/gst/quicktime/atoms.c b/gst/quicktime/atoms.c index 2fcb45f2bf..ebbd7c09ba 100644 --- a/gst/quicktime/atoms.c +++ b/gst/quicktime/atoms.c @@ -613,7 +613,7 @@ atom_co64_init (AtomSTCO64 * co64) { guint8 flags[3] = { 0, 0, 0 }; - atom_full_init (&co64->header, FOURCC_co64, 0, 0, 0, flags); + atom_full_init (&co64->header, FOURCC_stco, 0, 0, 0, flags); atom_array_init (&co64->entries, 256); } @@ -2520,6 +2520,8 @@ static void atom_stco64_add_entry (AtomSTCO64 * stco64, guint64 entry) { atom_array_append (&stco64->entries, entry, 256); + if (entry > G_MAXUINT32) + stco64->header.header.type = FOURCC_co64; } static void @@ -2708,41 +2710,6 @@ atom_moov_update_duration (AtomMOOV * moov) moov->mvex.mehd.fragment_duration = duration; } -static void -atom_set_type (Atom * atom, guint32 fourcc) -{ - atom->type = fourcc; -} - -static void -atom_stbl_set_64bits (AtomSTBL * stbl, gboolean use) -{ - if (use) { - atom_set_type (&stbl->stco64.header.header, FOURCC_co64); - } else { - atom_set_type (&stbl->stco64.header.header, FOURCC_stco); - } -} - -static void -atom_trak_set_64bits (AtomTRAK * trak, gboolean use) -{ - atom_stbl_set_64bits (&trak->mdia.minf.stbl, use); -} - -void -atom_moov_set_64bits (AtomMOOV * moov, gboolean large_file) -{ - GList *traks = moov->traks; - - while (traks) { - AtomTRAK *trak = (AtomTRAK *) traks->data; - - atom_trak_set_64bits (trak, large_file); - traks = g_list_next (traks); - } -} - void atom_moov_set_fragmented (AtomMOOV * moov, gboolean fragmented) { diff --git a/gst/quicktime/atoms.h b/gst/quicktime/atoms.h index d074df429f..b65be8256a 100644 --- a/gst/quicktime/atoms.h +++ b/gst/quicktime/atoms.h @@ -821,7 +821,6 @@ 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); diff --git a/gst/quicktime/gstqtmux.c b/gst/quicktime/gstqtmux.c index ba5b9aca88..95f52a4a60 100644 --- a/gst/quicktime/gstqtmux.c +++ b/gst/quicktime/gstqtmux.c @@ -118,7 +118,6 @@ enum enum { PROP_0, - PROP_LARGE_FILE, PROP_MOVIE_TIMESCALE, PROP_TRAK_TIMESCALE, PROP_DO_CTTS, @@ -133,7 +132,6 @@ enum #define MDAT_LARGE_FILE_LIMIT ((guint64) 1024 * 1024 * 1024 * 2) #define MAX_TOLERATED_LATENESS (GST_SECOND / 10) -#define DEFAULT_LARGE_FILE FALSE #define DEFAULT_MOVIE_TIMESCALE 1000 #define DEFAULT_TRAK_TIMESCALE 0 #define DEFAULT_DO_CTTS FALSE @@ -229,11 +227,6 @@ gst_qt_mux_class_init (GstQTMuxClass * klass) gobject_class->get_property = gst_qt_mux_get_property; gobject_class->set_property = gst_qt_mux_set_property; - g_object_class_install_property (gobject_class, PROP_LARGE_FILE, - g_param_spec_boolean ("large-file", "Support for large files", - "Uses 64bits to some fields instead of 32bits, " - "providing support for large files", - DEFAULT_LARGE_FILE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, PROP_MOVIE_TIMESCALE, g_param_spec_uint ("movie-timescale", "Movie timescale", "Timescale to use in the movie (units per second)", @@ -1405,23 +1398,20 @@ gst_qt_mux_set_header_on_caps (GstQTMux * mux, GstBuffer * buf) static void gst_qt_mux_configure_moov (GstQTMux * qtmux, guint32 * _timescale) { - gboolean large_file, fragmented; + gboolean fragmented; guint32 timescale; GST_OBJECT_LOCK (qtmux); timescale = qtmux->timescale; - large_file = qtmux->large_file; fragmented = qtmux->fragment_sequence > 0; GST_OBJECT_UNLOCK (qtmux); /* inform lower layers of our property wishes, and determine duration. * Let moov take care of this using its list of traks; * so that released pads are also included */ - GST_DEBUG_OBJECT (qtmux, "Large file support: %d", large_file); GST_DEBUG_OBJECT (qtmux, "Updating timescale to %" G_GUINT32_FORMAT, timescale); atom_moov_update_timescale (qtmux->moov, timescale); - atom_moov_set_64bits (qtmux->moov, large_file); atom_moov_set_fragmented (qtmux->moov, fragmented); atom_moov_update_duration (qtmux->moov); @@ -3075,9 +3065,6 @@ gst_qt_mux_get_property (GObject * object, GST_OBJECT_LOCK (qtmux); switch (prop_id) { - case PROP_LARGE_FILE: - g_value_set_boolean (value, qtmux->large_file); - break; case PROP_MOVIE_TIMESCALE: g_value_set_uint (value, qtmux->timescale); break; @@ -3130,9 +3117,6 @@ gst_qt_mux_set_property (GObject * object, GST_OBJECT_LOCK (qtmux); switch (prop_id) { - case PROP_LARGE_FILE: - qtmux->large_file = g_value_get_boolean (value); - break; case PROP_MOVIE_TIMESCALE: qtmux->timescale = g_value_get_uint (value); break; diff --git a/gst/quicktime/gstqtmux.h b/gst/quicktime/gstqtmux.h index 227eb2abdf..4df0c3e2b9 100644 --- a/gst/quicktime/gstqtmux.h +++ b/gst/quicktime/gstqtmux.h @@ -173,7 +173,6 @@ struct _GstQTMux guint32 trak_timescale; AtomsTreeFlavor flavor; gboolean fast_start; - gboolean large_file; gboolean guess_pts; gchar *fast_start_file_path; gchar *moov_recov_file_path;