I'm new to Gstreamer, and I have problems when I compile the tutorial 1 of Gstreamer. I'm using Windows 7 64 bit with visual c++ express 2010, and Gstreamer SDK 2012.11 32 bits (downloaded from here). Here is the code :
#include "stdafx.h"
#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 ("playbin2 uri=file://E:/test_1.MOV", 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;
}
First error :
error C2664: 'gst_bus_timed_pop_filtered' : cannot convert parameter 3 from 'int' to 'GstMessageType'
So I just removed GST_MESSAGE_ERROR from the code. So the line is now :
msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_EOS);
I had the same problem with Ubuntu. But after that, in Ubuntu, I could play a video.
Second error : But with Windows, the compilation is good, but when I try to run it, I have thoses errors :
GStreamer-CRITICAL **: gst_element_set_state: assertion 'GST_IS_ELEMENT <element>' failed
GStreamer-CRITICAL **: gst_element_get_bus: assertion 'GST_IS_ELEMENT <element>' failed
GStreamer-CRITICAL **: gst_bus_timed_pop_filtered: assertion 'GST_IS_BUS <bus>' failed
GStreamer-CRITICAL **: gst_object_unref: assertion 'object=!NULL' failed
GStreamer-CRITICAL **: gst_element_set_state: assertion 'GST_IS_ELEMENT <element>' failed
GStreamer-CRITICAL **: gst_object_unref: assertion 'object=!NULL' failed
I don't really understand why it works with ubuntu and not with Windows. And I really don't know how to solve this problem. Could you help me please ?
Regards,