答复: Extracting MIME type of compressed audio stream when using playbin

尹小彪(嵌入式软件事业部) yinxb at neusoft.com
Tue Feb 7 17:02:10 PST 2012


In Unix-like system you can use Tracker.

Im my project(QT) befor,I use tracker to get the mimetype of media.

________________________________
发件人: gstreamer-devel-bounces+yinxb=neusoft.com at lists.freedesktop.org [gstreamer-devel-bounces+yinxb=neusoft.com at lists.freedesktop.org] 代表 Dinesh Iyer [dsi.maillist at gmail.com]
发送时间: 2012年2月8日 8:03
收件人: gstreamer-devel at lists.freedesktop.org
主题: Extracting MIME type of compressed audio stream when using playbin

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
---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---------------------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20120208/4af13344/attachment.html>


More information about the gstreamer-devel mailing list