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 332723 - New API: gst_type_find_helper_for_buffer
New API: gst_type_find_helper_for_buffer
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Reported: 2006-02-27 11:22 UTC by Tim-Philipp Müller
Modified: 2006-02-27 19:23 UTC
See Also:
GNOME target: ---
GNOME version: ---

proposed API addition (5.19 KB, patch)
2006-02-27 11:23 UTC, Tim-Philipp Müller
none Details | Review
updated patch (6.10 KB, patch)
2006-02-27 18:19 UTC, Tim-Philipp Müller
committed Details | Review

Description Tim-Philipp Müller 2006-02-27 11:22:39 UTC
There are quite a few elements now that implement their own typefinding stuff for typefinding from a given buffer (when used in push mode), e.g.

 - typefindelement
 - apedemux
 - id3demux

It would make sense to provide a helper function for that similar to gst_type_find_helper(). Here's my suggestion:

 * gst_type_find_helper_for_buffer:
 * @obj: object doing the typefinding, or NULL (used for logging)
 * @buf: a #GstBuffer with data to typefind
 * @prob: location to store the probability of the found caps, or #NULL
 * Tries to find what type of data is contained in the given #GstBuffer.
 * Returns: The #GstCaps corresponding to the data, or #NULL if no type could
 * be found.

GstCaps *
gst_type_find_helper_for_buffer (GstObject              * obj,
                                 GstBuffer              * buf,
                                 GstTypeFindProbability * prob);

Patch coming up.
Comment 1 Tim-Philipp Müller 2006-02-27 11:23:27 UTC
Created attachment 60221 [details] [review]
proposed API addition
Comment 2 Michael Smith 2006-02-27 12:17:15 UTC
After some IRC discussions: this looks good apart from the docs, which are a little short on details. 

API is ok by me if the docs are improved.
Comment 3 Tim-Philipp Müller 2006-02-27 18:19:04 UTC
Created attachment 60248 [details] [review]
updated patch

Updated patch. Same API, but
 - more documentation
 - fix sorting order (actually sort highest rank first, not lowest)
 - don't support peeks with negative offsets (doesn't make sense here)
Comment 4 Tim-Philipp Müller 2006-02-27 19:23:18 UTC
Comitted, including documentation:

2006-02-27  Tim-Philipp Müller  <tim at centricular dot net>

        * docs/libs/gstreamer-libs-docs.sgml:
        * docs/libs/gstreamer-libs-sections.txt:
        * libs/gst/base/gsttypefindhelper.c:
          Add section for typefind helper and add documentation
          for the old and the new function.

2006-02-27  Tim-Philipp Müller  <tim at centricular dot net>

        * libs/gst/base/gsttypefindhelper.c: (buf_helper_find_peek),
        (buf_helper_find_suggest), (type_find_factory_rank_cmp),
        * libs/gst/base/gsttypefindhelper.h:
          New API: gst_type_find_helper_for_buffer() (#332723).