diff mpcommon.c @ 28325:21504ba0f5d3

Factorize print_version(). Print CPU information in verbose mode instead of by default.
author diego
date Sun, 25 Jan 2009 20:35:58 +0000
parents e54c9b7eb0d8
children 51797a3b96d2
line wrap: on
line diff
--- a/mpcommon.c	Sun Jan 25 20:10:36 2009 +0000
+++ b/mpcommon.c	Sun Jan 25 20:35:58 2009 +0000
@@ -5,7 +5,11 @@
 #include "mplayer.h"
 #include "libvo/sub.h"
 #include "libvo/video_out.h"
+#include "cpudetect.h"
+#include "help_mp.h"
+#include "mp_msg.h"
 #include "spudec.h"
+#include "version.h"
 #include "vobsub.h"
 #ifdef CONFIG_TV_TELETEXT
 #include "stream/tv.h"
@@ -24,6 +28,47 @@
 sub_data* subdata = NULL;
 subtitle* vo_sub_last = NULL;
 
+
+void print_version(const char* name)
+{
+    mp_msg(MSGT_CPLAYER, MSGL_INFO, MP_TITLE, name);
+
+    /* Test for CPU capabilities (and corresponding OS support) for optimizing */
+    GetCpuCaps(&gCpuCaps);
+#if ARCH_X86
+    mp_msg(MSGT_CPLAYER, MSGL_V,
+	   "CPUflags:  MMX: %d MMX2: %d 3DNow: %d 3DNow2: %d SSE: %d SSE2: %d\n",
+	   gCpuCaps.hasMMX, gCpuCaps.hasMMX2,
+	   gCpuCaps.has3DNow, gCpuCaps.has3DNowExt,
+	   gCpuCaps.hasSSE, gCpuCaps.hasSSE2);
+#ifdef RUNTIME_CPUDETECT
+    mp_msg(MSGT_CPLAYER,MSGL_V, MSGTR_CompiledWithRuntimeDetection);
+#else
+    mp_msg(MSGT_CPLAYER,MSGL_V, MSGTR_CompiledWithCPUExtensions);
+#if HAVE_MMX
+    mp_msg(MSGT_CPLAYER,MSGL_V," MMX");
+#endif
+#if HAVE_MMX2
+    mp_msg(MSGT_CPLAYER,MSGL_V," MMX2");
+#endif
+#if HAVE_3DNOW
+    mp_msg(MSGT_CPLAYER,MSGL_V," 3DNow");
+#endif
+#if HAVE_3DNOWEX
+    mp_msg(MSGT_CPLAYER,MSGL_V," 3DNowEx");
+#endif
+#if HAVE_SSE
+    mp_msg(MSGT_CPLAYER,MSGL_V," SSE");
+#endif
+#if HAVE_SSE2
+    mp_msg(MSGT_CPLAYER,MSGL_V," SSE2");
+#endif
+    mp_msg(MSGT_CPLAYER,MSGL_V,"\n");
+#endif /* RUNTIME_CPUDETECT */
+#endif /* ARCH_X86 */
+}
+
+
 void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset)
 {
     unsigned char *packet=NULL;