From 80cc1fcc030efd372400b52273b9fe277a6b9330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Wed, 27 Sep 2023 15:16:43 +0200 Subject: [PATCH] mpdhelper: remove useless code The audio/video codec name from mime type should be retrieved from gst_codec_utils_caps_get_mime_codec instead Part-of: --- .../ext/adaptivedemux2/dash/gstmpd-prelude.h | 2 - .../ext/adaptivedemux2/dash/gstmpdhelper.c | 54 ------------------- .../ext/adaptivedemux2/dash/gstmpdhelper.h | 3 +- 3 files changed, 1 insertion(+), 58 deletions(-) diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstmpd-prelude.h b/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstmpd-prelude.h index a49a8f85df..3f42ec5ced 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstmpd-prelude.h +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstmpd-prelude.h @@ -33,10 +33,8 @@ #define gst_mpd_descriptor_type_node_get_type gst_mpd_descriptor_type_node2_get_type #define gst_mpd_descriptor_type_node_new gst_mpd_descriptor_type_node2_new #define gst_mpd_helper_combine_urls gst_mpd_helper2_combine_urls -#define gst_mpd_helper_get_audio_codec_from_mime gst_mpd_helper2_get_audio_codec_from_mime #define gst_mpd_helper_get_mpd_type gst_mpd_helper2_get_mpd_type #define gst_mpd_helper_get_SAP_type gst_mpd_helper2_get_SAP_type -#define gst_mpd_helper_get_video_codec_from_mime gst_mpd_helper2_get_video_codec_from_mime #define gst_mpd_helper_mimetype_to_caps gst_mpd_helper2_mimetype_to_caps #define gst_mpd_helper_strncmp_ext gst_mpd_helper2_strncmp_ext #define gst_mpd_location_node_free gst_mpd_location_node2_free diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstmpdhelper.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstmpdhelper.c index 85a300216c..4ccdd343f5 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstmpdhelper.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstmpdhelper.c @@ -82,60 +82,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-good/ext/adaptivedemux2/dash/gstmpdhelper.h b/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstmpdhelper.h index 65a7e45bf9..14025c7e01 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstmpdhelper.h +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstmpdhelper.h @@ -63,8 +63,7 @@ gboolean gst_mpd_helper_get_SAP_type (xmlNode * a_node, const gchar * property_n const gchar * gst_mpd_helper_mimetype_to_caps (const gchar * mimeType); GstCaps *gst_mpd_helper_mimetype_to_codec_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);