encoding-profile: don't order profiles by stream ID ..
authorMathieu Duponchelle <mathieu@centricular.com>
Thu, 20 Jan 2022 23:57:16 +0000 (00:57 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 2 Aug 2022 15:48:12 +0000 (15:48 +0000)
when creating a profile from a discoverer info.

There is no justification for the existing code, and talking with
Thibault he cannot remember why the sort was in place.

On the other hand, this allows GES users to not have to implement
a callback for the select-tracks-for-object callback when using
it to trim a single clip, which the output profile was built from:
track elements will be placed in the appropriate track by default,
that is the one that will be connected to the matching profile.

For multi-clip timelines, the situation doesn't change, users will
still have to implement a callback and do the leg work of placing
track elements (if any) in a matching track (if any).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1549>

subprojects/gst-plugins-base/gst-libs/gst/pbutils/encoding-profile.c

index 65fd107..66e404c 100644 (file)
@@ -2258,13 +2258,6 @@ create_stream_profile_recurse (GstEncodingProfile * toplevel,
   return toplevel;
 }
 
-static gint
-_compare_profile_names (const GstEncodingProfile * a,
-    const GstEncodingProfile * b)
-{
-  return g_strcmp0 (a->name, b->name);
-}
-
 /**
  * gst_encoding_profile_from_discoverer:
  * @info: (transfer none): The #GstDiscovererInfo to read from
@@ -2296,11 +2289,6 @@ gst_encoding_profile_from_discoverer (GstDiscovererInfo * info)
       g_object_unref (profile);
       return NULL;
     }
-    /* Sort by stream ID */
-    GST_ENCODING_CONTAINER_PROFILE (profile)->encodingprofiles =
-        g_list_sort (GST_ENCODING_CONTAINER_PROFILE (profile)->encodingprofiles,
-        (GCompareFunc) _compare_profile_names);
-
   }
 
   return (GstEncodingProfile *) profile;