Ticket #54480: patch-ffmpeg3-compat.diff

File patch-ffmpeg3-compat.diff, 8.7 KB (added by RJVB (René Bertin), 7 years ago)
  • configure

    Submitted By:            Armin K <krejzi au email do com>
    Date:                    2016-05-06
    Initial Package Version: 2.2.3
    Upstream Status:         Committed
    Origin:                  Upstream
    Description:             Fixes building against ffmpeg3
                             Rediffed for version 2.2.3 by Bruce Dubbs
    
    diff -Naur  configure  configure
     
    3654936549
    3655036550    if test -n "$PKG_CONFIG" && \
    3655136551    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavutil < 55\""; } >&5
    36552   ($PKG_CONFIG --exists --print-errors "libavutil < 55") 2>&5
     36552  ($PKG_CONFIG --exists --print-errors "libavutil > 55") 2>&5
    3655336553  ac_status=$?
    3655436554  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    3655536555  test $ac_status = 0; }; then
     
    3684336843    ffmpeg)
    3684436844      if test -n "$PKG_CONFIG" && \
    3684536845    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec >= 57.10.100\""; } >&5
    36846   ($PKG_CONFIG --exists --print-errors "libavcodec >= 57.10.100") 2>&5
     36846  ($PKG_CONFIG --exists --print-errors "libavcodec >= 60.10.100") 2>&5
    3684736847  ac_status=$?
    3684836848  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    3684936849  test $ac_status = 0; }; then
     
    3692736927      ffmpeg)
    3692836928        if test -n "$PKG_CONFIG" && \
    3692936929    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec >= 57.10.100\""; } >&5
    36930   ($PKG_CONFIG --exists --print-errors "libavcodec >= 57.10.100") 2>&5
     36930  ($PKG_CONFIG --exists --print-errors "libavcodec >= 60.10.100") 2>&5
    3693136931  ac_status=$?
    3693236932  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    3693336933  test $ac_status = 0; }; then
     
    4511945119    ffmpeg) av_vdpau_ver="55.42.100"
    4512045120      if test -n "$PKG_CONFIG" && \
    4512145121    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec >= 57.10.100\""; } >&5
    45122   ($PKG_CONFIG --exists --print-errors "libavcodec >= 57.10.100") 2>&5
     45122  ($PKG_CONFIG --exists --print-errors "libavcodec >= 60.10.100") 2>&5
    4512345123  ac_status=$?
    4512445124  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    4512545125  test $ac_status = 0; }; then
  • modules/codec/avcodec/audio.c

    diff -Naur  modules/codec/avcodec/audio.c  modules/codec/avcodec/audio.c
     
    3636#include <vlc_codec.h>
    3737#include <vlc_avcodec.h>
    3838
     39#include "avcodec.h"
     40
    3941#include <libavcodec/avcodec.h>
    4042#include <libavutil/mem.h>
    4143
    42 #include <libavutil/audioconvert.h>
    43 
    44 #include "avcodec.h"
    4544
    4645/*****************************************************************************
    4746 * decoder_sys_t : decoder descriptor
  • modules/codec/avcodec/avcommon_compat.h

    diff -Naur  modules/codec/avcodec/avcommon_compat.h  modules/codec/avcodec/avcommon_compat.h
     
    506506
    507507#endif /* HAVE_LIBAVUTIL_AVUTIL_H */
    508508
     509#if LIBAVUTIL_VERSION_MAJOR >= 55
     510# define FF_API_AUDIOCONVERT 1
     511#endif
     512
     513/* libavutil/pixfmt.h */
     514#ifndef PixelFormat
     515# define PixelFormat AVPixelFormat
     516#endif
     517
    509518#ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
    510519# include <libavformat/avformat.h>
    511520
  • modules/codec/avcodec/encoder.c

    diff -Naur  modules/codec/avcodec/encoder.c  modules/codec/avcodec/encoder.c
     
    4141#include <vlc_cpu.h>
    4242
    4343#include <libavcodec/avcodec.h>
    44 #include <libavutil/audioconvert.h>
    4544
    4645#include "avcodec.h"
    4746#include "avcommon.h"
     
    311310    else if( !GetFfmpegCodec( p_enc->fmt_out.i_codec, &i_cat, &i_codec_id,
    312311                             &psz_namecodec ) )
    313312    {
    314         if( FindFfmpegChroma( p_enc->fmt_out.i_codec ) == PIX_FMT_NONE )
     313        if( FindFfmpegChroma( p_enc->fmt_out.i_codec ) == AV_PIX_FMT_NONE )
    315314            return VLC_EGENERIC; /* handed chroma output */
    316315
    317316        i_cat      = VIDEO_ES;
     
    10171016        }
    10181017    }
    10191018
    1020     p_sys->frame = avcodec_alloc_frame();
     1019    p_sys->frame = av_frame_alloc();
    10211020    if( !p_sys->frame )
    10221021    {
    10231022        goto error;
     
    10881087    AVFrame *frame = NULL;
    10891088    if( likely(p_pict) ) {
    10901089        frame = p_sys->frame;
    1091         avcodec_get_frame_defaults( frame );
     1090        av_frame_unref( frame );
     1091
    10921092        for( i_plane = 0; i_plane < p_pict->i_planes; i_plane++ )
    10931093        {
    10941094            p_sys->frame->data[i_plane] = p_pict->p[i_plane].p_pixels;
     
    13291329    //How much we need to copy from new packet
    13301330    const int leftover = leftover_samples * p_sys->p_context->channels * p_sys->i_sample_bytes;
    13311331
    1332     avcodec_get_frame_defaults( p_sys->frame );
     1332    av_frame_unref( p_sys->frame );
    13331333    p_sys->frame->format     = p_sys->p_context->sample_fmt;
    13341334    p_sys->frame->nb_samples = leftover_samples + p_sys->i_samples_delay;
    13351335
     
    14511451    while( ( p_aout_buf->i_nb_samples >= p_sys->i_frame_size ) ||
    14521452           ( p_sys->b_variable && p_aout_buf->i_nb_samples ) )
    14531453    {
    1454         avcodec_get_frame_defaults( p_sys->frame );
     1454        av_frame_unref( p_sys->frame );
     1455
    14551456        if( p_sys->b_variable )
    14561457            p_sys->frame->nb_samples = p_aout_buf->i_nb_samples;
    14571458        else
  • modules/codec/avcodec/vaapi.c

    diff -Naur  modules/codec/avcodec/vaapi.c  modules/codec/avcodec/vaapi.c
     
    595595        return err;
    596596
    597597    /* Only VLD supported */
    598     p_va->pix_fmt = PIX_FMT_VAAPI_VLD;
     598    p_va->pix_fmt = AV_PIX_FMT_VAAPI_VLD;
    599599    p_va->setup = Setup;
    600600    p_va->get = Get;
    601601    p_va->release = Release;
  • modules/codec/avcodec/video.c

    diff -Naur  modules/codec/avcodec/video.c  modules/codec/avcodec/video.c
     
    234234    p_sys->p_codec = p_codec;
    235235    p_sys->i_codec_id = i_codec_id;
    236236    p_sys->psz_namecodec = psz_namecodec;
    237     p_sys->p_ff_pic = avcodec_alloc_frame();
     237    p_sys->p_ff_pic = av_frame_alloc();
    238238    p_sys->b_delayed_open = true;
    239239    p_sys->p_va = NULL;
    240240    vlc_sem_init( &p_sys->sem_mt, 0 );
     
    446446    if( ffmpeg_OpenCodec( p_dec ) < 0 )
    447447    {
    448448        msg_Err( p_dec, "cannot open codec (%s)", p_sys->psz_namecodec );
    449         avcodec_free_frame( &p_sys->p_ff_pic );
     449        av_frame_free( &p_sys->p_ff_pic );
    450450        vlc_sem_destroy( &p_sys->sem_mt );
    451451        free( p_sys );
    452452        return VLC_EGENERIC;
     
    826826    wait_mt( p_sys );
    827827
    828828    if( p_sys->p_ff_pic )
    829         avcodec_free_frame( &p_sys->p_ff_pic );
     829        av_frame_free( &p_sys->p_ff_pic );
    830830
    831831    if( p_sys->p_va )
    832832        vlc_va_Delete( p_sys->p_va );
  • configure.ac

    diff -Naur  configure.ac  configure.ac
    old new  
    23052305[  --enable-avcodec        libavcodec codec (default enabled)])
    23062306AS_IF([test "${enable_avcodec}" != "no"], [
    23072307  PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 53.34.0 libavutil >= 51.22.0], [
    2308     PKG_CHECK_EXISTS([libavutil < 55],, [
    2309       AC_MSG_ERROR([libavutil versions 55 and later are not supported.])
     2308    PKG_CHECK_EXISTS([libavutil < 56],, [
     2309      AC_MSG_ERROR([libavutil versions 56 and later are not supported.])
    23102310    ])
    23112311    VLC_SAVE_FLAGS
    23122312    CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
     
    23642364AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
    23652365  case "${avfork}" in
    23662366    ffmpeg)
    2367       PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
    2368         AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 57.10 or libav.])
     2367      PKG_CHECK_EXISTS([libavcodec >= 60.10.100], [
     2368        AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 60.10 or libav.])
    23692369      ])
    23702370      ;;
    23712371  esac
     
    23982398  AS_IF([test "x${have_avcodec}" = "xyes"], [
    23992399    case "${avfork}" in
    24002400      ffmpeg)
    2401         PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
    2402           AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec < 57.10 or libav.])
     2401        PKG_CHECK_EXISTS([libavcodec >= 60.10.100], [
     2402          AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec < 60.10 or libav.])
    24032403        ])
    24042404        ;;
    24052405    esac
     
    31623162  case "${avfork}" in
    31633163    libav) av_vdpau_ver="55.26.0" ;;
    31643164    ffmpeg) av_vdpau_ver="55.42.100"
    3165       PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
    3166         AC_MSG_ERROR([VDPAU requires FFmpeg libavcodec < 57.10 or libav.])
     3165      PKG_CHECK_EXISTS([libavcodec >= 60.10.100], [
     3166        AC_MSG_ERROR([VDPAU requires FFmpeg libavcodec < 60.10 or libav.])
    31673167      ])
    31683168      ;;
    31693169  esac