Skip to content
Snippets Groups Projects
Commit 36855abc authored by wm4's avatar wm4
Browse files

lavu/frame: fix inconsistent qp_table_buf deprecation

Everything related to the QP data is deprecated, with qp_table_buf being
an inconsistent exception. Some parts were under the deprecation guards,
some not. It probably didn't even compile.
parent f19b0c6a
No related branches found
No related tags found
No related merge requests found
...@@ -48,11 +48,10 @@ MAKE_ACCESSORS(AVFrame, frame, enum AVColorRange, color_range) ...@@ -48,11 +48,10 @@ MAKE_ACCESSORS(AVFrame, frame, enum AVColorRange, color_range)
#if FF_API_FRAME_QP #if FF_API_FRAME_QP
int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int qp_type) int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int qp_type)
{ {
FF_DISABLE_DEPRECATION_WARNINGS
av_buffer_unref(&f->qp_table_buf); av_buffer_unref(&f->qp_table_buf);
f->qp_table_buf = buf; f->qp_table_buf = buf;
FF_DISABLE_DEPRECATION_WARNINGS
f->qscale_table = buf->data; f->qscale_table = buf->data;
f->qstride = stride; f->qstride = stride;
f->qscale_type = qp_type; f->qscale_type = qp_type;
...@@ -66,12 +65,12 @@ int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type) ...@@ -66,12 +65,12 @@ int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type)
FF_DISABLE_DEPRECATION_WARNINGS FF_DISABLE_DEPRECATION_WARNINGS
*stride = f->qstride; *stride = f->qstride;
*type = f->qscale_type; *type = f->qscale_type;
FF_ENABLE_DEPRECATION_WARNINGS
if (!f->qp_table_buf) if (!f->qp_table_buf)
return NULL; return NULL;
return f->qp_table_buf->data; return f->qp_table_buf->data;
FF_ENABLE_DEPRECATION_WARNINGS
} }
#endif #endif
...@@ -520,7 +519,9 @@ void av_frame_unref(AVFrame *frame) ...@@ -520,7 +519,9 @@ void av_frame_unref(AVFrame *frame)
av_freep(&frame->extended_buf); av_freep(&frame->extended_buf);
av_dict_free(&frame->metadata); av_dict_free(&frame->metadata);
#if FF_API_FRAME_QP #if FF_API_FRAME_QP
FF_DISABLE_DEPRECATION_WARNINGS
av_buffer_unref(&frame->qp_table_buf); av_buffer_unref(&frame->qp_table_buf);
FF_ENABLE_DEPRECATION_WARNINGS
#endif #endif
av_buffer_unref(&frame->hw_frames_ctx); av_buffer_unref(&frame->hw_frames_ctx);
......
...@@ -529,6 +529,7 @@ typedef struct AVFrame { ...@@ -529,6 +529,7 @@ typedef struct AVFrame {
attribute_deprecated attribute_deprecated
int qscale_type; int qscale_type;
attribute_deprecated
AVBufferRef *qp_table_buf; AVBufferRef *qp_table_buf;
#endif #endif
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment