gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog configure.ac server/asobj/NetSt...


From: Bastiaan Jacques
Subject: [Gnash-commit] gnash ChangeLog configure.ac server/asobj/NetSt...
Date: Fri, 22 Feb 2008 00:02:24 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Bastiaan Jacques <bjacques>     08/02/22 00:02:24

Modified files:
        .              : ChangeLog configure.ac 
        server/asobj   : NetStreamGst.cpp NetStreamGst.h 

Log message:
                * configure.ac: Make sure that the test for Gstreamer's modern 
pbutils
                is run always if Gstreamer is the media handler (previously, it 
was
                only tested if the handler was manually specified).
                * server/asobj/NetStreamGst.{cpp,h}: Reinstate the missing 
plugins
                install feature. This implementation calls the installer
                asynchronously.
        
        I'm considering applying this patch to the -rc1 branch, because it 
fixes,
        strictly speaking, a regression. Opinions (and testers) welcome.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5716&r2=1.5717
http://cvs.savannah.gnu.org/viewcvs/gnash/configure.ac?cvsroot=gnash&r1=1.480&r2=1.481
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamGst.cpp?cvsroot=gnash&r1=1.80&r2=1.81
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamGst.h?cvsroot=gnash&r1=1.33&r2=1.34

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5716
retrieving revision 1.5717
diff -u -b -r1.5716 -r1.5717
--- ChangeLog   21 Feb 2008 22:47:32 -0000      1.5716
+++ ChangeLog   22 Feb 2008 00:02:23 -0000      1.5717
@@ -1,3 +1,12 @@
+2008-02-20 Bastiaan Jacques <address@hidden>
+
+       * configure.ac: Make sure that the test for Gstreamer's modern pbutils
+       is run always if Gstreamer is the media handler (previously, it was
+       only tested if the handler was manually specified).
+       * server/asobj/NetStreamGst.{cpp,h}: Reinstate the missing plugins
+       install feature. This implementation calls the installer
+       asynchronously.
+
 2008-02-21 Sandro Santilli <address@hidden>
 
        * testsuite/misc-swfmill.all/Makefile.am: drop unneeded references

Index: configure.ac
===================================================================
RCS file: /sources/gnash/gnash/configure.ac,v
retrieving revision 1.480
retrieving revision 1.481
diff -u -b -r1.480 -r1.481
--- configure.ac        21 Feb 2008 22:33:51 -0000      1.480
+++ configure.ac        22 Feb 2008 00:02:23 -0000      1.481
@@ -1533,7 +1533,10 @@
        AC_MSG_WARN([No appropriate gstreamer library found, will try using 
mad.])
        media_handler=mad
     fi
-  else
+  fi
+fi
+
+if test x"$media_handler" = x"gst"; then
     AC_MSG_CHECKING([for modern pbutils])
     save_cflags=$CFLAGS
     CFLAGS=$GSTREAMER_CFLAGS
@@ -1547,9 +1550,9 @@
       AC_DEFINE([GST_HAS_MODERN_PBUTILS], [], [GStreamer has pbutils with 
missing codec install routines installed])
       AC_MSG_RESULT([ok])
     fi
-  fi
 fi
 
+
 if test x"$media_handler" = x"mad"; then
   dnl Will set MAD_LIBS and MAD_CFLAGS.
   dnl Handles --with-mad-incl and --with-mad-lib

Index: server/asobj/NetStreamGst.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamGst.cpp,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -b -r1.80 -r1.81
--- server/asobj/NetStreamGst.cpp       20 Feb 2008 19:03:59 -0000      1.80
+++ server/asobj/NetStreamGst.cpp       22 Feb 2008 00:02:24 -0000      1.81
@@ -30,6 +30,12 @@
 #include <gst/gstelement.h>
 #include <GstUtil.h>
 
+#ifdef GST_HAS_MODERN_PBUTILS
+#include <gst/pbutils/pbutils.h>
+#include <gst/pbutils/missing-plugins.h>
+#include <gst/pbutils/install-plugins.h>
+#endif // GST_HAS_MODERN_PBUTILS
+
 
 //                                        video -> ffmpegcolorspace -> 
capsfilter -> fakesink
 //                                       /
@@ -164,6 +170,10 @@
   gst_element_get_state(_pipeline, NULL, NULL, 0); // wait for a response
 
   gst_object_unref(GST_OBJECT(_pipeline));
+  
+#ifdef GST_HAS_MODERN_PBUTILS
+  std::for_each(_missing_plugins.begin(), _missing_plugins.end(), g_free);
+#endif
 }
 
 void
@@ -334,7 +344,11 @@
   
   gst_object_unref(GST_OBJECT(bus));
   
+  handleMissingPlugins();
+  
   processStatusNotifications();
+  
+  g_main_context_iteration (NULL, FALSE);
 }
 
 double
@@ -587,8 +601,88 @@
     }
   }
 
+  missingPluginMsg(message);
+}
+
+void
+NetStreamGst::missingPluginMsg(GstMessage* message)
+{
+#ifdef GST_HAS_MODERN_PBUTILS
+  if (!gst_is_missing_plugin_message(message)) {
+    return;
+  }  
+  
+  gchar* plugin_name = gst_missing_plugin_message_get_description (message);
+
+  if (!gst_install_plugins_supported()) {
+    log_error(_("Missing Gstreamer plugin: %s. Please consider installing 
it."),
+      plugin_name);
+    g_free(plugin_name);
+    return;
+  }
+      
+  gchar* detail = gst_missing_plugin_message_get_installer_detail (message);
+  
+  _missing_plugins.push_back(detail);
+  
+  log_debug(_("Missing plugin: %s. Will attempt to start system installer"),
+    plugin_name);
+
+  g_free(plugin_name);
+#endif
+}
+
+#ifdef GST_HAS_MODERN_PBUTILS
+static void
+install_plugins_cb(GstInstallPluginsReturn result, gpointer /*user_data*/)
+{
+  switch(result) {
+    case GST_INSTALL_PLUGINS_SUCCESS:
+    case GST_INSTALL_PLUGINS_PARTIAL_SUCCESS:
+      log_debug(_("Gstreamer plugin installation was at least partially "
+                "successful. Will try to restart the pipeline."));
+      break;    
+    default:
+      log_error(_("The request for system installation of missing plugins "
+                  "has failed. Full playback will not be possible."));
+  }
+}
+#endif
+
+void
+NetStreamGst::handleMissingPlugins()
+{
+#ifdef GST_HAS_MODERN_PBUTILS
+  if (_missing_plugins.empty()) {
+    return;
+  }
+
+  boost::scoped_array<gchar*> details( new char*[_missing_plugins.size()+1] );
+
+  for (size_t i = 0; i < _missing_plugins.size(); ++i) {
+    details[i] = _missing_plugins[i];
+  }
+
+  details[_missing_plugins.size()] = NULL;
+
+  GstInstallPluginsReturn ret = gst_install_plugins_async(details.get(), NULL,
+    install_plugins_cb, NULL);
+  
+  std::for_each(_missing_plugins.begin(), _missing_plugins.end(), g_free);
+  _missing_plugins.clear();
+  
+  switch(ret) {
+    case GST_INSTALL_PLUGINS_STARTED_OK:
+    case GST_INSTALL_PLUGINS_INSTALL_IN_PROGRESS:
+      break;
+    default:
+      log_error(_("Failed to start the system Gstreamer plugin installer."
+                "Media playback will not work (fully)."));      
+  }
+#endif
 }
 
+
 // NOTE: callbacks will be called from the streaming thread!
 
 void 

Index: server/asobj/NetStreamGst.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamGst.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- server/asobj/NetStreamGst.h 30 Jan 2008 06:10:10 -0000      1.33
+++ server/asobj/NetStreamGst.h 22 Feb 2008 00:02:24 -0000      1.34
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: NetStreamGst.h,v 1.33 2008/01/30 06:10:10 bjacques Exp $ */
+/* $Id: NetStreamGst.h,v 1.34 2008/02/22 00:02:24 bjacques Exp $ */
 
 #ifndef __NETSTREAMGST_H__
 #define __NETSTREAMGST_H__
@@ -76,6 +76,8 @@
 
 private:
   void handleMessage (GstMessage *message);
+  void missingPluginMsg(GstMessage* message);
+  void handleMissingPlugins();
 
   GstElement* _pipeline;
   GstElement* _dataqueue;
@@ -83,6 +85,9 @@
   GstElement* _audiobin;
   GstElement* _videobin;
   gint64      _duration;
+#ifdef GST_HAS_MODERN_PBUTILS
+  std::vector<gchar*> _missing_plugins;
+#endif
 };
 
 } // gnash namespace




reply via email to

[Prev in Thread] Current Thread [Next in Thread]