Extracting MIME type of compressed audio stream when using playbin

Dinesh Iyer dsi.maillist at gmail.com
Tue Feb 7 16:03:49 PST 2012


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.

Any help would be appreciated.

Regards,
Dinesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20120207/0c9538df/attachment.htm>


More information about the gstreamer-devel mailing list