Mercurial > mplayer.hg
comparison libvo/vo_xv.c @ 614:f83ec60bce49
fprintf(stderr converted to printf(
author | szabii |
---|---|
date | Tue, 24 Apr 2001 11:30:57 +0000 |
parents | 77e0094f0cce |
children | 41d6eec69b60 |
comparison
equal
deleted
inserted
replaced
613:7b522fdaf92e | 614:f83ec60bce49 |
---|---|
108 | 108 |
109 mydisplay = XOpenDisplay(name); | 109 mydisplay = XOpenDisplay(name); |
110 | 110 |
111 if (mydisplay == NULL) | 111 if (mydisplay == NULL) |
112 { | 112 { |
113 fprintf(stderr,"Can't open display\n"); | 113 printf("Can't open display\n"); |
114 return -1; | 114 return -1; |
115 } | 115 } |
116 | 116 |
117 screen = DefaultScreen(mydisplay); | 117 screen = DefaultScreen(mydisplay); |
118 | 118 |
153 if (Success == XvQueryExtension(mydisplay,&ver,&rel,&req,&ev,&err)) | 153 if (Success == XvQueryExtension(mydisplay,&ver,&rel,&req,&ev,&err)) |
154 { | 154 { |
155 /* check for Xvideo support */ | 155 /* check for Xvideo support */ |
156 if (Success != XvQueryAdaptors(mydisplay,DefaultRootWindow(mydisplay), &adaptors,&ai)) | 156 if (Success != XvQueryAdaptors(mydisplay,DefaultRootWindow(mydisplay), &adaptors,&ai)) |
157 { | 157 { |
158 fprintf(stderr,"Xv: XvQueryAdaptors failed"); | 158 printf("Xv: XvQueryAdaptors failed"); |
159 return -1; | 159 return -1; |
160 } | 160 } |
161 /* check adaptors */ | 161 /* check adaptors */ |
162 for (i = 0; i < adaptors; i++) | 162 for (i = 0; i < adaptors; i++) |
163 { | 163 { |
168 { | 168 { |
169 fo = XvListImageFormats(mydisplay, xv_port, (int*)&formats); | 169 fo = XvListImageFormats(mydisplay, xv_port, (int*)&formats); |
170 xv_format=0; | 170 xv_format=0; |
171 for(i = 0; i < formats; i++) | 171 for(i = 0; i < formats; i++) |
172 { | 172 { |
173 fprintf(stderr, "Xvideo image format: 0x%x (%4.4s) %s\n", fo[i].id,(char*)&fo[i].id, (fo[i].format == XvPacked) ? "packed" : "planar"); | 173 printf("Xvideo image format: 0x%x (%4.4s) %s\n", fo[i].id,(char*)&fo[i].id, (fo[i].format == XvPacked) ? "packed" : "planar"); |
174 | 174 |
175 if (fo[i].id == format) | 175 if (fo[i].id == format) |
176 { | 176 { |
177 xv_format = fo[i].id; | 177 xv_format = fo[i].id; |
178 } | 178 } |
180 if (!xv_format) xv_port = 0; | 180 if (!xv_format) xv_port = 0; |
181 } | 181 } |
182 | 182 |
183 if (xv_port != 0) | 183 if (xv_port != 0) |
184 { | 184 { |
185 fprintf( stderr,"using Xvideo port %d for hw scaling\n",xv_port ); | 185 printf( "using Xvideo port %d for hw scaling\n",xv_port ); |
186 | 186 |
187 allocate_xvimage(0); | 187 allocate_xvimage(0); |
188 | 188 |
189 XGetGeometry( mydisplay,mywindow,&mRoot,&drwX,&drwY,&drwWidth,&drwHeight,&drwBorderWidth,&drwDepth ); | 189 XGetGeometry( mydisplay,mywindow,&mRoot,&drwX,&drwY,&drwWidth,&drwHeight,&drwBorderWidth,&drwDepth ); |
190 drwX=0; drwY=0; | 190 drwX=0; drwY=0; |
191 XTranslateCoordinates( mydisplay,mywindow,mRoot,0,0,&drwcX,&drwcY,&mRoot ); | 191 XTranslateCoordinates( mydisplay,mywindow,mRoot,0,0,&drwcX,&drwcY,&mRoot ); |
192 fprintf( stderr,"[xv] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight ); | 192 printf( "[xv] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight ); |
193 | 193 |
194 if ( mFullscreen ) | 194 if ( mFullscreen ) |
195 { | 195 { |
196 drwX=( vo_screenwidth - (dwidth > vo_screenwidth?vo_screenwidth:dwidth) ) / 2; | 196 drwX=( vo_screenwidth - (dwidth > vo_screenwidth?vo_screenwidth:dwidth) ) / 2; |
197 drwcX+=drwX; | 197 drwcX+=drwX; |
198 drwY=( vo_screenheight - (dheight > vo_screenheight?vo_screenheight:dheight) ) / 2; | 198 drwY=( vo_screenheight - (dheight > vo_screenheight?vo_screenheight:dheight) ) / 2; |
199 drwcY+=drwY; | 199 drwcY+=drwY; |
200 drwWidth=(dwidth > vo_screenwidth?vo_screenwidth:dwidth); | 200 drwWidth=(dwidth > vo_screenwidth?vo_screenwidth:dwidth); |
201 drwHeight=(dheight > vo_screenheight?vo_screenheight:dheight); | 201 drwHeight=(dheight > vo_screenheight?vo_screenheight:dheight); |
202 fprintf( stderr,"[xv-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight ); | 202 printf( "[xv-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight ); |
203 } | 203 } |
204 | 204 |
205 saver_off(mydisplay); // turning off screen saver | 205 saver_off(mydisplay); // turning off screen saver |
206 return 0; | 206 return 0; |
207 } | 207 } |
241 if(e&VO_EVENT_RESIZE) | 241 if(e&VO_EVENT_RESIZE) |
242 { | 242 { |
243 XGetGeometry( mydisplay,mywindow,&mRoot,&drwX,&drwY,&drwWidth,&drwHeight,&drwBorderWidth,&drwDepth ); | 243 XGetGeometry( mydisplay,mywindow,&mRoot,&drwX,&drwY,&drwWidth,&drwHeight,&drwBorderWidth,&drwDepth ); |
244 drwX=0; drwY=0; | 244 drwX=0; drwY=0; |
245 XTranslateCoordinates( mydisplay,mywindow,mRoot,0,0,&drwcX,&drwcY,&mRoot ); | 245 XTranslateCoordinates( mydisplay,mywindow,mRoot,0,0,&drwcX,&drwcY,&mRoot ); |
246 fprintf( stderr,"[xv] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight ); | 246 printf( "[xv] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight ); |
247 | 247 |
248 if ( mFullscreen ) | 248 if ( mFullscreen ) |
249 { | 249 { |
250 drwX=( vo_screenwidth - (dwidth > vo_screenwidth?vo_screenwidth:dwidth) ) / 2; | 250 drwX=( vo_screenwidth - (dwidth > vo_screenwidth?vo_screenwidth:dwidth) ) / 2; |
251 drwcX+=drwX; | 251 drwcX+=drwX; |
252 drwY=( vo_screenheight - (dheight > vo_screenheight?vo_screenheight:dheight) ) / 2; | 252 drwY=( vo_screenheight - (dheight > vo_screenheight?vo_screenheight:dheight) ) / 2; |
253 drwcY+=drwY; | 253 drwcY+=drwY; |
254 drwWidth=(dwidth > vo_screenwidth?vo_screenwidth:dwidth); | 254 drwWidth=(dwidth > vo_screenwidth?vo_screenwidth:dwidth); |
255 drwHeight=(dheight > vo_screenheight?vo_screenheight:dheight); | 255 drwHeight=(dheight > vo_screenheight?vo_screenheight:dheight); |
256 fprintf( stderr,"[xv-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight ); | 256 printf( "[xv-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight ); |
257 } | 257 } |
258 } | 258 } |
259 } | 259 } |
260 | 260 |
261 | 261 |