diff options
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/mga_common.c | 3 | ||||
-rw-r--r-- | libvo/video_out.c | 1 | ||||
-rw-r--r-- | libvo/video_out.h | 2 | ||||
-rw-r--r-- | libvo/vo_directx.c | 23 | ||||
-rw-r--r-- | libvo/vo_dxr2.c | 5 | ||||
-rw-r--r-- | libvo/vo_dxr3.c | 6 | ||||
-rw-r--r-- | libvo/vo_gl.c | 5 | ||||
-rw-r--r-- | libvo/vo_gl2.c | 8 | ||||
-rw-r--r-- | libvo/vo_x11.c | 6 | ||||
-rw-r--r-- | libvo/vo_xmga.c | 2 | ||||
-rw-r--r-- | libvo/vo_xover.c | 6 | ||||
-rw-r--r-- | libvo/vo_xv.c | 6 | ||||
-rw-r--r-- | libvo/vo_xvidix.c | 5 | ||||
-rw-r--r-- | libvo/vo_xvmc.c | 5 | ||||
-rw-r--r-- | libvo/w32_common.c | 16 | ||||
-rw-r--r-- | libvo/w32_common.h | 1 | ||||
-rw-r--r-- | libvo/x11_common.c | 10 | ||||
-rw-r--r-- | libvo/x11_common.h | 2 |
18 files changed, 102 insertions, 10 deletions
diff --git a/libvo/mga_common.c b/libvo/mga_common.c index e5ef50042d..89560c3e9b 100644 --- a/libvo/mga_common.c +++ b/libvo/mga_common.c @@ -324,6 +324,9 @@ static uint32_t control(uint32_t request, void *data, ...) #endif #ifdef VO_XMGA + case VOCTRL_ONTOP: + vo_x11_ontop(); + return VO_TRUE; case VOCTRL_GET_PANSCAN: if ( !inited || !vo_fs ) return VO_FALSE; return VO_TRUE; diff --git a/libvo/video_out.c b/libvo/video_out.c index ad3f01265b..33aa944f5d 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -40,6 +40,7 @@ int vo_vsync = 0; int vo_fs = 0; int vo_fsmode = 0; float vo_panscan = 0.0f; +int vo_ontop = 0; int vo_pts=0; // for hw decoding float vo_fps=0; // for mp1e rte diff --git a/libvo/video_out.h b/libvo/video_out.h index dc0ff6997e..c4a476c5d0 100644 --- a/libvo/video_out.h +++ b/libvo/video_out.h @@ -55,6 +55,8 @@ // ... 21 #define VOCTRL_START_SLICE 21 +#define VOCTRL_ONTOP 25 + // Vo can be used by xover #define VOCTRL_XOVERLAY_SUPPORT 22 diff --git a/libvo/vo_directx.c b/libvo/vo_directx.c index 6e3e5192ea..f986b48d3f 100644 --- a/libvo/vo_directx.c +++ b/libvo/vo_directx.c @@ -43,7 +43,6 @@ static HINSTANCE hddraw_dll; //handle to ddraw.dll static RECT rd; //rect of our stretched image static RECT rs; //rect of our source image static HWND hWnd=NULL; //handle to the window -static uint32_t ontop=0; //always in foreground static uint32_t image_width, image_height; //image width and height static uint32_t d_image_width, d_image_height; //image width and height zoomed static uint8_t *image=NULL; //image data @@ -60,6 +59,7 @@ extern void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w extern int vo_doublebuffering; //tribblebuffering extern int vo_fs; extern int vo_directrendering; +extern int vo_ontop; /***************************************************************************** * DirectDraw GUIDs. @@ -527,12 +527,12 @@ static uint32_t Directx_ManageDisplay(uint32_t width,uint32_t height) dwUpdateFlags = DDOVER_SHOW | DDOVER_DDFX; /*if hardware can't do colorkeying set the window on top*/ if(capsDrv.dwCKeyCaps & DDCKEYCAPS_DESTOVERLAY) dwUpdateFlags |= DDOVER_KEYDESTOVERRIDE; - else ontop = 1; + else vo_ontop = 1; } /*calculate window rect with borders*/ if(!vo_fs)AdjustWindowRect(&rd_window,WS_OVERLAPPEDWINDOW|WS_SIZEBOX,0); - if((vo_fs) || (!vo_fs && ontop))hWndafter=HWND_TOPMOST; + if((vo_fs) || (!vo_fs && vo_ontop))hWndafter=HWND_TOPMOST; else hWndafter=HWND_NOTOPMOST; /*display the window*/ @@ -822,11 +822,6 @@ static uint32_t preinit(const char *arg) mp_msg(MSGT_VO,MSGL_V,"<vo_directx><INFO>disabled overlay\n"); nooverlay = 1; } - if(strstr(arg,"ontop")) - { - mp_msg(MSGT_VO,MSGL_V,"<vo_directx><INFO>window ontop\n"); - ontop = 1; - } } if (Directx_InitDirectDraw()!= 0)return 1; //init DirectDraw if (Directx_CheckPrimaryPixelformat()!=0)return 1; @@ -1162,6 +1157,18 @@ static uint32_t control(uint32_t request, void *data, ...) return query_format(*((uint32_t*)data)); case VOCTRL_DRAW_IMAGE: return put_image(data); + case VOCTRL_ONTOP: + if(vm) + { + mp_msg(MSGT_VO, MSGL_ERR,"<vo_directx><ERROR>ontop has no meaning in exclusive mode\n"); + } + else + { + if(vo_ontop) vo_ontop = 0; + else vo_ontop = 1; + Directx_ManageDisplay(0,0); + } + return VO_TRUE; case VOCTRL_FULLSCREEN: { if(vm) diff --git a/libvo/vo_dxr2.c b/libvo/vo_dxr2.c index d1afe2a0b2..4d3a84af66 100644 --- a/libvo/vo_dxr2.c +++ b/libvo/vo_dxr2.c @@ -854,6 +854,8 @@ static uint32_t config(uint32_t s_width, uint32_t s_height, uint32_t width, uint break; } + if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop); + // start playing if(ioctl(dxr2_fd, DXR2_IOC_PLAY, NULL) == 0) { playing = 1; @@ -1065,6 +1067,9 @@ static uint32_t control(uint32_t request, void *data, ...) flush_dxr2(); ioctl(dxr2_fd, DXR2_IOC_PLAY, NULL); return VO_TRUE; + case VOCTRL_ONTOP: + vo_x11_ontop(); + return VO_TRUE; case VOCTRL_FULLSCREEN: if(!use_ol) return VO_NOTIMPL; diff --git a/libvo/vo_dxr3.c b/libvo/vo_dxr3.c index 8cad38217d..aea525876e 100644 --- a/libvo/vo_dxr3.c +++ b/libvo/vo_dxr3.c @@ -285,6 +285,9 @@ static uint32_t control(uint32_t request, void *data, ...) } return VO_TRUE; #ifdef HAVE_X11 + case VOCTRL_ONTOP: + vo_x11_ontop(); + return VO_TRUE; case VOCTRL_FULLSCREEN: if (dxr3_overlay) { vo_x11_fullscreen(); @@ -668,6 +671,9 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32 overlay_set_mode(overlay_data, EM8300_OVERLAY_MODE_OVERLAY); overlay_set_mode(overlay_data, EM8300_OVERLAY_MODE_RECTANGLE); } + + if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop); + #endif return 0; diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 8fd08bdf0e..0acf616991 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -207,6 +207,8 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin saver_off(mDisplay); // turning off screen saver + if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop); + return 0; } @@ -314,6 +316,9 @@ static uint32_t control(uint32_t request, void *data, ...) case VOCTRL_RESUME: return (int_pause=0); case VOCTRL_QUERY_FORMAT: return query_format(*((uint32_t*)data)); + case VOCTRL_ONTOP: + vo_x11_ontop(); + return VO_TRUE; case VOCTRL_FULLSCREEN: vo_x11_fullscreen(); return VO_TRUE; diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index b4e0e0a41c..4b249e777b 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -1006,6 +1006,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin return -1; #ifndef GL_WIN32 saver_off(mDisplay); + if (vo_ontop) vo_x11_setlayer(mDisplay,vo_window, vo_ontop); #endif return 0; @@ -1172,6 +1173,13 @@ static uint32_t control(uint32_t request, void *data, ...) case VOCTRL_RESUME: return (int_pause=0); case VOCTRL_QUERY_FORMAT: return query_format(*((uint32_t*)data)); + case VOCTRL_ONTOP: +#ifdef GL_WIN32 + vo_w32_ontop(); +#else + vo_x11_ontop(); +#endif + return VO_TRUE; case VOCTRL_FULLSCREEN: #ifdef GL_WIN32 vo_w32_fullscreen(); diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c index 07b1c9045a..6203f783d7 100644 --- a/libvo/vo_x11.c +++ b/libvo/vo_x11.c @@ -435,6 +435,9 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t #endif saver_off(mDisplay); + + if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop); + return 0; } @@ -657,6 +660,9 @@ static uint32_t control(uint32_t request, void *data, ...) va_end(ap); return vo_x11_get_equalizer(data, value); } + case VOCTRL_ONTOP: + vo_x11_ontop(); + return VO_TRUE; case VOCTRL_FULLSCREEN: { vo_x11_fullscreen(); diff --git a/libvo/vo_xmga.c b/libvo/vo_xmga.c index 3d57eb5b9d..444f227d15 100644 --- a/libvo/vo_xmga.c +++ b/libvo/vo_xmga.c @@ -221,6 +221,8 @@ static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width, uint3 saver_off(mDisplay); + if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop); + XFlush( mDisplay ); XSync( mDisplay,False ); diff --git a/libvo/vo_xover.c b/libvo/vo_xover.c index 7c89733e4d..256a22ec56 100644 --- a/libvo/vo_xover.c +++ b/libvo/vo_xover.c @@ -192,6 +192,9 @@ static void set_window(int force_update) XSetForeground(mDisplay, vo_gc, colorkey); XFillRectangle(mDisplay, vo_window, vo_gc, drwX, drwY, drwWidth, (vo_fs ? drwHeight - 1 : drwHeight)); + + if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop); + /* flush, update drawable */ XFlush(mDisplay); @@ -456,6 +459,9 @@ static uint32_t control(uint32_t request, void *data, ...) case VOCTRL_GET_PANSCAN: if ( !vo_config_count || !vo_fs ) return VO_FALSE; return VO_TRUE; + case VOCTRL_ONTOP: + vo_x11_ontop(); + return VO_TRUE; case VOCTRL_FULLSCREEN: vo_x11_fullscreen(); case VOCTRL_SET_PANSCAN: diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c index b6b6856f43..8062385e9f 100644 --- a/libvo/vo_xv.c +++ b/libvo/vo_xv.c @@ -346,6 +346,9 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32 mp_msg(MSGT_VO,MSGL_V, "[xv] dx: %d dy: %d dw: %d dh: %d\n",drwX,drwY,vo_dwidth,vo_dheight ); saver_off(mDisplay); // turning off screen saver + + if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop); + return 0; } @@ -749,6 +752,9 @@ static uint32_t control(uint32_t request, void *data, ...) return(vo_xv_get_eq(xv_port, data, value)); } + case VOCTRL_ONTOP: + vo_x11_ontop(); + return VO_TRUE; } return VO_NOTIMPL; } diff --git a/libvo/vo_xvidix.c b/libvo/vo_xvidix.c index c064cc7c44..8d22c75106 100644 --- a/libvo/vo_xvidix.c +++ b/libvo/vo_xvidix.c @@ -368,6 +368,8 @@ else panscan_calc(); + if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop); + saver_off(mDisplay); /* turning off screen saver */ return(0); @@ -466,6 +468,9 @@ static uint32_t control(uint32_t request, void *data, ...) case VOCTRL_GET_PANSCAN: if ( !vo_config_count || !vo_fs ) return VO_FALSE; return VO_TRUE; + case VOCTRL_ONTOP: + vo_x11_ontop(); + return VO_TRUE; case VOCTRL_FULLSCREEN: vo_x11_fullscreen(); case VOCTRL_SET_PANSCAN: diff --git a/libvo/vo_xvmc.c b/libvo/vo_xvmc.c index e09dd96b98..31fe54f09f 100644 --- a/libvo/vo_xvmc.c +++ b/libvo/vo_xvmc.c @@ -792,6 +792,8 @@ found_subpic: mp_msg(MSGT_VO,MSGL_V, "[xvmc] dx: %d dy: %d dw: %d dh: %d\n",drwX,drwY,vo_dwidth,vo_dheight ); + if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop); + saver_off(mDisplay); // turning off screen saver //end vo_xv @@ -1408,6 +1410,9 @@ static uint32_t control(uint32_t request, void *data, ... ) //vo_xv case VOCTRL_GUISUPPORT: return VO_TRUE; + case VOCTRL_ONTOP: + vo_x11_ontop(); + return VO_TRUE; case VOCTRL_FULLSCREEN: vo_x11_fullscreen(); case VOCTRL_GET_PANSCAN: diff --git a/libvo/w32_common.c b/libvo/w32_common.c index a6d770149a..2a46ee1206 100644 --- a/libvo/w32_common.c +++ b/libvo/w32_common.c @@ -146,18 +146,20 @@ static void resetMode(void) { } int createRenderingContext(void) { + HWND layer = HWND_NOTOPMOST; if (wglContext) return 1; + if (vo_fs || vo_ontop) layer = HWND_TOPMOST; if (vo_fs) { changeMode(); - SetWindowPos(vo_hwnd, HWND_TOPMOST, 0, 0, vo_screenwidth, vo_screenheight, SWP_SHOWWINDOW); + SetWindowPos(vo_hwnd, layer, 0, 0, vo_screenwidth, vo_screenheight, SWP_SHOWWINDOW); if (cursor) { ShowCursor(0); cursor = 0; } } else { resetMode(); - SetWindowPos(vo_hwnd, HWND_NOTOPMOST, (vo_screenwidth - vo_dwidth) / 2, (vo_screenheight - vo_dheight) / 2, vo_dwidth, vo_dheight, SWP_SHOWWINDOW); + SetWindowPos(vo_hwnd, layer, (vo_screenwidth - vo_dwidth) / 2, (vo_screenheight - vo_dheight) / 2, vo_dwidth, vo_dheight, SWP_SHOWWINDOW); if (!cursor) { ShowCursor(1); cursor = 1; @@ -256,6 +258,16 @@ void vo_w32_fullscreen(void) { createRenderingContext(); } +void vo_w32_ontop( void ) +{ + vo_ontop = !vo_ontop; + if (!vo_fs) { + HWND layer = HWND_NOTOPMOST; + if (vo_ontop) layer = HWND_TOPMOST; + SetWindowPos(vo_hwnd, layer, (vo_screenwidth - vo_dwidth) / 2, (vo_screenheight - vo_dheight) / 2, vo_dwidth, vo_dheight, SWP_SHOWWINDOW); + } +} + void vo_w32_uninit() { mp_msg(MSGT_VO, MSGL_V, "vo: win32: uninit\n"); resetMode(); diff --git a/libvo/w32_common.h b/libvo/w32_common.h index 1b67a962a2..ddb86d3571 100644 --- a/libvo/w32_common.h +++ b/libvo/w32_common.h @@ -6,6 +6,7 @@ extern uint32_t o_dheight; extern HDC vo_hdc; extern int vo_fs; extern int vo_vm; +extern int vo_ontop; extern int vo_init(void); extern void vo_w32_uninit(void); diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 2f08c375d0..0fd9bc92e9 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -1050,6 +1050,9 @@ void vo_x11_fullscreen( void ) vo_x11_decoration( mDisplay,vo_window,(vo_fs) ? 0 : 1 ); vo_x11_sizehint( x,y,w,h,0 ); vo_x11_setlayer( mDisplay,vo_window,vo_fs ); + + if ((!(vo_fs)) & vo_ontop) vo_x11_setlayer(mDisplay, vo_window,vo_ontop); + if(vo_wm_type==0 && !(vo_fsmode&16)) // XUnmapWindow( mDisplay,vo_window ); // required for MWM XWithdrawWindow(mDisplay,vo_window,mScreen); @@ -1062,6 +1065,13 @@ void vo_x11_fullscreen( void ) XFlush( mDisplay ); } +void vo_x11_ontop( void ) +{ + vo_ontop = (!(vo_ontop)); + + vo_x11_setlayer(mDisplay, vo_window, vo_ontop); +} + /* * XScreensaver stuff */ diff --git a/libvo/x11_common.h b/libvo/x11_common.h index dc25b1d93b..253fd0f7b6 100644 --- a/libvo/x11_common.h +++ b/libvo/x11_common.h @@ -27,6 +27,7 @@ extern int vo_fs_layer; extern int vo_wm_type; extern int vo_fs_type; extern char** vo_fstype_list; +extern int vo_ontop; extern char *mDisplayName; extern Display *mDisplay; @@ -60,6 +61,7 @@ extern Window vo_x11_create_smooth_window( Display *mDisplay, Window mRoot, extern void vo_x11_clearwindow_part(Display *mDisplay, Window vo_window, int img_width, int img_height, int use_fs); extern void vo_x11_clearwindow( Display *mDisplay, Window vo_window ); +extern void vo_x11_ontop(); #endif |