当我运行示例 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:
-属性管理器 > 右键单击项目 > 添加现有属性表 > 链接文件 gstreamer-1.0 props (share\vs\2010\libs\gstreamer-1.0.props)
最佳答案
尝试替换GST_MESSAGE_ERROR | GST_MESSAGE_EOS
与 (GstMessageType)(GST_MESSAGE_ERROR | GST_MESSAGE_EOS)
关于c++ - Gstreamer - 示例 1 中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47982299/