我想读取文件并播放。非常简单。
* windows10,Visual Studio 2017社区。 p>
在命令提示符下,这正常工作。
gst-launch-1.0 filesrc location="C:/test.webm" ! decodebin ! autovideosink
但是我的代码无法正常工作。
int main(int argc, char *argv[]) {
..... declare variable
/* Initialize GStreamer */
gst_init (&argc, &argv);
/* Create the elements */
source = gst_element_factory_make ("filesrc", "source");
decode = gst_element_factory_make("decodebin", "decode");
sink = gst_element_factory_make ("autovideosink", "sink");
pipeline = gst_pipeline_new ("test-pipeline");
gst_bin_add_many (GST_BIN (pipeline), source, decode, sink, NULL);
g_object_set (G_OBJECT(source), "location", "C:/test.webm", NULL);
bus = gst_element_get_bus (pipeline);
... error processing
}
我的错误是这个
Error received from element sink-actual-sink-d3dvideo: Output window was closed
Debugging information: ../sys/d3dvideosink/d3dhelpers.c(1911): d3d_render_buffer (): /GstPipeline:test-pipeline/GstAutoVideoSink:sink/GstD3DVideoSink:sink-actual-sink-d3dvideo
请帮助我,我有什么问题。