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)
This commit is contained in:
Mark Nauwelaerts 2010-12-03 15:23:00 +01:00
parent e0e679dba9
commit 1ff6806cd4
4 changed files with 4 additions and 55 deletions

View file

@ -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)
{

View file

@ -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);

View file

@ -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;

View file

@ -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;