c++ - Gstreamer - 示例 1 中的错误

标签 c++ gstreamer

当我运行示例 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/

相关文章:

c++ - 麦片序列化错误

c++ - 在 Mac OS X 上安装 C++ Armadillo 库

c++ - 如何制作不同常量的元组?

python - Pocketsphinx + Gstreamer 竞赛条件? Pocketsphinx无法在Python脚本中同时收听音频+录音?

opencv - 修改网络摄像头流

c++ - 如何在 C++ 中通过引用调用一个类的变量

c++ - 复制初始化与直接初始化已更改?

c - 如何通过名称获取 gstreamer 管道?

gstreamer - 'num-buffers' 在 gstreamer 中有什么作用?

html - 我们可以将 gstreamer 集成到 Electron 应用程序中吗?如何?