[FFmpeg-cvslog] cpudetect: add av_force_cpu_flags()
Michael Niedermayer
git at videolan.org
Thu Jun 2 21:24:54 CEST 2011
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jun 2 16:09:22 2011 +0200| [5ad38d93e86e66b29b329c04cdc86f22a96b7db3] | committer: Michael Niedermayer
cpudetect: add av_force_cpu_flags()
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5ad38d93e86e66b29b329c04cdc86f22a96b7db3
---
libavutil/avutil.h | 2 +-
libavutil/cpu.c | 9 +++++++--
libavutil/cpu.h | 7 +++++++
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/libavutil/avutil.h b/libavutil/avutil.h
index e3bc6c7..cdd4f71 100644
--- a/libavutil/avutil.h
+++ b/libavutil/avutil.h
@@ -40,7 +40,7 @@
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
#define LIBAVUTIL_VERSION_MAJOR 51
-#define LIBAVUTIL_VERSION_MINOR 3
+#define LIBAVUTIL_VERSION_MINOR 4
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 66262b9..c439a83 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -19,10 +19,15 @@
#include "cpu.h"
#include "config.h"
+static int flags, checked;
+
+void av_force_cpu_flags(int arg){
+ flags = arg;
+ checked = 1;
+}
+
int av_get_cpu_flags(void)
{
- static int flags, checked;
-
if (checked)
return flags;
diff --git a/libavutil/cpu.h b/libavutil/cpu.h
index 4ec3a27..da93fb5 100644
--- a/libavutil/cpu.h
+++ b/libavutil/cpu.h
@@ -46,6 +46,13 @@
*/
int av_get_cpu_flags(void);
+
+/**
+ * Disables cpu detection and forces the specified flags.
+ */
+void av_force_cpu_flags(int flags);
+
+
/* The following CPU-specific functions shall not be called directly. */
int ff_get_cpu_flags_arm(void);
int ff_get_cpu_flags_ppc(void);
More information about the ffmpeg-cvslog
mailing list