Merge branch 'upstream/4.7.0' into tizen_opencv_upgrade
authorTae-Young Chung <ty83.chung@samsung.com>
Mon, 9 Jan 2023 06:05:06 +0000 (15:05 +0900)
committerTae-Young Chung <ty83.chung@samsung.com>
Mon, 9 Jan 2023 06:26:47 +0000 (15:26 +0900)
Change-Id: I4e03b2520eca4c053892158aa4fb47ac6a1b7819

1  2 
modules/videoio/src/cap_ffmpeg_impl.hpp

@@@ -91,36 -95,41 +95,97 @@@ extern "C" 
  
  #include <libavcodec/avcodec.h>
  #include <libswscale/swscale.h>
+ #ifdef HAVE_FFMPEG_LIBAVDEVICE
+ #include <libavdevice/avdevice.h>
+ #endif
+ // https://github.com/FFmpeg/FFmpeg/blob/b6af56c034759b81985f8ea094e41cbd5f7fecfb/doc/APIchanges#L602-L605
+ #if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(58, 9, 100)
+ #  define CV_FFMPEG_REGISTER
+ #endif
+ // https://github.com/FFmpeg/FFmpeg/blob/b6af56c034759b81985f8ea094e41cbd5f7fecfb/doc/APIchanges#L654-L657
+ #if LIBAVCODEC_BUILD < CALC_FFMPEG_VERSION(58, 9, 100)
+ #  define CV_FFMPEG_LOCKMGR
+ #endif
+ // https://github.com/FFmpeg/FFmpeg/blob/b6af56c034759b81985f8ea094e41cbd5f7fecfb/doc/APIchanges#L390-L392
+ #if LIBAVCODEC_BUILD >= CALC_FFMPEG_VERSION(58, 87, 100)
+ #include <libavcodec/bsf.h>
+ #endif
+ #include <libavutil/pixdesc.h>
+ // https://github.com/FFmpeg/FFmpeg/blob/b6af56c034759b81985f8ea094e41cbd5f7fecfb/doc/APIchanges#L208-L210
+ #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(59, 0, 100)
+ #  define CV_FFMPEG_FMT_CONST const
+ #else
+ #  define CV_FFMPEG_FMT_CONST
+ #endif
+ // https://github.com/FFmpeg/FFmpeg/blob/b6af56c034759b81985f8ea094e41cbd5f7fecfb/doc/APIchanges#L623-L624
+ #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(58, 7, 100)
+ #  define CV_FFMPEG_URL
+ #endif
+ // AVStream.codec deprecated in favor of AVStream.codecpar
+ // https://github.com/FFmpeg/FFmpeg/blob/b6af56c034759b81985f8ea094e41cbd5f7fecfb/doc/APIchanges#L1039-L1040
++#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(59, 16, 100)
++//#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(57, 33, 100)
++#  define CV_FFMPEG_CODECPAR
++#  define CV_FFMPEG_CODEC_FIELD codecpar
++#else
++#  define CV_FFMPEG_CODEC_FIELD codec
++#endif
++
++#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(59, 16, 100)
++#  define CV_FFMPEG_PTS_FIELD pts
++#else
++#  define CV_FFMPEG_PTS_FIELD pkt_pts
++#endif
++
++// https://github.com/FFmpeg/FFmpeg/blob/b6af56c034759b81985f8ea094e41cbd5f7fecfb/doc/APIchanges#L1757-L1758
++#if LIBAVUTIL_BUILD < CALC_FFMPEG_VERSION(52, 63, 100)
++inline static AVRational av_make_q(int num, int den)
++{
++    AVRational res;
++    res.num = num;
++    res.den = den;
++    return res;
++}
++#endif
++
++
 +
 +// https://github.com/FFmpeg/FFmpeg/blob/b6af56c034759b81985f8ea094e41cbd5f7fecfb/doc/APIchanges#L602-L605
 +#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(58, 9, 100)
 +#  define CV_FFMPEG_REGISTER
 +#endif
 +
 +// https://github.com/FFmpeg/FFmpeg/blob/b6af56c034759b81985f8ea094e41cbd5f7fecfb/doc/APIchanges#L654-L657
 +#if LIBAVCODEC_BUILD < CALC_FFMPEG_VERSION(58, 9, 100)
 +#  define CV_FFMPEG_LOCKMGR
 +#endif
 +
 +// https://github.com/FFmpeg/FFmpeg/blob/b6af56c034759b81985f8ea094e41cbd5f7fecfb/doc/APIchanges#L390-L392
 +#if LIBAVCODEC_BUILD >= CALC_FFMPEG_VERSION(58, 87, 100)
 +#include <libavcodec/bsf.h>
 +#endif
 +
 +// https://github.com/FFmpeg/FFmpeg/blob/b6af56c034759b81985f8ea094e41cbd5f7fecfb/doc/APIchanges#L208-L210
 +#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(59, 0, 100)
 +#  define CV_FFMPEG_FMT_CONST const
 +#else
 +#  define CV_FFMPEG_FMT_CONST
 +#endif
 +
 +// https://github.com/FFmpeg/FFmpeg/blob/b6af56c034759b81985f8ea094e41cbd5f7fecfb/doc/APIchanges#L623-L624
 +#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(58, 7, 100)
 +#  define CV_FFMPEG_URL
 +#endif
 +
 +// AVStream.codec deprecated in favor of AVStream.codecpar
 +// https://github.com/FFmpeg/FFmpeg/blob/b6af56c034759b81985f8ea094e41cbd5f7fecfb/doc/APIchanges#L1039-L1040
  #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(59, 16, 100)
  //#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(57, 33, 100)
  #  define CV_FFMPEG_CODECPAR