diff options
Diffstat (limited to 'src/xine-utils')
-rw-r--r-- | src/xine-utils/memcpy.c | 25 | ||||
-rw-r--r-- | src/xine-utils/xineutils.h | 37 |
2 files changed, 18 insertions, 44 deletions
diff --git a/src/xine-utils/memcpy.c b/src/xine-utils/memcpy.c index 39cbad416..3e1de857d 100644 --- a/src/xine-utils/memcpy.c +++ b/src/xine-utils/memcpy.c @@ -362,6 +362,7 @@ static struct { uint32_t cpu_require; } memcpy_method[] = { + { NULL, NULL, 0, 0 }, { "glibc memcpy()", memcpy, 0, 0 }, #ifdef ARCH_X86 { "linux kernel memcpy()", linux_kernel_memcpy, 0, 0 }, @@ -407,6 +408,8 @@ void xine_probe_fast_memcpy(config_values_t *config) char *buf1, *buf2; int i, j, best; static int config_flags = -1; + static char *memcpy_methods[] = {"probe", "glibc", "kernel", + "mmx", "mmxext", "sse", NULL}; #ifdef ARCH_X86 config_flags = xine_mm_accel(); @@ -414,9 +417,13 @@ void xine_probe_fast_memcpy(config_values_t *config) config_flags = 0; #endif - best = config->lookup_int (config, "fast_memcpy", -1); + best = config->register_enum (config, "misc.memcpy_method", 0, + memcpy_methods, + "Memcopy method to use in xine for large data chunks.", + NULL, NULL, NULL); + /* check if function is configured and valid for this machine */ - if( best != -1 && + if( best != 0 && (config_flags & memcpy_method[best].cpu_require) == memcpy_method[best].cpu_require ) { printf("xine: using %s\n", memcpy_method[best].name ); @@ -424,7 +431,7 @@ void xine_probe_fast_memcpy(config_values_t *config) return; } - best = -1; + best = 0; xine_fast_memcpy = memcpy; @@ -440,7 +447,7 @@ void xine_probe_fast_memcpy(config_values_t *config) /* make sure buffers are present on physical memory */ memcpy(buf1,buf2,BUFSIZE); - for(i=0; memcpy_method[i].name; i++) + for(i=1; memcpy_method[i].name; i++) { if( (config_flags & memcpy_method[i].cpu_require) != memcpy_method[i].cpu_require ) @@ -464,13 +471,15 @@ void xine_probe_fast_memcpy(config_values_t *config) printf("\t%s : %lld\n",memcpy_method[i].name, t); - if( best == -1 || t < memcpy_method[best].time ) + if( best == 0 || t < memcpy_method[best].time ) best = i; } - printf("xine: using %s\n", memcpy_method[best].name ); + + printf("memcpy: using %s\n", memcpy_method[best].name ); xine_fast_memcpy = memcpy_method[best].function; - config->set_int (config, "fast_memcpy", best ); - + + config->update_num (config, "misc.memcpy_method", best); + free(buf1); free(buf2); } diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index e181ea1aa..1655b3dd8 100644 --- a/src/xine-utils/xineutils.h +++ b/src/xine-utils/xineutils.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xineutils.h,v 1.2 2001/11/17 22:40:01 miguelfreitas Exp $ + * $Id: xineutils.h,v 1.3 2001/11/18 03:53:25 guenter Exp $ * */ #ifndef XINEUTILS_H @@ -540,22 +540,6 @@ void xine_probe_fast_memcpy(config_values_t *config); /* Debugging/Monitoring */ -extern uint32_t xine_debug; - -#define VERBOSE (xine_debug & 0x8000>>1) // 16384 -#define METRONOM (xine_debug & 0x8000>>2) // 8192 -#define AUDIO (xine_debug & 0x8000>>3) // 4096 -#define DEMUX (xine_debug & 0x8000>>4) // 2048 -#define INPUT (xine_debug & 0x8000>>5) // 1024 -#define VIDEO (xine_debug & 0x8000>>6) // 512 -#define VPTS (xine_debug & 0x8000>>7) // 256 -#define MPEG (xine_debug & 0x8000>>8) // 128 -#define VAVI (xine_debug & 0x8000>>9) // 64 -#define AC3 (xine_debug & 0x8000>>10) // 32 -#define LOOP (xine_debug & 0x8000>>11) // 16 -#define GUI (xine_debug & 0x8000>>12) // 8 -#define SPU (xine_debug & 0x8000>>13) // 4 - #ifdef __GNUC__ #define perr(FMT,ARGS...) {fprintf(stderr, FMT, ##ARGS);fflush(stderr);} #else /* C99 version: */ @@ -566,19 +550,6 @@ extern uint32_t xine_debug; /* * Debug stuff */ -#ifdef __GNUC__ -#define xprintf(LVL, FMT, ARGS...) { \ - if(LVL) { \ - printf(FMT, ##ARGS); \ - } \ - } -#else /* C99 version: */ -#define xprintf(LVL, ...) { \ - if(LVL) { \ - printf(__VA_ARGS__); \ - } \ - } -#endif /* __GNUC__ */ /* * profiling @@ -591,12 +562,6 @@ void xine_profiler_print_results (void); #else /* no DEBUG, release version */ -#ifdef __GNUC__ -#define xprintf(LVL, FMT, ARGS...) -#else /* C99 version: */ -#define xprintf(LVL, ...) -#endif - #define xine_profiler_init() #define xine_profiler_allocate_slot(label) (-1) #define xine_profiler_start_count(id) |