[MPlayer-dev-eng] Fwd: [Mplayerxp-cvslog] CVS: mplayerxp/mplayerxp cfg-mplayer.h,1.15,1.16 mplayer.c,1.91,1.92

sr seru at gmx.net
Sat Jan 4 15:13:28 CET 2003


El sáb, 04 de ene de 2003, a las 12:37:18 +0100, Arpi dijo:
> this is interesting, we should port it to mplayer...
> any volunteers? :)
sure, patch attached. too bad nick left :(
> 
> --------- Forwarded message ---------
> From: Nick Kurshev <nickols_k at users.sourceforge.net>
> To: mplayerxp-cvslog at lists.sourceforge.net
> Subject: [Mplayerxp-cvslog] CVS: mplayerxp/mplayerxp cfg-mplayer.h,1.15,1.16 mplayer.c,1.91,1.92
> 
> Update of /cvsroot/mplayerxp/mplayerxp/mplayerxp
> In directory sc8-pr-cvs1:/tmp/cvs-serv21091
> 
> Modified Files:
> 	cfg-mplayer.h mplayer.c 
> Log Message:
> en(dis)able mmx features at run-time
> 
> Index: cfg-mplayer.h
> ===================================================================
> RCS file: /cvsroot/mplayerxp/mplayerxp/mplayerxp/cfg-mplayer.h,v
> retrieving revision 1.15
> retrieving revision 1.16
> diff -u -d -r1.15 -r1.16
> --- cfg-mplayer.h	24 Dec 2002 18:58:51 -0000	1.15
> +++ cfg-mplayer.h	4 Jan 2003 09:36:20 -0000	1.16
> @@ -93,6 +93,15 @@
>  extern unsigned vo_da_buffs;
>  extern unsigned vo_use_bm;
>  
> +#ifdef ARCH_X86
> +extern int x86_mmx;
> +extern int x86_mmx2;
> +extern int x86_3dnow;
> +extern int x86_3dnow2;
> +extern int x86_sse;
> +extern int x86_sse2;
> +#endif
> +
>  /* from libvo/aspect.c */
>  extern float monitor_aspect;
>  extern float vo_panscan;
> @@ -271,6 +280,21 @@
>          {"enable_bm", &vo_use_bm, CONF_TYPE_FLAG, 0, 0, 1, NULL},
>          {"enable_bm2", &vo_use_bm, CONF_TYPE_FLAG, 0, 0, 2, NULL},
>          {"disable_bm", &vo_use_bm, CONF_TYPE_FLAG, 0, 1, 0, NULL},
> +
> +#ifdef ARCH_X86
> +        {"mmx", &x86_mmx, CONF_TYPE_FLAG, 0, 0, 1, NULL},
> +        {"nommx", &x86_mmx, CONF_TYPE_FLAG, 0, 1, 0, NULL},
> +        {"mmx2", &x86_mmx2, CONF_TYPE_FLAG, 0, 0, 1, NULL},
> +        {"nommx2", &x86_mmx2, CONF_TYPE_FLAG, 0, 1, 0, NULL},
> +        {"3dnow", &x86_3dnow, CONF_TYPE_FLAG, 0, 0, 1, NULL},
> +        {"no3dnow", &x86_3dnow, CONF_TYPE_FLAG, 0, 1, 0, NULL},
> +        {"3dnow2", &x86_3dnow2, CONF_TYPE_FLAG, 0, 0, 1, NULL},
> +        {"no3dnow2", &x86_3dnow2, CONF_TYPE_FLAG, 0, 1, 0, NULL},
> +        {"sse", &x86_sse, CONF_TYPE_FLAG, 0, 0, 1, NULL},
> +        {"nosse", &x86_sse, CONF_TYPE_FLAG, 0, 1, 0, NULL},
> +        {"sse2", &x86_sse2, CONF_TYPE_FLAG, 0, 0, 1, NULL},
> +        {"nosse2", &x86_sse2, CONF_TYPE_FLAG, 0, 1, 0, NULL},
> +#endif
>  
>  #ifdef HAVE_AA
>  	{"aa*",	vo_aa_parseoption,  CONF_TYPE_FUNC_FULL, 0, 0, 0 , 
> &vo_aa_revertoption},
> 
> Index: mplayer.c
> ===================================================================
> RCS file: /cvsroot/mplayerxp/mplayerxp/mplayerxp/mplayer.c,v
> retrieving revision 1.91
> retrieving revision 1.92
> diff -u -d -r1.91 -r1.92
> --- mplayer.c	2 Jan 2003 18:13:18 -0000	1.91
> +++ mplayer.c	4 Jan 2003 09:36:20 -0000	1.92
> @@ -704,9 +704,21 @@
>  }
>  
>  #ifdef ARCH_X86
> +int x86_mmx=-1;
> +int x86_mmx2=-1;
> +int x86_3dnow=-1;
> +int x86_3dnow2=-1;
> +int x86_sse=-1;
> +int x86_sse2=-1;
>  static void get_mmx_optimizations( void )
>  {
>    GetCpuCaps(&gCpuCaps);
> +  if(x86_mmx != -1) gCpuCaps.hasMMX=x86_mmx;
> +  if(x86_mmx2 != -1) gCpuCaps.hasMMX2=x86_mmx2;
> +  if(x86_3dnow != -1) gCpuCaps.has3DNow=x86_3dnow;
> +  if(x86_3dnow2 != -1) gCpuCaps.has3DNowExt=x86_3dnow2;
> +  if(x86_sse != -1) gCpuCaps.hasSSE=x86_sse;
> +  if(x86_sse2 != -1) gCpuCaps.hasSSE2=x86_sse2;
>    MSG_INFO("CPUflags: Type: %d MMX: %d MMX2: %d 3DNow: %d 3DNow2: %d SSE:
> %d SSE2: %d\n",
>        gCpuCaps.cpuType,gCpuCaps.hasMMX,gCpuCaps.hasMMX2,
>        gCpuCaps.has3DNow, gCpuCaps.has3DNowExt,
> @@ -1665,9 +1677,6 @@
>    MSG_INFO("%s",banner_text);
>  //  memset(&vtune,0,sizeof(vo_tune_info_t));
>    /* Test for cpu capabilities (and corresponding OS support) for
> optimizing */
> -#ifdef ARCH_X86
> -  get_mmx_optimizations();
> -#endif
>  
>      playtree = play_tree_new();
>  
> @@ -1678,6 +1687,10 @@
>      parse_cfgfiles(mconfig);
>  
>      if(m_config_parse_command_line(mconfig, argc, argv, envp) < 0)
> exit(1); // error parsing cmdline
> +
> +#ifdef ARCH_X86
> +  get_mmx_optimizations();
> +#endif
>  
>      playtree = play_tree_cleanup(playtree);
>      if(playtree) {
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Mplayerxp-cvslog mailing list
> Mplayerxp-cvslog at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mplayerxp-cvslog
> 
> 
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
-------------- next part --------------
Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.190
diff -u -r1.190 cfg-mplayer.h
--- cfg-mplayer.h	3 Jan 2003 12:40:09 -0000	1.190
+++ cfg-mplayer.h	4 Jan 2003 14:15:05 -0000
@@ -120,6 +120,15 @@
 extern int nortc;
 #endif
 
+#ifdef ARCH_X86
+extern int x86_mmx;
+extern int x86_mmx2;
+extern int x86_3dnow;
+extern int x86_3dnow2;
+extern int x86_sse;
+extern int x86_sse2;
+#endif
+
 /* from libvo/aspect.c */
 extern float monitor_aspect;
 
@@ -317,6 +326,22 @@
 	// draw by slices or whole frame (usefull with libmpeg2/libavcodec)
 	{"slices", &vd_use_slices, CONF_TYPE_FLAG, 0, 0, 1, NULL},
 	{"noslices", &vd_use_slices, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+
+#ifdef ARCH_X86
+        {"mmx", &x86_mmx, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+        {"nommx", &x86_mmx, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+        {"mmx2", &x86_mmx2, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+        {"nommx2", &x86_mmx2, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+        {"3dnow", &x86_3dnow, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+        {"no3dnow", &x86_3dnow, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+        {"3dnow2", &x86_3dnow2, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+        {"no3dnow2", &x86_3dnow2, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+        {"sse", &x86_sse, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+        {"nosse", &x86_sse, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+        {"sse2", &x86_sse2, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+        {"nosse2", &x86_sse2, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+#endif
+
 
 #ifdef HAVE_AA
 	// -vo aa
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.644
diff -u -r1.644 mplayer.c
--- mplayer.c	3 Jan 2003 20:46:28 -0000	1.644
+++ mplayer.c	4 Jan 2003 14:15:14 -0000
@@ -635,7 +635,19 @@
   mp_msg(MSGT_CPLAYER,MSGL_INFO,banner_text);
   /* Test for cpu capabilities (and corresponding OS support) for optimizing */
 #ifdef ARCH_X86
+  int x86_mmx=-1;
+  int x86_mmx2=-1;
+  int x86_3dnow=-1;
+  int x86_3dnow2=-1;
+  int x86_sse=-1;
+  int x86_sse2=-1;
   GetCpuCaps(&gCpuCaps);
+  if(x86_mmx != -1) gCpuCaps.hasMMX=x86_mmx;
+  if(x86_mmx2 != -1) gCpuCaps.hasMMX2=x86_mmx2;
+  if(x86_3dnow != -1) gCpuCaps.has3DNow=x86_3dnow;
+  if(x86_3dnow2 != -1) gCpuCaps.has3DNowExt=x86_3dnow2;
+  if(x86_sse != -1) gCpuCaps.hasSSE=x86_sse;
+  if(x86_sse2 != -1) gCpuCaps.hasSSE2=x86_sse2; 
   mp_msg(MSGT_CPLAYER,MSGL_INFO,"CPUflags:  MMX: %d MMX2: %d 3DNow: %d 3DNow2: %d SSE: %d SSE2: %d\n",
       gCpuCaps.hasMMX,gCpuCaps.hasMMX2,
       gCpuCaps.has3DNow, gCpuCaps.has3DNowExt,
@@ -664,7 +676,11 @@
 #endif
   mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n\n");
 #endif
-
+  if(gCpuCaps.hasMMX) mplayer_accel |= MM_ACCEL_X86_MMX;
+  if(gCpuCaps.hasMMX2) mplayer_accel |= MM_ACCEL_X86_MMXEXT;
+  if(gCpuCaps.hasSSE) mplayer_accel |= MM_ACCEL_X86_SSE;
+  if(gCpuCaps.has3DNow) mplayer_accel |= MM_ACCEL_X86_3DNOW;
+  if(gCpuCaps.has3DNowExt) mplayer_accel |= MM_ACCEL_X86_3DNOWEXT;
 #endif
 
 #ifdef USE_TV
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20030104/d6f5de16/attachment.pgp>


More information about the MPlayer-dev-eng mailing list