Unified · Split
| @@ -12,6 +12,9 @@ libavutil: 2011-04-18 · 11 unmodified lines | |||
| 12 | 12 | ||
| 13 | API changes, most recent first: | 13 | API changes, most recent first: |
| 14 | 14 | ||
| 15 | 2012-03-xx - xxxxxxx - lavu 51.25.0 - cpu.h | ||
| 16 | Add av_set_cpu_flags_mask(). | ||
| 17 | |||
| 15 | 2012-xx-xx - lavc 54.8.0 | 18 | 2012-xx-xx - lavc 54.8.0 |
| 16 | xxxxxxx Add av_get_exact_bits_per_sample() | 19 | xxxxxxx Add av_get_exact_bits_per_sample() |
| 17 | xxxxxxx Add av_get_audio_frame_duration() | 20 | xxxxxxx Add av_get_audio_frame_duration() |
| @@ -152,7 +152,7 @@ · 151 unmodified lines | |||
| 152 | */ | 152 | */ |
| 153 | 153 | ||
| 154 | #define LIBAVUTIL_VERSION_MAJOR 51 | 154 | #define LIBAVUTIL_VERSION_MAJOR 51 |
| 155 | #define LIBAVUTIL_VERSION_MINOR 24 | 155 | #define LIBAVUTIL_VERSION_MINOR 25 |
| 156 | #define LIBAVUTIL_VERSION_MICRO 0 | 156 | #define LIBAVUTIL_VERSION_MICRO 0 |
| 157 | 157 | ||
| 158 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ | 158 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |
| @@ -19,9 +19,11 @@ · 18 unmodified lines | |||
| 19 | #include "cpu.h" | 19 | #include "cpu.h" |
| 20 | #include "config.h" | 20 | #include "config.h" |
| 21 | 21 | ||
| 22 | static int cpuflags_mask, checked; | ||
| 23 | |||
| 22 | int av_get_cpu_flags(void) | 24 | int av_get_cpu_flags(void) |
| 23 | { | 25 | { |
| 24 | static int flags, checked; | 26 | static int flags; |
| 25 | 27 | ||
| 26 | if (checked) | 28 | if (checked) |
| 27 | return flags; | 29 | return flags; |
| @@ -30,10 +32,18 @@ int av_get_cpu_flags(void) · 2 unmodified lines | |||
| 30 | if (ARCH_PPC) flags = ff_get_cpu_flags_ppc(); | 32 | if (ARCH_PPC) flags = ff_get_cpu_flags_ppc(); |
| 31 | if (ARCH_X86) flags = ff_get_cpu_flags_x86(); | 33 | if (ARCH_X86) flags = ff_get_cpu_flags_x86(); |
| 32 | 34 | ||
| 35 | flags &= cpuflags_mask; | ||
| 33 | checked = 1; | 36 | checked = 1; |
| 37 | |||
| 34 | return flags; | 38 | return flags; |
| 35 | } | 39 | } |
| 36 | 40 | ||
| 41 | void av_set_cpu_flags_mask(int mask) | ||
| 42 | { | ||
| 43 | cpuflags_mask = mask; | ||
| 44 | checked = 0; | ||
| 45 | } | ||
| 46 | |||
| 37 | #ifdef TEST | 47 | #ifdef TEST |
| 38 | 48 | ||
| 39 | #undef printf | 49 | #undef printf |
| @@ -48,6 +48,14 @@ · 47 unmodified lines | |||
| 48 | */ | 48 | */ |
| 49 | int av_get_cpu_flags(void); | 49 | int av_get_cpu_flags(void); |
| 50 | 50 | ||
| 51 | /** | ||
| 52 | * Set a mask on flags returned by av_get_cpu_flags(). | ||
| 53 | * This function is mainly useful for testing. | ||
| 54 | * | ||
| 55 | * @warning this function is not thread safe. | ||
| 56 | */ | ||
| 57 | void av_set_cpu_flags_mask(int mask); | ||
| 58 | |||
| 51 | /* The following CPU-specific functions shall not be called directly. */ | 59 | /* The following CPU-specific functions shall not be called directly. */ |
| 52 | int ff_get_cpu_flags_arm(void); | 60 | int ff_get_cpu_flags_arm(void); |
| 53 | int ff_get_cpu_flags_ppc(void); | 61 | int ff_get_cpu_flags_ppc(void); |