diff --git a/subprojects/gst-plugins-bad/ext/dash/gstdashsink.c b/subprojects/gst-plugins-bad/ext/dash/gstdashsink.c index f915bab99d..77980496b3 100644 --- a/subprojects/gst-plugins-bad/ext/dash/gstdashsink.c +++ b/subprojects/gst-plugins-bad/ext/dash/gstdashsink.c @@ -723,23 +723,20 @@ gst_dash_sink_get_stream_metadata (GstDashSink * sink, GST_DEBUG_OBJECT (sink, "stream caps %s", gst_caps_to_string (caps)); s = gst_caps_get_structure (caps, 0); + g_free (stream->codec); + stream->codec = gst_codec_utils_caps_get_mime_codec (caps); + switch (stream->type) { case DASH_SINK_STREAM_TYPE_VIDEO: { gst_structure_get_int (s, "width", &stream->info.video.width); gst_structure_get_int (s, "height", &stream->info.video.height); - g_free (stream->codec); - stream->codec = - g_strdup (gst_mpd_helper_get_video_codec_from_mime (caps)); break; } case DASH_SINK_STREAM_TYPE_AUDIO: { gst_structure_get_int (s, "channels", &stream->info.audio.channels); gst_structure_get_int (s, "rate", &stream->info.audio.rate); - g_free (stream->codec); - stream->codec = - g_strdup (gst_mpd_helper_get_audio_codec_from_mime (caps)); break; } case DASH_SINK_STREAM_TYPE_SUBTITLE: diff --git a/subprojects/gst-plugins-bad/ext/dash/gstmpdhelper.c b/subprojects/gst-plugins-bad/ext/dash/gstmpdhelper.c index 3bdbaf29b4..a66de89b92 100644 --- a/subprojects/gst-plugins-bad/ext/dash/gstmpdhelper.c +++ b/subprojects/gst-plugins-bad/ext/dash/gstmpdhelper.c @@ -78,61 +78,6 @@ gst_mpd_helper_get_SAP_type (xmlNode * a_node, return exists; } -const gchar * -gst_mpd_helper_get_audio_codec_from_mime (GstCaps * caps) -{ - GstStructure *s; - const gchar *name = ""; - const gchar *codec_name = NULL; - - if (!caps) - return NULL; - s = gst_caps_get_structure (caps, 0); - if (!s) - goto done; - name = gst_structure_get_name (s); - if (!g_strcmp0 (name, "audio/mpeg")) { - gint mpeg_version; - if (gst_structure_get_int (s, "mpegversion", &mpeg_version)) { - if (mpeg_version == 4) - return "mp4a"; - } - - } else { - GST_DEBUG ("No codecs for this caps name %s", name); - } - -done: - return codec_name; -} - -const gchar * -gst_mpd_helper_get_video_codec_from_mime (GstCaps * caps) -{ - GstStructure *s; - const gchar *name = ""; - const gchar *codec_name = NULL; - - if (!caps) - return NULL; - - s = gst_caps_get_structure (caps, 0); - if (!s) - goto done; - name = gst_structure_get_name (s); - if (!g_strcmp0 (name, "video/x-h264")) { - return "avc1"; - } else if (!g_strcmp0 (name, "video/x-h265")) { - return "hvc1"; - } else { - GST_DEBUG ("No codecs for this caps name %s", name); - } - -done: - return codec_name; -} - - const gchar * gst_mpd_helper_mimetype_to_caps (const gchar * mimeType) { diff --git a/subprojects/gst-plugins-bad/ext/dash/gstmpdhelper.h b/subprojects/gst-plugins-bad/ext/dash/gstmpdhelper.h index 84ae0e730c..95eaec9c87 100644 --- a/subprojects/gst-plugins-bad/ext/dash/gstmpdhelper.h +++ b/subprojects/gst-plugins-bad/ext/dash/gstmpdhelper.h @@ -61,8 +61,6 @@ gboolean gst_mpd_helper_get_mpd_type (xmlNode * a_node, const gchar * property_n gboolean gst_mpd_helper_get_SAP_type (xmlNode * a_node, const gchar * property_name, GstMPDSAPType * property_value); const gchar * gst_mpd_helper_mimetype_to_caps (const gchar * mimeType); -const gchar * gst_mpd_helper_get_video_codec_from_mime (GstCaps * caps); -const gchar * gst_mpd_helper_get_audio_codec_from_mime (GstCaps * caps); GstUri *gst_mpd_helper_combine_urls (GstUri * base, GList * list, gchar ** query, guint idx); int gst_mpd_helper_strncmp_ext (const char *s1, const char *s2);