[MPlayer-dev-eng] [PATCH] directx rootwin support

Joey Parrish joey at nicewarrior.org
Thu Aug 12 02:27:58 CEST 2004


Hello,

This first patch adds -rootwin support to vo_directx.  It's pretty
simple and straightforward.  I see no reason not to commit this, but
feel free to correct me.

The second patch adds VOCTRL_ROOTWIN and MP_CMD_VO_ROOTWIN to allow
toggling rootwin at runtime.  I am only adding support for this VOCTRL
to vo_directx at the moment.  I don't know whether any other vo's can
support this or not.  X11 people should look into that.

Comments?  Commit #1?  #2 is stupid?  :)

--Joey

-- 
"SAKE!!!!" --Tom Cruise
-------------- next part --------------
adds rootwin support to vo_directx

diff -Nur main.sofar/libvo/vo_directx.c main.dev/libvo/vo_directx.c
--- main.sofar/libvo/vo_directx.c	2004-07-19 23:19:50.000000000 +0000
+++ main.dev/libvo/vo_directx.c	2004-08-11 17:59:39.253732800 +0000
@@ -69,6 +69,7 @@
 extern int vo_fs;
 extern int vo_directrendering;
 extern int vo_ontop;
+extern int vo_rootwin;
 extern int vidmode;
 
 /*****************************************************************************
@@ -600,7 +601,7 @@
           RECT rdw=rd;
           AdjustWindowRect(&rdw,WS_OVERLAPPEDWINDOW|WS_SIZEBOX,FALSE);
 //          printf("window: %i %i %ix%i\n",rdw.left,rdw.top,rdw.right - rdw.left,rdw.bottom - rdw.top);      
-          SetWindowPos(hWnd,(vo_ontop)?HWND_TOPMOST:HWND_NOTOPMOST,rdw.left,rdw.top,rdw.right-rdw.left,rdw.bottom-rdw.top,SWP_NOOWNERZORDER); 
+          SetWindowPos(hWnd,(vo_ontop)?HWND_TOPMOST:(vo_rootwin?HWND_BOTTOM:HWND_NOTOPMOST),rdw.left,rdw.top,rdw.right-rdw.left,rdw.bottom-rdw.top,SWP_NOOWNERZORDER); 
     }
     else SetWindowPos(hWndFS,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE|SWP_NOOWNERZORDER);
 
-------------- next part --------------
adds runtime toggle of root window playback
  only supported by vo_directx at the moment

diff -Nur main.sofar/input/input.c main.dev/input/input.c
--- main.sofar/input/input.c	2004-08-10 03:07:23.000000000 +0000
+++ main.dev/input/input.c	2004-08-11 17:59:39.193646400 +0000
@@ -100,6 +100,7 @@
 #endif
   { MP_CMD_VO_FULLSCREEN, "vo_fullscreen", 0, { {-1,{0}} } },
   { MP_CMD_VO_ONTOP, "vo_ontop", 0, { {-1,{0}} } },
+  { MP_CMD_VO_ROOTWIN, "vo_rootwin", 0, { {-1,{0}} } },
   { MP_CMD_SCREENSHOT, "screenshot", 0, { {-1,{0}} } },
   { MP_CMD_PANSCAN, "panscan",1,  { {MP_CMD_ARG_FLOAT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
   { MP_CMD_LOADFILE, "loadfile", 1, { {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } },
diff -Nur main.sofar/input/input.h main.dev/input/input.h
--- main.sofar/input/input.h	2004-07-17 12:47:12.000000000 +0000
+++ main.dev/input/input.h	2004-08-11 17:58:41.560774400 +0000
@@ -54,6 +54,7 @@
 #define MP_CMD_SUB_FORCED_ONLY 50
 #define MP_CMD_VO_ONTOP 51
 #define MP_CMD_SUB_SELECT 52
+#define MP_CMD_VO_ROOTWIN 53
 
 #define MP_CMD_GUI_EVENTS       5000
 #define MP_CMD_GUI_LOADFILE     5001
diff -Nur main.sofar/libvo/video_out.h main.dev/libvo/video_out.h
--- main.sofar/libvo/video_out.h	2004-08-02 18:01:57.000000000 +0000
+++ main.dev/libvo/video_out.h	2004-08-11 17:59:39.223689600 +0000
@@ -56,6 +56,7 @@
 #define VOCTRL_START_SLICE 21
 
 #define VOCTRL_ONTOP 25
+#define VOCTRL_ROOTWIN 26
 
 // Vo can be used by xover
 #define VOCTRL_XOVERLAY_SUPPORT 22
diff -Nur main.sofar/libvo/vo_directx.c main.dev/libvo/vo_directx.c
--- main.sofar/libvo/vo_directx.c	2004-07-19 23:19:50.000000000 +0000
+++ main.dev/libvo/vo_directx.c	2004-08-11 17:59:39.253732800 +0000
@@ -1260,6 +1260,18 @@
 				Directx_ManageDisplay();
 			}
 		return VO_TRUE;
+    case VOCTRL_ROOTWIN:
+	        if(vidmode)
+			{
+				mp_msg(MSGT_VO, MSGL_ERR,"<vo_directx><ERROR>rootwin has no meaning in exclusive mode\n");
+			}
+	        else
+			{
+				if(vo_rootwin) vo_rootwin = 0;
+				else vo_rootwin = 1;
+				Directx_ManageDisplay();
+			}
+		return VO_TRUE;
     case VOCTRL_FULLSCREEN:
 		{
 	        if(vidmode)
diff -Nur main.sofar/mplayer.c main.dev/mplayer.c
--- main.sofar/mplayer.c	2004-08-11 17:57:55.053900800 +0000
+++ main.dev/mplayer.c	2004-08-11 17:59:39.293790400 +0000
@@ -749,6 +749,7 @@
 int osd_show_percentage = 0;
 int osd_show_tv_channel = 25;
 int osd_show_ontop = 0;
+int osd_show_rootwin = 0;
 int osd_show_framedropping = 0;
 
 int rtc_fd=-1;
@@ -3043,6 +3044,17 @@
      }
 
     } break;
+    case MP_CMD_VO_ROOTWIN:
+    {
+     if(video_out && vo_config_count) {
+       video_out->control(VOCTRL_ROOTWIN, 0);
+#ifdef USE_OSD
+       osd_show_ontop=10;
+       vo_osd_changed(OSDTYPE_SUBTITLE);
+#endif
+     }
+
+    } break;
     case MP_CMD_PANSCAN : {
       if ( !video_out ) break;
       if ( video_out->control( VOCTRL_GET_PANSCAN,NULL ) == VO_TRUE )
@@ -3622,6 +3634,9 @@
       } else if (osd_show_ontop) {
 	  snprintf(osd_text_tmp, 63, "Stay on top: %sabled", vo_ontop?"en":"dis");
 	  osd_show_ontop--;
+      } else if (osd_show_rootwin) {
+	  snprintf(osd_text_tmp, 63, "Rootwin: %sabled", vo_rootwin?"en":"dis");
+	  osd_show_rootwin--;
       } else if (osd_show_framedropping) {
 	  snprintf(osd_text_tmp, 63, "Framedropping: %s",
 	     (frame_dropping == 1 ? "on" :


More information about the MPlayer-dev-eng mailing list