Hi,<br><br> Try this in your callback function:<br> myInfo = gst_caps_to_string(caps);<br> g_print(myInfo);<br><br>You will see something like that for a video pipeline in your console:<br> video/x-raw-rgb, bpp=(int)16, depth=(int)16, width=(int)640, height=(int)464, framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)1/1, red_mask=(int)63488, green_mask=(int)2016, blue_mask=(int)31, endianness=(int)1234
<br><br>hope this help you,<br>Erwan Masson<br><br><br><br><div><span class="gmail_quote">2007/4/13, Vincent Torri <<a href="mailto:vtorri@univ-evry.fr">vtorri@univ-evry.fr</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Hey,<br><br>I wrote a prog that extracts (some of ?) those data from any<br>multimedia file (audio or video) 2 years ago. I've attached it.<br><br>Basically:<br>1) I build a basic pipeline : filesrc ! decodebin<br>
2) I set the pipeline to the PAUSED state.<br>3) Each time a stream is found, I get its properties.<br><br>The program has 2 parts :<br>1) a lib one, that stores the properties<br>2) a binary one that uses the lib part. I've made a CLI one (no gui) and 3
<br>gui, one with gtk. You'll have to disable the other gui to compile the<br>progs, iirc (or maybe they'll not be built as I think that you don't have<br>those toolkits. I can't remember).<br><br>That means that you can even use directly the lib part and integrate it to
<br>your prog if you find it usefull. There is a GNU Copying licence, but I<br>think that it has been automatically created. I didn't intend to use the<br>GPL.<br><br>Or else, you can just look at how I wrote it and get only the audio part
<br>(as the lib extracts also the video informations)<br><br>Example of output with the CLI:<br><br>Filename....................: ********.mp3<br>Size........................: 6,2 MB (or 6305,8 KB, or 6457150 B)<br>Container...................: no informations
<br><br>Streams<br> |<br> +-Audio stream #0<br> +-Mimetype..............: audio/mpeg<br> +-Decoder info<br> | |<br> | +-Name...............: mad mp3 decoder<br> | +-Description........: Uses mad code to decode mp3 streams
<br> | +-Class..............: Codec/Decoder/Audio<br> | +-Author.............: Wim Taymans <<a href="mailto:wim@fluendo.com">wim@fluendo.com</a>><br> |<br> +-Duration..............: 0:04:29.31916666
<br> +-Sample rate...........: 44100<br> +-Sample count..........: 11864307<br> +-Channels..............: 2<br> +-Endianess.............: 0<br> +-Width.................: 32<br> +-Depth.................: 32
<br> +-Signed................: yes<br><br>I hope this helps.<br><br>Regards,<br><br>Vincent Torri<br><br>On Fri, 13 Apr 2007, Mario Torre wrote:<br><br>> Hello!<br>><br>> My project for the Google Summer Of Code was accepted as part of the GNU
<br>> Project:<br>> <a href="http://code.google.com/soc/gnu/appinfo.html?csaid=FDB6DFFB07FE351C">http://code.google.com/soc/gnu/appinfo.html?csaid=FDB6DFFB07FE351C</a><br>><br>> As I said in an earlier mail, my task is to hook GStreamer into GNU
<br>> Classpath.<br>><br>> Now, I've found a problem that is blocking me from a couple days and is<br>> taking me away all my sleep :)<br>><br>> I need to write a (Java) class that displays this kind of information
<br>> about an audio file:<br>><br>> * Encoding type<br>> * Sample rate<br>> * Sample size in bits<br>> * Channels<br>> * Frame size<br>> * Frame rate<br>> * Endiannes<br>> * Header size<br>>
<br>> Of course, I could just add a reader for any given kind of audio file,<br>> but then this is pointless to have a gstreamer hook that can recognize<br>> (almost) any type given the right plugin.<br>><br>> My problem is that I can't find an example of how to parse a file and
<br>> extract this data (I need to do that in C, not Java). The program should<br>> return as soon as all these info are retrieved (if possible). I've see<br>> the Discover class from the python bindings (which seems to be what I'm
<br>> looking for), but I hate to admit that I was unable to recreate its<br>> behaviour, though I think I'm on the correct way. What I'm doing is this<br>> (to see what capabilities an element has), I get a typefind element and
<br>> attach a signal handler to it, but this seems to be not enough, and all<br>> the output I get is:<br>><br>> -----<br>> application/ogg<br>> print_pad<br>> size of caps: 1<br>> fields in structure: 0
<br>> -----<br>><br>> [...]<br>> g_signal_connect (G_OBJECT (typefind), "have-type",<br>> G_CALLBACK (have_type_callback), loop);<br>> [...]<br>><br>> gboolean have_type_callback(GstElement *typefind,
<br>> guint probability,<br>> const GstCaps *caps,<br>> gpointer data)<br>> {<br>> [...]<br>> GstStructure *st = NULL;<br>
> int size = 0;<br>><br>> g_fprintf (stderr, "print_pad\n");<br>><br>> size = gst_caps_get_size (caps);<br>> g_fprintf (stderr, "size of caps: %d\n", size);<br>><br>> for (int j = 0; j < size; j++) {
<br>> st = gst_caps_get_structure (caps, j);<br>> if (st != NULL) {<br>> size = gst_structure_n_fields (st);<br>> g_fprintf (stderr, "fields in structure: %d\n", size);<br>><br>> for (int i = 0; i < size; i++) {
<br>> g_fprintf (stderr, "field name: %s\n",<br>> gst_structure_nth_field_name(st, i));<br>> }<br>> }<br>> }<br>> [...]<br>> }<br>><br>> I'm a bit new to all that, so forgive me if I'm doing some incredibly
<br>> stupid mistake :)<br>><br>> Thanks for all the help,<br>> Mario<br>> --<br>> Lima Software - <a href="http://www.limasoftware.net/">http://www.limasoftware.net/</a><br>> GNU Classpath Developer -
<a href="http://www.classpath.org/">http://www.classpath.org/</a><br>> Jabber: <a href="mailto:neugens@jabber.org">neugens@jabber.org</a> - Profile: <a href="http://www.gtalkprofile.com/profile/9661.html">http://www.gtalkprofile.com/profile/9661.html
</a><br>> pgp key: <a href="http://subkeys.pgp.net/">http://subkeys.pgp.net/</a><br>> PGP Key ID: 80F240CF<br>> Fingerprint: BA39 9666 94EC 8B73 27FA FC7C 4086 63E3 80F2 40CF<br>><br>> Please, support open standards:
<br>> <a href="http://opendocumentfellowship.org/petition/">http://opendocumentfellowship.org/petition/</a><br>> <a href="http://www.nosoftwarepatents.com/">http://www.nosoftwarepatents.com/</a><br>><br>><br>> -------------------------------------------------------------------------
<br>> Take Surveys. Earn Cash. Influence the Future of IT<br>> Join SourceForge.net's Techsay panel and you'll get the chance to share your<br>> opinions on IT & business topics through brief surveys-and earn cash
<br>> <a href="http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV">http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV</a><br>> _______________________________________________
<br>> gstreamer-devel mailing list<br>> <a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>> <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel">
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>><br>> --<br>> Ce message a été vérifié par MailScanner<br>> pour des virus ou des polluriels et rien de<br>> suspect n'a été trouvé.<br>
> Message délivré par le serveur de messagerie de l'Université d'Evry.<br>><br>><br>-------------------------------------------------------------------------<br>Take Surveys. Earn Cash. Influence the Future of IT
<br>Join SourceForge.net's Techsay panel and you'll get the chance to share your<br>opinions on IT & business topics through brief surveys-and earn cash<br><a href="http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV">
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV</a><br>_______________________________________________<br>gstreamer-devel mailing list<br><a href="mailto:gstreamer-devel@lists.sourceforge.net">
gstreamer-devel@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br><br><br></blockquote></div><br>