2015-03-02 40 views
0

我目前在GStreamer工作在Windows 7下(x86_64)作爲虛擬機(VirtualBox的),我想運行一個基本的管道:的Gstreamer基本管道運行,但不顯示在Windows 7 VirtualBox的

gst-launch-1.0 -v videotestsrc pattern=snow ! autovideosync 

當我運行該管道獲得:

Setting pipeline to PAUSED... 
Pipeline is PREROLLING 

然後出現錯誤:

Pipeline doesn't want to preroll 

我解決了這個通過在管道末端添加異步處理= true,但沒有任何顯示仍然存在錯誤...

我試圖運行相同的管道編寫C++代碼。這是一個簡單的主要你可以運行。當我運行這段代碼時,我沒有遇到任何錯誤,但沒有顯示任何內容。

#include <gst/gst.h> 
#include <glib.h> 
#include <stdio.h> 

int main(int argc, char* argv[]) { 
GMainLoop *loop; 
GstElement *pipeline, *source, *sink; 

g_print("Starting..."); 
/* Initialisation */ 
gst_init(&argc, &argv); 

g_print("Loop is created..."); 
loop = g_main_loop_new(NULL, FALSE); 

/* Create gstreamer elements */ 
pipeline = gst_pipeline_new("gst-app-sink"); 
source = gst_element_factory_make("videotestsrc", "src"); 
sink = gst_element_factory_make("autovideosink", "sink"); 

if (!pipeline || !source || !sink) { 
    g_printerr("One element could not be created. Exiting.\n"); 
    return -1; 
} 

/* Set up the pipeline */ 

/* we add all elements into the pipeline */ 
/* source | sink */ 
gst_bin_add_many(GST_BIN(pipeline), source, sink, NULL); 

/* we link the elements together */ 
/* src -> sink */ 
gst_element_link(source, sink); 

/* Set the pipeline to "playing" state*/ 
gst_element_set_state(pipeline, GST_STATE_PLAYING); 

/* Iterate */ 
g_print("Running...\n"); 
g_main_loop_run(loop); 

/* Out of the main loop, clean up nicely */ 
g_print("Returned, stopping playback\n"); 
gst_element_set_state(pipeline, GST_STATE_NULL); 

g_print("Deleting pipeline\n"); 
gst_object_unref(GST_OBJECT(pipeline)); 
g_main_loop_unref(loop); 

return 0; 

}

我真的不知道它會來的。有任何想法嗎?

回答

0

默認情況下,虛擬機不啓用顯示這些類型流所必需的2D和3D視頻加速。只需右鍵單擊您的VM - >設置 - >顯示並選中「啓用3D加速」和「啓用2D視頻加速」。

相關問題