Extracting MIME type of compressed audio stream when using playbin
Stefan Sauer
ensonic at hora-obscura.de
Wed Feb 8 11:09:14 PST 2012
On 02/08/2012 01:03 AM, Dinesh Iyer wrote:
> Hello all,
> I am developing a cross platform application to read data and metadata
> from audio files. On Linux, I am using Gstreamer. I am using playbin2
> to decode the data and assigning the "audio-sink" of the playbin to an
> appsink from which I retrieve the data. Is there a way for me to
> extract the mime type of the compressed audio stream before it is
> decoded. The reason I need this is that I would like to provide a
> consistent naming for the actual audio format across all formats. On
> Windows using Media Foundation, I can key off the media subtype. If I
> had access to the mime type of the compressed audio, I could key off
> this mime-type. An example code would look like:
>
> if( strstr(mimetype, "x-vorbis") != NULL )
> return "Vorbis";
>
> if( strstr(mimetype, "wma") != NULL )
> return "Windows Media Audio";
>
> The only way I see now is to read the GST_TAG_AUDIO_CODEC and search
> for string such as MP3, AAC which I do not feel is very robust.
GStreamer does not really deal with mime types. The internally used
media types are somewhat similar though. If you want mime types glib can
give you those for files (xdg-mime utils too). Otherwise you could
probably locate the typefind element inside playbin2 and listen to the
"have-type" signal. In the signal handler you will receive the caps you
are looking for.
Stefan
>
> Any help would be appreciated.
>
> Regards,
> Dinesh
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20120208/209542be/attachment.htm>
More information about the gstreamer-devel
mailing list