我在我的程序中使用GStreamer 1.0從文件播放視頻。我想輸出到Gdk.Pixbuf將其添加到圖像來顯示它。但我無法弄清楚如何正確使用它。如何使用Vala將GStreamer視頻輸出到Gdk.Pixbuf?
這裏是我試圖這樣做,但它不會編譯:
this.pipeline = new Pipeline ("mypipeline");
this.src = ElementFactory.make ("filesrc", "video");
src.set("location", downloadFileName);
this.sink = ElementFactory.make ("gdkpixbufsink", "sink");
this.pipeline.add_many (this.src, this.sink);
this.src.link (this.sink);
this.pipeline.set_state (State.PLAYING);
this.videoPixbuf = sink.get("last-pixbuf") as Gdk.Pixbuf;
你建議我怎麼做正確,如果可能的話?或者我怎樣才能做到這一點,而不使用Gdk.Pixbuf?我只是不知道該怎麼做。