gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r12349: Silence some debugging messa


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r12349: Silence some debugging messages.
Date: Wed, 04 Aug 2010 11:54:51 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 12349 [merge]
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Wed 2010-08-04 11:54:51 +0200
message:
  Silence some debugging messages.
  
  Select a sensible default if no hwaccel or renderer is passed, but otherwise
  don't. This only really affects hwaccel, as the renderer choice is 
  parsed before.
modified:
  gui/gtk/gtk.cpp
  gui/gtk/gtk_canvas.cpp
  gui/gtk/gtk_glue_agg.cpp
  libcore/asobj/NetStream_as.cpp
=== modified file 'gui/gtk/gtk.cpp'
--- a/gui/gtk/gtk.cpp   2010-07-15 03:07:54 +0000
+++ b/gui/gtk/gtk.cpp   2010-08-04 08:56:39 +0000
@@ -335,8 +335,6 @@
 bool
 GtkGui::run()
 {
-    //GNASH_REPORT_FUNCTION;
-
     // Kick-start before setting the interval timeout
     advance_movie(this);
     
@@ -944,8 +942,6 @@
 bool
 GtkGui::createWindow(int width, int height)
 {
-    //GNASH_REPORT_FUNCTION;
-    
     assert(_width>0);
     assert(_height>0);
     
@@ -2127,8 +2123,6 @@
 void
 GtkGui::createQualityMenu(GtkWidget *obj)
 {
-    GNASH_REPORT_FUNCTION;
-
     GtkWidget *menuitem = gtk_menu_item_new_with_mnemonic (_("_Quality"));
     gtk_widget_show (menuitem);
     gtk_container_add (GTK_CONTAINER (obj), menuitem);

=== modified file 'gui/gtk/gtk_canvas.cpp'
--- a/gui/gtk/gtk_canvas.cpp    2010-07-15 03:07:54 +0000
+++ b/gui/gtk/gtk_canvas.cpp    2010-08-04 08:50:32 +0000
@@ -28,6 +28,7 @@
 #include "rc.h"
 #include "log.h"
 #include "gtk_glue.h"
+#include "GnashException.h"
 
 #ifdef HAVE_VA_VA_H
 #include "vaapi_utils.h"
@@ -83,14 +84,12 @@
 GtkWidget *
 gnash_canvas_new ()
 {
-    GNASH_REPORT_FUNCTION;
     return GTK_WIDGET(g_object_new (GNASH_TYPE_CANVAS, NULL));
 }
 
 static void
 gnash_canvas_class_init(GnashCanvasClass *gnash_canvas_class)
 {
-    GNASH_REPORT_FUNCTION;
     GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(gnash_canvas_class);
 
     parent_class = (GObjectClass 
*)g_type_class_peek_parent(gnash_canvas_class);
@@ -104,7 +103,6 @@
 static void
 gnash_canvas_init(GnashCanvas *canvas)
 {
-    GNASH_REPORT_FUNCTION;
 
     canvas->renderer.reset();
 
@@ -121,7 +119,6 @@
 static void
 gnash_canvas_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
 {
-    GNASH_REPORT_FUNCTION;
     GnashCanvas *canvas = GNASH_CANVAS(widget);
 
     gnash::log_debug("gnash_canvas_size_allocate %d %d", allocation->width,
@@ -151,7 +148,6 @@
 static gboolean
 gnash_canvas_configure_event(GtkWidget *widget, GdkEventConfigure *event)
 {
-    GNASH_REPORT_FUNCTION;
     GnashCanvas *canvas = GNASH_CANVAS(widget);
 
     canvas->glue->configure(widget, event);
@@ -162,7 +158,6 @@
 static void
 gnash_canvas_realize(GtkWidget *widget)
 {
-    GNASH_REPORT_FUNCTION;
     GnashCanvas *canvas = GNASH_CANVAS(widget);
     GdkWindowAttr attributes;
     gint attributes_mask;
@@ -196,7 +191,6 @@
 static void
 gnash_canvas_after_realize(GtkWidget *widget)
 {
-    GNASH_REPORT_FUNCTION;
     GnashCanvas *canvas = GNASH_CANVAS(widget);
 
     canvas->renderer.reset(canvas->glue->createRenderHandler());
@@ -210,96 +204,87 @@
         std::string& renderer, int argc, char **argv[])
 {
 
-    GNASH_REPORT_FUNCTION;
-
     // Order should be VAAPI, Xv, X11
     bool initialized_renderer = false;
 
     // If a renderer hasn't been defined in gnashrc, or on the command
     // line, pick a sensible default.
     if (renderer.empty()) {
+#ifdef RENDERER_AGG
         renderer = "agg";
+#elif defined (RENDERER_CAIRO)
+        renderer = "cairo";
+#elif defined (RENDERER_OGL)
+        renderer = "ogl";
+#endif
     }
-    std::string next_renderer = renderer;
 
     // If the Hardware acceleration isn't defined in gnashrc, or on
     // the command line, pick a sensible default.
     if (hwaccel.empty()) {
         hwaccel = "none";
     }
-    std::string next_hwaccel = hwaccel;
 
-    while (!initialized_renderer) {
-        renderer = next_renderer;
-        hwaccel = next_hwaccel;
 #ifdef HAVE_VA_VA_H
-        // Global enable VA-API, if requested
-        gnash::vaapi_set_is_enabled(hwaccel == "vaapi");
+    // Global enable VA-API, if requested
+    gnash::vaapi_set_is_enabled(hwaccel == "vaapi");
 #endif
-        // Use the Cairo renderer. Cairo is also used by GTK2, so using
-        // Cairo makes much sense. Unfortunately, our implementation seems
-        // to have serious performance issues, although it does work.
+    // Use the Cairo renderer. Cairo is also used by GTK2, so using
+    // Cairo makes much sense. Unfortunately, our implementation seems
+    // to have serious performance issues, although it does work.
 #ifdef RENDERER_CAIRO
-        if (renderer == "cairo") {
-            canvas->glue.reset(new gnash::GtkCairoGlue);
-            // Set the renderer to the next one to try if initializing
-            // fails.
-            next_renderer = "agg";
-        }
+    if (renderer == "cairo") {
+        canvas->glue.reset(new gnash::GtkCairoGlue);
+    }
 #endif
 
 #ifdef RENDERER_OPENGL
-        if (renderer == "opengl") {
-            canvas->glue.reset(new gnash::GtkGlExtGlue);
-            // Set the renderer to the next one to try if initializing
-            // fails.
-            next_renderer = "agg";
-            // Use the AGG software library for rendering. While this runs
-            // on any hardware platform, it does have performance issues
-            // on low-end platforms without a GPU. So while AGG may render
-            // streaming video over a network connection just fine,
-            // anything below about 600Mhz CPU may have buffering and
-            // rendering performance issues.
-        }
+    if (renderer == "opengl") {
+        canvas->glue.reset(new gnash::GtkGlExtGlue);
+        // Use the AGG software library for rendering. While this runs
+        // on any hardware platform, it does have performance issues
+        // on low-end platforms without a GPU. So while AGG may render
+        // streaming video over a network connection just fine,
+        // anything below about 600Mhz CPU may have buffering and
+        // rendering performance issues.
+    }
 #endif
-        if (renderer == "agg") {
-            // Use LibVva, which works on Nvidia, AT, or Intel 965 GPUs
-            // with AGG or OpenGL.
+    if (renderer == "agg") {
+        // Use LibVva, which works on Nvidia, AT, or Intel 965 GPUs
+        // with AGG or OpenGL.
 #ifdef HAVE_VA_VA_H
-            if (hwaccel == "vaapi") {
-                canvas->glue.reset(new gnash::GtkAggVaapiGlue);
-                // Set the hardware acclerator to the next one to try
-                // if initializing fails.
-                next_hwaccel = "xv";
-            } else
+        if (hwaccel == "vaapi") {
+            canvas->glue.reset(new gnash::GtkAggVaapiGlue);
+            // Set the hardware acclerator to the next one to try
+            // if initializing fails.
+        } else
 #endif
 #ifdef RENDERER_AGG
 #ifdef HAVE_XV
-           if (hwaccel == "xv") {
-                // Use the X11 XV extension, which works on most GPUs.
-                canvas->glue.reset(new gnash::GtkAggXvGlue);
-                // Set the hardware acclerator to the next one to try
-                // if initializing fails.
-                next_hwaccel = "none";
-            } else
-#endif
-                {
-                canvas->glue.reset(new gnash::GtkAggGlue);
-            }
-#endif
+        if (hwaccel == "xv") {
+            // Use the X11 XV extension, which works on most GPUs.
+            canvas->glue.reset(new gnash::GtkAggXvGlue);
+            // Set the hardware acclerator to the next one to try
+            // if initializing fails.
+        } else 
+#endif
+        {
+            canvas->glue.reset(new gnash::GtkAggGlue);
         }
+#endif
+    }
 
-        // Initialize the canvas for rendering into
-        initialized_renderer = canvas->glue->init(argc, argv);
-        // If the renderer with the least dependencies fails, we can't
-        // proceed.
-        if (!initialized_renderer && (renderer == "agg") &&
-                (hwaccel == "none")) {
-            break;
-        }
+    // Initialize the canvas for rendering into
+    initialized_renderer = canvas->glue->init(argc, argv);
+    // If the renderer with the least dependencies fails, we can't
+    // proceed.
+    if (!initialized_renderer) {
+        boost::format fmt = boost::format("Requested renderer %1% (hwaccel: "
+                "%2%) could not be initialized") % renderer % hwaccel;
+        throw gnash::GnashException(fmt.str());
     }
         
-    if (initialized_renderer && renderer == "opengl") {
+    if (renderer == "opengl") {
         // OpenGL glue needs to prepare the drawing area for OpenGL
         // rendering before
         // widgets are realized and before the configure event is fired.

=== modified file 'gui/gtk/gtk_glue_agg.cpp'
--- a/gui/gtk/gtk_glue_agg.cpp  2010-07-15 03:07:54 +0000
+++ b/gui/gtk/gtk_glue_agg.cpp  2010-08-04 08:56:39 +0000
@@ -43,7 +43,6 @@
 :   _offscreenbuf(NULL),
     _agg_renderer(NULL)
 {
-    GNASH_REPORT_FUNCTION;
 }
 
 GtkAggGlue::~GtkAggGlue()

=== modified file 'libcore/asobj/NetStream_as.cpp'
--- a/libcore/asobj/NetStream_as.cpp    2010-07-14 10:47:13 +0000
+++ b/libcore/asobj/NetStream_as.cpp    2010-08-04 08:56:39 +0000
@@ -341,7 +341,6 @@
 
 void NetStream_as::close()
 {
-    GNASH_REPORT_FUNCTION;
 
     // Delete any samples in the audio queue.
     _audioStreamer.cleanAudioQueue();


reply via email to

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