[gst-devel] typefind's have-type signal

Sebastian Dröge sebastian.droege at collabora.co.uk
Sun Aug 2 12:48:04 CEST 2009


Am Sonntag, den 02.08.2009, 12:34 +0200 schrieb Murray Cumming:
> The typefind element can detect the mime-type of a stream. This is
> provided by its have-type signal:
> http://gstreamer.freedesktop.org/data/doc/gstreamer/stable/gstreamer-plugins/html/gstreamer-plugins-typefind.html#GstTypeFindElement-have-type
> 
> That signal provides a caps parameter. By looking at existing code, I
> found that the mime-type string is in caps.get_structure(0).get_name()
> (forgive the pseudo code).
> 
> In my brief tests I have not found caps to ever have more than 1
> GstStructure, and I have not found the GstStructure to ever have any
> id/value fields.
> 
> So, should the have-type signal just provide a const gchar* mime-type
> parameter, or should I sometimes expect other information in the caps?
> If so, I'd like to document that in the API reference.

It's not a mimetype but caps that are detected by typefind. Typefind
will only ever report caps with a single structure but this single
structure will often contain more information than just the structure
name (what you call mimetype). For example the structure could be

audio/mpeg, mpegversion=(int)1, layer=(int)3

Just try it on an MP3 file without ID3/APE tags or
gst-launch-0.10 -v filesrc location=test.mp3 ! id3demux ! typefind ! ...

The have-type signal should as such always provide a GstCaps *
parameter, a string would loose information.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090802/1fc9482d/attachment.pgp>


More information about the gstreamer-devel mailing list