【发布时间】:2014-11-25 16:57:34
【问题描述】:
我在 Vala 的应用程序中使用 GStreamer 来播放 .mp4 视频。我正在尝试从教程制作管道:filesrc -> decodebin -> pulsesink,但我的应用程序总是崩溃。这是我的代码:
this.pipeline = new Pipeline ("mypipeline");
this.src = ElementFactory.make ("filesrc", "video");
src.set("location", downloadFileName);
this.decode = ElementFactory.make ("decodebin", "decode");
this.sink = ElementFactory.make ("autoaudiosink", "sink");
this.pipeline.add_many (this.src, this.decode, this.sink);
if (this.src == null)
error("Gstreamer element init error 1");
if (this.decode == null)
error("Gstreamer element init error 2");
if (this.sink == null)
error("Gstreamer element init error 3");
if (!this.src.link (this.decode))
error("GStreamer linking problems.");
if (!this.decode.link (this.sink))
error("GStreamer linking problems 2.");
this.pipeline.set_state (State.PLAYING);
而且我的应用程序总是因“GStreamer 链接问题 2”而崩溃。
gst-launch-1.0 filesrc location=<filename> ! decodebin ! pulsesink
工作正常,所以我认为这是与 Vala 相关的问题(当然是我的实际文件名)。
你能告诉我我做错了什么吗?
【问题讨论】: