GNOME Bugzilla – Bug 332723
New API: gst_type_find_helper_for_buffer
Last modified: 2006-02-27 19:23:18 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.
Created attachment 60221 [details] [review] proposed API addition
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.
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)
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), (gst_type_find_helper_for_buffer): * libs/gst/base/gsttypefindhelper.h: New API: gst_type_find_helper_for_buffer() (#332723).