After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 796865 - typefind: Add _with_extension() variants for typefinding data or a buffer
typefind: Add _with_extension() variants for typefinding data or a buffer
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal enhancement
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-07-24 14:30 UTC by Sebastian Dröge (slomo)
Modified: 2018-07-27 12:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
typefind: Add _with_extension() variants for typefinding data or a buffer (12.72 KB, patch)
2018-07-24 14:30 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2018-07-24 14:30:18 UTC
See commit message
Comment 1 Sebastian Dröge (slomo) 2018-07-24 14:30:22 UTC
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 2 Tim-Philipp Müller 2018-07-24 15:56:04 UTC
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.
Comment 3 Sebastian Dröge (slomo) 2018-07-24 22:14:03 UTC
Attachment 373146 [details] pushed as d196b0b - typefind: Add _with_extension() variants for typefinding data or a buffer
Comment 4 Jan Schmidt 2018-07-27 12:00:32 UTC
sort_list_by_matched_extension()?