Commit a453745c authored by jehan's avatar jehan

fix ffmpeg old_codec_ids detection

parent 35454585
......@@ -123,18 +123,22 @@ AC_DEFUN([MS_CHECK_VIDEO],[
CPPFLAGS_save=$CPPFLAGS
CPPFLAGS="$FFMPEG_CFLAGS $CPPFLAGS -Wno-error"
AC_CHECK_HEADERS(libavcodec/avcodec.h)
AC_CHECK_HEADER(libavcodec/old_codec_ids.h,[ old_codec_ids_found=yes
AC_DEFINE(HAVE_AVCODEC_OLD_CODEC_IDS,1,[for compatibility purpose with old ffmpeg])]
,[old_codec_ids_found=no],[#include "libavcodec/avcodec.h"])
AC_MSG_CHECKING([AV_CODEC_ID_SNOW])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libavcodec/avcodec.h>]],
[[AVCodecID toto=AV_CODEC_ID_SNOW;if(toto){}]])]
,[AC_DEFINE(CODEC_ID_SNOW,AV_CODEC_ID_SNOW,[for compatibility purpose with old ffmpeg])
AC_DEFINE(HAVE_AVCODEC_SNOW,1,[for compatibility purpose with old ffmpeg])
[[enum AVCodecID toto=AV_CODEC_ID_SNOW;if(toto){}]])]
,[if test x$old_codec_ids_found = xno ; then
AC_DEFINE(CODEC_ID_SNOW,AV_CODEC_ID_SNOW,[for compatibility purpose with old ffmpeg])
fi
AC_DEFINE(HAVE_AVCODEC_SNOW,1,[for compatibility purpose with old ffmpeg])
AC_MSG_RESULT([found])]
,[AC_MSG_RESULT([not found])])
AC_MSG_CHECKING([CODEC_ID_SNOW])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libavcodec/avcodec.h>]],
[[CodecID toto=CODEC_ID_SNOW;if (toto){}]])]
,[AC_DEFINE(HAVE_CODEC_ID_SNOW,1,[for compatibility purpose with old ffmpeg])
AC_DEFINE(HAVE_AVCODEC_SNOW,1,[for compatibility purpose with old ffmpeg])
[[enum CodecID toto=CODEC_ID_SNOW;if (toto){}]])]
,[AC_DEFINE(HAVE_AVCODEC_SNOW,1,[for compatibility purpose with old ffmpeg])
AC_MSG_RESULT([found])]
,[AC_MSG_RESULT([not found])])
CPPFLAGS=$CPPFLAGS_save
......
......@@ -66,15 +66,20 @@ static inline int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
return avcodec_decode_video(avctx,picture, got_picture_ptr,avpkt->data,avpkt->size);
}
#endif
#if HAVE_AVCODEC_OLD_CODEC_IDS
#include <libavcodec/old_codec_ids.h>
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54,25,0)
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54,25,0)
/*CODEC_ID_* and CodecID have been deprecated for a long time and this release removes it altogether. Please use AV_CODEC_ID_* and AVCodecID instead.*/
#define CodecID AVCodecID
#define CODEC_ID_H264 AV_CODEC_ID_H264
#define CODEC_ID_H263 AV_CODEC_ID_H263
#define CODEC_ID_H263P AV_CODEC_ID_H263P
#define CODEC_ID_MPEG4 AV_CODEC_ID_MPEG4
#define CODEC_ID_MJPEG AV_CODEC_ID_MJPEG
#ifndef HAVE_AVCODEC_OLD_CODEC_IDS
#define CODEC_ID_H264 AV_CODEC_ID_H264
#define CODEC_ID_H263 AV_CODEC_ID_H263
#define CODEC_ID_H263P AV_CODEC_ID_H263P
#define CODEC_ID_MPEG4 AV_CODEC_ID_MPEG4
#define CODEC_ID_MJPEG AV_CODEC_ID_MJPEG
#endif
#endif
#ifndef HAVE_FUN_avcodec_encode_video2
......
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