]> git.sesse.net Git - ffmpeg/commitdiff
lavu/frame: put frame QP elements under a new version guard
authorHendrik Leppkes <h.leppkes@gmail.com>
Sat, 5 Sep 2015 15:35:31 +0000 (17:35 +0200)
committerHendrik Leppkes <h.leppkes@gmail.com>
Sat, 5 Sep 2015 15:35:31 +0000 (17:35 +0200)
These fields are still used, removal postponed until a replacement functionality is available.

libavutil/frame.c
libavutil/frame.h
libavutil/version.h

index f403fd75ddfdf67a758daa911fb9fd6b5825e434..7b4177bc953d3b52ede6e521c9753035af57d5a8 100644 (file)
@@ -46,29 +46,35 @@ MAKE_ACCESSORS(AVFrame, frame, enum AVColorRange, color_range)
 
 AVDictionary **avpriv_frame_get_metadatap(AVFrame *frame) {return &frame->metadata;};
 
+#if FF_API_FRAME_QP
 int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int qp_type)
 {
     av_buffer_unref(&f->qp_table_buf);
 
     f->qp_table_buf = buf;
 
+FF_DISABLE_DEPRECATION_WARNINGS
     f->qscale_table = buf->data;
     f->qstride      = stride;
     f->qscale_type  = qp_type;
+FF_ENABLE_DEPRECATION_WARNINGS
 
     return 0;
 }
 
 int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type)
 {
+FF_DISABLE_DEPRECATION_WARNINGS
     *stride = f->qstride;
     *type   = f->qscale_type;
+FF_ENABLE_DEPRECATION_WARNINGS
 
     if (!f->qp_table_buf)
         return NULL;
 
     return f->qp_table_buf->data;
 }
+#endif
 
 const char *av_get_colorspace_name(enum AVColorSpace val)
 {
@@ -342,6 +348,8 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy)
         av_dict_copy(&sd_dst->metadata, sd_src->metadata, 0);
     }
 
+#if FF_API_FRAME_QP
+FF_DISABLE_DEPRECATION_WARNINGS
     dst->qscale_table = NULL;
     dst->qstride      = 0;
     dst->qscale_type  = 0;
@@ -353,6 +361,8 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy)
             dst->qscale_type  = src->qscale_type;
         }
     }
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
     return 0;
 }
@@ -471,7 +481,9 @@ void av_frame_unref(AVFrame *frame)
         av_buffer_unref(&frame->extended_buf[i]);
     av_freep(&frame->extended_buf);
     av_dict_free(&frame->metadata);
+#if FF_API_FRAME_QP
     av_buffer_unref(&frame->qp_table_buf);
+#endif
 
     get_frame_defaults(frame);
 }
index f5e89376badda882c2f0a21cc5b06fc935607865..5270798c55fa007df1310395bd58c5f1e40000a8 100644 (file)
@@ -477,6 +477,7 @@ typedef struct AVFrame {
      */
     int pkt_size;
 
+#if FF_API_FRAME_QP
     /**
      * QP table
      * Not to be accessed directly from outside libavutil
@@ -497,6 +498,7 @@ typedef struct AVFrame {
      * Not to be accessed directly from outside libavutil
      */
     AVBufferRef *qp_table_buf;
+#endif
 } AVFrame;
 
 /**
@@ -523,8 +525,10 @@ void    av_frame_set_decode_error_flags   (AVFrame *frame, int     val);
 int     av_frame_get_pkt_size(const AVFrame *frame);
 void    av_frame_set_pkt_size(AVFrame *frame, int val);
 AVDictionary **avpriv_frame_get_metadatap(AVFrame *frame);
+#if FF_API_FRAME_QP
 int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type);
 int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int type);
+#endif
 enum AVColorSpace av_frame_get_colorspace(const AVFrame *frame);
 void    av_frame_set_colorspace(AVFrame *frame, enum AVColorSpace val);
 enum AVColorRange av_frame_get_color_range(const AVFrame *frame);
index 9fbdc7227c9110fbd26a55a3b090ebe5a6f1935b..31d952197f8e741ee2be6839e6aea0056d20532f 100644 (file)
 #ifndef FF_API_VAAPI
 #define FF_API_VAAPI                    (LIBAVUTIL_VERSION_MAJOR < 56)
 #endif
+#ifndef FF_API_FRAME_QP
+#define FF_API_FRAME_QP                 (LIBAVUTIL_VERSION_MAJOR < 56)
+#endif
 
 #ifndef FF_CONST_AVUTIL55
 #if LIBAVUTIL_VERSION_MAJOR >= 55