Hi,<br><br><br><div class="gmail_quote">On Wed, Oct 24, 2012 at 6:26 PM, rasnaut <span dir="ltr"><<a href="mailto:rasnaut@gmail.com" target="_blank">rasnaut@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi to All!<br>
I working with gstreamer-1.0 and try use fakesrc for work with audiostream.<br>
For start trying I copy only 0 in buffer (I used MapInfo structure). So, my<br>
code:<br></blockquote><div><br>Have you tried to use audiotestsrc instead of fakesrc ? (you will not need the audiorate element)<br><br><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-audiotestsrc.html">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-audiotestsrc.html</a><br>
<br>Best regards,<br>Tiago Katcipis<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
main()<br>
{<br>
gst_init (NULL,NULL);<br>
loop = g_main_loop_new (NULL, FALSE);<br>
<br>
/* setup pipeline */<br>
pipeline = gst_pipeline_new ("pipeline");<br>
g_assert(pipeline);<br>
fakesrc = gst_element_factory_make ("fakesrc", "source");<br>
g_assert(fakesrc);<br>
flt = gst_element_factory_make ("capsfilter", "flt");<br>
g_assert(flt);<br>
rate = gst_element_factory_make ("audiorate", "rate");<br>
g_assert(rate);<br>
conv = gst_element_factory_make ("audioconvert", "conv");<br>
g_assert(conv);<br>
audiosink = gst_element_factory_make ("alsasink", "asink");<br>
g_assert(videosink);<br>
<br>
/* setup */<br>
g_object_set (G_OBJECT (flt), "caps",<br>
gst_caps_new_simple ("audio/x-raw",<br>
"format",G_TYPE_STRING,"S16LE",<br>
"rate", G_TYPE_INT,16000,<br>
"channels", G_TYPE_INT, 1,<br>
NULL), NULL);<br>
gst_bin_add_many (GST_BIN (pipeline), fakesrc, flt,rate, conv,<br>
audiosink, NULL);<br>
if(!gst_element_link_many (fakesrc, flt, rate, conv, audiosink, NULL))<br>
{<br>
g_error("Link Error\n");<br>
}<br>
<br>
/* setup fake source */<br>
g_object_set (G_OBJECT (fakesrc),<br>
"signal-handoffs", TRUE,<br>
"sizemax", 16000,<br>
"sizetype", 2, NULL);<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>
g_main_loop_unref (loop);<br>
}<br>
<br>
So, when I start my programm apear next error:<br>
GStreamer-CRITICAL **: gst_segment_to_running_time: assertion<br>
`segment->format == format' failed<br>
<br>
When I changed alsasink on fakesink, all work. Maybe it's because my<br>
audiocard is working with another details:<br>
format = SL32_LE<br>
rate = 48000<br>
channels = 2<br>
<br>
I tryed change my details:<br>
g_object_set (G_OBJECT (flt), "caps",<br>
gst_caps_new_simple ("audio/x-raw",<br>
"format",G_TYPE_STRING,"S32LE",<br>
"rate", G_TYPE_INT,48000,<br>
"channels", G_TYPE_INT, 2,<br>
NULL), NULL);<br>
<br>
g_object_set (G_OBJECT (fakesrc),<br>
"signal-handoffs", TRUE,<br>
"sizemax", 48000*2,<br>
"sizetype", 8, NULL);<br>
<br>
but error still stayed.<br>
Anybody know, what I do wrong?<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/fakesrc-for-audio-stream-tp4656701.html" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/fakesrc-for-audio-stream-tp4656701.html</a><br>
Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div><br>