[Mplayer-cvslog] CVS: main/libvo vo_sdl.c,1.47,1.48

Felix Buenemann atmosfear at users.sourceforge.net
Sat Jun 23 12:18:26 CEST 2001


Update of /cvsroot/mplayer/main/libvo
In directory usw-pr-cvs1:/tmp/cvs-serv3822/libvo

Modified Files:
	vo_sdl.c 
Log Message:
Made surface locks switchable via preprocessor.


Index: vo_sdl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_sdl.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -r1.47 -r1.48
*** vo_sdl.c	2001/06/22 19:56:41	1.47
--- vo_sdl.c	2001/06/23 10:18:23	1.48
***************
*** 95,98 ****
--- 95,101 ----
  #undef SDL_NOHWSURFACE
  
+ /* define to enable surface locks, this might be needed on SMP machines */
+ #undef SDL_ENABLE_LOCKS
+ 
  //#define BUGGY_SDL //defined by configure
  
***************
*** 832,836 ****
--- 835,861 ----
  }
  
+ #ifdef SDL_ENABLE_LOCKS
+ #define	SDL_OVR_LOCK        if (SDL_LockYUVOverlay (priv->overlay)) { \
+ 				if(verbose) printf("SDL: Couldn't lock YUV overlay\n"); \
+ 				return -1; \
+ 	    		    }
+ #define SDL_OVR_UNLOCK      SDL_UnlockYUVOverlay (priv->overlay);
+ 
+ #define SDL_SRF_LOCK(srf)   if(SDL_MUSTLOCK(srf)) { \
+ 				if(SDL_LockSurface (srf)) { \
+ 					if(verbose) printf("SDL: Couldn't lock RGB surface\n"); \
+ 					return -1; \
+ 				} \
+ 			    }
  
+ #define SDL_SRF_UNLOCK(srf) if(SDL_MUSTLOCK(srf)) \
+ 				SDL_UnlockSurface (srf);
+ #else
+ #define SDL_OVR_LOCK
+ #define SDL_OVR_UNLOCK
+ #define SDL_SRF_LOCK(srf)
+ #define SDL_SRF_UNLOCK(srf)
+ #endif
+ 
  /**
   * Draw a frame to the SDL YUV overlay.
***************
*** 852,859 ****
          case IMGFMT_I420:
          case IMGFMT_IYUV:
! 	    /*if (SDL_LockYUVOverlay (priv->overlay)) {
! 		if(verbose) printf("SDL: Couldn't lock YUV overlay\n");
! 		return -1;
! 	    }*/
  	    dst = (uint8_t *) *(priv->overlay->pixels);
  	    memcpy (dst, src[0], priv->framePlaneY);
--- 877,881 ----
          case IMGFMT_I420:
          case IMGFMT_IYUV:
! 	    SDL_OVR_LOCK
  	    dst = (uint8_t *) *(priv->overlay->pixels);
  	    memcpy (dst, src[0], priv->framePlaneY);
***************
*** 862,866 ****
  	    dst += priv->framePlaneUV;
  	    memcpy (dst, src[1], priv->framePlaneUV);
! 	    /*SDL_UnlockYUVOverlay (priv->overlay);*/
              break;
  
--- 884,888 ----
  	    dst += priv->framePlaneUV;
  	    memcpy (dst, src[1], priv->framePlaneUV);
! 	    SDL_OVR_UNLOCK
              break;
  
***************
*** 868,875 ****
          case IMGFMT_UYVY:
          case IMGFMT_YVYU:
! 	    /*if (SDL_LockYUVOverlay (priv->overlay)) {
! 		if(verbose) printf("SDL: Couldn't lock YUV overlay\n");
! 		return -1;
! 	    }*/
  	    dst = (uint8_t *) *(priv->overlay->pixels);
  	    if(priv->flip) {
--- 890,894 ----
          case IMGFMT_UYVY:
          case IMGFMT_YVYU:
! 	    SDL_OVR_LOCK
  	    dst = (uint8_t *) *(priv->overlay->pixels);
  	    if(priv->flip) {
***************
*** 882,886 ****
  	    }
  	    else memcpy (dst, src[0], priv->framePlaneYUY);
! 	    /*SDL_UnlockYUVOverlay (priv->overlay);*/
              break;
  	
--- 901,905 ----
  	    }
  	    else memcpy (dst, src[0], priv->framePlaneYUY);
! 	    SDL_OVR_UNLOCK
              break;
  	
***************
*** 894,903 ****
  	case IMGFMT_BGR32:
  		if((priv->format&0xFF) == priv->bpp) {
! 			/*if(SDL_MUSTLOCK(priv->surface)) {
! 				if (SDL_LockSurface (priv->surface)) {
! 					if(verbose) printf("SDL: Couldn't lock RGB surface\n");
! 					return -1;
! 				}
! 			}*/
  			dst = (uint8_t *) priv->surface->pixels;
  			if(priv->flip) {
--- 913,917 ----
  	case IMGFMT_BGR32:
  		if((priv->format&0xFF) == priv->bpp) {
! 			SDL_SRF_LOCK(priv->surface)
  			dst = (uint8_t *) priv->surface->pixels;
  			if(priv->flip) {
***************
*** 910,922 ****
  			}
  			else memcpy (dst, src[0], priv->framePlaneRGB);
! 			/*if(SDL_MUSTLOCK(priv->surface)) 
! 				SDL_UnlockSurface (priv->surface);*/
  		} else {
! 			/*if(SDL_MUSTLOCK(priv->rgbsurface)) {
! 				if (SDL_LockSurface (priv->rgbsurface)) {
! 					if(verbose) printf("SDL: Couldn't lock RGB surface\n");
! 					return -1;
! 				}
! 			}*/
  			dst = (uint8_t *) priv->rgbsurface->pixels;
  			if(priv->flip) {
--- 924,930 ----
  			}
  			else memcpy (dst, src[0], priv->framePlaneRGB);
! 			SDL_SRF_UNLOCK(priv->surface)
  		} else {
! 			SDL_SRF_LOCK(priv->rgbsurface)
  			dst = (uint8_t *) priv->rgbsurface->pixels;
  			if(priv->flip) {
***************
*** 929,934 ****
  			}
  			else memcpy (dst, src[0], priv->framePlaneRGB);
! 			/*if(SDL_MUSTLOCK(priv->rgbsurface)) 
! 				SDL_UnlockSurface (priv->rgbsurface);*/
  		}
  		break;
--- 937,941 ----
  			}
  			else memcpy (dst, src[0], priv->framePlaneRGB);
! 			SDL_SRF_UNLOCK(priv->rgbsurface)
  		}
  		break;
***************
*** 955,962 ****
          int i;
  
! 	/*if (SDL_LockYUVOverlay (priv->overlay)) {
! 		if(verbose) printf("SDL: Couldn't lock YUV overlay");
! 		return -1;
! 	}*/
  
  	dst = (uint8_t *) *(priv->overlay->pixels) 
--- 962,966 ----
          int i;
  
! 	SDL_OVR_LOCK
  
  	dst = (uint8_t *) *(priv->overlay->pixels) 
***************
*** 989,993 ****
          }
  
! 	/*SDL_UnlockYUVOverlay (priv->overlay);*/
  
  	return 0;
--- 993,997 ----
          }
  
! 	SDL_OVR_UNLOCK
  
  	return 0;


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list