summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-09-05 17:35:31 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2015-09-05 17:35:31 +0200
commita9915268327b097bba84a07f68968d8c07f4b549 (patch)
treea5d584c6d925f4feee4984d0dd0a906f3b6d17ed /libavutil
parentb9fd813351733b867fb73219e33b1f4845b40dde (diff)
lavu/frame: put frame QP elements under a new version guard
These fields are still used, removal postponed until a replacement functionality is available.
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/frame.c12
-rw-r--r--libavutil/frame.h4
-rw-r--r--libavutil/version.h3
3 files changed, 19 insertions, 0 deletions
diff --git a/libavutil/frame.c b/libavutil/frame.c
index f403fd75dd..7b4177bc95 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -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);
}
diff --git a/libavutil/frame.h b/libavutil/frame.h
index f5e89376ba..5270798c55 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -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);
diff --git a/libavutil/version.h b/libavutil/version.h
index 9fbdc7227c..31d952197f 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -117,6 +117,9 @@
#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