media_caps = gst_mss_stream_get_caps (stream->manifest_stream);
caps = gst_caps_new_simple ("video/quicktime", "variant", G_TYPE_STRING,
- "mss-fragmented", "media-caps", GST_TYPE_CAPS, media_caps, NULL);
+ "mss-fragmented", "timescale", G_TYPE_UINT64,
+ gst_mss_stream_get_timescale (stream->manifest_stream), "media-caps",
+ GST_TYPE_CAPS, media_caps, NULL);
gst_caps_unref (media_caps);
if (caps) {
#include "gstmssmanifest.h"
+#define DEFAULT_TIMESCALE 10000000
+
#define MSS_NODE_STREAM_FRAGMENT "c"
#define MSS_NODE_STREAM_QUALITY "QualityLevel"
#define MSS_PROP_DURATION "d"
#define MSS_PROP_NUMBER "n"
#define MSS_PROP_TIME "t"
+#define MSS_PROP_TIMESCALE "TimeScale"
#define MSS_PROP_URL "Url"
/* TODO check if atoi is successful? */
return caps;
}
+guint64
+gst_mss_stream_get_timescale (GstMssStream * stream)
+{
+ gchar *timescale;
+ guint64 ts = DEFAULT_TIMESCALE;
+
+ timescale =
+ (gchar *) xmlGetProp (stream->xmlnode, (xmlChar *) MSS_PROP_TIMESCALE);
+ if (!timescale) {
+ timescale =
+ (gchar *) xmlGetProp (stream->xmlnode->parent,
+ (xmlChar *) MSS_PROP_TIMESCALE);
+ }
+
+ if (timescale) {
+ ts = strtoull (timescale, NULL, 10);
+ g_free (timescale);
+ }
+ return ts;
+}
+
GstCaps *
gst_mss_stream_get_caps (GstMssStream * stream)
{
GstMssStreamType streamtype = gst_mss_stream_get_type (stream);
xmlNodePtr qualitylevel = stream->current_quality->data;
+ GstCaps *caps = NULL;
if (streamtype == MSS_STREAM_TYPE_VIDEO)
- return _gst_mss_stream_video_caps_from_qualitylevel_xml (qualitylevel);
+ caps = _gst_mss_stream_video_caps_from_qualitylevel_xml (qualitylevel);
else if (streamtype == MSS_STREAM_TYPE_AUDIO)
- return _gst_mss_stream_audio_caps_from_qualitylevel_xml (qualitylevel);
+ caps = _gst_mss_stream_audio_caps_from_qualitylevel_xml (qualitylevel);
- return NULL;
+ return caps;
}
GstFlowReturn
GstMssStreamType gst_mss_stream_get_type (GstMssStream *stream);
GstCaps * gst_mss_stream_get_caps (GstMssStream * stream);
+guint64 gst_mss_stream_get_timescale (GstMssStream * stream);
GstFlowReturn gst_mss_stream_get_fragment_url (GstMssStream * stream, gchar ** url);
GstFlowReturn gst_mss_stream_advance_fragment (GstMssStream * stream);