dashdemux: check for profiles

Check for available profiles to enable certain features for
dash playback. For now we check for the ISOFF On Demand 2011 profile.
This commit is contained in:
Thiago Santos 2015-01-09 16:43:03 -03:00
parent 516f1ae0f4
commit b40e5decb2
2 changed files with 26 additions and 0 deletions

View file

@ -2842,6 +2842,18 @@ gst_mpd_client_free (GstMpdClient * client)
g_free (client);
}
static void
gst_mpd_client_check_profiles (GstMpdClient * client)
{
GST_DEBUG ("Profiles: %s", client->mpd_node->profiles);
if (g_strstr_len (client->mpd_node->profiles, -1,
"urn:mpeg:dash:profile:isoff-on-demand:2011")) {
client->profile_isoff_ondemand = TRUE;
GST_DEBUG ("Found ISOFF on demand profile (2011)");
}
}
gboolean
gst_mpd_parse (GstMpdClient * client, const gchar * data, gint size)
{
@ -2879,6 +2891,8 @@ gst_mpd_parse (GstMpdClient * client, const gchar * data, gint size)
xmlFreeDoc (doc);
}
gst_mpd_client_check_profiles (client);
return TRUE;
}
@ -4293,3 +4307,9 @@ gst_media_fragment_info_clear (GstMediaFragmentInfo * fragment)
g_free (fragment->uri);
g_free (fragment->index_uri);
}
gboolean
gst_mpd_client_has_isoff_ondemand_profile (GstMpdClient * client)
{
return client->profile_isoff_ondemand;
}

View file

@ -471,6 +471,9 @@ struct _GstMpdClient
gchar *mpd_uri; /* manifest file URI */
gchar *mpd_base_uri; /* base URI for resolving relative URIs.
* this will be different for redirects */
/* profiles */
gboolean profile_isoff_ondemand;
};
/* Basic initialization/deinitialization functions */
@ -545,6 +548,9 @@ guint gst_mpdparser_get_list_and_nb_of_audio_language (GstMpdClient *client, GLi
gint64 gst_mpd_client_calculate_time_difference (const GstDateTime * t1, const GstDateTime * t2);
/* profiles */
gboolean gst_mpd_client_has_isoff_ondemand_profile (GstMpdClient *client);
G_END_DECLS
#endif /* __GST_MPDPARSER_H__ */