<div>I think you can&#39;t simply put any mimetype in the caps , it must be some valid mimetype . </div>
<div> </div>
<div>Please go through this link    <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/section-types-definitions.html">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/section-types-definitions.html</a> <br>
<br></div>
<div class="gmail_quote">On Tue, May 18, 2010 at 4:01 PM, Hunterwood <span dir="ltr">&lt;<a href="mailto:markus.jagerskogh@imentum.se">markus.jagerskogh@imentum.se</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote"><br>Hi,<br><br>I have tried several different non-existing types: audio/x-test, audio/xyz,<br>audio/x-xyz, audio/x-qwertyuiop, audio/x-test, ...<br>
<br>Since my encoder is passing data to my decoder, I thought that the only<br>imortant thing was that they have the same caps to make it work (when I&#39;m<br>finished, I want them to use a currently non-existing type), but it doesn&#39;t<br>
work.<br>gst-inspect shows the same type for the source of the encoder and the sink<br>of the decoder, but when trying with gst-launch, it doesn&#39;t work:<br><br>C:\gstreamer\bin&gt;gst-launch-0.10.exe audiotestsrc ! gtestenc ! gtestdec !<br>
audioresample ! autoaudiosink<br>Setting pipeline to PAUSED ...<br>Pipeline is PREROLLING ...<br>ERROR: from element /GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0:<br>Internal data flow error.<br>Additional debug info:<br>
..\Source\gstreamer\libs\gst\base\gstbasesrc.c(2378): gst_base_src_loop ():<br>/GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0:<br>streaming task paused, reason not-negotiated (-4)<br>ERROR: pipeline doesn&#39;t want to preroll.<br>
Setting pipeline to NULL ...<br>Freeing pipeline ...<br>C:\gstreamer\bin&gt;<br><br>Since I couldn&#39;t make it work with non-existing types i tried several<br>different existing types, but the only types that work are ANY and<br>
audio/x-raw-int:<br><br>C:\gstreamer\bin&gt;gst-launch-0.10.exe audiotestsrc ! gtestenc ! gtestdec !<br>audioresample ! autoaudiosink<br>Setting pipeline to PAUSED ...<br>Pipeline is PREROLLING ...<br>Pipeline is PREROLLED ...<br>
Setting pipeline to PLAYING ...<br>New clock: GstAudioSinkClock<br>^C<br>C:\gstreamer\bin&gt;<br><br>To isolate the problem with the caps, the code just passes on the incomming<br>buffer (just as the gst-template, which I used as base), and the<br>
interresting parts of the encoder looks like this (I have omited<br>gst_gtestenc_class_init and parts of gst_gtestenc_base_init bellow):<br><br>static GstStaticPadTemplate gtest_enc_sink_factory = GST_STATIC_PAD_TEMPLATE<br>

<div class="im">(&quot;sink&quot;,<br>   GST_PAD_SINK,<br>   GST_PAD_ALWAYS,<br></div>   GST_STATIC_CAPS (&quot;audio/x-raw-int, &quot;<br>       &quot;rate = (int) { 48000 }, &quot;<br>       &quot;channels = (int) { 1 }, &quot;<br>
       &quot;endianness = (int) BYTE_ORDER, &quot;<br>       &quot;width = (int) 16, &quot; &quot;depth = (int) 16, &quot; &quot;signed = (boolean) True&quot;)<br>   );<br>
<div class="im"><br>static GstStaticPadTemplate gtest_enc_src_factory = GST_STATIC_PAD_TEMPLATE<br>(&quot;src&quot;,<br>   GST_PAD_SRC,<br>   GST_PAD_ALWAYS,<br></div>   GST_STATIC_CAPS (&quot;audio/x-test&quot;)<br>   );<br>
<br>GST_BOILERPLATE (Gstgtestenc, gst_gtestenc, GstElement, GST_TYPE_ELEMENT);<br><br>static void gst_gtestenc_base_init (gpointer gclass)<br>{<br> GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);<br><br>// ...<br>
<br> gst_element_class_add_pad_template (element_class,<br>     gst_static_pad_template_get (&amp;amp;gtest_enc_src_factory));<br> gst_element_class_add_pad_template (element_class,<br>     gst_static_pad_template_get (&amp;amp;gtest_enc_sink_factory));<br>
}<br><br>static void gst_gtestenc_init (Gstgtestenc * filter,<br>   GstgtestencClass * gclass)<br>{<br> filter-&gt;sinkpad = gst_pad_new_from_static_template<br>(&amp;amp;gtest_enc_sink_factory, &quot;sink&quot;);<br> gst_pad_set_chain_function (filter-&gt;sinkpad,<br>
                             GST_DEBUG_FUNCPTR(gst_gtestenc_chain));<br><br> filter-&gt;srcpad = gst_pad_new_from_static_template<br>(&amp;amp;gtest_enc_src_factory, &quot;src&quot;);<br> gst_element_add_pad (GST_ELEMENT (filter), filter-&gt;sinkpad);<br>
 gst_element_add_pad (GST_ELEMENT (filter), filter-&gt;srcpad);<br> gst_pad_use_fixed_caps (filter-&gt;sinkpad);<br> gst_pad_use_fixed_caps (filter-&gt;srcpad);<br>}<br><br>static GstFlowReturn gst_gtestenc_chain (GstPad * pad, GstBuffer * buf)<br>
{<br> Gstgtestenc *filter;<br><br> filter = GST_GtestENC (GST_OBJECT_PARENT (pad));<br><br> /* just push out the incoming buffer without touching it */<br> return gst_pad_push (filter-&gt;srcpad, buf);<br>}<br><br><br>The code in the decoder is basicly the same - pass on the incomming data.<br>
The main difference at the moment is the caps definitions:<br>
<div class="im"><br><br>static GstStaticPadTemplate gtest_dec_sink_factory = GST_STATIC_PAD_TEMPLATE<br>(&quot;sink&quot;,<br>   GST_PAD_SINK,<br>   GST_PAD_ALWAYS,<br></div>   GST_STATIC_CAPS (&quot;audio/x-test&quot;)<br>
   );<br><br>static GstStaticPadTemplate gtest_dec_src_factory = GST_STATIC_PAD_TEMPLATE<br>
<div class="im">(&quot;src&quot;,<br>   GST_PAD_SRC,<br>   GST_PAD_ALWAYS,<br></div>   GST_STATIC_CAPS (&quot;audio/x-raw-int, &quot;<br>       &quot;rate = (int) { 48000 }, &quot;<br>               &quot;channels = (int) { 1 }, &quot;<br>
       &quot;endianness = (int) BYTE_ORDER, &quot;<br>       &quot;width = (int) 16, &quot; &quot;depth = (int) 16, &quot; &quot;signed = (boolean) True&quot;)<br>   );<br><br><br><br>What am I doing wrong?<br>Why is it working with audio/x-raw-int, but not with audio/x-test?<br>
<br>Regards,<br> Markus<br><font color="#888888">--<br>View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/Caps-problem-when-writing-encoder-decoder-tp2219436p2221067.html" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/Caps-problem-when-writing-encoder-decoder-tp2219436p2221067.html</a><br>
</font>
<div>
<div></div>
<div class="h5">Sent from the GStreamer-devel mailing list archive at Nabble.com.<br><br>------------------------------------------------------------------------------<br><br>_______________________________________________<br>
gstreamer-devel mailing list<br><a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br><br>Sudarshan Bisht<br>