[gst-devel] Wavparse - getting to blockalign, format, etc.

Stefan Kost ensonic at hora-obscura.de
Sat Jan 20 10:29:44 CET 2007


hi,


Edward Averill wrote:
> Thanks ensonic, I have it "kind of" working now...
> 
> In my set_caps() function, I'm doing this:
> 
> ------------ start code -----------
> 
>   GstpalmADPCM *filter;
I would write this as GstPalmADPCM

>   GstStructure *ins;
> 
>   filter = GST_PALMADPCM (gst_pad_get_parent (pad));
and this as GST_PALM_ADPCM
> 
>   ins = gst_caps_get_structure(caps, 0);
> 
>   if (gst_structure_get_int (ins, "channels", &filter->channels)) {
> 	printf("channels: %d\n", filter->channels);
>   }
> 
>   if (gst_structure_get_int (ins, "rate", &filter->rate)) {
> 	printf("rate: %d\n", filter->rate);
>   }
> 
>   if (gst_structure_get_int (ins, "format", &filter->format)) {
> 	printf("format: %d\n", filter->format);
>   }
without checking, I belive this needs to be gst_structure_get_fourcc(...), you
can print it like this:
printf ("format: %" GST_FOURCC_FORMAT "\n", GST_FOURCC_ARGS (filter->format));

Stefan

> ------------------- end code -------------------
> 
> I see rate and channels, but no format - even though I see wavparse print 
> the information out!  I need the format, among other bits of info.. and from 
> poking around in gstwavparse.c it looks like it's there.. somewhere.. but 
> I'm not sure the above mechanism is proper (or maybe I just am not using the 
> Right Names(tm) for things)..
> 
> Any suggestions, recommendations, or examples I can pilfer from?
> 
> All info appreciated! :-)
> 
> ...ed..
> 
>> Message: 3
>> Date: Thu, 18 Jan 2007 09:03:54 +0100
>> From: "ensonic" <ensonic at hora-obscura.de>
>> Subject: Re: [gst-devel] Wavparse to rip apart compressed audio?
>> 	Newbie Q.
>> To: " Edward Averill " <edaverill at hotmail.com>
>> Cc: gstreamer-devel at lists.sourceforge.net
>> Message-ID: <5ea9f03ca39308b15e30f7ab307f807e at hora-obscura.de>
>> Content-Type: text/plain; charset=us-ascii
>>
>> hi,
>>
>> On 1:02:09 am 18/01/2007 "Edward Averill" <edaverill at hotmail.com> wrote:
>>> Ok, I have some RIFF-format files I need to get the fmt info from.
>>> The data inside is compressed, but I have an element that will handle
>>> that...
>>>
>>> What I'm wondering is: is there any reason I can't use the data
>>> output from the wavparse element to feed my decoder?  And is there an
>>> example of how to get the channels/bit depth/etc. information out of
>>> the wavparse element, or will I need to write my own wavparse-like
>>> library that will give me access to that information? I see that I
>>> can use the gstriff library to help with this, if needed.
>>>
>> wavparse acts as a demuxer. it parses the riff-wav container and emits data
>> packets. the meta data of the stream is parts of the caps. additional
>> metadata might be send as tags.
>>
>> what format is it that you need to decode? if you run 'gst-inspect
>> wavparse' you see that it already knows about lot of formats (like
>> audio/ms-gsm, audio/x-mulaw, audio/x-adpcm, ...). If your format is not
>> among this, we need to add a fourcc mapping.
>>
>> Is the decoder you want to use already a gstreamer element? Once the output
>> caps are fine, you should be able to plug it in.
>>
>> Stefan
>>
>>> Sorry if this is a newbie type question, my last element was
>>> standalone and I'm trying to Use What's There this time rather than
>>> Re-Invent The Wheel.
>>>
>>> ...ed..
> 
> 
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel





More information about the gstreamer-devel mailing list