APPSRC buffers caps

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

APPSRC buffers caps

cristian
Hello all,

I have as reference the appsrc example from gstreamer demo app. The demo feeds the pipeline with chunks extracted from one media file (mapping the file and then use an offset to feed chunks of data to the pipeline)
My work is to feed the pipeline from chunks of data (PCM samples) coming from a device driver to user space. I am able to use the data to write into a wav file and then listen.
I am not an expert , but if I get only data how does gstreamer elements know what caps to use?
So far I used :
- set caps to appsrc element : g_object_set(G_OBJECT(m_datasource), "caps", bufcaps, NULL);
- set every buffer , a hard coded caps : gst_buffer_set caps(buufer, mycaps);
I am working over a week on this I am running out of ideas.
Any help , I appreciate greatly .

 
Reply | Threaded
Open this post in threaded view
|

Re: APPSRC buffers caps

Wim Taymans
On 07/15/2011 04:24 PM, cristian wrote:

> Hello all,
>
> I have as reference the appsrc example from gstreamer demo app. The demo
> feeds the pipeline with chunks extracted from one media file (mapping the
> file and then use an offset to feed chunks of data to the pipeline)
> My work is to feed the pipeline from chunks of data (PCM samples) coming
> from a device driver to user space. I am able to use the data to write into
> a wav file and then listen.
> I am not an expert , but if I get only data how does gstreamer elements know
> what caps to use?
You either set the caps property on appsrc or set caps on each buffer
before you push
it into appsrc, setting the caps on appsrc is recommended.

Wim

> So far I used :
> - set caps to appsrc element : g_object_set(G_OBJECT(m_datasource), "caps",
> bufcaps, NULL);
> - set every buffer , a hard coded caps : gst_buffer_set caps(buufer,
> mycaps);
> I am working over a week on this I am running out of ideas.
> Any help , I appreciate greatly .
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/APPSRC-buffers-caps-tp3670075p3670075.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: APPSRC buffers caps

cristian
Set the caps on appsrc and the src pad from decodebin are :
Caps new pad decoded = audio/ms-gsm, rate=(int)[ 1, 96000 ], channels=(int)[ 1, 2 ]; audio/mpeg, mpegversion=(int)1, layer=(int)3, rate=(int)[ 8000, 48000 ], channels=(int)[ 1, 2 ]; audio/mpeg, mpegversion=(int)1, layer=(int)2, rate=(int)[ 16000, 48000 ], channels=(int)[ 1, 2 ]; audio/x-raw-int, endianness=(int)1234, signed=(boolean){ true, false }, width=(int){ 8, 16, 24, 32 }, depth=(int)[ 1, 32 ], rate=(int)[ 1000, 192000 ], channels=(int)[ 1, 8 ]; audio/x-vorbis, rate=(int)[ 1000, 192000 ], channels=(int)[ 1, 2 ]; audio/x-ac3, rate=(int)[ 1000, 96000 ], channels=(int)[ 1, 6 ]; audio/x-dts; audio/mpeg, mpegversion=(int)4, rate=(int)[ 1000, 96000 ], channels=(int)[ 1, 8 ]; audio/x-alaw, rate=(int)[ 1000, 48000 ], channels=(int)[ 1, 2 ]; audio/x-mulaw, rate=(int)[ 1000, 48000 ], channels=(int)[ 1, 2 ]; audio/x-wms, bitrate=(int)[ 0, 2147483647 ], rate=(int)[ 1000, 96000 ], channels=(int)[ 1, 2 ], block_align=(int)[ 1, 2147483647 ]; audio/x-adpcm, layout=(string)microsoft, rate=(int)[ 1000, 96000 ], channels=(int)[ 1, 2 ], block_align=(int)[ 1, 2147483647 ]; audio/x-adpcm, layout=(string)dvi, rate=(int)[ 1000, 48000 ], channels=(int)[ 1, 2 ], block_align=(int)[ 1, 2147483647 ]; audio/x-truespeech, rate=(int)8000, channels=(int)[ 1, 2 ]; audio/x-wma, wmaversion=(int)1, bitrate=(int)[ 0, 2147483647 ], rate=(int)[ 1000, 96000 ], channels=(int)[ 1, 6 ], block_align=(int)[ 1, 2147483647 ]; audio/x-wma, wmaversion=(int)2, bitrate=(int)[ 0, 2147483647 ], rate=(int)[ 1000, 96000 ], channels=(int)[ 1, 6 ], block_align=(int)[ 1, 2147483647 ]; audio/x-wma, wmaversion=(int)3, bitrate=(int)[ 0, 2147483647 ], rate=(int)[ 1000, 96000 ], channels=(int)[ 1, 6 ], block_align=(int)[ 1, 2147483647 ]; audio/x-vnd.sony.atrac3, rate=(int)[ 1000, 96000 ], channels=(int)[ 1, 2 ]; audio/x-raw-float, endianness=(int)1234, width=(int){ 32, 64 }, rate=(int)[ 1000, 192000 ], channels=(int)[ 1, 8 ]; audio/x-voxware, voxwaretype=(int)117, rate=(int)[ 1000, 96000 ], channels=(int)[ 1, 2 ]; audio/x-adpcm, layout=(string)dk4, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]; audio/x-adpcm, layout=(string)dk3, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]; audio/x-adpcm, layout=(string)dvi, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 2 ]; audio/AMR, rate=(int)8000, channels=(int)1; audio/AMR-WB, rate=(int)16000, channels=(int)1; audio/x-siren; application/x-ogg-avi

Not so good I guess!
Reply | Threaded
Open this post in threaded view
|

Re: APPSRC buffers caps

cristian
My pipeline is like this :
appssrc "caps = blabla" ! decodebin2 ! alsasink

where caps : GstCaps *bufcaps;
  bufcaps = gst_caps_new_simple("audio/x-wav",
                                "endianness", G_TYPE_INT, 1234,
                                "channels", G_TYPE_INT, 2,
                                "width", G_TYPE_INT, 16,
                                "depth", G_TYPE_INT , 16,
                                "signed", G_TYPE_BOOLEAN, TRUE,
                                "rate", G_TYPE_INT , 44100, NULL);
And when the new-decoded-pad callback from decodebin2, I get those multiple caps on the pad found. Don't know why!!!