History

cpu: add av_set_cpu_flags_mask().

Anton Khirnov committed 14 years ago

Commit 4d851f81 parent 338978a4 files · +23 −2Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavutil/avutil.h +1 −1
  3. libavutil/cpu.c +11 −1
  4. libavutil/cpu.h +8 −0
doc/APIchanges+3−0
@@ -12,6 +12,9 @@ libavutil: 2011-04-18 · 11 unmodified lines
12 12
13API changes, most recent first:13API changes, most recent first:
14 14
152012-03-xx - xxxxxxx - lavu 51.25.0 - cpu.h
16 Add av_set_cpu_flags_mask().
17
152012-xx-xx - lavc 54.8.0182012-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()
libavutil/avutil.h+1−1
@@ -152,7 +152,7 @@ · 151 unmodified lines
152 */152 */
153 153
154#define LIBAVUTIL_VERSION_MAJOR 51154#define LIBAVUTIL_VERSION_MAJOR 51
155#define LIBAVUTIL_VERSION_MINOR 24155#define LIBAVUTIL_VERSION_MINOR 25
156#define LIBAVUTIL_VERSION_MICRO 0156#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, \
libavutil/cpu.c+11−1
@@ -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
22static int cpuflags_mask, checked;
23
22int av_get_cpu_flags(void)24int 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
41void av_set_cpu_flags_mask(int mask)
42{
43 cpuflags_mask = mask;
44 checked = 0;
45}
46
37#ifdef TEST47#ifdef TEST
38 48
39#undef printf49#undef printf
libavutil/cpu.h+8−0
@@ -48,6 +48,14 @@ · 47 unmodified lines
48 */48 */
49int av_get_cpu_flags(void);49int 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 */
57void 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. */
52int ff_get_cpu_flags_arm(void);60int ff_get_cpu_flags_arm(void);
53int ff_get_cpu_flags_ppc(void);61int ff_get_cpu_flags_ppc(void);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t