[FFmpeg-devel] [PATCH] avcodec/dv_profile: deprecate internal function that shouldn't be public

James Almer jamrial at gmail.com
Fri Sep 19 06:50:28 CEST 2014


Signed-off-by: James Almer <jamrial at gmail.com>
---
Unlike us, libav got rid of the internal symbols before the header became public on 
an actual relase, so we're stuck with it until next bump.
I renamed the function to ff_ since it's only used outside libavcodec when called
with the public symbol.

 doc/APIchanges                   |  3 +++
 libavcodec/dv_profile.c          | 12 ++++++++++--
 libavcodec/dv_profile.h          |  6 ++++++
 libavcodec/dv_profile_internal.h |  8 ++++++++
 libavcodec/dvdec.c               |  3 ++-
 libavcodec/version.h             |  5 ++++-
 6 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 8a28029..b257b21 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil:     2014-08-09
 
 API changes, most recent first:
 
+2014-09-xx - xxxxxxx - lavc 56.1.101 - dv_profile.h
+  deprecate avpriv_dv_frame_profile2(), which was made public by accident.
+
 
 -------- 8< --------- FFmpeg 2.4 was cut here -------- 8< ---------
 
diff --git a/libavcodec/dv_profile.c b/libavcodec/dv_profile.c
index 084f304..b301cbf 100644
--- a/libavcodec/dv_profile.c
+++ b/libavcodec/dv_profile.c
@@ -257,7 +257,7 @@ void ff_dv_print_profiles(void *logctx, int loglevel)
 
 #endif /* CONFIG_DVPROFILE */
 
-const AVDVProfile* avpriv_dv_frame_profile2(AVCodecContext* codec, const AVDVProfile *sys,
+const AVDVProfile* ff_dv_frame_profile(AVCodecContext* codec, const AVDVProfile *sys,
                                        const uint8_t *frame, unsigned buf_size)
 {
 #if CONFIG_DVPROFILE
@@ -297,10 +297,18 @@ const AVDVProfile* avpriv_dv_frame_profile2(AVCodecContext* codec, const AVDVPro
     return NULL;
 }
 
+#if FF_API_DV_FRAME_PROFILE
+const AVDVProfile* avpriv_dv_frame_profile2(AVCodecContext* codec, const AVDVProfile *sys,
+                                            const uint8_t *frame, unsigned buf_size)
+{
+    return ff_dv_frame_profile(codec, sys, frame, buf_size);
+}
+#endif
+
 const AVDVProfile *av_dv_frame_profile(const AVDVProfile *sys,
                                        const uint8_t *frame, unsigned buf_size)
 {
-    return avpriv_dv_frame_profile2(NULL, sys, frame, buf_size);
+    return ff_dv_frame_profile(NULL, sys, frame, buf_size);
 }
 
 const AVDVProfile *av_dv_codec_profile(int width, int height,
diff --git a/libavcodec/dv_profile.h b/libavcodec/dv_profile.h
index a2aec4d..d4437c9 100644
--- a/libavcodec/dv_profile.h
+++ b/libavcodec/dv_profile.h
@@ -58,8 +58,14 @@ typedef struct AVDVProfile {
     const uint8_t  (*audio_shuffle)[9];     /* PCM shuffling table */
 } AVDVProfile;
 
+#if FF_API_DV_FRAME_PROFILE
+/**
+ * @deprecated use av_dv_frame_profile()
+ */
+attribute_deprecated
 const AVDVProfile* avpriv_dv_frame_profile2(AVCodecContext* codec, const AVDVProfile *sys,
                                             const uint8_t* frame, unsigned buf_size);
+#endif
 
 /**
  * Get a DV profile for the provided compressed frame.
diff --git a/libavcodec/dv_profile_internal.h b/libavcodec/dv_profile_internal.h
index 9772041..67d3a2b 100644
--- a/libavcodec/dv_profile_internal.h
+++ b/libavcodec/dv_profile_internal.h
@@ -19,9 +19,17 @@
 #ifndef AVCODEC_DV_PROFILE_INTERNAL_H
 #define AVCODEC_DV_PROFILE_INTERNAL_H
 
+#include "dv_profile.h"
+
 /**
  *  Print all allowed DV profiles into logctx at specified logging level.
  */
 void ff_dv_print_profiles(void *logctx, int loglevel);
 
+/**
+ * Get a DV profile for the provided compressed frame.
+ */
+const AVDVProfile* ff_dv_frame_profile(AVCodecContext* codec, const AVDVProfile *sys,
+                                       const uint8_t *frame, unsigned buf_size);
+
 #endif /* AVCODEC_DV_PROFILE_INTERNAL_H */
diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
index 7de7e5b..5751135 100644
--- a/libavcodec/dvdec.c
+++ b/libavcodec/dvdec.c
@@ -42,6 +42,7 @@
 
 #include "avcodec.h"
 #include "dv.h"
+#include "dv_profile_internal.h"
 #include "dvdata.h"
 #include "get_bits.h"
 #include "idctdsp.h"
@@ -362,7 +363,7 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, void *data,
     int apt, is16_9, ret;
     const AVDVProfile *sys;
 
-    sys = avpriv_dv_frame_profile2(avctx, s->sys, buf, buf_size);
+    sys = ff_dv_frame_profile(avctx, s->sys, buf, buf_size);
     if (!sys || buf_size < sys->frame_size) {
         av_log(avctx, AV_LOG_ERROR, "could not find dv frame profile\n");
         return -1; /* NOTE: we only accept several full frames */
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 7b30334..a77e8b7 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -30,7 +30,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR 56
 #define LIBAVCODEC_VERSION_MINOR  1
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \
@@ -175,5 +175,8 @@
 /* XXX: don't forget to drop the -vismv documentation */
 #define FF_API_VISMV             (LIBAVCODEC_VERSION_MAJOR < 57)
 #endif
+#ifndef FF_API_DV_FRAME_PROFILE
+#define FF_API_DV_FRAME_PROFILE  (LIBAVCODEC_VERSION_MAJOR < 57)
+#endif
 
 #endif /* AVCODEC_VERSION_H */
-- 
1.8.5.5



More information about the ffmpeg-devel mailing list