gstreamer sample documentation code not running

一曲冷凌霜 提交于 2019-12-12 03:05:14

问题


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


回答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.



来源:https://stackoverflow.com/questions/18406152/gstreamer-sample-documentation-code-not-running

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!