Commit d43a165b authored by Vittorio Giovara's avatar Vittorio Giovara

imgconvert: Add the proper API guards to a deprecated function

parent f7168d70
...@@ -33,12 +33,14 @@ ...@@ -33,12 +33,14 @@
#include "libavutil/internal.h" #include "libavutil/internal.h"
#include "libavutil/imgutils.h" #include "libavutil/imgutils.h"
#if FF_API_GETCHROMA
void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift) void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
{ {
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
*h_shift = desc->log2_chroma_w; *h_shift = desc->log2_chroma_w;
*v_shift = desc->log2_chroma_h; *v_shift = desc->log2_chroma_h;
} }
#endif
static int is_gray(const AVPixFmtDescriptor *desc) static int is_gray(const AVPixFmtDescriptor *desc)
{ {
......
...@@ -48,6 +48,9 @@ ...@@ -48,6 +48,9 @@
* the public API and may change, break or disappear at any time. * the public API and may change, break or disappear at any time.
*/ */
#ifndef FF_API_GETCHROMA
#define FF_API_GETCHROMA (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_MISSING_SAMPLE #ifndef FF_API_MISSING_SAMPLE
#define FF_API_MISSING_SAMPLE (LIBAVCODEC_VERSION_MAJOR < 58) #define FF_API_MISSING_SAMPLE (LIBAVCODEC_VERSION_MAJOR < 58)
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment