Commit be5d9107 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Use <vlc_cpu.h>

parent 1f133a02
...@@ -785,27 +785,7 @@ VLC_EXPORT( int, __vlc_execve, ( vlc_object_t *p_object, int i_argc, char *const ...@@ -785,27 +785,7 @@ VLC_EXPORT( int, __vlc_execve, ( vlc_object_t *p_object, int i_argc, char *const
/* dir wrappers (defined in src/extras/libc.c) */ /* dir wrappers (defined in src/extras/libc.c) */
VLC_EXPORT(int, vlc_wclosedir, ( void *_p_dir )); VLC_EXPORT(int, vlc_wclosedir, ( void *_p_dir ));
/***************************************************************************** /* Fast large memory copy and memory set */
* CPU capabilities
*****************************************************************************/
#define CPU_CAPABILITY_NONE 0
#define CPU_CAPABILITY_MMX (1<<3)
#define CPU_CAPABILITY_3DNOW (1<<4)
#define CPU_CAPABILITY_MMXEXT (1<<5)
#define CPU_CAPABILITY_SSE (1<<6)
#define CPU_CAPABILITY_SSE2 (1<<7)
#define CPU_CAPABILITY_SSE3 (1<<8)
#define CPU_CAPABILITY_SSSE3 (1<<9)
#define CPU_CAPABILITY_SSE4 (1<<10)
#define CPU_CAPABILITY_ALTIVEC (1<<16)
#define CPU_CAPABILITY_NEON (1<<24)
#define CPU_CAPABILITY_FPU (1<<31)
VLC_EXPORT( unsigned, vlc_CPU, ( void ) );
typedef void *(*vlc_memcpy_t) (void *tgt, const void *src, size_t n);
typedef void *(*vlc_memset_t) (void *tgt, int c, size_t n);
VLC_EXPORT( void, vlc_fastmem_register, (vlc_memcpy_t cpy, vlc_memset_t set) );
VLC_EXPORT( void *, vlc_memcpy, ( void *, const void *, size_t ) ); VLC_EXPORT( void *, vlc_memcpy, ( void *, const void *, size_t ) );
VLC_EXPORT( void *, vlc_memset, ( void *, int, size_t ) ); VLC_EXPORT( void *, vlc_memset, ( void *, int, size_t ) );
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <vlc_aout.h> #include <vlc_aout.h>
#include <vlc_block.h> #include <vlc_block.h>
#include <vlc_filter.h> #include <vlc_filter.h>
#include <vlc_cpu.h>
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_aout.h> #include <vlc_aout.h>
#include <vlc_cpu.h>
static int Open (vlc_object_t *); static int Open (vlc_object_t *);
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <vlc_dialog.h> #include <vlc_dialog.h>
#include <vlc_aout.h> #include <vlc_aout.h>
#include <vlc_cpu.h>
/* ALSA part /* ALSA part
Note: we use the new API which is available since 0.9.0beta10a. */ Note: we use the new API which is available since 0.9.0beta10a. */
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_aout.h> #include <vlc_aout.h>
#include <vlc_cpu.h>
#include <pulse/pulseaudio.h> #include <pulse/pulseaudio.h>
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_codec.h> #include <vlc_codec.h>
#include <vlc_avcodec.h> #include <vlc_avcodec.h>
#include <vlc_cpu.h>
/* ffmpeg header */ /* ffmpeg header */
#define HAVE_MMX 1 #define HAVE_MMX 1
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <vlc_codec.h> #include <vlc_codec.h>
#include <vlc_dialog.h> #include <vlc_dialog.h>
#include <vlc_avcodec.h> #include <vlc_avcodec.h>
#include <vlc_cpu.h>
/* ffmpeg header */ /* ffmpeg header */
#define HAVE_MMX 1 #define HAVE_MMX 1
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <vlc_input.h> #include <vlc_input.h>
#include <vlc_aout.h> #include <vlc_aout.h>
#include <vlc_codec.h> #include <vlc_codec.h>
#include <vlc_cpu.h>
#include <faad.h> #include <faad.h>
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_aout.h> #include <vlc_aout.h>
#include <vlc_codec.h> #include <vlc_codec.h>
#include <vlc_cpu.h>
/* On Win32, we link statically */ /* On Win32, we link statically */
#ifdef WIN32 #ifdef WIN32
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_codec.h> #include <vlc_codec.h>
#include <vlc_block_helper.h> #include <vlc_block_helper.h>
#include <vlc_cpu.h>
#include "../codec/cc.h" #include "../codec/cc.h"
#include <mpeg2.h> #include <mpeg2.h>
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <vlc_sout.h> #include <vlc_sout.h>
#include <vlc_codec.h> #include <vlc_codec.h>
#include <vlc_charset.h> #include <vlc_charset.h>
#include <vlc_cpu.h>
#ifdef PTW32_STATIC_LIB #ifdef PTW32_STATIC_LIB
#include <pthread.h> #include <pthread.h>
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_codec.h> #include <vlc_codec.h>
#include <vlc_codec_synchro.h> #include <vlc_codec_synchro.h>
#include <vlc_cpu.h>
#include <unistd.h> #include <unistd.h>
#ifdef __GLIBC__ #ifdef __GLIBC__
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_cpu.h>
#undef HAVE_MMX #undef HAVE_MMX
#undef HAVE_MMX2 #undef HAVE_MMX2
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_cpu.h>
#ifdef HAVE_ALTIVEC_H #ifdef HAVE_ALTIVEC_H
# include <altivec.h> # include <altivec.h>
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <vlc_sout.h> #include <vlc_sout.h>
#include <vlc_avcodec.h> #include <vlc_avcodec.h>
#include <vlc_filter.h> #include <vlc_filter.h>
#include <vlc_cpu.h>
#include <vlc_block.h> #include <vlc_block.h>
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_filter.h> #include <vlc_filter.h>
#include <vlc_cpu.h>
#include "i420_rgb.h" #include "i420_rgb.h"
#if defined (MODULE_NAME_IS_i420_rgb) #if defined (MODULE_NAME_IS_i420_rgb)
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_filter.h> #include <vlc_filter.h>
#include <vlc_cpu.h>
#define SRC_FOURCC "I420,IYUV,YV12" #define SRC_FOURCC "I420,IYUV,YV12"
#define DEST_FOURCC "YMGA" #define DEST_FOURCC "YMGA"
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_filter.h> #include <vlc_filter.h>
#include <vlc_cpu.h>
#if defined (MODULE_NAME_IS_i420_yuy2_altivec) && defined(HAVE_ALTIVEC_H) #if defined (MODULE_NAME_IS_i420_yuy2_altivec) && defined(HAVE_ALTIVEC_H)
# include <altivec.h> # include <altivec.h>
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_filter.h> #include <vlc_filter.h>
#include <vlc_cpu.h>
#include "i422_yuy2.h" #include "i422_yuy2.h"
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_filter.h> #include <vlc_filter.h>
#include <vlc_cpu.h>
static int Open (vlc_object_t *); static int Open (vlc_object_t *);
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <vlc_vout.h> #include <vlc_vout.h>
#include <vlc_sout.h> #include <vlc_sout.h>
#include <vlc_filter.h> #include <vlc_filter.h>
#include <vlc_cpu.h>
#ifdef CAN_COMPILE_MMXEXT #ifdef CAN_COMPILE_MMXEXT
# include "mmx.h" # include "mmx.h"
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_filter.h> #include <vlc_filter.h>
#include <vlc_cpu.h>
#include "filter_picture.h" #include "filter_picture.h"
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_filter.h> #include <vlc_filter.h>
#include <vlc_cpu.h>
#ifdef HAVE_LIBSWSCALE_SWSCALE_H #ifdef HAVE_LIBSWSCALE_SWSCALE_H
# include <libswscale/swscale.h> # include <libswscale/swscale.h>
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_aout.h> #include <vlc_aout.h>
#include <vlc_cpu.h>
#include "aout_internal.h" #include "aout_internal.h"
/***************************************************************************** /*****************************************************************************
......
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
#include "audio_output/aout_internal.h" #include "audio_output/aout_internal.h"
#include <vlc_charset.h> #include <vlc_charset.h>
#include <vlc_cpu.h>
#include "libvlc.h" #include "libvlc.h"
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#endif #endif
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_cpu.h>
#include <sys/types.h> #include <sys/types.h>
#ifndef WIN32 #ifndef WIN32
...@@ -81,7 +82,7 @@ static bool check_OS_capability( const char *psz_capability, pid_t pid ) ...@@ -81,7 +82,7 @@ static bool check_OS_capability( const char *psz_capability, pid_t pid )
*****************************************************************************/ *****************************************************************************/
uint32_t CPUCapabilities( void ) uint32_t CPUCapabilities( void )
{ {
uint32_t i_capabilities = CPU_CAPABILITY_NONE; uint32_t i_capabilities = 0;
#if defined( __i386__ ) || defined( __x86_64__ ) #if defined( __i386__ ) || defined( __x86_64__ )
unsigned int i_eax, i_ebx, i_ecx, i_edx; unsigned int i_eax, i_ebx, i_ecx, i_edx;
......
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
#include "vlc_charset.h" #include "vlc_charset.h"
#include "vlc_arrays.h" #include "vlc_arrays.h"
#include <vlc_cpu.h>
#include "modules/modules.h" #include "modules/modules.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment