<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 02/08/2012 01:03 AM, Dinesh Iyer wrote:
<blockquote
cite="mid:CAHcSuBqJnx+7cU1n1L1F6RHWdpF76bufDAzW-KGxoQAPO-2HMA@mail.gmail.com"
type="cite">Hello all,<br>
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:<br>
<br>
<span style="font-family: courier new,monospace;">if(
strstr(mimetype, "x-vorbis") != NULL )</span><br
style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> return
"Vorbis";</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">if(
strstr(mimetype, "wma") != NULL )</span><br style="font-family:
courier new,monospace;">
<span style="font-family: courier new,monospace;"> return "Windows
Media Audio";</span><br>
<br>
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.<br>
</blockquote>
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.<br>
<br>
Stefan<br>
<br>
<blockquote
cite="mid:CAHcSuBqJnx+7cU1n1L1F6RHWdpF76bufDAzW-KGxoQAPO-2HMA@mail.gmail.com"
type="cite"><br>
Any help would be appreciated.<br>
<br>
Regards,<br>
Dinesh<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
gstreamer-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
</blockquote>
<br>
</body>
</html>