Mercurial > mplayer.hg
comparison libvo/vo_sdl.c @ 543:ee0010d0ca81
Changed some code so it only kicks in when XV is disable.
(Later I'll change that stuff to be detected at runtime.)
author | atmosfear |
---|---|
date | Fri, 20 Apr 2001 10:27:51 +0000 |
parents | 7eaec864e3d2 |
children | 3fde7340afd5 |
comparison
equal
deleted
inserted
replaced
542:7eaec864e3d2 | 543:ee0010d0ca81 |
---|---|
97 LIBVO_EXTERN(sdl) | 97 LIBVO_EXTERN(sdl) |
98 | 98 |
99 //#include "log.h" | 99 //#include "log.h" |
100 //#define LOG if(0)printf | 100 //#define LOG if(0)printf |
101 | 101 |
102 extern int verbose; | |
103 | |
102 static vo_info_t vo_info = | 104 static vo_info_t vo_info = |
103 { | 105 { |
104 "SDL YUV overlay (SDL v1.1.7+ only!)", | 106 "SDL YUV overlay (SDL v1.1.7+ only!)", |
105 "sdl", | 107 "sdl", |
106 "Ryan C. Gordon <icculus@lokigames.com>", | 108 "Ryan C. Gordon <icculus@lokigames.com>", |
219 | 221 |
220 /* default to no fullscreen mode, we'll set this as soon we have the avail. modes */ | 222 /* default to no fullscreen mode, we'll set this as soon we have the avail. modes */ |
221 priv->fullmode = -2; | 223 priv->fullmode = -2; |
222 /* other default values */ | 224 /* other default values */ |
223 #ifdef SDL_NOHWSURFACE | 225 #ifdef SDL_NOHWSURFACE |
224 printf("SDL: using software-surface\n"); | 226 if(verbose) printf("SDL: using software-surface\n"); |
225 priv->sdlflags = SDL_SWSURFACE|SDL_RESIZABLE|SDL_ASYNCBLIT; | 227 priv->sdlflags = SDL_SWSURFACE|SDL_RESIZABLE|SDL_ASYNCBLIT; |
226 priv->sdlfullflags = SDL_SWSURFACE|SDL_FULLSCREEN|SDL_DOUBLEBUF|SDL_ASYNCBLIT; | 228 priv->sdlfullflags = SDL_SWSURFACE|SDL_FULLSCREEN|SDL_DOUBLEBUF|SDL_ASYNCBLIT; |
227 #else | 229 #else |
228 printf("SDL: using hardware-surface\n"); | 230 if(verbose) printf("SDL: using hardware-surface\n"); |
229 priv->sdlflags = SDL_HWSURFACE|SDL_RESIZABLE|SDL_ASYNCBLIT; //SDL_HWACCEL | 231 priv->sdlflags = SDL_HWSURFACE|SDL_RESIZABLE|SDL_ASYNCBLIT; //SDL_HWACCEL |
230 priv->sdlfullflags = SDL_HWSURFACE|SDL_FULLSCREEN|SDL_DOUBLEBUF|SDL_ASYNCBLIT; //SDL_HWACCEL | 232 priv->sdlfullflags = SDL_HWSURFACE|SDL_FULLSCREEN|SDL_DOUBLEBUF|SDL_ASYNCBLIT; //SDL_HWACCEL |
231 #endif | 233 #endif |
232 priv->surface = NULL; | 234 priv->surface = NULL; |
233 priv->overlay = NULL; | 235 priv->overlay = NULL; |
386 unsigned int sdl_format; | 388 unsigned int sdl_format; |
387 | 389 |
388 sdl_format = format; | 390 sdl_format = format; |
389 switch(format){ | 391 switch(format){ |
390 case IMGFMT_YV12: | 392 case IMGFMT_YV12: |
391 printf("SDL: Using 0x%X (YV12) image format\n", format); break; | 393 if(verbose) printf("SDL: Using 0x%X (YV12) image format\n", format); break; |
392 case IMGFMT_IYUV: | 394 case IMGFMT_IYUV: |
393 printf("SDL: Using 0x%X (IYUV) image format\n", format); break; | 395 if(verbose) printf("SDL: Using 0x%X (IYUV) image format\n", format); break; |
394 case IMGFMT_YUY2: | 396 case IMGFMT_YUY2: |
395 printf("SDL: Using 0x%X (YUY2) image format\n", format); break; | 397 if(verbose) printf("SDL: Using 0x%X (YUY2) image format\n", format); break; |
396 case IMGFMT_UYVY: | 398 case IMGFMT_UYVY: |
397 printf("SDL: Using 0x%X (UYVY) image format\n", format); break; | 399 if(verbose) printf("SDL: Using 0x%X (UYVY) image format\n", format); break; |
398 case IMGFMT_YVYU: | 400 case IMGFMT_YVYU: |
399 printf("SDL: Using 0x%X (YVYU) image format\n", format); break; | 401 if(verbose) printf("SDL: Using 0x%X (YVYU) image format\n", format); break; |
400 case IMGFMT_I420: | 402 case IMGFMT_I420: |
401 printf("SDL: Using 0x%X (I420) image format\n", format); | 403 if(verbose) printf("SDL: Using 0x%X (I420) image format\n", format); |
402 printf("SDL: Mapping I420 to IYUV\n"); | 404 printf("SDL: Mapping I420 to IYUV\n"); |
403 sdl_format = SDL_IYUV_OVERLAY; | 405 sdl_format = SDL_IYUV_OVERLAY; |
404 break; | 406 break; |
405 default: | 407 default: |
406 printf("SDL: Unsupported image format (0x%X)\n",format); | 408 printf("SDL: Unsupported image format (0x%X)\n",format); |
425 // printf("SDL: fullscreenflag is set to: %i\n", fullscreen); | 427 // printf("SDL: fullscreenflag is set to: %i\n", fullscreen); |
426 // printf("SDL: Width: %i Height: %i D_Width %i D_Height: %i\n", width, height, d_width, d_height); | 428 // printf("SDL: Width: %i Height: %i D_Width %i D_Height: %i\n", width, height, d_width, d_height); |
427 switch(fullscreen){ | 429 switch(fullscreen){ |
428 case 0x01: | 430 case 0x01: |
429 case 0x05: | 431 case 0x05: |
430 printf("SDL: setting zoomed fullscreen without modeswitching\n"); | 432 if(verbose) printf("SDL: setting zoomed fullscreen without modeswitching\n"); |
431 priv->windowsize.w = d_width; | 433 priv->windowsize.w = d_width; |
432 priv->windowsize.h = d_height; | 434 priv->windowsize.h = d_height; |
433 if(priv->surface = SDL_SetVideoMode (d_width, d_height, priv->bpp, priv->sdlfullflags)) | 435 if(priv->surface = SDL_SetVideoMode (d_width, d_height, priv->bpp, priv->sdlfullflags)) |
434 SDL_ShowCursor(0); | 436 SDL_ShowCursor(0); |
435 break; | 437 break; |
436 case 0x02: | 438 case 0x02: |
437 case 0x03: | 439 case 0x03: |
438 printf("SDL: setting nonzoomed fullscreen with modeswitching\n"); | |
439 priv->windowsize.w = width; | 440 priv->windowsize.w = width; |
440 priv->windowsize.h = height; | 441 priv->windowsize.h = height; |
442 #ifdef SDL_NOXV | |
443 if(verbose) printf("SDL: setting nonzoomed fullscreen with modeswitching\n"); | |
441 if(priv->surface = SDL_SetVideoMode (width, height, priv->bpp, priv->sdlfullflags)) | 444 if(priv->surface = SDL_SetVideoMode (width, height, priv->bpp, priv->sdlfullflags)) |
442 SDL_ShowCursor(0); | 445 SDL_ShowCursor(0); |
446 #else | |
447 if(verbose) printf("SDL: setting zoomed fullscreen with modeswitching\n"); | |
448 priv->surface=NULL; | |
449 set_fullmode(priv->fullmode); | |
450 #endif | |
443 break; | 451 break; |
444 case 0x06: | 452 case 0x06: |
445 case 0x07: | 453 case 0x07: |
446 printf("SDL: setting zoomed fullscreen with modeswitching\n"); | 454 if(verbose) printf("SDL: setting zoomed fullscreen with modeswitching\n"); |
447 priv->windowsize.w = width; | 455 priv->windowsize.w = width; |
448 priv->windowsize.h = height; | 456 priv->windowsize.h = height; |
449 priv->surface=NULL; | 457 priv->surface=NULL; |
450 set_fullmode(priv->fullmode); | 458 set_fullmode(priv->fullmode); |
451 break; | 459 break; |
452 default: | 460 default: |
453 printf("SDL: setting windowed mode\n"); | 461 if(verbose) printf("SDL: setting windowed mode\n"); |
454 priv->windowsize.w = d_width; | 462 priv->windowsize.w = d_width; |
455 priv->windowsize.h = d_height; | 463 priv->windowsize.h = d_height; |
456 priv->surface = SDL_SetVideoMode (d_width, d_height, priv->bpp, priv->sdlflags); | 464 priv->surface = SDL_SetVideoMode (d_width, d_height, priv->bpp, priv->sdlflags); |
457 } | 465 } |
458 if(!priv->surface) return -1; // cannot SetVideoMode | 466 if(!priv->surface) return -1; // cannot SetVideoMode |