<div dir="ltr"><div>Ok,  cool I try that.</div><div><br></div><div>btw:  is there a tool that can be used to display what's going on in a pipe created with gst-launch?  (what I mean is, that shows the  pipeline and branches).  Is there 'something'  that would optimize a pipeline?</div><div><br></div><div>thanks,</div><div><br></div><div>Ron<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 16, 2019 at 7:15 AM Nicolas Dufresne <<a href="mailto:nicolas@ndufresne.ca">nicolas@ndufresne.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 15 mai 2019 22 h 40, R C <<a href="mailto:cjvijf@gmail.com" target="_blank">cjvijf@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  

    
  
  <div bgcolor="#FFFFFF">
    <p><tt><font size="+1">Hello,</font></tt></p>
    <p><tt><font size="+1">I am trying to get a little more familiar
          with gstreamer, and thought I'd do some</font></tt></p>
    <p><tt><font size="+1">of the "basic" programming tutorial examples.</font></tt></p>
    <p><tt><font size="+1"><br>
        </font></tt></p>
    <p><tt><font size="+1">I </font></tt>did play with the 3rd example:</p>
    <p><a class="gmail-m_1120761112080619405m_-7617182996987925846moz-txt-link-freetext" href="https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c" rel="noreferrer" target="_blank">https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c</a></p>
    <p><br>
    </p>
    <p>If I copy the example, and compile it, it works, no surprise
      there. But when I change it and do the "exercise", I get some
      weirdness.<br>
    </p>
    <p><br>
    </p>
    <p>What I noticed is (well I probably missed something)...  but the
      function call:</p>
    <pre class="gmail-m_1120761112080619405m_-7617182996987925846language-c"><code class="gmail-m_1120761112080619405m_-7617182996987925846language-c">data<span class="gmail-m_1120761112080619405m_-7617182996987925846token gmail-m_1120761112080619405m_-7617182996987925846punctuation">.</span>sink <span class="gmail-m_1120761112080619405m_-7617182996987925846token gmail-m_1120761112080619405m_-7617182996987925846operator">=</span> gst_element_factory_make <span class="gmail-m_1120761112080619405m_-7617182996987925846token gmail-m_1120761112080619405m_-7617182996987925846punctuation">(</span><span class="gmail-m_1120761112080619405m_-7617182996987925846token gmail-m_1120761112080619405m_-7617182996987925846string">"autoaudiosink"</span><span class="gmail-m_1120761112080619405m_-7617182996987925846token gmail-m_1120761112080619405m_-7617182996987925846punctuation">,</span> <span class="gmail-m_1120761112080619405m_-7617182996987925846token gmail-m_1120761112080619405m_-7617182996987925846string">"sink"</span><span class="gmail-m_1120761112080619405m_-7617182996987925846token gmail-m_1120761112080619405m_-7617182996987925846punctuation">)</span><span class="gmail-m_1120761112080619405m_-7617182996987925846token gmail-m_1120761112080619405m_-7617182996987925846punctuation">;

</span>According to the docs, the 2nd parameter can be 'whatever' you want to name it.
Since I wanted to do the video part too, I figure I should change the name to
"audio-something", and changed the second function call to:

</code><code class="gmail-m_1120761112080619405m_-7617182996987925846language-c">  data.convert = gst_element_factory_make ("audioconvert", "convert");   (original)
  data.sink = gst_element_factory_make ("autoaudiosink", "audiosink");   (changed name)<span class="gmail-m_1120761112080619405m_-7617182996987925846token gmail-m_1120761112080619405m_-7617182996987925846punctuation"></span></code>

of course in the even handler (pad_added_handler), the name needs to be changed in to:

<code class="gmail-m_1120761112080619405m_-7617182996987925846language-c">GstPad *sink_pad = gst_element_get_static_pad (data->convert, "audiosink");<span class="gmail-m_1120761112080619405m_-7617182996987925846token gmail-m_1120761112080619405m_-7617182996987925846punctuation">

Browsing through the code, that should be it, BUT it seems "</span></code><code class="gmail-m_1120761112080619405m_-7617182996987925846language-c">sink_pad</code>"<code class="gmail-m_1120761112080619405m_-7617182996987925846language-c"><span class="gmail-m_1120761112080619405m_-7617182996987925846token gmail-m_1120761112080619405m_-7617182996987925846punctuation"></span></code><code class="gmail-m_1120761112080619405m_-7617182996987925846language-c"></code> always is NULL
 and the pipeline elements don't/can't be linked. (see errors below)

since this is supposed to be a simple example,  what am I missing?

thanks,

Ron


errors:
# ./basic-tutorial-3
Pipeline state changed from NULL to READY:
Received new pad 'src_0' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.991: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed
It has type 'video/x-raw' which is not raw audio. Ignoring.</pre></div></blockquote></div></div><div dir="auto">I'm not really able to see all steps that lead you to this, but I can give you a trick to help. G_DEBUG=fatal_criticals will make it abort on the assertion, run this in gdb, and analyse the context that lead to that pad being null.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF"><pre class="gmail-m_1120761112080619405m_-7617182996987925846language-c"></pre></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF"><pre class="gmail-m_1120761112080619405m_-7617182996987925846language-c">(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Received new pad 'src_1' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_link_full: assertion 'GST_IS_PAD (sinkpad)' failed
Type is 'audio/x-raw' but link failed.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Error received from element source: Internal data stream error.
Debugging information: gstbasesrc.c(2950): gst_base_src_loop (): /GstPipeline:test-pipeline/GstURIDecodeBin:source/GstSoupHTTPSrc:source:
streaming stopped, reason not-linked (-1)

</pre>
  </div>

_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" rel="noreferrer" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></blockquote></div></div></div>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></blockquote></div>