annotate libvo/vo_xmga.c @ 4583:b80542b7982f

added Anders Johansson
author gabucino
date Fri, 08 Feb 2002 13:55:53 +0000
parents cc34a9ba42df
children 5fbfd8545c3b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
100
201c2f931497 added #define SHOW_TIME option... (debug)
arpi_esp
parents: 56
diff changeset
1
201c2f931497 added #define SHOW_TIME option... (debug)
arpi_esp
parents: 56
diff changeset
2 //#define SHOW_TIME
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
4 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5 * video_out_xmga.c
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
7 * Copyright (C) Zoltan Ponekker - Jan 2001
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
8 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9 * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
11 * mpeg2dec is free software; you can redistribute it and/or modify
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
13 * the Free Software Foundation; either version 2, or (at your option)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
14 * any later version.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
15 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
16 * mpeg2dec is distributed in the hope that it will be useful,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19 * GNU General Public License for more details.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22 * along with GNU Make; see the file COPYING. If not, write to
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
24 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
27 #include <stdio.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
28 #include <stdlib.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
29 #include <string.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
30
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
31 #include "config.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
32 #include "video_out.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
33 #include "video_out_internal.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
34
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
35 LIBVO_EXTERN( xmga )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
37 #include <sys/ioctl.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
38 #include <unistd.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
39 #include <fcntl.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40 #include <sys/mman.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42 #include "drivers/mga_vid.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
43
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
44 #include <X11/Xlib.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45 #include <X11/Xutil.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
46 #include <errno.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
47
4017
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
48 #ifdef HAVE_XINERAMA
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
49 #include <X11/extensions/Xinerama.h>
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
50 #endif
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
51
31
1fc618eba830 added check_events() interface
arpi_esp
parents: 1
diff changeset
52 #include "x11_common.h"
616
41d6eec69b60 clean up
pontscho
parents: 614
diff changeset
53 #include "sub.h"
2057
378aed6b232d Use aspect()
atmos4
parents: 2039
diff changeset
54 #include "aspect.h"
31
1fc618eba830 added check_events() interface
arpi_esp
parents: 1
diff changeset
55
182
80a7b40f201a *** empty log message ***
pontscho
parents: 120
diff changeset
56 #ifdef SHOW_TIME
100
201c2f931497 added #define SHOW_TIME option... (debug)
arpi_esp
parents: 56
diff changeset
57 #include "../linux/timer.h"
201c2f931497 added #define SHOW_TIME option... (debug)
arpi_esp
parents: 56
diff changeset
58 static unsigned int timer=0;
201c2f931497 added #define SHOW_TIME option... (debug)
arpi_esp
parents: 56
diff changeset
59 static unsigned int timerd=0;
201c2f931497 added #define SHOW_TIME option... (debug)
arpi_esp
parents: 56
diff changeset
60 #endif
201c2f931497 added #define SHOW_TIME option... (debug)
arpi_esp
parents: 56
diff changeset
61
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62 static vo_info_t vo_info =
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64 "X11 (Matrox G200/G400 overlay in window using /dev/mga_vid)",
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65 "xmga",
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
66 "Zoltan Ponekker <pontscho@makacs.poliod.hu>",
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
67 ""
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
68 };
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
69
922
db06ae8967eb Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents: 844
diff changeset
70 //static Display * mDisplay;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
71 static Window mWindow;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72 static GC mGC;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
73 static XGCValues wGCV;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
74
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
75 static XImage * myximage;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
76
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
77 static uint32_t mDepth, bpp, mode;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
78 static XWindowAttributes attribs;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
79 static uint32_t X_already_started=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
81 static uint32_t wndHeight;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82 static uint32_t wndWidth;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83 static uint32_t wndX;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
84 static uint32_t wndY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
85
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
86 static uint32_t fgColor;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
87
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
88 static uint32_t mvHeight;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
89 static uint32_t mvWidth;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
90
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
91 static Window mRoot;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
92 static uint32_t drwX,drwY,drwWidth,drwHeight,drwBorderWidth,drwDepth;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
93 static uint32_t drwcX,drwcY,dwidth,dheight,mFullscreen;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
94
1783
beec84c3d830 fix gui support
pontscho
parents: 1723
diff changeset
95 #ifdef HAVE_NEW_GUI
723
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
96 static uint32_t mdwidth,mdheight;
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
97 #endif
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
98
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
99 static XSetWindowAttributes xWAttribs;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
100
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
101 #include "mga_common.c"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
102
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
103 static void mDrawColorKey( void )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
104 {
4568
cc34a9ba42df fs resize bug fix.
pontscho
parents: 4433
diff changeset
105 XSetBackground( mDisplay,mGC,0 );
cc34a9ba42df fs resize bug fix.
pontscho
parents: 4433
diff changeset
106 // XFillRectangle( mDisplay,mWindow,mGC,0,0,drwWidth,drwHeight );
cc34a9ba42df fs resize bug fix.
pontscho
parents: 4433
diff changeset
107 XClearWindow( mDisplay,mWindow );
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
108 XSetForeground( mDisplay,mGC,fgColor );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
109 XFillRectangle( mDisplay,mWindow,mGC,drwX,drwY,drwWidth,(mFullscreen?drwHeight - 1:drwHeight) );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
110 XFlush( mDisplay );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
111 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
112
120
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
113 static void set_window(){
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
114
1783
beec84c3d830 fix gui support
pontscho
parents: 1723
diff changeset
115 #ifdef HAVE_NEW_GUI
723
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
116 if ( vo_window != None )
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
117 {
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
118 mFullscreen=0;
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
119 dwidth=mdwidth; dheight=mdheight;
1852
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
120 if ( ( vo_dwidth == vo_screenwidth )&&( vo_dheight == vo_screenheight ) )
723
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
121 {
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
122 mFullscreen=1;
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
123 dwidth=vo_screenwidth;
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
124 dheight=vo_screenwidth * mdheight / mdwidth;
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
125 }
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
126 }
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
127 #endif
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
128
1852
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
129 XGetGeometry( mDisplay,mWindow,&mRoot,&drwX,&drwY,&drwWidth,&drwHeight,&drwBorderWidth,&drwDepth );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
130 drwX=0; drwY=0; // drwWidth=wndWidth; drwHeight=wndHeight;
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
131 XTranslateCoordinates( mDisplay,mWindow,mRoot,0,0,&drwcX,&drwcY,&mRoot );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
132 fprintf( stderr,"[xmga] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
133
3558
1dbf58c3d50c aspect ratio bug fix for gui
pontscho
parents: 2249
diff changeset
134 aspect(&dwidth,&dheight,A_NOZOOM);
120
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
135 if ( mFullscreen )
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
136 {
3558
1dbf58c3d50c aspect ratio bug fix for gui
pontscho
parents: 2249
diff changeset
137 aspect(&dwidth,&dheight,A_ZOOM);
120
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
138 drwX=( vo_screenwidth - (dwidth > vo_screenwidth?vo_screenwidth:dwidth) ) / 2;
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
139 drwcX+=drwX;
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
140 drwY=( vo_screenheight - (dheight > vo_screenheight?vo_screenheight:dheight) ) / 2;
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
141 drwcY+=drwY;
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
142 drwWidth=(dwidth > vo_screenwidth?vo_screenwidth:dwidth);
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
143 drwHeight=(dheight > vo_screenheight?vo_screenheight:dheight);
1852
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
144 fprintf( stderr,"[xmga-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
120
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
145 }
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
146
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
147 mDrawColorKey();
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
148
4017
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
149 #ifdef HAVE_XINERAMA
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
150 if(XineramaIsActive(mDisplay))
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
151 {
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
152 XineramaScreenInfo *screens;
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
153 int num_screens;
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
154 int i;
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
155
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
156 screens = XineramaQueryScreens(mDisplay,&num_screens);
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
157
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
158 /* find the screen we are on */
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
159 i = 0;
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
160 while(!(screens[i].x_org <= drwcX && screens[i].y_org <= drwcY &&
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
161 screens[i].x_org + screens[i].width >= drwcX &&
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
162 screens[i].y_org + screens[i].height >= drwcY ))
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
163 {
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
164 i++;
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
165 }
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
166
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
167 /* set drwcX and drwcY to the right values */
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
168 drwcX = drwcX - screens[i].x_org;
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
169 drwcY = drwcY - screens[i].y_org;
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
170 XFree(screens);
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
171 }
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
172
21a75ab24703 Xinerama patch number two by attila.
atmos4
parents: 3990
diff changeset
173 #endif
120
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
174 mga_vid_config.x_org=drwcX;
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
175 mga_vid_config.y_org=drwcY;
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
176 mga_vid_config.dest_width=drwWidth;
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
177 mga_vid_config.dest_height=drwHeight;
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
178
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
179 }
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
180
31
1fc618eba830 added check_events() interface
arpi_esp
parents: 1
diff changeset
181 static void check_events(void)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
182 {
4303
a53d7ca1ed84 move bug fixed
pontscho
parents: 4017
diff changeset
183 int e=vo_x11_check_events(mDisplay);
a53d7ca1ed84 move bug fixed
pontscho
parents: 4017
diff changeset
184 if ( !(e&VO_EVENT_RESIZE) && !(e&VO_EVENT_EXPOSE) ) return;
a53d7ca1ed84 move bug fixed
pontscho
parents: 4017
diff changeset
185 if(e&VO_EVENT_EXPOSE) mDrawColorKey();
a53d7ca1ed84 move bug fixed
pontscho
parents: 4017
diff changeset
186 set_window();
a53d7ca1ed84 move bug fixed
pontscho
parents: 4017
diff changeset
187 if ( ioctl( f,MGA_VID_CONFIG,&mga_vid_config ) )
a53d7ca1ed84 move bug fixed
pontscho
parents: 4017
diff changeset
188 printf( "Error in mga_vid_config ioctl (wrong mga_vid.o version?)" );
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
189 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
190
1501
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 1210
diff changeset
191 static void draw_osd(void)
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 1210
diff changeset
192 { vo_draw_text(mga_vid_config.src_width,mga_vid_config.src_height,draw_alpha);}
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 1210
diff changeset
193
31
1fc618eba830 added check_events() interface
arpi_esp
parents: 1
diff changeset
194 static void flip_page(void){
182
80a7b40f201a *** empty log message ***
pontscho
parents: 120
diff changeset
195 #ifdef SHOW_TIME
100
201c2f931497 added #define SHOW_TIME option... (debug)
arpi_esp
parents: 56
diff changeset
196 unsigned int t;
201c2f931497 added #define SHOW_TIME option... (debug)
arpi_esp
parents: 56
diff changeset
197 t=GetTimer();
201c2f931497 added #define SHOW_TIME option... (debug)
arpi_esp
parents: 56
diff changeset
198 printf(" [timer: %08X diff: %6d dd: %6d ] \n",t,t-timer,(t-timer)-timerd);
201c2f931497 added #define SHOW_TIME option... (debug)
arpi_esp
parents: 56
diff changeset
199 timerd=t-timer;
201c2f931497 added #define SHOW_TIME option... (debug)
arpi_esp
parents: 56
diff changeset
200 timer=t;
182
80a7b40f201a *** empty log message ***
pontscho
parents: 120
diff changeset
201 #endif
100
201c2f931497 added #define SHOW_TIME option... (debug)
arpi_esp
parents: 56
diff changeset
202
1501
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 1210
diff changeset
203 vo_mga_flip_page();
31
1fc618eba830 added check_events() interface
arpi_esp
parents: 1
diff changeset
204 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
205
4433
df8e0f71cc3c new info for tuning
nick
parents: 4352
diff changeset
206 static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t* info)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
207 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
208 char * frame_mem;
56
cdb2e30be421 mga_vid fixes, code cleanup
arpi_esp
parents: 47
diff changeset
209 // uint32_t frame_size;
927
2098be9cb19b mScreen removed -> segfault solved
arpi_esp
parents: 922
diff changeset
210 // int mScreen;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
211 unsigned int fg, bg;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
212 char * mTitle=(title == NULL) ? "XMGA render" : title;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
213 char * name=":0.0";
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
214 XSizeHints hint;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
215 XVisualInfo vinfo;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
216 XEvent xev;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
217
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
218 XGCValues xgcv;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
219 unsigned long xswamask;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
220
1210
5cbbca64a5c9 vo_subdevice support
arpi_esp
parents: 1137
diff changeset
221 char *devname=vo_subdevice?vo_subdevice:"/dev/mga_vid";
5cbbca64a5c9 vo_subdevice support
arpi_esp
parents: 1137
diff changeset
222
5cbbca64a5c9 vo_subdevice support
arpi_esp
parents: 1137
diff changeset
223 f = open(devname,O_RDWR);
5cbbca64a5c9 vo_subdevice support
arpi_esp
parents: 1137
diff changeset
224 if(f == -1)
5cbbca64a5c9 vo_subdevice support
arpi_esp
parents: 1137
diff changeset
225 {
1637
248972c26eee fixed mga uninit
arpi
parents: 1501
diff changeset
226 perror("open");
1210
5cbbca64a5c9 vo_subdevice support
arpi_esp
parents: 1137
diff changeset
227 printf("Couldn't open %s\n",devname);
5cbbca64a5c9 vo_subdevice support
arpi_esp
parents: 1137
diff changeset
228 return(-1);
5cbbca64a5c9 vo_subdevice support
arpi_esp
parents: 1137
diff changeset
229 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
230
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
231 switch(format)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
232 {
182
80a7b40f201a *** empty log message ***
pontscho
parents: 120
diff changeset
233 case IMGFMT_YV12:
56
cdb2e30be421 mga_vid fixes, code cleanup
arpi_esp
parents: 47
diff changeset
234 mga_vid_config.format=MGA_VID_FORMAT_YV12;
182
80a7b40f201a *** empty log message ***
pontscho
parents: 120
diff changeset
235 mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height + ( ( ( width + 31 ) & ~31 ) * height ) / 2;
56
cdb2e30be421 mga_vid fixes, code cleanup
arpi_esp
parents: 47
diff changeset
236 break;
470
8e101a5d9dc2 I420/IYUV support
arpi_esp
parents: 448
diff changeset
237 case IMGFMT_I420:
8e101a5d9dc2 I420/IYUV support
arpi_esp
parents: 448
diff changeset
238 mga_vid_config.format=MGA_VID_FORMAT_I420;
8e101a5d9dc2 I420/IYUV support
arpi_esp
parents: 448
diff changeset
239 mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height + ( ( ( width + 31 ) & ~31 ) * height ) / 2;
8e101a5d9dc2 I420/IYUV support
arpi_esp
parents: 448
diff changeset
240 break;
8e101a5d9dc2 I420/IYUV support
arpi_esp
parents: 448
diff changeset
241 case IMGFMT_IYUV:
8e101a5d9dc2 I420/IYUV support
arpi_esp
parents: 448
diff changeset
242 mga_vid_config.format=MGA_VID_FORMAT_IYUV;
8e101a5d9dc2 I420/IYUV support
arpi_esp
parents: 448
diff changeset
243 mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height + ( ( ( width + 31 ) & ~31 ) * height ) / 2;
8e101a5d9dc2 I420/IYUV support
arpi_esp
parents: 448
diff changeset
244 break;
56
cdb2e30be421 mga_vid fixes, code cleanup
arpi_esp
parents: 47
diff changeset
245 case IMGFMT_YUY2:
cdb2e30be421 mga_vid fixes, code cleanup
arpi_esp
parents: 47
diff changeset
246 mga_vid_config.format=MGA_VID_FORMAT_YUY2;
182
80a7b40f201a *** empty log message ***
pontscho
parents: 120
diff changeset
247 mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height * 2;
56
cdb2e30be421 mga_vid fixes, code cleanup
arpi_esp
parents: 47
diff changeset
248 break;
448
198b46b739d8 qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents: 384
diff changeset
249 case IMGFMT_UYVY:
198b46b739d8 qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents: 384
diff changeset
250 mga_vid_config.format=MGA_VID_FORMAT_UYVY;
198b46b739d8 qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents: 384
diff changeset
251 mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height * 2;
198b46b739d8 qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents: 384
diff changeset
252 break;
614
f83ec60bce49 fprintf(stderr converted to printf(
szabii
parents: 612
diff changeset
253 default: printf("mga: invalid output format %0X\n",format); return (-1);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
254 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
255
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
256 if ( X_already_started ) return -1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
257
922
db06ae8967eb Centralized and cleaned up X11 connecting, fixed remote X11 playing, -display option for mplayer. SHOULD BE TESTED.
lgb
parents: 844
diff changeset
258 if (!vo_init()) return -1;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
259
2249
48f0ac1e9d13 Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents: 2057
diff changeset
260 aspect_save_orig(width,height);
48f0ac1e9d13 Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents: 2057
diff changeset
261 aspect_save_prescale(d_width,d_height);
48f0ac1e9d13 Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents: 2057
diff changeset
262 aspect_save_screenres(vo_screenwidth,vo_screenheight);
48f0ac1e9d13 Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents: 2057
diff changeset
263
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
264 mvWidth=width; mvHeight=height;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
265
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
266 wndX=0; wndY=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
267 wndWidth=d_width; wndHeight=d_height;
1783
beec84c3d830 fix gui support
pontscho
parents: 1723
diff changeset
268 #ifdef HAVE_NEW_GUI
1852
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
269 // mdwidth=d_width; mdheight=d_height;
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
270 mdwidth=width; mdheight=height;
723
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
271 #endif
844
108ea5157cbc didn't handle flags parameter correctly
arpi_esp
parents: 723
diff changeset
272 mFullscreen=fullscreen&1;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
273
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
274 switch ( vo_depthonscreen )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
275 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
276 case 32:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
277 case 24: fgColor=0x00ff00ffL; break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
278 case 16: fgColor=0xf81fL; break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
279 case 15: fgColor=0x7c1fL; break;
614
f83ec60bce49 fprintf(stderr converted to printf(
szabii
parents: 612
diff changeset
280 default: printf( "Sorry, this (%d) color depth not supported.\n",vo_depthonscreen ); return -1;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
281 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
282
2249
48f0ac1e9d13 Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents: 2057
diff changeset
283 aspect(&d_width,&d_height,A_NOZOOM);
1723
5e4214a7540e GUI stuff. now seeking works, and xmga renders to video window
arpi
parents: 1637
diff changeset
284 #ifdef HAVE_NEW_GUI
723
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
285 if ( vo_window == None )
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
286 {
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
287 #endif
844
108ea5157cbc didn't handle flags parameter correctly
arpi_esp
parents: 723
diff changeset
288 if ( mFullscreen )
723
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
289 {
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
290 wndWidth=vo_screenwidth;
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
291 wndHeight=vo_screenheight;
2039
452f3cb96b32 Make aware of new -fs calling.
atmos4
parents: 1924
diff changeset
292 #ifdef X11_FULLSCREEN
2249
48f0ac1e9d13 Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents: 2057
diff changeset
293 aspect(&d_width,&d_height,A_ZOOM);
2039
452f3cb96b32 Make aware of new -fs calling.
atmos4
parents: 1924
diff changeset
294 #endif
723
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
295 }
2249
48f0ac1e9d13 Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents: 2057
diff changeset
296 dwidth=d_width; dheight=d_height;
723
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
297
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
298 XGetWindowAttributes( mDisplay,DefaultRootWindow( mDisplay ),&attribs );
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
299 mDepth=attribs.depth;
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
300 if ( mDepth != 15 && mDepth != 16 && mDepth != 24 && mDepth != 32 ) mDepth=24;
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
301 XMatchVisualInfo( mDisplay,mScreen,mDepth,TrueColor,&vinfo );
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
302 xWAttribs.colormap=XCreateColormap( mDisplay,RootWindow( mDisplay,mScreen ),vinfo.visual,AllocNone );
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
303 xWAttribs.background_pixel=0;
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
304 xWAttribs.border_pixel=0;
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
305 xWAttribs.event_mask=StructureNotifyMask | ExposureMask | KeyPressMask;
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
306 xswamask=CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
307
3847
c8c7ba08ef44 -wid/-rootwin support
arpi
parents: 3558
diff changeset
308 if ( WinID>=0 ){
c8c7ba08ef44 -wid/-rootwin support
arpi
parents: 3558
diff changeset
309 mWindow = WinID ? ((Window)WinID) : RootWindow(mDisplay,mScreen);
c8c7ba08ef44 -wid/-rootwin support
arpi
parents: 3558
diff changeset
310 XUnmapWindow( mDisplay,mWindow );
c8c7ba08ef44 -wid/-rootwin support
arpi
parents: 3558
diff changeset
311 XChangeWindowAttributes( mDisplay,mWindow,xswamask,&xWAttribs);
c8c7ba08ef44 -wid/-rootwin support
arpi
parents: 3558
diff changeset
312 } else
723
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
313 mWindow=XCreateWindow( mDisplay,RootWindow( mDisplay,mScreen ),
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
314 wndX,wndY,
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
315 wndWidth,wndHeight,
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
316 xWAttribs.border_pixel,
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
317 mDepth,
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
318 InputOutput,
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
319 vinfo.visual,xswamask,&xWAttribs );
1137
4c7b219e126c patch: some X11 compliance fixed: set ClassHint and better fullscreen mode
arpi_esp
parents: 927
diff changeset
320 vo_x11_classhint( mDisplay,mWindow,"xmga" );
723
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
321 vo_hidecursor(mDisplay,mWindow);
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
322
844
108ea5157cbc didn't handle flags parameter correctly
arpi_esp
parents: 723
diff changeset
323 if ( mFullscreen ) vo_x11_decoration( mDisplay,mWindow,0 );
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
324
723
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
325 XGetNormalHints( mDisplay,mWindow,&hint );
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
326 hint.x=wndX; hint.y=wndY;
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
327 hint.width=wndWidth; hint.height=wndHeight;
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
328 hint.base_width=wndWidth; hint.base_height=wndHeight;
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
329 hint.flags=USPosition | USSize;
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
330 XSetNormalHints( mDisplay,mWindow,&hint );
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
331 XStoreName( mDisplay,mWindow,mTitle );
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
332 XMapWindow( mDisplay,mWindow );
3990
87538547c8f4 xinerama fix by attila
atmos4
parents: 3847
diff changeset
333 #ifdef HAVE_XINERAMA
87538547c8f4 xinerama fix by attila
atmos4
parents: 3847
diff changeset
334 vo_x11_xinerama_move(mDisplay,mWindow);
87538547c8f4 xinerama fix by attila
atmos4
parents: 3847
diff changeset
335 #endif
1723
5e4214a7540e GUI stuff. now seeking works, and xmga renders to video window
arpi
parents: 1637
diff changeset
336 mGC=XCreateGC( mDisplay,mWindow,GCForeground,&wGCV );
5e4214a7540e GUI stuff. now seeking works, and xmga renders to video window
arpi
parents: 1637
diff changeset
337 #ifdef HAVE_NEW_GUI
723
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
338 }
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
339 else
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
340 {
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
341 mWindow=vo_window;
1852
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
342 // fprintf( stderr,"[xmga] width: %d height: %d d_width: %d d_height: %d\n",width,height,d_width,d_height );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
343 // if ( vo_screenwidth != d_width )
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
344 // {
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
345 // XMoveWindow( mDisplay,mWindow,( vo_screenwidth - d_width ) / 2,( vo_screenheight - d_height ) / 2 );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
346 // XResizeWindow( mDisplay,mWindow,d_width,d_height );
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
347 // }
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
348 // else mFullscreen=1;
1723
5e4214a7540e GUI stuff. now seeking works, and xmga renders to video window
arpi
parents: 1637
diff changeset
349 mGC=vo_gc; //XCreateGC( mDisplay,mWindow,GCForeground,&wGCV );
723
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
350 }
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
351 #endif
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
352
120
93ea0c6aae7f common window setup code moved to set_window()
arpi_esp
parents: 100
diff changeset
353 set_window();
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
354
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
355 mga_vid_config.src_width=width;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
356 mga_vid_config.src_height=height;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
357
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
358 mga_vid_config.colkey_on=1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
359 mga_vid_config.colkey_red=255;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
360 mga_vid_config.colkey_green=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
361 mga_vid_config.colkey_blue=255;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
362
56
cdb2e30be421 mga_vid fixes, code cleanup
arpi_esp
parents: 47
diff changeset
363 if(mga_init()) return -1;
1852
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
364
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
365 set_window();
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
366
1723
5e4214a7540e GUI stuff. now seeking works, and xmga renders to video window
arpi
parents: 1637
diff changeset
367 #ifdef HAVE_NEW_GUI
723
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
368 if ( vo_window == None )
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
369 #endif
1723
5e4214a7540e GUI stuff. now seeking works, and xmga renders to video window
arpi
parents: 1637
diff changeset
370 {
723
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
371 XFlush( mDisplay );
c3e0bdb64027 add gui support
pontscho
parents: 616
diff changeset
372 XSync( mDisplay,False );
1723
5e4214a7540e GUI stuff. now seeking works, and xmga renders to video window
arpi
parents: 1637
diff changeset
373 }
4316
9f8a618e87c3 fix screen saver bug under gui
pontscho
parents: 4303
diff changeset
374
9f8a618e87c3 fix screen saver bug under gui
pontscho
parents: 4303
diff changeset
375 saver_off(mDisplay);
324
720c640332c8 Szebb es jobb screensaver-kikapcsolo resz
laaz
parents: 213
diff changeset
376
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
377 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
378 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
379
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
380 static const vo_info_t* get_info( void )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
381 { return &vo_info; }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
382
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
383
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
384 static void
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
385 uninit(void)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
386 {
4316
9f8a618e87c3 fix screen saver bug under gui
pontscho
parents: 4303
diff changeset
387 saver_on(mDisplay);
1852
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
388 #ifdef HAVE_NEW_GUI
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
389 if ( vo_window == None )
58dd326fcc4a fix xshape, mixer, fullscreen, etc
pontscho
parents: 1783
diff changeset
390 #endif
1924
6185fef2703a XDestroyWindow fix baze.
pontscho
parents: 1909
diff changeset
391 {
6185fef2703a XDestroyWindow fix baze.
pontscho
parents: 1909
diff changeset
392 XDestroyWindow( mDisplay,mWindow );
6185fef2703a XDestroyWindow fix baze.
pontscho
parents: 1909
diff changeset
393 }
1637
248972c26eee fixed mga uninit
arpi
parents: 1501
diff changeset
394 mga_uninit();
248972c26eee fixed mga uninit
arpi
parents: 1501
diff changeset
395 printf("vo: uninit!\n");
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
396 }
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4316
diff changeset
397
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4316
diff changeset
398 static uint32_t preinit(const char *arg)
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4316
diff changeset
399 {
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4316
diff changeset
400 return 0;
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4316
diff changeset
401 }
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4316
diff changeset
402
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4316
diff changeset
403 static void query_vaa(vo_vaa_t *vaa)
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4316
diff changeset
404 {
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4316
diff changeset
405 memset(vaa,0,sizeof(vo_vaa_t));
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4316
diff changeset
406 }