0

在成功执行了几个教程后,尝试编译和运行示例 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  

任何输入?

参考:
整个appsrc示例代码

4

1 回答 1

1

看来您正在尝试使用旧版本的 gstreamer:0.10 编译 gstreamer-1.0 示例。

GST_BUFFER_PTSGST_BUFFER_DTS在 gstreamer-0.11 中引入,并在GST_BUFFER_TIMESTAMPgstreamer-0.10 之前可用。

使用较新的 gstreamer 版本或更改GST_BUFFER_PTSGST_BUFFER_TIMESTAMP.

于 2013-08-25T12:48:32.547 回答