[Mplayer-cvslog] CVS: main/libvo vo_sdl.c,1.7,1.8

Felix Buenemann atmosfear at users.sourceforge.net
Wed Apr 11 15:46:58 CEST 2001


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

Modified Files:
	vo_sdl.c 
Log Message:
- Full OSD and subtitle support added
- Some minor code changes


Index: vo_sdl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_sdl.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** vo_sdl.c	2001/04/11 12:47:45	1.7
--- vo_sdl.c	2001/04/11 13:46:56	1.8
***************
*** 1,5 ****
  /*
!  *  video_out_sdl.c
   *
   *  Copyright (C) Ryan C. Gordon <icculus at lokigames.com> - April 22, 2000.
   *
--- 1,7 ----
  /*
!  *  vo_sdl.c
   *
+  *  (was video_out_sdl.c from OMS project)
+  *
   *  Copyright (C) Ryan C. Gordon <icculus at lokigames.com> - April 22, 2000.
   *
***************
*** 51,55 ****
   *    - Bugfix to check_events() to reveal mouse cursor after 'q'-quit in
   *       fullscreen-mode
!  *    Felix Buenemann <Atmosfear at users.sourceforge.net> - March 12, 2001
   *    - Changed keypress-detection from keydown to keyup, seems to fix keyrepeat
   *       bug (key had to be pressed twice to be detected)
--- 53,57 ----
   *    - Bugfix to check_events() to reveal mouse cursor after 'q'-quit in
   *       fullscreen-mode
!  *    Felix Buenemann <Atmosfear at users.sourceforge.net> - April 10, 2001
   *    - Changed keypress-detection from keydown to keyup, seems to fix keyrepeat
   *       bug (key had to be pressed twice to be detected)
***************
*** 58,61 ****
--- 60,66 ----
   *       which caused the player to exit (keyboard-buffer problem? better solution
   *       recommed)
+  *    Felix Buenemann <Atmosfear at users.sourceforge.net> - April 11, 2001
+  *    - OSD and subtitle support added
+  *    - some minor code-changes
   */
  
***************
*** 76,79 ****
--- 81,87 ----
  //#define LOG if(0)printf
  
+ /* Uncomment if you want to force Xv SDL output? */
+ /* #define SDL_FORCEXV */
+ 
  static vo_info_t vo_info = 
  {
***************
*** 117,124 ****
  } sdl_priv;
  
  
! /** OMS Plugin functions **/
  
  
  /**
   * Take a null-terminated array of pointers, and find the last element.
--- 125,151 ----
  } sdl_priv;
  
+ 
+ /** libvo Plugin functions **/
+ 
+ /**
+  * draw_alpha is used for osd and subtitle display.
+  *
+  **/
  
! //void vo_draw_alpha_yv12(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride);
! //void vo_draw_alpha_yuy2(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride);
  
+ static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
+     struct sdl_priv_s *priv = &sdl_priv;
+     int x,y;
+ 	
+   if (priv->format==IMGFMT_YV12)
+     vo_draw_alpha_yv12(w,h,src,srca,stride,((uint8_t *) *(priv->overlay->pixels))+priv->width*y0+x0,priv->width);
+   else
+     vo_draw_alpha_yuy2(w,h,src,srca,stride,((uint8_t *) *(priv->overlay->pixels))+2*(priv->width*y0+x0),2*priv->width);
+ 
+ }
  
+ 
  /**
   * Take a null-terminated array of pointers, and find the last element.
***************
*** 157,160 ****
--- 184,192 ----
  
  //	LOG (LOG_DEBUG, "SDL video out: Opened Plugin");
+ 
+ 	/* does the user want SDL to try and force Xv */
+ 	#ifdef SDL_FORCEXV
+ 		setenv("SDL_VIDEO_X11_NODIRECTCOLOR", "1", 1);
+ 	#endif
  	
  	/* default to no fullscreen mode, we'll set this as soon we have the avail. modes */
***************
*** 166,169 ****
--- 198,202 ----
  	priv->overlay = NULL;
  	priv->fullmodes = NULL;
+ 	priv->bpp = 0; //added atmos
  
  	/* initialize the SDL Video system */
***************
*** 219,223 ****
  	/* We dont want those in out event queue */
  	SDL_EventState(SDL_ACTIVEEVENT, SDL_IGNORE);
- 	//SDL_EventState(SDL_KEYUP, SDL_IGNORE);
  	SDL_EventState(SDL_KEYDOWN, SDL_IGNORE);
  	SDL_EventState(SDL_MOUSEMOTION, SDL_IGNORE);
--- 252,255 ----
***************
*** 243,249 ****
  {
  	struct sdl_priv_s *priv = &sdl_priv;
- 	
- //	LOG (LOG_DEBUG, "SDL video out: Closed Plugin");
- //	LOG (LOG_INFO, "SDL video out: Closed Plugin");
  
  	/* Cleanup YUV Overlay structure */
--- 275,278 ----
***************
*** 255,263 ****
  		SDL_FreeSurface(priv->surface);
  	
! 	/* TODO: cleanup the full_modes array */
  	
  	/* Cleanup SDL */
! 	SDL_Quit();
  
  	return 0;
  }
--- 284,295 ----
  		SDL_FreeSurface(priv->surface);
  	
! 	/* DONT attempt to free the fullscreen modes array. SDL_Quit* does this for us */
  	
  	/* Cleanup SDL */
! 	SDL_Quit(); /* might have to be changed to quitsubsystem only, if plugins become
! 		       changeable on the fly */
  
+ //	LOG (LOG_DEBUG, "SDL video out: Closed Plugin");
+ 
  	return 0;
  }
***************
*** 317,325 ****
  {
  	struct sdl_priv_s *priv = &sdl_priv;
!         unsigned int sdl_format, aspectheight;
  
          switch(format){
!           case IMGFMT_YV12: sdl_format=SDL_YV12_OVERLAY;break;
!           case IMGFMT_YUY2: sdl_format=SDL_YUY2_OVERLAY;break;
            default:
              printf("SDL: Unsupported image format (0x%X)\n",format);
--- 349,364 ----
  {
  	struct sdl_priv_s *priv = &sdl_priv;
!         unsigned int sdl_format;
! 
  
          switch(format){
!           case IMGFMT_YV12:
! 	  	sdl_format=SDL_YV12_OVERLAY;
! 		printf("SDL: Using YV12 image format\n");
! 	  break;
!           case IMGFMT_YUY2:
! 	  	sdl_format=SDL_YUY2_OVERLAY;
! 		printf("SDL: Using YUY2 image format\n");
! 	  break;
            default:
              printf("SDL: Unsupported image format (0x%X)\n",format);
***************
*** 329,332 ****
--- 368,374 ----
  	sdl_open (NULL, NULL);
  
+ 	/* Set output window title */
+ 	SDL_WM_SetCaption (".: MPlayer : F = Fullscreen/Windowed : Keypad + = Cycle Fullscreen Resolutions :.", "SDL Video Out");
+ 
  	/* Save the original Image size */
  	
***************
*** 570,573 ****
--- 612,618 ----
  	struct sdl_priv_s *priv = &sdl_priv;
  
+ 	//vo_draw_alpha_yuy2(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride)
+ 	vo_draw_text(priv->width,priv->height,draw_alpha);	
+ 		
  	/* check and react on keypresses and window resizes */
  	check_events();


_______________________________________________
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