[MPlayer-cvslog] CVS: main/libvo video_out.c, 1.100, 1.101 video_out.h, 1.61, 1.62 vo_directx.c, 1.58, 1.59
Joey Parrish CVS
syncmail at mplayerhq.hu
Thu Nov 10 23:25:56 CET 2005
CVS change done by Joey Parrish CVS
Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv19925/libvo
Modified Files:
video_out.c video_out.h vo_directx.c
Log Message:
add a switch, slave command, and vo control to toggle borderless window.
includes documentation.
Index: video_out.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/video_out.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -r1.100 -r1.101
--- video_out.c 6 Aug 2005 13:38:00 -0000 1.100
+++ video_out.c 10 Nov 2005 22:25:54 -0000 1.101
@@ -45,6 +45,7 @@
int vo_refresh_rate=0;
int vo_keepaspect=1;
int vo_rootwin=0;
+int vo_border=1;
int WinID = -1;
int vo_pts=0; // for hw decoding
Index: video_out.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/video_out.h,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- video_out.h 21 Aug 2005 01:20:31 -0000 1.61
+++ video_out.h 10 Nov 2005 22:25:54 -0000 1.62
@@ -57,6 +57,7 @@
#define VOCTRL_ONTOP 25
#define VOCTRL_ROOTWIN 26
+#define VOCTRL_BORDER 27
// Vo can be used by xover
#define VOCTRL_XOVERLAY_SUPPORT 22
@@ -202,6 +203,7 @@
extern int vo_keepaspect;
extern int vo_rootwin;
extern int vo_ontop;
+extern int vo_border;
extern int vo_gamma_brightness;
extern int vo_gamma_saturation;
Index: vo_directx.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_directx.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- vo_directx.c 10 Nov 2005 21:15:37 -0000 1.58
+++ vo_directx.c 10 Nov 2005 22:25:54 -0000 1.59
@@ -670,6 +670,7 @@
if(!vidmode && !vo_fs){
if(WinID == -1) {
RECT rdw=rd;
+ if (vo_border)
AdjustWindowRect(&rdw,WNDSTYLE,FALSE);
// printf("window: %i %i %ix%i\n",rdw.left,rdw.top,rdw.right - rdw.left,rdw.bottom - rdw.top);
rdw.left += monitor_rect.left; /* move to global coordinate space */
@@ -1039,7 +1040,7 @@
if (WinID != -1) hWnd = WinID;
else
hWnd = CreateWindowEx(vidmode?WS_EX_TOPMOST:0,
- WNDCLASSNAME_WINDOWED,"",(vidmode)?WS_POPUP:WNDSTYLE,
+ WNDCLASSNAME_WINDOWED,"",(vidmode || !vo_border)?WS_POPUP:WNDSTYLE,
CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,NULL,NULL,hInstance,NULL);
wc.hbrBackground = blackbrush;
wc.lpszClassName = WNDCLASSNAME_FULLSCREEN;
@@ -1295,6 +1296,7 @@
rd.right = rd.left + d_image_width;
rd.bottom = rd.top + d_image_height;
if (WinID == -1) {
+ if (vo_border)
AdjustWindowRect(&rd,WNDSTYLE,FALSE);
SetWindowPos(hWnd,NULL, vo_dx, vo_dy,rd.right-rd.left,rd.bottom-rd.top,SWP_SHOWWINDOW|SWP_NOOWNERZORDER);
}
@@ -1449,6 +1451,30 @@
return query_format(*((uint32_t*)data));
case VOCTRL_DRAW_IMAGE:
return put_image(data);
+ case VOCTRL_BORDER:
+ if(WinID != -1) return VO_TRUE;
+ if(vidmode)
+ {
+ mp_msg(MSGT_VO, MSGL_ERR,"<vo_directx><ERROR>border has no meaning in exclusive mode\n");
+ }
+ else
+ {
+ if(vo_border) {
+ vo_border = 0;
+ SetWindowLong(hWnd, GWL_STYLE, WS_POPUP);
+ } else {
+ vo_border = 1;
+ SetWindowLong(hWnd, GWL_STYLE, WNDSTYLE);
+ }
+ // needed AFAICT to force the window to
+ // redisplay with the new style. --Joey
+ if (!vo_fs) {
+ ShowWindow(hWnd,SW_HIDE);
+ ShowWindow(hWnd,SW_SHOW);
+ }
+ Directx_ManageDisplay();
+ }
+ return VO_TRUE;
case VOCTRL_ONTOP:
if(WinID != -1) return VO_TRUE;
if(vidmode)
More information about the MPlayer-cvslog
mailing list