diff mbox series

[FFmpeg-devel,2/2] avutil/cpu: Schedule deprecated functions for removal

Message ID HE1PR0301MB2154CA49898F38D7C08124C98F4E9@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit 7368e5537db61683b535257adbc0c3b15f0f84f2
Headers show
Series [FFmpeg-devel,1/2] Include attributes.h directly
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt April 14, 2021, 5:01 p.m. UTC
av_set_cpu_flags_mask() has been deprecated in the commit which merged
it: 6df42f98746be06c883ce683563e07c9a2af983f; av_parse_cpu_flags() has
been deprecated in 4b529edff8934c258af95e5acc51f84deea66262.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavutil/cpu.c     | 3 ++-
 libavutil/cpu.h     | 3 +++
 libavutil/version.h | 3 +++
 3 files changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 8e3576a1f3..bdac454421 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -102,6 +102,7 @@  int av_get_cpu_flags(void)
     return flags;
 }
 
+#if FF_API_CPU_FLAGS
 void av_set_cpu_flags_mask(int mask)
 {
     atomic_store_explicit(&cpu_flags, get_cpu_flags() & mask,
@@ -192,7 +193,7 @@  int av_parse_cpu_flags(const char *s)
 
     return flags & INT_MAX;
 }
-
+#endif
 int av_parse_cpu_caps(unsigned *flags, const char *s)
 {
         static const AVOption cpuflags_opts[] = {
diff --git a/libavutil/cpu.h b/libavutil/cpu.h
index 83099dd969..18dfa492ef 100644
--- a/libavutil/cpu.h
+++ b/libavutil/cpu.h
@@ -24,6 +24,7 @@ 
 #include <stddef.h>
 
 #include "attributes.h"
+#include "version.h"
 
 #define AV_CPU_FLAG_FORCE    0x80000000 /* force usage of selected flags (OR) */
 
@@ -88,6 +89,7 @@  int av_get_cpu_flags(void);
  */
 void av_force_cpu_flags(int flags);
 
+#if FF_API_CPU_FLAGS
 /**
  * Set a mask on flags returned by av_get_cpu_flags().
  * This function is mainly useful for testing.
@@ -106,6 +108,7 @@  attribute_deprecated void av_set_cpu_flags_mask(int mask);
  */
 attribute_deprecated
 int av_parse_cpu_flags(const char *s);
+#endif
 
 /**
  * Parse CPU caps from a string and update the given AV_CPU_* flags based on that.
diff --git a/libavutil/version.h b/libavutil/version.h
index e88e1ad08d..4e5bf45cf8 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -135,6 +135,9 @@ 
 #ifndef FF_API_BUFFER_SIZE_T
 #define FF_API_BUFFER_SIZE_T            (LIBAVUTIL_VERSION_MAJOR < 57)
 #endif
+#ifndef FF_API_CPU_FLAGS
+#define FF_API_CPU_FLAGS                (LIBAVUTIL_VERSION_MAJOR < 57)
+#endif
 #ifndef FF_API_D2STR
 #define FF_API_D2STR                    (LIBAVUTIL_VERSION_MAJOR < 58)
 #endif