For mp3 it works fine. <br><br>For wav and raw pcm files program never get signal handoff.<br>To play wav file I used dynamic pad and for pcm doesn't need pad.<br><br>Is it possible to play binary data using this approach? If so what would be the decoder elements. <br>
<br>I have looked into appsrc plugin . I ran the example given as part of the plugin. Audio is not coming.<br><br>Thanks,<br><span class="sg">Akbar</span><span></span> <br><br>
<div><span class="gmail_quote">On 7/12/08, <b class="gmail_sendername">Stefan Kost</b> <<a href="mailto:ensonic@hora-obscura.de">ensonic@hora-obscura.de</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">hi,<br>Akbar Basha schrieb:<span class="q"><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Stefan,<br><br>Thanks for the response .<br></blockquote><br></span>Would you please post to the list.
<div><span class="e" id="q_11b16b9620c3efc6_3"><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>I tried the same. But could not produce the result.<br><br>Please find the code.<br><br>static void<br>
cb_handoff (GstElement *fakesrc,<br> GstBuffer *buffer,<br> gpointer user_data)<br>{<br> /* Clip start and end */<br><br> data = (guint8 *) g_malloc (3000);<br> GST_BUFFER_SIZE (buffer) = 3000;<br> GST_BUFFER_DATA (buffer) = GST_BUFFER_MALLOCDATA (buffer) = data;<br>
FILE* fp = fopen("vertigo.mp3","rb");<br> if(fp == NULL)<br> {<br> printf( " File is not opened \n");<br> return;<br> }<br> fread(data,3000,1,fp);<br> fclose(fp);<br> }<br><br>gint<br>
main (gint argc,<br> gchar *argv[])<br>{<br> GstElement *pipeline, *fakesrc, *flt, *conv, *audiosink;<br> GMainLoop *loop;<br><br> /* init GStreamer */<br> gst_init (&argc, &argv);<br> loop = g_main_loop_new (NULL, FALSE);<br>
<br> /* setup pipeline */<br> pipeline = gst_pipeline_new ("pipeline");<br> fakesrc = gst_element_factory_make ("fakesrc", "source");<br> flt = gst_element_factory_make ("capsfilter", "flt");<br>
conv = gst_element_factory_make ("mad", "conv");<br> audiosink = gst_element_factory_make ("alsasink", "audiosink");<br><br> /* setup */<br> g_object_set (G_OBJECT (flt), "caps",<br>
gst_caps_new_simple("audio/x-raw-int",<br> "channels", G_TYPE_INT, 2,<br> "rate", G_TYPE_INT, 32000,<br> "depth", G_TYPE_INT, 16, NULL), NULL);<br>
</blockquote><br></span></div>This is obviously wrong. You load an mp3 and not raw audio data. The capsfilter needs to tell that. But in your case you would not even need one.<span class="q"><br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br> gst_bin_add_many (GST_BIN (pipeline), fakesrc, flt,conv, audiosink, NULL);<br> gst_element_link_many (fakesrc, flt,conv, audiosink, NULL);<br>
<br> /* setup fake source */<br> g_object_set (G_OBJECT (fakesrc),"signal-handoffs", TRUE,NULL);<br><br> g_signal_connect (fakesrc, "handoff", G_CALLBACK (cb_handoff), NULL);<br><br> /* play */<br> gst_element_set_state (pipeline, GST_STATE_PLAYING);<br>
g_main_loop_run (loop);<br><br> /* clean up */<br> gst_element_set_state (pipeline, GST_STATE_NULL);<br> gst_object_unref (GST_OBJECT (pipeline));<br><br> return 0;<br>}<br><br>Even if I set using memset . Audio is not coming.<br>
</blockquote><br></span>What happens?<br><br>Stefan<br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><span class="q"><br>how to proceed in the case pad is required i.e for wav files.<br><br>Regards,<br>Akbar<br>
<br></span>
<div><span class="e" id="q_11b16b9620c3efc6_8">On Wed, Jul 9, 2008 at 11:53 PM, Stefan Kost <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:ensonic@hora-obscura.de" target="_blank">ensonic@hora-obscura.de</a> <mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:ensonic@hora-obscura.de" target="_blank">ensonic@hora-obscura.de</a>>> wrote:<br>
<br> Akbar Basha schrieb:<br><br> Hi,<br><br> I would like to play the buffer , which is filled with any audio<br> file data.<br> Does gstreamer provides any mechanism to play.<br><br><br> if you have the whole bufer in memory, use a fakesrc with<br>
signal-handoffs=TRUE and connect to handoff signal. In the handoff<br> signal you put the pointer to your data into the GST_BUFFER_DATA,<br> set the correct GST_BUFFER_SIZE and clear GST_BUFFER_MALLOC_DATA (if<br> it was previously set g_free() the previous content).<br>
<br> You should used a capsfilter after fakesrc and set the format of<br> your sample on the capsfilter caps.<br><br> Its sort of a hack, but works fine.<br><br> Stefan<br><br><br> Thanks in advance.<br><br>
Regards,<br> Akbar<br><br><br> ------------------------------------------------------------------------<br><br> -------------------------------------------------------------------------<br> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!<br>
Studies have shown that voting for your favorite open source<br> project,<br> along with a healthy diet, reduces your potential for chronic<br> lameness<br> and boredom. Vote Now at <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.sourceforge.net/community/cca08" target="_blank">http://www.sourceforge.net/community/cca08</a><br>
<br><br> ------------------------------------------------------------------------<br><br> _______________________________________________<br> gstreamer-devel mailing list<br><br> <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank">gstreamer-devel@lists.sourceforge.net</a><br>
</span></div> <mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank">gstreamer-devel@lists.sourceforge.net</a>><span class="q"><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br><br>
<br><br></span></blockquote><br></blockquote></div><br>