typefind's have-type signal

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

typefind's have-type signal

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.

--
[hidden email]
www.murrayc.com
www.openismus.com


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: typefind's have-type signal

Sebastian Dröge-7
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.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

signature.asc (204 bytes) Download Attachment