0

Trying to compile and run a sample appsrc code after having successfully executed several tutorials. This is a documentation code, supposed it to run but ...

The command used to compile

gcc appGuideAppSrc.c -o appGuide `pkg-config --cflags --libs gstreamer-0.10 gstreamer-app-0.10`  

Got the following error after

appGuideAppSrc.c: In function ‘cb_need_data’:  
appGuideAppSrc.c:14:8: warning: assignment makes pointer from integer without a cast [enabled by default]  
appGuideAppSrc.c:18:25: error: lvalue required as left operand of assignment  

Ok, the warning is fine but the line where it throws error is which seems to be ok

   GST_BUFFER_PTS (buffer) = timestamp;

Based on answer below from @Michal, changed it to TIMESTAMP and got the following error

(appGuide:11043): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed

(appGuide:11043): GStreamer-CRITICAL **: gst_bin_add_many: assertion `GST_IS_ELEMENT (element_1)' failed  

(appGuide:11043): GStreamer-CRITICAL **: gst_element_link_many: assertion `GST_IS_ELEMENT (element_1)' failed  

(appGuide:11043): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)' failed  

(appGuide:11043): GLib-GObject-WARNING **: invalid (NULL) pointer instance  

(appGuide:11043): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion  `G_TYPE_CHECK_INSTANCE (instance)' failed  

Any inputs ?

References:
The whole appsrc sample code

user2618142
  • 1,035
  • 2
  • 18
  • 35

1 Answers1

1

It appears that you're trying to compile a gstreamer-1.0 example with an older version of gstreamer: 0.10.

GST_BUFFER_PTS and GST_BUFFER_DTS were introduced in gstreamer-0.11 and replaced GST_BUFFER_TIMESTAMP available up to gstreamer-0.10.

Either use a newer gstreamer version or change GST_BUFFER_PTS to GST_BUFFER_TIMESTAMP.

Michał Wróbel
  • 684
  • 4
  • 10
  • Why do you say that "the warning is fine"? I'd rather recommend the opposite: compile your code with -Wall – Michał Wróbel Aug 25 '13 at 14:04
  • I said warning is fine (Like I am a programmer, don't care about warning) types. Lets focus on error. :) – user2618142 Mar 10 '14 at 09:19
  • I guess that this time the line with `appsrc = gst_element_factory_make ("appsrc", "source");` failed. Make sure that you have appsrc plugin (launch `gst-inspect-0.10 appsrc`). Running your program with environment variable `GST_DEBUG` set to e.g. `3` could also be helpful. – Michał Wróbel Mar 10 '14 at 18:39
  • No need, your answer relating to 0.10 and 1.0 was correct. – user2618142 Mar 11 '14 at 06:58