History

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.

wm4 committed 8 years ago

Commit 36855ab1 parent f19b0c62 files · +5 −3Browse files

Unified · Split

2 files
  1. libavutil/frame.c +4 −3
  2. libavutil/frame.h +1 −0
libavutil/frame.c+4−3
@@ -48,11 +48,10 @@ MAKE_ACCESSORS(AVFrame, frame, enum AVColorRange, color_range) · 47 unmodified lines
48#if FF_API_FRAME_QP48#if FF_API_FRAME_QP
49int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int qp_type)49int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int qp_type)
50{50{
51FF_DISABLE_DEPRECATION_WARNINGS
51 av_buffer_unref(&f->qp_table_buf);52 av_buffer_unref(&f->qp_table_buf);
52 53
53 f->qp_table_buf = buf;54 f->qp_table_buf = buf;
54
55FF_DISABLE_DEPRECATION_WARNINGS
56 f->qscale_table = buf->data;55 f->qscale_table = buf->data;
57 f->qstride = stride;56 f->qstride = stride;
58 f->qscale_type = qp_type;57 f->qscale_type = qp_type;
@@ -66,12 +65,12 @@ int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type) · 7 unmodified lines
66FF_DISABLE_DEPRECATION_WARNINGS65FF_DISABLE_DEPRECATION_WARNINGS
67 *stride = f->qstride;66 *stride = f->qstride;
68 *type = f->qscale_type;67 *type = f->qscale_type;
69FF_ENABLE_DEPRECATION_WARNINGS
70 68
71 if (!f->qp_table_buf)69 if (!f->qp_table_buf)
72 return NULL;70 return NULL;
73 71
74 return f->qp_table_buf->data;72 return f->qp_table_buf->data;
73FF_ENABLE_DEPRECATION_WARNINGS
75}74}
76#endif75#endif
77 76
@@ -520,7 +519,9 @@ void av_frame_unref(AVFrame *frame) · 442 unmodified lines
520 av_freep(&frame->extended_buf);519 av_freep(&frame->extended_buf);
521 av_dict_free(&frame->metadata);520 av_dict_free(&frame->metadata);
522#if FF_API_FRAME_QP521#if FF_API_FRAME_QP
522FF_DISABLE_DEPRECATION_WARNINGS
523 av_buffer_unref(&frame->qp_table_buf);523 av_buffer_unref(&frame->qp_table_buf);
524FF_ENABLE_DEPRECATION_WARNINGS
524#endif525#endif
525 526
526 av_buffer_unref(&frame->hw_frames_ctx);527 av_buffer_unref(&frame->hw_frames_ctx);
libavutil/frame.h+1−0
@@ -529,6 +529,7 @@ typedef struct AVFrame { · 528 unmodified lines
529 attribute_deprecated529 attribute_deprecated
530 int qscale_type;530 int qscale_type;
531 531
532 attribute_deprecated
532 AVBufferRef *qp_table_buf;533 AVBufferRef *qp_table_buf;
533#endif534#endif
534 /**535 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t