gstreamer-示例1中的错误
Gstreamer - error in the example 1
当我运行示例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 *,gstbus *,gstclocktime,gstmessagetype)':无法转换参数3从'int'到'gstmessageType'
怎么了?
- Property Manager>右键单击项目>添加现有属性表>链接文件GStreamer-1.0 Props(Share vs 2010 libs libs gstreamer-1.0.props)
尝试用(GstMessageType)(GST_MESSAGE_ERROR | GST_MESSAGE_EOS)
GST_MESSAGE_ERROR | GST_MESSAGE_EOS
我已经解决了问题(解决方案1),我仍然不得不弄乱路径和链接,我不确定我做了什么,但是它可能与bin目录链接(由于某种原因,这是以前不起作用的)。要注意的另一件事是程序需要具有.c扩展名(不是.cpp)。
相关文章:
- 示例外壳应用程序显示的 V8 "segmentation fault (core dumped)"错误
- C++20 个模块在 clang (Windows):在最简单的示例中键入信息错误
- CGAL 示例上的编译错误
- 是什么导致 glTexSubImage1D() - 加载纹理时在此示例中出现GL_INVALID_VALUE错误?
- 学习C++并在早期示例中遇到错误(在非静态数据成员之前需要构造函数)
- 与unordered_map向量一起使用的最小示例中的scoped_allocator_adaptor错误
- 在 leveldb 的 c++ 示例中声明迭代器时出现分段错误
- 遵循官方 Direct2D 示例,但出现访问冲突错误
- 提升 asio 回声服务器示例中的黑客或错误?
- C++ 提升示例:创建和管理线程(编译错误)
- 从转码示例中使用时,比例过滤器会带有错误崩溃
- C++ 示例的错误
- 由以下划线开头的标识符引起的错误的真实示例
- 编译Boost ASIO示例时出现错误
- 需要的具体示例.错误:已经定义的.OBJ 一个或多个多个定义的符号
- OPENCV EDGEBOX示例程序中的错误
- 解析错误示例
- Docopt链接器错误示例程序
- 复制构造函数错误示例
- Cloud_viewer错误示例