[gst-devel] setting packet time on playbin
René Stadler
mail at renestadler.de
Mon Oct 8 14:48:48 CEST 2007
Am Samstag, den 06.10.2007, 15:49 +0200 schrieb Alfred E. Heggestad:
> Hi
>
> I am using the 'playbin' source with my own fakesink callback function
> to get the raw pcm data, which works fine.
>
>
> static void handoff_handler(GstFakeSink *fakesink, GstBuffer *buffer,
> GstPad *pad, gpointer user_data)
> {
> /* ... */
> }
>
>
> void init(void)
> {
> /* Override audio-sink handoff handler */
> g_object_set(G_OBJECT(g->sink), "signal-handoffs", TRUE, NULL);
> g_signal_connect (g->sink, "handoff", G_CALLBACK (handoff_handler), g);
> g_object_set(G_OBJECT(g->source), "audio-sink", g->sink, NULL);
> }
>
>
>
> current the PCM data on the handoff_handler is 44.1kHz/2ch, which gives
> 2304 samples each time the function is called. that corresponds to a packet
> time of ~38 milliseconds.
>
>
> my question is basically; is it possible to set the packet time so my
> callback function is called with a packet time of e.g. 20 milliseconds
> (i.e. 50 times per second). ?
>
>
> Thanks for this great software
>
>
> /alfred
In general, this is not possible. If you are reading from a raw audio
source that is derived from GstBaseSrc, you can set the "blocksize"
property however.
You can also use GstAdapter in your app. You would feed all buffers
into the adapter and then read from there in any size you desire.
--
Regards,
René Stadler
More information about the gstreamer-devel
mailing list