+
+ //Convert arguments to unicode if enabled
+#if wxUSE_UNICODE
+ int i;
+ char **argvGST = new char*[wxTheApp->argc + 1];
+ for ( i = 0; i < wxTheApp->argc; i++ )
+ {
+#if wxUSE_UNICODE_WCHAR
+ argvGST[i] = wxStrdupA(wxConvUTF8.cWX2MB(wxTheApp->argv[i]));
+#else
+ argvGST[i] = wxStrdupA(wxTheApp->argv[i].utf8_str());
+#endif
+ }
+
+ argvGST[wxTheApp->argc] = NULL;
+
+ int argcGST = wxTheApp->argc;
+#else
+#define argcGST wxTheApp->argc
+#define argvGST wxTheApp->argv
+#endif
+
+ //Really init gstreamer
+ gboolean bInited;
+ GError* error = NULL;
+#if GST_VERSION_MAJOR > 0 || GST_VERSION_MINOR >= 10
+ bInited = gst_init_check(&argcGST, &argvGST, &error);
+#else
+ bInited = gst_init_check(&argcGST, &argvGST);
+#endif
+
+ // Cleanup arguments for unicode case
+#if wxUSE_UNICODE
+ for ( i = 0; i < argcGST; i++ )
+ {
+ free(argvGST[i]);
+ }
+
+ delete [] argvGST;
+#endif
+
+ if(!bInited) //gst_init_check fail?
+ {
+ if(error)
+ {
+ wxLogSysError(wxT("Could not initialize GStreamer\n")
+ wxT("Error Message:%s"),
+ (const wxChar*) wxConvUTF8.cMB2WX(error->message)
+ );
+ g_error_free(error);
+ }
+ else
+ wxLogSysError(wxT("Could not initialize GStreamer"));
+
+ return false;
+ }