Author: rolf
Date: 2008-02-19 10:26:06 -0500 (Tue, 19 Feb 2008)
New Revision: 96156

Modified:
   trunk/moon/plugin/ChangeLog
   trunk/moon/plugin/plugin-class.cpp
   trunk/moon/plugin/plugin.cpp
   trunk/moon/plugin/plugin.h
   trunk/moon/src/ChangeLog
   trunk/moon/src/media.cpp
   trunk/moon/src/pipeline-ffmpeg.cpp
Log:
* src/pipeline-ffmpeg.cpp: Comment out error message which just shows
  ffmpeg's shortcomings.
* src/media.cpp: Remove printf.
* plugin/plugin.cpp, plugin/plugin-class.cpp, plugin/plugin.h: Add
  MaxFrameRate to the properties page, and parse windowless and
  framerate properties during initialization and store the values on
  the plugin instance, so that the property page can show the correct
  values.

Modified: trunk/moon/plugin/ChangeLog
===================================================================
--- trunk/moon/plugin/ChangeLog 2008-02-19 15:24:19 UTC (rev 96155)
+++ trunk/moon/plugin/ChangeLog 2008-02-19 15:26:06 UTC (rev 96156)
@@ -1,3 +1,10 @@
+2008-02-19  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
+
+       * plugin.cpp, plugin-class.cpp, plugin.h: Add MaxFrameRate to the 
properties
+         page, and parse windowless and framerate properties during
+         initialization and store the values on the plugin instance, so that 
the
+         property page can show the correct values.
+
 2008-02-15  Chris Toshok  <[EMAIL PROTECTED]>
 
        * plugin-class.cpp (MoonlightStoryboardObject::Invoke): the seek

Modified: trunk/moon/plugin/plugin-class.cpp
===================================================================
--- trunk/moon/plugin/plugin-class.cpp  2008-02-19 15:24:19 UTC (rev 96155)
+++ trunk/moon/plugin/plugin-class.cpp  2008-02-19 15:26:06 UTC (rev 96156)
@@ -1656,7 +1656,7 @@
 
        // not implemented yet.
        case MoonId_MaxFrameRate:
-               DEBUG_WARN_NOTIMPLEMENTED ("maxFrameRate property");
+               plugin->setMaxFrameRate (NPVARIANT_TO_INT32 (*value));
                return true;
 
        // Cant be set after initialization so return true

Modified: trunk/moon/plugin/plugin.cpp
===================================================================
--- trunk/moon/plugin/plugin.cpp        2008-02-19 15:24:19 UTC (rev 96155)
+++ trunk/moon/plugin/plugin.cpp        2008-02-19 15:26:06 UTC (rev 96156)
@@ -230,6 +230,7 @@
        table_add (table, "Background:", 0, row++);
        table_add (table, "Kind:", 0, row++);
        table_add (table, "Windowless:", 0, row++);
+       table_add (table, "MaxFrameRate:", 0, row++);
        
        row = 0;
        table_add (table, source, 1, row++);
@@ -240,6 +241,8 @@
        table_add (table, background, 1, row++);
        table_add (table, xaml_loader == NULL ? "(Unknown)" : 
(xaml_loader->IsManaged () ? "1.1 (XAML + Managed Code)" : "1.0 (Pure XAML)"), 
1, row++);
        table_add (table, windowless ? "yes" : "no", 1, row++);
+       snprintf (buffer, sizeof (buffer), "%i", maxFrameRate);
+       table_add (table, buffer, 1, row++);
        
        row++;
        properties_fps_label = gtk_label_new ("");
@@ -296,6 +299,11 @@
        this->background = NULL;
 
        this->windowless = false;
+       
+       // MSDN says the default is 24: 
http://msdn2.microsoft.com/en-us/library/bb979688.aspx
+       // blog says the default is 60: 
http://blogs.msdn.com/seema/archive/2007/10/07/perf-debugging-tips-enableredrawregions-a-performance-bug-in-videobrush.aspx
+       // testing seems to confirm that the default is 60.
+       this->maxFrameRate = 60;
 
        this->vm_missing_file = NULL;
        this->xaml_loader = NULL;
@@ -393,6 +401,16 @@
                        this->background = g_strdup (argv[i]);
                        continue;
                }
+               
+               if (!g_ascii_strcasecmp (argn [i], "windowless")) {
+                       this->windowless = !g_ascii_strcasecmp (argv [i], 
"true");
+                       continue;
+               }
+               
+               if (!g_ascii_strcasecmp (argn [i], "framerate")) {
+                       this->maxFrameRate = atoi (argv [i]);
+                       continue;
+               }
        }
 }
 
@@ -533,6 +551,8 @@
        display = gdk_drawable_get_display 
(this->surface->GetDrawingArea()->window);
        gtk_widget_show_all (this->container);
        this->UpdateSource ();
+       
+       TimeManager::Instance ()->SetMaximumRefreshRate (maxFrameRate);
 }
 
 void
@@ -1075,6 +1095,20 @@
        return this->windowless;
 }
 
+int
+PluginInstance::getMaxFrameRate ()
+{
+       return this->maxFrameRate;
+}
+
+void
+PluginInstance::setMaxFrameRate (int value)
+{
+       this->maxFrameRate = value;
+       
+       TimeManager::Instance ()->SetMaximumRefreshRate (MAX (value, 64));
+}
+
 int32
 PluginInstance::getActualHeight ()
 {

Modified: trunk/moon/plugin/plugin.h
===================================================================
--- trunk/moon/plugin/plugin.h  2008-02-19 15:24:19 UTC (rev 96155)
+++ trunk/moon/plugin/plugin.h  2008-02-19 15:26:06 UTC (rev 96156)
@@ -41,6 +41,7 @@
        char *onError;
 
        bool windowless;
+       int maxFrameRate;
 
        GtkWidget *properties_fps_label;
 
@@ -127,6 +128,8 @@
        void setEnableRedrawRegions (bool value);
        bool getEnableHtmlAccess ();
        bool getWindowless ();
+       void setMaxFrameRate (int value);
+       int  getMaxFrameRate ();
 
        MoonlightScriptControlObject *getRootObject ();
        NPP getInstance ();

Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2008-02-19 15:24:19 UTC (rev 96155)
+++ trunk/moon/src/ChangeLog    2008-02-19 15:26:06 UTC (rev 96156)
@@ -1,3 +1,9 @@
+2008-02-19  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
+
+       * pipeline-ffmpeg.cpp: Comment out error message which just shows 
ffmpeg's
+         shortcomings.
+       * media.cpp: Remove printf.
+
 2008-02-19  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * moon-path.c: #if out moon_get_origin since it's not used 

Modified: trunk/moon/src/media.cpp
===================================================================
--- trunk/moon/src/media.cpp    2008-02-19 15:24:19 UTC (rev 96155)
+++ trunk/moon/src/media.cpp    2008-02-19 15:26:06 UTC (rev 96156)
@@ -517,7 +517,6 @@
        }
        
        if (advance_frame_timeout_id != 0) {
-               printf ("MediaElement::Reinitialize (): removing timeout\n");
                TimeManager::Instance ()->RemoveTimeout 
(advance_frame_timeout_id);
                advance_frame_timeout_id = 0;
        }

Modified: trunk/moon/src/pipeline-ffmpeg.cpp
===================================================================
--- trunk/moon/src/pipeline-ffmpeg.cpp  2008-02-19 15:24:19 UTC (rev 96155)
+++ trunk/moon/src/pipeline-ffmpeg.cpp  2008-02-19 15:26:06 UTC (rev 96156)
@@ -299,7 +299,7 @@
                length = avcodec_decode_audio2 (context, (int16_t *) 
audio_buffer, &frame_size, mf->buffer, mf->buflen);
                
                if (length < 0 || (uint32_t) frame_size < mf->buflen) {
-                       media->AddMessage (MEDIA_CODEC_ERROR, g_strdup_printf 
("Error while decoding audio frame (length: %i, frame_size. %i, buflen: %u).", 
length, frame_size, mf->buflen));
+                       //media->AddMessage (MEDIA_CODEC_ERROR, g_strdup_printf 
("Error while decoding audio frame (length: %i, frame_size. %i, buflen: %u).", 
length, frame_size, mf->buflen));
                        return MEDIA_CODEC_ERROR;
                }
                

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to