You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-29 05:57:37 +02:00
cpu: add av_set_cpu_flags_mask().
This commit is contained in:
@@ -12,6 +12,9 @@ libavutil: 2011-04-18
|
|||||||
|
|
||||||
API changes, most recent first:
|
API changes, most recent first:
|
||||||
|
|
||||||
|
2012-03-xx - xxxxxxx - lavu 51.25.0 - cpu.h
|
||||||
|
Add av_set_cpu_flags_mask().
|
||||||
|
|
||||||
2012-xx-xx - lavc 54.8.0
|
2012-xx-xx - lavc 54.8.0
|
||||||
xxxxxxx Add av_get_exact_bits_per_sample()
|
xxxxxxx Add av_get_exact_bits_per_sample()
|
||||||
xxxxxxx Add av_get_audio_frame_duration()
|
xxxxxxx Add av_get_audio_frame_duration()
|
||||||
|
|||||||
@@ -152,7 +152,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define LIBAVUTIL_VERSION_MAJOR 51
|
#define LIBAVUTIL_VERSION_MAJOR 51
|
||||||
#define LIBAVUTIL_VERSION_MINOR 24
|
#define LIBAVUTIL_VERSION_MINOR 25
|
||||||
#define LIBAVUTIL_VERSION_MICRO 0
|
#define LIBAVUTIL_VERSION_MICRO 0
|
||||||
|
|
||||||
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
|
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
|
||||||
|
|||||||
@@ -19,9 +19,11 @@
|
|||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
static int cpuflags_mask, checked;
|
||||||
|
|
||||||
int av_get_cpu_flags(void)
|
int av_get_cpu_flags(void)
|
||||||
{
|
{
|
||||||
static int flags, checked;
|
static int flags;
|
||||||
|
|
||||||
if (checked)
|
if (checked)
|
||||||
return flags;
|
return flags;
|
||||||
@@ -30,10 +32,18 @@ int av_get_cpu_flags(void)
|
|||||||
if (ARCH_PPC) flags = ff_get_cpu_flags_ppc();
|
if (ARCH_PPC) flags = ff_get_cpu_flags_ppc();
|
||||||
if (ARCH_X86) flags = ff_get_cpu_flags_x86();
|
if (ARCH_X86) flags = ff_get_cpu_flags_x86();
|
||||||
|
|
||||||
|
flags &= cpuflags_mask;
|
||||||
checked = 1;
|
checked = 1;
|
||||||
|
|
||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void av_set_cpu_flags_mask(int mask)
|
||||||
|
{
|
||||||
|
cpuflags_mask = mask;
|
||||||
|
checked = 0;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
|
|
||||||
#undef printf
|
#undef printf
|
||||||
|
|||||||
@@ -48,6 +48,14 @@
|
|||||||
*/
|
*/
|
||||||
int av_get_cpu_flags(void);
|
int av_get_cpu_flags(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set a mask on flags returned by av_get_cpu_flags().
|
||||||
|
* This function is mainly useful for testing.
|
||||||
|
*
|
||||||
|
* @warning this function is not thread safe.
|
||||||
|
*/
|
||||||
|
void av_set_cpu_flags_mask(int mask);
|
||||||
|
|
||||||
/* The following CPU-specific functions shall not be called directly. */
|
/* The following CPU-specific functions shall not be called directly. */
|
||||||
int ff_get_cpu_flags_arm(void);
|
int ff_get_cpu_flags_arm(void);
|
||||||
int ff_get_cpu_flags_ppc(void);
|
int ff_get_cpu_flags_ppc(void);
|
||||||
|
|||||||
Reference in New Issue
Block a user