当我运行示例1时:
#include <gst/gst.h>
int main(int argc, char *argv[]) {
GstElement *pipeline;
GstBus *bus;
GstMessage *msg;
/* Initialize GStreamer */
gst_init (&argc, &argv);
/* Build the pipeline */
pipeline = gst_parse_launch ("playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm", NULL);
/* Start playing */
gst_element_set_state (pipeline, GST_STATE_PLAYING);
/* Wait until error or EOS */
bus = gst_element_get_bus (pipeline);
msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
/* Free resources */
if (msg != NULL)
gst_message_unref (msg);
gst_object_unref (bus);
gst_element_set_state (pipeline, GST_STATE_NULL);
gst_object_unref (pipeline);
return 0;
}
我收到两个错误: 1)类型“int”的参数与“GstMessageType”类型的参数不兼容
2)'GstMessage * gst_bus_timed_pop_filtered(GstBus *,GstClockTime,GstMessageType)':无法将参数3从'int'转换为'GstMessageType'
怎么了?我用这种方式链接了Visual studio和gstreamer:
-property manager>右键单击项目>添加现有属性表>链接文件gstreamer-1.0 props(share \ vs \ 2010 \ libs \ gstreamer-1.0.props)
我已经解决了问题,感谢to this post(解决方案1),我仍然不得不乱用路径和链接,我不知道我做了什么,但它可能将调试与bin目录链接(由于某种原因,这之前没有用) )。需要注意的另一件事是程序需要具有.c扩展名(而不是.cpp)。