From 5d705ed9235745df9730767f8cbd6e195a82ea8d Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 23 Apr 2024 07:30:12 +0200 Subject: [PATCH] ges/tools: Use new GstEncodingProfile function from pbutils Part-of: --- .../gst-editing-services/tools/ges-launcher.c | 9 +++++---- .../gst-editing-services/tools/utils.c | 20 ------------------- .../gst-editing-services/tools/utils.h | 1 - 3 files changed, 5 insertions(+), 25 deletions(-) diff --git a/subprojects/gst-editing-services/tools/ges-launcher.c b/subprojects/gst-editing-services/tools/ges-launcher.c index 6bd44e6f46..17cb98d570 100644 --- a/subprojects/gst-editing-services/tools/ges-launcher.c +++ b/subprojects/gst-editing-services/tools/ges-launcher.c @@ -618,10 +618,10 @@ _set_rendering_details (GESLauncher * self) smart_profile = TRUE; else { opts->format = get_file_extension (opts->outputuri); - prof = parse_encoding_profile (opts->format); + prof = gst_encoding_profile_from_string (opts->format); } } else { - prof = parse_encoding_profile (opts->format); + prof = gst_encoding_profile_from_string (opts->format); if (!prof) { ges_printerr ("Invalid format specified: %s", opts->format); goto done; @@ -636,7 +636,7 @@ _set_rendering_details (GESLauncher * self) opts->format = g_strdup ("application/ogg:video/x-theora:audio/x-vorbis"); - prof = parse_encoding_profile (opts->format); + prof = gst_encoding_profile_from_string (opts->format); } if (!prof) { @@ -649,7 +649,8 @@ _set_rendering_details (GESLauncher * self) GstEncodingProfile *new_prof; GList *tmp; - if (!(new_prof = parse_encoding_profile (opts->container_profile))) { + if (!(new_prof = + gst_encoding_profile_from_string (opts->container_profile))) { ges_printerr ("Failed to parse container profile %s", opts->container_profile); gst_object_unref (prof); diff --git a/subprojects/gst-editing-services/tools/utils.c b/subprojects/gst-editing-services/tools/utils.c index 3fef2c9b93..a284b3981c 100644 --- a/subprojects/gst-editing-services/tools/utils.c +++ b/subprojects/gst-editing-services/tools/utils.c @@ -183,26 +183,6 @@ ensure_uri (const gchar * location) return gst_filename_to_uri (location, NULL); } -GstEncodingProfile * -parse_encoding_profile (const gchar * format) -{ - GstEncodingProfile *profile; - GValue value = G_VALUE_INIT; - - g_value_init (&value, GST_TYPE_ENCODING_PROFILE); - - if (!gst_value_deserialize (&value, format)) { - g_value_reset (&value); - - return NULL; - } - - profile = g_value_dup_object (&value); - g_value_reset (&value); - - return profile; -} - void print_enum (GType enum_type) { diff --git a/subprojects/gst-editing-services/tools/utils.h b/subprojects/gst-editing-services/tools/utils.h index c29979db51..8ba861d753 100644 --- a/subprojects/gst-editing-services/tools/utils.h +++ b/subprojects/gst-editing-services/tools/utils.h @@ -58,7 +58,6 @@ typedef struct gchar * sanitize_timeline_description (gchar **args, GESLauncherParsedOptions *opts); gboolean get_flags_from_string (GType type, const gchar * str_flags, guint *val); gchar * ensure_uri (const gchar * location); -GstEncodingProfile * parse_encoding_profile (const gchar * format); void print_enum (GType enum_type); void ges_print (GstDebugColorFlags c, gboolean err, gboolean nline, const gchar * format, va_list var_args);