GNOME Bugzilla – Bug 796865
typefind: Add _with_extension() variants for typefinding data or a buffer
Last modified: 2018-07-27 12:00:32 UTC
See commit message
Created attachment 373146 [details] [review] typefind: Add _with_extension() variants for typefinding data or a buffer And make use of that in the typefind element to also be able to make use of the extension in push mode. It previously only did that in pull mode and this potentially speeds up typefinding and might also prevent false positives.
Comment on attachment 373146 [details] [review] typefind: Add _with_extension() variants for typefinding data or a buffer >+static GList * >+sort_list_by_extension (GstObject * obj, GList * type_list, >+ const gchar * extension) I would prefer a different name for this function if we can come up with one, as we don't really sort by extension (which we definitely don't want to do), we just massage the list as to move any matching typefinders to the front :) >+/** >+ * gst_type_find_helper_for_data_with_extension: >+ * @obj: (allow-none): object doing the typefinding, or %NULL (used for logging) >+ * @data: (transfer none) (array length=size): * a pointer with data to typefind >+ * @size: the size of @data >+ * @extension: extension of the media Missing nullable or allow-none, whichever it is these days, plus comment that %NULL is allowed. >+/** >+ * gst_type_find_helper_for_buffer_with_extension: >+ * @obj: (allow-none): object doing the typefinding, or %NULL (used for logging) >+ * @buf: (in) (transfer none): a #GstBuffer with data to typefind >+ * @prob: (out) (allow-none): location to store the probability of the found >+ * caps, or %NULL @extension: is missing. Otherwise looks good to me. Not sure why we did this only for pull mode in the first place.
Attachment 373146 [details] pushed as d196b0b - typefind: Add _with_extension() variants for typefinding data or a buffer
sort_list_by_matched_extension()?