Unified · Split
| @@ -12,6 +12,9 @@ libavutil: 2011-04-18 · 11 unmodified lines | ||
| 12 | 12 | |
| 13 | 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 | 18 | 2012-xx-xx - lavc 54.8.0 |
| 16 | 19 | xxxxxxx Add av_get_exact_bits_per_sample() |
| 17 | 20 | xxxxxxx Add av_get_audio_frame_duration() |
| @@ -152,7 +152,7 @@ · 151 unmodified lines | ||
| 152 | 152 | */ |
| 153 | 153 | |
| 154 | 154 | #define LIBAVUTIL_VERSION_MAJOR 51 |
| 155 | −#define LIBAVUTIL_VERSION_MINOR 24 | |
| 155 | +#define LIBAVUTIL_VERSION_MINOR 25 | |
| 156 | 156 | #define LIBAVUTIL_VERSION_MICRO 0 |
| 157 | 157 | |
| 158 | 158 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |
| @@ -19,9 +19,11 @@ · 18 unmodified lines | ||
| 19 | 19 | #include "cpu.h" |
| 20 | 20 | #include "config.h" |
| 21 | 21 | |
| 22 | +static int cpuflags_mask, checked; | |
| 23 | + | |
| 22 | 24 | int av_get_cpu_flags(void) |
| 23 | 25 | { |
| 24 | − static int flags, checked; | |
| 26 | + static int flags; | |
| 25 | 27 | |
| 26 | 28 | if (checked) |
| 27 | 29 | return flags; |
| @@ -30,10 +32,18 @@ int av_get_cpu_flags(void) · 2 unmodified lines | ||
| 30 | 32 | if (ARCH_PPC) flags = ff_get_cpu_flags_ppc(); |
| 31 | 33 | if (ARCH_X86) flags = ff_get_cpu_flags_x86(); |
| 32 | 34 | |
| 35 | + flags &= cpuflags_mask; | |
| 33 | 36 | checked = 1; |
| 37 | + | |
| 34 | 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 | 47 | #ifdef TEST |
| 38 | 48 | |
| 39 | 49 | #undef printf |
| @@ -48,6 +48,14 @@ · 47 unmodified lines | ||
| 48 | 48 | */ |
| 49 | 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 | 59 | /* The following CPU-specific functions shall not be called directly. */ |
| 52 | 60 | int ff_get_cpu_flags_arm(void); |
| 53 | 61 | int ff_get_cpu_flags_ppc(void); |