在成功执行多个教程后,尝试编译并运行示例appsrc代码。这是一个文档代码,假设它运行但是......
用于编译的命令
gcc appGuideAppSrc.c -o appGuide `pkg-config --cflags --libs gstreamer-0.10 gstreamer-app-0.10`
后出现以下错误
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
好的,警告很好,但它抛出错误的行似乎没问题
GST_BUFFER_PTS (buffer) = timestamp;
根据以下@Michal的回答,将其更改为TIMESTAMP并收到以下错误
(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
任何输入?
参考文献:
whole appsrc sample code
答案 0 :(得分:1)
看来您正在尝试使用旧版本的gstreamer编译gstreamer-1.0示例:0.10。
在gstreamer-0.11中引入了{p>GST_BUFFER_PTS
和GST_BUFFER_DTS
,并将GST_BUFFER_TIMESTAMP
替换为gstreamer-0.10。
使用较新的gstreamer版本或将GST_BUFFER_PTS
更改为GST_BUFFER_TIMESTAMP
。