]> git.sesse.net Git - vlc/commitdiff
Added funcionality for vertical retrace sync for refresh rates 60Hz or lower
authorTony Castley <tcastley@videolan.org>
Thu, 6 Dec 2001 10:29:40 +0000 (10:29 +0000)
committerTony Castley <tcastley@videolan.org>
Thu, 6 Dec 2001 10:29:40 +0000 (10:29 +0000)
(Thanks Rudolf)
Fixed the Prev Title Bug, now works.

plugins/beos/InterfaceWindow.cpp
plugins/beos/VideoWindow.h
plugins/beos/vout_beos.cpp

index 082848a81f03686d61e597520bc66f31ba68d591..03ad843a8d8ecd153b3e39a4ac52882ed579623a 100644 (file)
@@ -2,7 +2,7 @@
  * InterfaceWindow.cpp: beos interface
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: InterfaceWindow.cpp,v 1.8 2001/11/30 09:49:48 tcastley Exp $
+ * $Id: InterfaceWindow.cpp,v 1.9 2001/12/06 10:29:40 tcastley Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -428,7 +428,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
             i_id = p_intf->p_input->stream.p_selected_area->i_id - 1;
 
             /* Disallow area 0 since it is used for video_ts.vob */
-            if( i_id < 0 )
+            if( i_id > 0 )
             {
                 p_area = p_intf->p_input->stream.pp_areas[i_id];
                 input_ChangeArea( p_intf->p_input, (input_area_t*)p_area );
index 0568462e1018f27bdda0e164cefe71dd832f5582..ebb08be77c1ee40ef976acfd47c26164541a94e2 100644 (file)
@@ -2,7 +2,7 @@
  * VideoWindow.h: BeOS video window class prototype
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: VideoWindow.h,v 1.8 2001/12/01 06:38:53 tcastley Exp $
+ * $Id: VideoWindow.h,v 1.9 2001/12/06 10:29:40 tcastley Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Tony Castley <tcastley@mail.powerup.com.au>
@@ -22,8 +22,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
-#include <Bitmap.h>
-
 class VLCView : public BView
 {
 public:
index 624575e68611e6776e3f81f61c59e6abef648a0c..226624c9a79c408496f8a72f961104b8ab6bca66 100644 (file)
@@ -2,7 +2,7 @@
  * vout_beos.cpp: beos video output display method
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: vout_beos.cpp,v 1.33 2001/12/01 06:38:53 tcastley Exp $
+ * $Id: vout_beos.cpp,v 1.34 2001/12/06 10:29:40 tcastley Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -108,21 +108,53 @@ BWindow *beos_GetAppWindow(char *name)
     return window; 
 }
 
-/*****************************************************************************
- * DrawingThread : thread that really does the drawing
- *****************************************************************************/
-int32 Draw(void *data)
-{
-    VideoWindow* p_win;
-    p_win = (VideoWindow *) data;
-    if ( p_win->voutWindow->LockLooper() )
-    {
-        p_win->view->DrawBitmap( p_win->bitmap[p_win->i_buffer],
-                                 p_win->bitmap[p_win->i_buffer]->Bounds(),
-                                 p_win->voutWindow->Bounds() );  
-        p_win->voutWindow->UnlockLooper();
-    }
-    return B_OK;
+/**************************************************************************** 
+* 
+ * DrawingThread : thread that really does the drawing 
+ **************************************************************************** 
+*/ 
+int32 Draw(void *data) 
+{ 
+    //rudolf: sync init: 
+    BScreen *screen; 
+    display_mode disp_mode; 
+    static uint32 refresh, oldrefresh = 0; 
+
+    screen = new BScreen(); 
+    screen-> GetMode(&disp_mode); 
+    refresh = 
+         (disp_mode.timing.pixel_clock * 1000)/((disp_mode.timing.h_total)* 
+         (disp_mode.timing.v_total)); 
+    if (!(refresh == oldrefresh)) 
+    { 
+        printf("\nNew refreshrate is %d:Hz\n",refresh); 
+        oldrefresh = refresh; 
+        if (refresh  < 61) 
+        { 
+            printf("Enabling retrace sync.\n"); 
+        } 
+        else 
+        { 
+            printf("Disabling retrace sync.\n"); 
+        } 
+    } 
+
+    VideoWindow* p_win; 
+    p_win = (VideoWindow *) data; 
+    if ( p_win-> voutWindow-> LockLooper() ) 
+    { 
+        //rudolf: sync: 
+        if (refresh  < 61) 
+        { 
+            screen-> WaitForRetrace(22000);//set timeout for  < 45 Hz... 
+        } 
+
+        p_win-> view-> DrawBitmap( p_win-> bitmap[p_win-> i_buffer], 
+                                 p_win-> bitmap[p_win-> i_buffer]-> Bounds(), 
+                                 p_win-> voutWindow-> Bounds() );  
+        p_win-> voutWindow-> UnlockLooper(); 
+    } 
+    return B_OK; 
 }
 
 /*****************************************************************************