--- configure.orig 2013-04-23 18:48:24 UTC +++ configure @@ -16009,9 +16009,9 @@ if test "x$enable_video_hash" != "xno"; { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether FFmpeg is present" >&5 $as_echo_n "checking whether FFmpeg is present... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for avcodec_alloc_frame in -lavcodec" >&5 -$as_echo_n "checking for avcodec_alloc_frame in -lavcodec... " >&6; } -if ${ac_cv_lib_avcodec_avcodec_alloc_frame+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for avcodec_decode_video2 in -lavcodec" >&5 +$as_echo_n "checking for avcodec_decode_video2 in -lavcodec... " >&6; } +if ${ac_cv_lib_avcodec_avcodec_decode_video2+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16025,27 +16025,27 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ #ifdef __cplusplus extern "C" #endif -char avcodec_alloc_frame (); +char avcodec_decode_video2 (); int main () { -return avcodec_alloc_frame (); +return avcodec_decode_video2 (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_avcodec_avcodec_alloc_frame=yes + ac_cv_lib_avcodec_avcodec_decode_video2=yes else - ac_cv_lib_avcodec_avcodec_alloc_frame=no + ac_cv_lib_avcodec_avcodec_decode_video2=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_avcodec_alloc_frame" >&5 -$as_echo "$ac_cv_lib_avcodec_avcodec_alloc_frame" >&6; } -if test "x$ac_cv_lib_avcodec_avcodec_alloc_frame" = xyes; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_avcodec_decode_video2" >&5 +$as_echo "$ac_cv_lib_avcodec_avcodec_decode_video2" >&6; } +if test "x$ac_cv_lib_avcodec_avcodec_decode_video2" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBAVCODEC 1 _ACEOF --- configure.ac.orig 2013-04-23 18:47:49 UTC +++ configure.ac @@ -122,7 +122,7 @@ fi]) AC_DEFUN([AC_CHECK_FFMPEG], [ AC_MSG_CHECKING([whether FFmpeg is present]) -AC_CHECK_LIB([avcodec], [avcodec_alloc_frame], [], [AC_MSG_ERROR([ +AC_CHECK_LIB([avcodec], [avcodec_decode_video2], [], [AC_MSG_ERROR([ *** libavcodec not found. You need FFmpeg. Get it at ])]) --- src/cimgffmpeg.cpp.orig 2012-11-23 20:58:01 UTC +++ src/cimgffmpeg.cpp @@ -39,11 +39,11 @@ void vfinfo_close(VFInfo *vfinfo){ int ReadFrames(VFInfo *st_info, CImgList *pFrameList, unsigned int low_index, unsigned int hi_index) { //target pixel format - PixelFormat ffmpeg_pixfmt; + AVPixelFormat ffmpeg_pixfmt; if (st_info->pixelformat == 0) - ffmpeg_pixfmt = PIX_FMT_GRAY8; + ffmpeg_pixfmt = AV_PIX_FMT_GRAY8; else - ffmpeg_pixfmt = PIX_FMT_RGB24; + ffmpeg_pixfmt = AV_PIX_FMT_RGB24; st_info->next_index = low_index; @@ -100,12 +100,12 @@ int ReadFrames(VFInfo *st_info, CImgList AVFrame *pFrame; // Allocate video frame - pFrame=avcodec_alloc_frame(); + pFrame=av_frame_alloc(); if (pFrame==NULL) return -1; // Allocate an AVFrame structure - AVFrame *pConvertedFrame = avcodec_alloc_frame(); + AVFrame *pConvertedFrame = av_frame_alloc(); if(pConvertedFrame==NULL) return -1; @@ -123,7 +123,7 @@ int ReadFrames(VFInfo *st_info, CImgList int size = 0; - int channels = ffmpeg_pixfmt == PIX_FMT_GRAY8 ? 1 : 3; + int channels = ffmpeg_pixfmt == AV_PIX_FMT_GRAY8 ? 1 : 3; AVPacket packet; int result = 1; @@ -189,11 +189,11 @@ int ReadFrames(VFInfo *st_info, CImgList int NextFrames(VFInfo *st_info, CImgList *pFrameList) { - PixelFormat ffmpeg_pixfmt; + AVPixelFormat ffmpeg_pixfmt; if (st_info->pixelformat == 0) - ffmpeg_pixfmt = PIX_FMT_GRAY8; + ffmpeg_pixfmt = AV_PIX_FMT_GRAY8; else - ffmpeg_pixfmt = PIX_FMT_RGB24; + ffmpeg_pixfmt = AV_PIX_FMT_RGB24; if (st_info->pFormatCtx == NULL) { @@ -254,10 +254,10 @@ int NextFrames(VFInfo *st_info, CImgList AVFrame *pFrame; // Allocate video frame - pFrame=avcodec_alloc_frame(); + pFrame=av_frame_alloc(); // Allocate an AVFrame structure - AVFrame *pConvertedFrame = avcodec_alloc_frame(); + AVFrame *pConvertedFrame = av_frame_alloc(); if(pConvertedFrame==NULL){ return -1; } @@ -287,7 +287,7 @@ int NextFrames(VFInfo *st_info, CImgList break; if(packet.stream_index == st_info->videoStream) { - int channels = ffmpeg_pixfmt == PIX_FMT_GRAY8 ? 1 : 3; + int channels = ffmpeg_pixfmt == AV_PIX_FMT_GRAY8 ? 1 : 3; AVPacket avpkt; av_init_packet(&avpkt); avpkt.data = packet.data;