Monday, 15 March 2010

Gstreamer with visual C++ express 2010 - tutorial 1 -



Gstreamer with visual C++ express 2010 - tutorial 1 -

i'm new gstreamer, , have problems when compile tutorial 1 of gstreamer. i'm using windows 7 64 bit visual c++ express 2010, , gstreamer sdk 2012.11 32 bits (downloaded here). here 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 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); homecoming 0; }

first error :

error c2664: 'gst_bus_timed_pop_filtered' : cannot convert parameter 3 'int' 'gstmessagetype'

so removed gst_message_error code. line :

msg = gst_bus_timed_pop_filtered (bus, gst_clock_time_none, gst_message_eos);

i had same problem ubuntu. after that, in ubuntu, play video.

second error : windows, compilation good, when seek run it, 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 understand why works ubuntu , not windows. , don't know how solve problem. help me please ?

regards,

lfirst error

probably code compiled c++, bit more strict @ enum casts. seek replacing: gst_message_error | gst_message_eos (gstmessagetype)(gst_message_error | gst_message_eos)

second error

there high probability, line:

pipeline = gst_parse_launch ("playbin2 uri=file://e:/test_1.mov", null);

returns null, , rest of errors result of this. why homecoming null? there many reasons. maybe have not installed plugin "playbin2"? seek this:

pass pointer gerror construction sec parameter gst_parse_launch (it has message field can give hint) pass --gst-debug-level=4 or higher commandline parameter when running program. see many informations @ console output, reason of failure somewhere there.

visual-c++ gstreamer

No comments:

Post a Comment