<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" 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="moz-txt-link-freetext" href="https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c">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="  language-c"><code class="  language-c">data<span class="token punctuation">.</span>sink <span class="token operator">=</span> gst_element_factory_make <span class="token punctuation">(</span><span class="token string">"autoaudiosink"</span><span class="token punctuation">,</span> <span class="token string">"sink"</span><span class="token punctuation">)</span><span class="token punctuation">;

</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="  language-c">  data.convert = gst_element_factory_make ("audioconvert", "convert");   (original)
  data.sink = gst_element_factory_make ("autoaudiosink", "audiosink");   (changed name)<span class="token punctuation"></span></code>

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

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

Browsing through the code, that should be it, BUT it seems "</span></code><code class="  language-c">sink_pad</code>"<code class="  language-c"><span class="token punctuation"></span></code><code class="  language-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.

(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>
  </body>
</html>