-// //have alsa?
-// if (GST_IS_OBJECT(m_audiosink) == false)
-// {
-// //nope, try OSS
-// m_audiosink = gst_element_factory_make ("osssink", "audiosink");
-// wxASSERT_MSG(GST_IS_OBJECT(m_audiosink), wxT("WARNING: Alsa and OSS drivers for gstreamer not found - audio will be unavailable for wxMediaCtrl"));
-// }
-
+ //4
+ g_signal_connect (m_player, "eos", G_CALLBACK (OnFinish), this);
+ g_signal_connect (m_player, "error", G_CALLBACK (OnError), this);
+
+ //5
+ GstElement* overlay = NULL;
+ GstElement* videosink;
+
+#if defined(__WXGTK__) && wxUSE_DYNLIB_CLASS
+
+ //use gnome-specific gstreamer extensions
+ //if synthisis (?) file not found, it
+ //spits out a warning and uses ximagesink
+ wxDynamicLibrary gstgconf;
+ if(gstgconf.Load(gstgconf.CanonicalizeName(wxT("gstgconf-0.8"))))
+ {
+ typedef GstElement* (*LPgst_gconf_get_default_video_sink) (void);
+ LPgst_gconf_get_default_video_sink pGst_gconf_get_default_video_sink =
+ (LPgst_gconf_get_default_video_sink)
+ gstgconf.GetSymbol(wxT("gst_gconf_get_default_video_sink"));
+
+ if (pGst_gconf_get_default_video_sink)
+ {
+ videosink = (*pGst_gconf_get_default_video_sink) ();
+ wxASSERT( GST_IS_BIN(videosink) );
+ overlay = gst_bin_get_by_interface (GST_BIN (videosink),
+ GST_TYPE_X_OVERLAY);
+ }
+
+ gstgconf.Detach();
+ }
+
+ if ( ! GST_IS_X_OVERLAY(overlay) )
+ {
+#endif
+ videosink = gst_element_factory_make ("xvimagesink", "videosink");
+ if ( !GST_IS_OBJECT(videosink) )
+ videosink = gst_element_factory_make ("ximagesink", "videosink");
+
+ overlay = videosink;
+
+ wxASSERT( GST_IS_X_OVERLAY(overlay) );
+ if ( ! GST_IS_X_OVERLAY(overlay) )
+ return false;
+#if defined(__WXGTK__) && wxUSE_DYNLIB_CLASS
+ }
+#endif