mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
qtmux: allow specifying trak timescale
This is mainly because Smoothstreaming client are broken and don't take the TimeScale property into account.
This commit is contained in:
parent
92b8a00ac8
commit
bee00aa70f
2 changed files with 18 additions and 2 deletions
|
@ -105,6 +105,7 @@ enum
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_LARGE_FILE,
|
PROP_LARGE_FILE,
|
||||||
PROP_MOVIE_TIMESCALE,
|
PROP_MOVIE_TIMESCALE,
|
||||||
|
PROP_TRAK_TIMESCALE,
|
||||||
PROP_DO_CTTS,
|
PROP_DO_CTTS,
|
||||||
PROP_FLAVOR,
|
PROP_FLAVOR,
|
||||||
PROP_FAST_START,
|
PROP_FAST_START,
|
||||||
|
@ -120,6 +121,7 @@ enum
|
||||||
|
|
||||||
#define DEFAULT_LARGE_FILE FALSE
|
#define DEFAULT_LARGE_FILE FALSE
|
||||||
#define DEFAULT_MOVIE_TIMESCALE 1000
|
#define DEFAULT_MOVIE_TIMESCALE 1000
|
||||||
|
#define DEFAULT_TRAK_TIMESCALE 0
|
||||||
#define DEFAULT_DO_CTTS FALSE
|
#define DEFAULT_DO_CTTS FALSE
|
||||||
#define DEFAULT_FAST_START FALSE
|
#define DEFAULT_FAST_START FALSE
|
||||||
#define DEFAULT_FAST_START_TEMP_FILE NULL
|
#define DEFAULT_FAST_START_TEMP_FILE NULL
|
||||||
|
@ -223,6 +225,11 @@ gst_qt_mux_class_init (GstQTMuxClass * klass)
|
||||||
"Timescale to use in the movie (units per second)",
|
"Timescale to use in the movie (units per second)",
|
||||||
1, G_MAXUINT32, DEFAULT_MOVIE_TIMESCALE,
|
1, G_MAXUINT32, DEFAULT_MOVIE_TIMESCALE,
|
||||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
|
||||||
|
g_object_class_install_property (gobject_class, PROP_TRAK_TIMESCALE,
|
||||||
|
g_param_spec_uint ("trak-timescale", "Track timescale",
|
||||||
|
"Timescale to use for the tracks (units per second, 0 is automatic)",
|
||||||
|
0, G_MAXUINT32, DEFAULT_TRAK_TIMESCALE,
|
||||||
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
|
||||||
g_object_class_install_property (gobject_class, PROP_DO_CTTS,
|
g_object_class_install_property (gobject_class, PROP_DO_CTTS,
|
||||||
g_param_spec_boolean ("presentation-time",
|
g_param_spec_boolean ("presentation-time",
|
||||||
"Include presentation-time info",
|
"Include presentation-time info",
|
||||||
|
@ -2542,7 +2549,8 @@ gst_qt_mux_audio_sink_set_caps (GstPad * pad, GstCaps * caps)
|
||||||
qtpad->fourcc = entry.fourcc;
|
qtpad->fourcc = entry.fourcc;
|
||||||
qtpad->sample_size = constant_size;
|
qtpad->sample_size = constant_size;
|
||||||
atom_trak_set_audio_type (qtpad->trak, qtmux->context, &entry,
|
atom_trak_set_audio_type (qtpad->trak, qtmux->context, &entry,
|
||||||
entry.sample_rate, ext_atom, constant_size);
|
qtmux->trak_timescale ? qtmux->trak_timescale : entry.sample_rate,
|
||||||
|
ext_atom, constant_size);
|
||||||
|
|
||||||
gst_object_unref (qtmux);
|
gst_object_unref (qtmux);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -2656,7 +2664,8 @@ gst_qt_mux_video_sink_set_caps (GstPad * pad, GstCaps * caps)
|
||||||
|
|
||||||
/* bring frame numerator into a range that ensures both reasonable resolution
|
/* bring frame numerator into a range that ensures both reasonable resolution
|
||||||
* as well as a fair duration */
|
* as well as a fair duration */
|
||||||
rate = adjust_rate (framerate_num);
|
rate = qtmux->trak_timescale ?
|
||||||
|
qtmux->trak_timescale : adjust_rate (framerate_num);
|
||||||
GST_DEBUG_OBJECT (qtmux, "Rate of video track selected: %" G_GUINT32_FORMAT,
|
GST_DEBUG_OBJECT (qtmux, "Rate of video track selected: %" G_GUINT32_FORMAT,
|
||||||
rate);
|
rate);
|
||||||
|
|
||||||
|
@ -3051,6 +3060,9 @@ gst_qt_mux_get_property (GObject * object,
|
||||||
case PROP_MOVIE_TIMESCALE:
|
case PROP_MOVIE_TIMESCALE:
|
||||||
g_value_set_uint (value, qtmux->timescale);
|
g_value_set_uint (value, qtmux->timescale);
|
||||||
break;
|
break;
|
||||||
|
case PROP_TRAK_TIMESCALE:
|
||||||
|
g_value_set_uint (value, qtmux->trak_timescale);
|
||||||
|
break;
|
||||||
case PROP_DO_CTTS:
|
case PROP_DO_CTTS:
|
||||||
g_value_set_boolean (value, qtmux->guess_pts);
|
g_value_set_boolean (value, qtmux->guess_pts);
|
||||||
break;
|
break;
|
||||||
|
@ -3103,6 +3115,9 @@ gst_qt_mux_set_property (GObject * object,
|
||||||
case PROP_MOVIE_TIMESCALE:
|
case PROP_MOVIE_TIMESCALE:
|
||||||
qtmux->timescale = g_value_get_uint (value);
|
qtmux->timescale = g_value_get_uint (value);
|
||||||
break;
|
break;
|
||||||
|
case PROP_TRAK_TIMESCALE:
|
||||||
|
qtmux->trak_timescale = g_value_get_uint (value);
|
||||||
|
break;
|
||||||
case PROP_DO_CTTS:
|
case PROP_DO_CTTS:
|
||||||
qtmux->guess_pts = g_value_get_boolean (value);
|
qtmux->guess_pts = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -170,6 +170,7 @@ struct _GstQTMux
|
||||||
|
|
||||||
/* properties */
|
/* properties */
|
||||||
guint32 timescale;
|
guint32 timescale;
|
||||||
|
guint32 trak_timescale;
|
||||||
AtomsTreeFlavor flavor;
|
AtomsTreeFlavor flavor;
|
||||||
gboolean fast_start;
|
gboolean fast_start;
|
||||||
gboolean large_file;
|
gboolean large_file;
|
||||||
|
|
Loading…
Reference in a new issue