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
|
|
|
36549 | 36549 | |
36550 | 36550 | if test -n "$PKG_CONFIG" && \ |
36551 | 36551 | { { $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 |
36553 | 36553 | ac_status=$? |
36554 | 36554 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
36555 | 36555 | test $ac_status = 0; }; then |
… |
… |
|
36843 | 36843 | ffmpeg) |
36844 | 36844 | if test -n "$PKG_CONFIG" && \ |
36845 | 36845 | { { $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 |
36847 | 36847 | ac_status=$? |
36848 | 36848 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
36849 | 36849 | test $ac_status = 0; }; then |
… |
… |
|
36927 | 36927 | ffmpeg) |
36928 | 36928 | if test -n "$PKG_CONFIG" && \ |
36929 | 36929 | { { $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 |
36931 | 36931 | ac_status=$? |
36932 | 36932 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
36933 | 36933 | test $ac_status = 0; }; then |
… |
… |
|
45119 | 45119 | ffmpeg) av_vdpau_ver="55.42.100" |
45120 | 45120 | if test -n "$PKG_CONFIG" && \ |
45121 | 45121 | { { $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 |
45123 | 45123 | ac_status=$? |
45124 | 45124 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
45125 | 45125 | test $ac_status = 0; }; then |
diff -Naur modules/codec/avcodec/audio.c modules/codec/avcodec/audio.c
|
|
|
36 | 36 | #include <vlc_codec.h> |
37 | 37 | #include <vlc_avcodec.h> |
38 | 38 | |
| 39 | #include "avcodec.h" |
| 40 | |
39 | 41 | #include <libavcodec/avcodec.h> |
40 | 42 | #include <libavutil/mem.h> |
41 | 43 | |
42 | | #include <libavutil/audioconvert.h> |
43 | | |
44 | | #include "avcodec.h" |
45 | 44 | |
46 | 45 | /***************************************************************************** |
47 | 46 | * decoder_sys_t : decoder descriptor |
diff -Naur modules/codec/avcodec/avcommon_compat.h modules/codec/avcodec/avcommon_compat.h
|
|
|
506 | 506 | |
507 | 507 | #endif /* HAVE_LIBAVUTIL_AVUTIL_H */ |
508 | 508 | |
| 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 | |
509 | 518 | #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H |
510 | 519 | # include <libavformat/avformat.h> |
511 | 520 | |
diff -Naur modules/codec/avcodec/encoder.c modules/codec/avcodec/encoder.c
|
|
|
41 | 41 | #include <vlc_cpu.h> |
42 | 42 | |
43 | 43 | #include <libavcodec/avcodec.h> |
44 | | #include <libavutil/audioconvert.h> |
45 | 44 | |
46 | 45 | #include "avcodec.h" |
47 | 46 | #include "avcommon.h" |
… |
… |
|
311 | 310 | else if( !GetFfmpegCodec( p_enc->fmt_out.i_codec, &i_cat, &i_codec_id, |
312 | 311 | &psz_namecodec ) ) |
313 | 312 | { |
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 ) |
315 | 314 | return VLC_EGENERIC; /* handed chroma output */ |
316 | 315 | |
317 | 316 | i_cat = VIDEO_ES; |
… |
… |
|
1017 | 1016 | } |
1018 | 1017 | } |
1019 | 1018 | |
1020 | | p_sys->frame = avcodec_alloc_frame(); |
| 1019 | p_sys->frame = av_frame_alloc(); |
1021 | 1020 | if( !p_sys->frame ) |
1022 | 1021 | { |
1023 | 1022 | goto error; |
… |
… |
|
1088 | 1087 | AVFrame *frame = NULL; |
1089 | 1088 | if( likely(p_pict) ) { |
1090 | 1089 | frame = p_sys->frame; |
1091 | | avcodec_get_frame_defaults( frame ); |
| 1090 | av_frame_unref( frame ); |
| 1091 | |
1092 | 1092 | for( i_plane = 0; i_plane < p_pict->i_planes; i_plane++ ) |
1093 | 1093 | { |
1094 | 1094 | p_sys->frame->data[i_plane] = p_pict->p[i_plane].p_pixels; |
… |
… |
|
1329 | 1329 | //How much we need to copy from new packet |
1330 | 1330 | const int leftover = leftover_samples * p_sys->p_context->channels * p_sys->i_sample_bytes; |
1331 | 1331 | |
1332 | | avcodec_get_frame_defaults( p_sys->frame ); |
| 1332 | av_frame_unref( p_sys->frame ); |
1333 | 1333 | p_sys->frame->format = p_sys->p_context->sample_fmt; |
1334 | 1334 | p_sys->frame->nb_samples = leftover_samples + p_sys->i_samples_delay; |
1335 | 1335 | |
… |
… |
|
1451 | 1451 | while( ( p_aout_buf->i_nb_samples >= p_sys->i_frame_size ) || |
1452 | 1452 | ( p_sys->b_variable && p_aout_buf->i_nb_samples ) ) |
1453 | 1453 | { |
1454 | | avcodec_get_frame_defaults( p_sys->frame ); |
| 1454 | av_frame_unref( p_sys->frame ); |
| 1455 | |
1455 | 1456 | if( p_sys->b_variable ) |
1456 | 1457 | p_sys->frame->nb_samples = p_aout_buf->i_nb_samples; |
1457 | 1458 | else |
diff -Naur modules/codec/avcodec/vaapi.c modules/codec/avcodec/vaapi.c
|
|
|
595 | 595 | return err; |
596 | 596 | |
597 | 597 | /* Only VLD supported */ |
598 | | p_va->pix_fmt = PIX_FMT_VAAPI_VLD; |
| 598 | p_va->pix_fmt = AV_PIX_FMT_VAAPI_VLD; |
599 | 599 | p_va->setup = Setup; |
600 | 600 | p_va->get = Get; |
601 | 601 | p_va->release = Release; |
diff -Naur modules/codec/avcodec/video.c modules/codec/avcodec/video.c
|
|
|
234 | 234 | p_sys->p_codec = p_codec; |
235 | 235 | p_sys->i_codec_id = i_codec_id; |
236 | 236 | p_sys->psz_namecodec = psz_namecodec; |
237 | | p_sys->p_ff_pic = avcodec_alloc_frame(); |
| 237 | p_sys->p_ff_pic = av_frame_alloc(); |
238 | 238 | p_sys->b_delayed_open = true; |
239 | 239 | p_sys->p_va = NULL; |
240 | 240 | vlc_sem_init( &p_sys->sem_mt, 0 ); |
… |
… |
|
446 | 446 | if( ffmpeg_OpenCodec( p_dec ) < 0 ) |
447 | 447 | { |
448 | 448 | 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 ); |
450 | 450 | vlc_sem_destroy( &p_sys->sem_mt ); |
451 | 451 | free( p_sys ); |
452 | 452 | return VLC_EGENERIC; |
… |
… |
|
826 | 826 | wait_mt( p_sys ); |
827 | 827 | |
828 | 828 | if( p_sys->p_ff_pic ) |
829 | | avcodec_free_frame( &p_sys->p_ff_pic ); |
| 829 | av_frame_free( &p_sys->p_ff_pic ); |
830 | 830 | |
831 | 831 | if( p_sys->p_va ) |
832 | 832 | vlc_va_Delete( p_sys->p_va ); |
diff -Naur configure.ac configure.ac
old
|
new
|
|
2305 | 2305 | [ --enable-avcodec libavcodec codec (default enabled)]) |
2306 | 2306 | AS_IF([test "${enable_avcodec}" != "no"], [ |
2307 | 2307 | 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.]) |
2310 | 2310 | ]) |
2311 | 2311 | VLC_SAVE_FLAGS |
2312 | 2312 | CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}" |
… |
… |
|
2364 | 2364 | AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [ |
2365 | 2365 | case "${avfork}" in |
2366 | 2366 | 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.]) |
2369 | 2369 | ]) |
2370 | 2370 | ;; |
2371 | 2371 | esac |
… |
… |
|
2398 | 2398 | AS_IF([test "x${have_avcodec}" = "xyes"], [ |
2399 | 2399 | case "${avfork}" in |
2400 | 2400 | 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.]) |
2403 | 2403 | ]) |
2404 | 2404 | ;; |
2405 | 2405 | esac |
… |
… |
|
3162 | 3162 | case "${avfork}" in |
3163 | 3163 | libav) av_vdpau_ver="55.26.0" ;; |
3164 | 3164 | 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.]) |
3167 | 3167 | ]) |
3168 | 3168 | ;; |
3169 | 3169 | esac |