Cool! It works right now.<br>However, I had another issue.<br><br>I just try to let appsrc keep reading data from a array and then write data into file.<br>My pipleline is like appsrc-&gt;queue-&gt;filesink.<br>However, I cannot get right data in the file, actually there is no data in the file but a bunch of symbols.<br>
<br>I attached my codes here. Anyone met this problem before or know why?<br><br>#include &lt;gst/gst.h&gt;<br>#include &lt;stdio.h&gt;<br>#include &lt;string.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include &lt;gst/app/gstappsrc.h&gt;<br>
#include &lt;gst/app/gstappbuffer.h&gt;<br>#include &lt;gst/app/gstappsink.h&gt;<br><br><br>static const guint8 mp3[] = {<br>0x01, 0x02, 0x03, 0x04, 0x05, 0x06,0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,<br>
0x01, 0x02, 0x03, 0x04, 0x05, 0x06,0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,<br>0x01, 0x02, 0x03, 0x04, 0x05, 0x06,0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,<br>0x01, 0x02, 0x03, 0x04, 0x05, 0x06,0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,<br>
0x01, 0x02, 0x03, 0x04, 0x05, 0x06,0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,<br>0x01, 0x02, 0x03, 0x04, 0x05, 0x06,0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,<br>0x01, 0x02, 0x03, 0x04, 0x05, 0x06,0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,<br>
0x01, 0x02, 0x03, 0x04, 0x05, 0x06,0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,<br>0x01, 0x02, 0x03, 0x04, 0x05, 0x06,0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,<br>0x01, 0x02, 0x03, 0x04, 0x05, 0x06,0x07, 0x08, 0x09, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};<br>
<br>typedef struct _App App;<br>struct _App<br>{<br>  GstElement *pipe;<br>  GstElement *src;<br>  GstElement *q;<br>  GstElement *id;<br>  GstElement *q1;<br>  GstElement *sink;<br>};<br><br>App s_app;<br><br>static void finalize (void *priv);<br>
<br>int<br>main (int argc, char *argv[])<br>{<br><br><br>  FILE *fp;<br>  size_t bytes_read;<br>  App *app = &amp;s_app;<br>  int i;<br>  int mp3size;<br>  gst_init (&amp;argc, &amp;argv);<br><br>  app-&gt;pipe = gst_pipeline_new (NULL);<br>
  g_assert (app-&gt;pipe);<br><br>  app-&gt;src = gst_element_factory_make (&quot;appsrc&quot;, NULL);<br>  g_assert (app-&gt;src);<br>  gst_bin_add (GST_BIN (app-&gt;pipe), app-&gt;src);<br><br>  app-&gt;q = gst_element_factory_make (&quot;queue&quot;, NULL);<br>
  g_assert (app-&gt;q);<br>  gst_bin_add (GST_BIN (app-&gt;pipe), app-&gt;q);<br>/*<br>  app-&gt;id = gst_element_factory_make (&quot;identity&quot;, NULL);<br>  g_assert (app-&gt;id);<br>  gst_bin_add (GST_BIN (app-&gt;pipe), app-&gt;id);<br>
<br>  app-&gt;q1 = gst_element_factory_make (&quot;queue&quot;, NULL);<br>  g_assert (app-&gt;q1);<br>  gst_bin_add (GST_BIN (app-&gt;pipe), app-&gt;q1);<br>*/<br>  app-&gt;sink = gst_element_factory_make (&quot;filesink&quot;, NULL);<br>
  g_object_set (G_OBJECT (app-&gt;sink), &quot;location&quot;, &quot;mp3.data&quot;, NULL);<br>  g_assert (app-&gt;sink);<br>  gst_bin_add (GST_BIN (app-&gt;pipe), app-&gt;sink);<br><br>  gst_element_link (app-&gt;src, app-&gt;q);<br>
  //gst_element_link (app-&gt;q, app-&gt;id);<br>//  gst_element_link (app-&gt;id, app-&gt;q1);<br>  gst_element_link (app-&gt;q, app-&gt;sink);<br><br>  printf(&quot;Setting PIPELINE to PLAY.......\n&quot;);<br> <br>  gst_element_set_state (app-&gt;pipe, GST_STATE_PLAYING);<br>
<br>  mp3size=sizeof(mp3);<br><br>  for (i = 0; i &lt; mp3size-1; i++)<br>  {<br>    GstBuffer *buf;<br>    guint8 *data=malloc(1);<br>    *data=mp3[i];<br>    buf = gst_app_buffer_new (data, 1, finalize, data);<br>    gst_app_src_push_buffer (GST_APP_SRC (app-&gt;src), buf);<br>
    printf(&quot;framenum %d\n&quot;, (i+1));<br>        printf(&quot;framenum data %d\n&quot;,*GST_BUFFER_DATA(buf));<br><br>  }<br><br>  gst_app_src_end_of_stream (GST_APP_SRC (app-&gt;src));<br><br>  gst_element_set_state (app-&gt;pipe, GST_STATE_NULL);<br>
  //g_object_unref (buf);<br>  //free(data);<br>  return 0;<br>}<br><br>static void<br>finalize (void *priv)<br>{<br>  //printf (&quot;\nfreeing buffer for pointer %p\n&quot;, priv);<br>  //free (priv);<br>}<br><br>//=================<br>
<br><br><br><br><br><br><br><br><br><div class="gmail_quote">On Fri, Dec 9, 2011 at 5:47 AM, Mailing List SVR [via GStreamer-devel] <span dir="ltr">&lt;<a href="/user/SendEmail.jtp?type=node&node=4176938&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">

        
  
    
  
  
    Il 08/12/2011 21:11, Jun Zhang ha scritto:
    </div><blockquote style="border-left: 2px solid rgb(204, 204, 204); padding: 0pt 1em;" type="cite">Hello,<div class="im"><br>
      <br>
      I am trying to use appsrc to get data from my C application and
      met following problems.<br>
      <br>
       1.undefined reference to `gst_app_buffer_new&#39;<br>
       2. undefined reference to `gst_app_src_push_buffer&#39;<br>
       3.undefined reference to gst_app_src_end_of_stream <br>
      <br>
      After searching for a solution, I saw someone suggest add
      -lgstapp-0.10 into the make file: Following is the commands in the
      make file.<br>
      export
PKG_CONFIG_PATH=/root/targetfs/opt/gstreame/lib/pkgconfig:$PKG_CONFIG_PATH<br>
      <br>
      /root/CodeSourcery/Sourcery_G++_Lite//bin/arm-none-linux-gnueabi-gcc 
      -lgstapp-0.10  `pkg-config --cflags --libs gstreamer-0.10`-o syn
      test_syn.c<br>
      <br>
      And then I have following compile errors. However, i did check and
      found that the missing libgstbase-0.10.so.0 is in the same place
      with <a href="http://libgstapp-0.10.so" rel="nofollow" link="external" target="_blank">libgstapp-0.10.so</a>.<br>
      <br>
      Any suggestions?<br>
    </div></blockquote>
    <br><div class="im">
    try lo link to gstreamer-app-0.10 too,<br>
    <br>
    Nicola<br>
    </div><blockquote style="border-left: 2px solid rgb(204, 204, 204); padding: 0pt 1em;" type="cite"><br>
      <br><div class="im">
      /root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld:
      warning: libgstbase-0.10.so.0, needed by
      /root/targetfs///opt/gstreamer/lib/<a href="http://libgstapp-0.10.so" rel="nofollow" link="external" target="_blank">libgstapp-0.10.so</a>, not found
      (try using -rpath or -rpath-link)<br>
      /root/targetfs///opt/gstreamer/lib/<a href="http://libgstapp-0.10.so" rel="nofollow" link="external" target="_blank">libgstapp-0.10.so</a>: undefined
      reference to `gst_base_sink_wait_preroll&#39;<br>
      /root/targetfs///opt/gstreamer/lib/<a href="http://libgstapp-0.10.so" rel="nofollow" link="external" target="_blank">libgstapp-0.10.so</a>: undefined
      reference to `gst_base_src_set_live&#39;<br>
      /root/targetfs///opt/gstreamer/lib/<a href="http://libgstapp-0.10.so" rel="nofollow" link="external" target="_blank">libgstapp-0.10.so</a>: undefined
      reference to `gst_base_src_get_type&#39;<br>
      /root/targetfs///opt/gstreamer/lib/<a href="http://libgstapp-0.10.so" rel="nofollow" link="external" target="_blank">libgstapp-0.10.so</a>: undefined
      reference to `gst_base_src_query_latency&#39;<br>
      /root/targetfs///opt/gstreamer/lib/<a href="http://libgstapp-0.10.so" rel="nofollow" link="external" target="_blank">libgstapp-0.10.so</a>: undefined
      reference to `gst_base_src_set_format&#39;<br>
      /root/targetfs///opt/gstreamer/lib/<a href="http://libgstapp-0.10.so" rel="nofollow" link="external" target="_blank">libgstapp-0.10.so</a>: undefined
      reference to `gst_base_src_is_live&#39;<br>
      /root/targetfs///opt/gstreamer/lib/<a href="http://libgstapp-0.10.so" rel="nofollow" link="external" target="_blank">libgstapp-0.10.so</a>: undefined
      reference to `gst_base_sink_get_type&#39;<br>
      <br>
      <br>
      Thanks,<br>
      <br>
      Jun <br>
      <br>
      <fieldset></fieldset>
      <br>
      </div><pre>_______________________________________________
gstreamer-devel mailing list
<a href="http://user/SendEmail.jtp?type=node&amp;node=4176080&amp;i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="nofollow" link="external" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
    </blockquote>
    <br>
  

<br>_______________________________________________
<br>gstreamer-devel mailing list
<br><a href="http://user/SendEmail.jtp?type=node&amp;node=4176080&amp;i=1" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br><a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="nofollow" link="external" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
        
        <br>
        <br>
        <hr color="#cccccc" noshade size="1">
        <div style="color: rgb(68, 68, 68); font: 12px tahoma,geneva,helvetica,arial,sans-serif;">
                <div style="font-weight: bold;">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://gstreamer-devel.966125.n4.nabble.com/appsrc-undefined-reference-to-gst-app-buffer-new-tp4174142p4176080.html" target="_blank" rel="nofollow" link="external">http://gstreamer-devel.966125.n4.nabble.com/appsrc-undefined-reference-to-gst-app-buffer-new-tp4174142p4176080.html</a>
        </div>
        <div style="color: rgb(102, 102, 102); font: 11px/1.5em tahoma,geneva,helvetica,arial,sans-serif; margin-top: 0.4em;">
                
                To unsubscribe from appsrc undefined reference to &#39;gst_app_buffer_new&#39;, <a href="" target="_blank" rel="nofollow" link="external">click here</a>.<br>

                <a href="http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&amp;id=instant_html%21nabble%3Aemail.naml&amp;base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.InstantMailNamespace&amp;breadcrumbs=instant+emails%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font: 9px serif;" target="_blank" link="external">NAML</a>
        </div></blockquote></div><br>

        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/appsrc-undefined-reference-to-gst-app-buffer-new-tp4174142p4176938.html">Re: appsrc undefined reference to 'gst_app_buffer_new'</a><br/>
Sent from the <a href="http://gstreamer-devel.966125.n4.nabble.com/">GStreamer-devel mailing list archive</a> at Nabble.com.<br/>