|
@@ -1,13 +1,26 @@
|
|
|
-Changes for ffmpeg 3.0
|
|
|
+From 960c98831ca75b08168530f1c74af07901e01963 Mon Sep 17 00:00:00 2001
|
|
|
+From: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
+Date: Tue, 1 May 2018 22:32:02 +0200
|
|
|
+Subject: [PATCH] Changes for ffmpeg 3.0
|
|
|
|
|
|
This file is a copy of debian/patches/04_ffmpeg-3.0.diff, to be found in
|
|
|
http://www.deb-multimedia.org/pool/main/v/vlc-dmo/vlc-dmo_2.2.4.orig.tar.gz
|
|
|
|
|
|
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
+---
|
|
|
+ configure.ac | 14 +++++++-------
|
|
|
+ modules/codec/avcodec/audio.c | 2 +-
|
|
|
+ modules/codec/avcodec/encoder.c | 20 ++++++++++----------
|
|
|
+ modules/codec/avcodec/vaapi.c | 2 +-
|
|
|
+ modules/codec/avcodec/video.c | 14 +++++++-------
|
|
|
+ modules/demux/avformat/demux.c | 10 +++++-----
|
|
|
+ 6 files changed, 31 insertions(+), 31 deletions(-)
|
|
|
|
|
|
+diff --git a/configure.ac b/configure.ac
|
|
|
+index 16e44a8c61..6886b2b872 100644
|
|
|
--- a/configure.ac
|
|
|
+++ b/configure.ac
|
|
|
-@@ -2324,7 +2324,7 @@ AC_ARG_ENABLE(avcodec,
|
|
|
+@@ -2319,7 +2319,7 @@ AC_ARG_ENABLE(avcodec,
|
|
|
AS_IF([test "${enable_avcodec}" != "no"], [
|
|
|
PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 53.34.0 libavutil >= 51.22.0], [
|
|
|
PKG_CHECK_EXISTS([libavutil < 55],, [
|
|
@@ -16,7 +29,7 @@ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
])
|
|
|
VLC_SAVE_FLAGS
|
|
|
CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
|
|
|
-@@ -2334,7 +2334,7 @@ AS_IF([test "${enable_avcodec}" != "no"]
|
|
|
+@@ -2329,7 +2329,7 @@ AS_IF([test "${enable_avcodec}" != "no"], [
|
|
|
VLC_RESTORE_FLAGS
|
|
|
have_avcodec="yes"
|
|
|
],[
|
|
@@ -25,7 +38,7 @@ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
])
|
|
|
], [
|
|
|
have_avcodec="no"
|
|
|
-@@ -2383,7 +2383,7 @@ AS_IF([test "${have_vaapi}" = "yes" -a "
|
|
|
+@@ -2378,7 +2378,7 @@ AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
|
|
|
case "${avfork}" in
|
|
|
ffmpeg)
|
|
|
PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
|
|
@@ -34,7 +47,7 @@ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
])
|
|
|
;;
|
|
|
esac
|
|
|
-@@ -2417,7 +2417,7 @@ AS_IF([test "${enable_dxva2}" != "no"],
|
|
|
+@@ -2412,7 +2412,7 @@ AS_IF([test "${enable_dxva2}" != "no"], [
|
|
|
case "${avfork}" in
|
|
|
ffmpeg)
|
|
|
PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
|
|
@@ -43,7 +56,7 @@ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
])
|
|
|
;;
|
|
|
esac
|
|
|
-@@ -2509,7 +2509,7 @@ AS_IF([test "${enable_avformat}" != "no"
|
|
|
+@@ -2504,7 +2504,7 @@ AS_IF([test "${enable_avformat}" != "no"], [
|
|
|
])
|
|
|
VLC_RESTORE_FLAGS
|
|
|
],[
|
|
@@ -52,7 +65,7 @@ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
])
|
|
|
])
|
|
|
AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
|
|
|
-@@ -2538,7 +2538,7 @@ then
|
|
|
+@@ -2533,7 +2533,7 @@ then
|
|
|
])
|
|
|
VLC_RESTORE_FLAGS
|
|
|
],[
|
|
@@ -61,7 +74,7 @@ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
])
|
|
|
fi
|
|
|
|
|
|
-@@ -3181,7 +3181,7 @@ AS_IF([test "${have_vdpau}" = "yes" -a "
|
|
|
+@@ -3176,7 +3176,7 @@ AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
|
|
|
libav) av_vdpau_ver="55.26.0" ;;
|
|
|
ffmpeg) av_vdpau_ver="55.42.100"
|
|
|
PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
|
|
@@ -70,6 +83,8 @@ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
])
|
|
|
;;
|
|
|
esac
|
|
|
+diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c
|
|
|
+index 7068499d82..b5347ac896 100644
|
|
|
--- a/modules/codec/avcodec/audio.c
|
|
|
+++ b/modules/codec/avcodec/audio.c
|
|
|
@@ -39,7 +39,7 @@
|
|
@@ -81,57 +96,8 @@ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
|
|
|
#include "avcodec.h"
|
|
|
|
|
|
---- a/modules/codec/avcodec/video.c
|
|
|
-+++ b/modules/codec/avcodec/video.c
|
|
|
-@@ -108,8 +108,8 @@ static int lavc_GetFrame(struct AVCodecC
|
|
|
- static int ffmpeg_GetFrameBuf ( struct AVCodecContext *, AVFrame * );
|
|
|
- static void ffmpeg_ReleaseFrameBuf( struct AVCodecContext *, AVFrame * );
|
|
|
- #endif
|
|
|
--static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,
|
|
|
-- const enum PixelFormat * );
|
|
|
-+static enum AVPixelFormat ffmpeg_GetFormat( AVCodecContext *,
|
|
|
-+ const enum AVPixelFormat * );
|
|
|
-
|
|
|
- static uint32_t ffmpeg_CodecTag( vlc_fourcc_t fcc )
|
|
|
- {
|
|
|
-@@ -234,7 +234,7 @@ int InitVideoDec( decoder_t *p_dec, AVCo
|
|
|
- p_sys->p_codec = p_codec;
|
|
|
- p_sys->i_codec_id = i_codec_id;
|
|
|
- p_sys->psz_namecodec = psz_namecodec;
|
|
|
-- p_sys->p_ff_pic = avcodec_alloc_frame();
|
|
|
-+ p_sys->p_ff_pic = av_frame_alloc();
|
|
|
- p_sys->b_delayed_open = true;
|
|
|
- p_sys->p_va = NULL;
|
|
|
- vlc_sem_init( &p_sys->sem_mt, 0 );
|
|
|
-@@ -446,7 +446,7 @@ int InitVideoDec( decoder_t *p_dec, AVCo
|
|
|
- if( ffmpeg_OpenCodec( p_dec ) < 0 )
|
|
|
- {
|
|
|
- msg_Err( p_dec, "cannot open codec (%s)", p_sys->psz_namecodec );
|
|
|
-- avcodec_free_frame( &p_sys->p_ff_pic );
|
|
|
-+ av_frame_free( &p_sys->p_ff_pic );
|
|
|
- vlc_sem_destroy( &p_sys->sem_mt );
|
|
|
- free( p_sys );
|
|
|
- return VLC_EGENERIC;
|
|
|
-@@ -826,7 +826,7 @@ void EndVideoDec( decoder_t *p_dec )
|
|
|
- wait_mt( p_sys );
|
|
|
-
|
|
|
- if( p_sys->p_ff_pic )
|
|
|
-- avcodec_free_frame( &p_sys->p_ff_pic );
|
|
|
-+ av_frame_free( &p_sys->p_ff_pic );
|
|
|
-
|
|
|
- if( p_sys->p_va )
|
|
|
- vlc_va_Delete( p_sys->p_va );
|
|
|
-@@ -1313,8 +1313,8 @@ static void ffmpeg_ReleaseFrameBuf( stru
|
|
|
- }
|
|
|
- #endif
|
|
|
-
|
|
|
--static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
|
|
|
-- const enum PixelFormat *pi_fmt )
|
|
|
-+static enum AVPixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
|
|
|
-+ const enum AVPixelFormat *pi_fmt )
|
|
|
- {
|
|
|
- decoder_t *p_dec = p_context->opaque;
|
|
|
- decoder_sys_t *p_sys = p_dec->p_sys;
|
|
|
+diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
|
|
|
+index 457078a06f..2bfc0c05f2 100644
|
|
|
--- a/modules/codec/avcodec/encoder.c
|
|
|
+++ b/modules/codec/avcodec/encoder.c
|
|
|
@@ -41,7 +41,7 @@
|
|
@@ -170,7 +136,7 @@ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
if( !p_sys->frame )
|
|
|
{
|
|
|
goto error;
|
|
|
-@@ -1048,7 +1048,7 @@ static void vlc_av_packet_Release(block_
|
|
|
+@@ -1048,7 +1048,7 @@ static void vlc_av_packet_Release(block_t *block)
|
|
|
{
|
|
|
vlc_av_packet_t *b = (void *) block;
|
|
|
|
|
@@ -179,7 +145,7 @@ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
free(b);
|
|
|
}
|
|
|
|
|
|
-@@ -1088,7 +1088,7 @@ static block_t *EncodeVideo( encoder_t *
|
|
|
+@@ -1088,7 +1088,7 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
|
|
|
AVFrame *frame = NULL;
|
|
|
if( likely(p_pict) ) {
|
|
|
frame = p_sys->frame;
|
|
@@ -188,7 +154,7 @@ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
for( i_plane = 0; i_plane < p_pict->i_planes; i_plane++ )
|
|
|
{
|
|
|
p_sys->frame->data[i_plane] = p_pict->p[i_plane].p_pixels;
|
|
|
-@@ -1188,7 +1188,7 @@ static block_t *EncodeVideo( encoder_t *
|
|
|
+@@ -1188,7 +1188,7 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
|
|
|
av_pkt.duration / p_sys->p_context->time_base.den, p_sys->p_context );
|
|
|
if( unlikely(p_block == NULL) )
|
|
|
{
|
|
@@ -197,7 +163,7 @@ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
-@@ -1329,7 +1329,7 @@ static block_t *handle_delay_buffer( enc
|
|
|
+@@ -1329,7 +1329,7 @@ static block_t *handle_delay_buffer( encoder_t *p_enc, encoder_sys_t *p_sys, int
|
|
|
//How much we need to copy from new packet
|
|
|
const int leftover = leftover_samples * p_sys->p_context->channels * p_sys->i_sample_bytes;
|
|
|
|
|
@@ -206,7 +172,7 @@ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
p_sys->frame->format = p_sys->p_context->sample_fmt;
|
|
|
p_sys->frame->nb_samples = leftover_samples + p_sys->i_samples_delay;
|
|
|
|
|
|
-@@ -1451,7 +1451,7 @@ static block_t *EncodeAudio( encoder_t *
|
|
|
+@@ -1451,7 +1451,7 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf )
|
|
|
while( ( p_aout_buf->i_nb_samples >= p_sys->i_frame_size ) ||
|
|
|
( p_sys->b_variable && p_aout_buf->i_nb_samples ) )
|
|
|
{
|
|
@@ -215,7 +181,7 @@ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
if( p_sys->b_variable )
|
|
|
p_sys->frame->nb_samples = p_aout_buf->i_nb_samples;
|
|
|
else
|
|
|
-@@ -1514,7 +1514,7 @@ void CloseEncoder( vlc_object_t *p_this
|
|
|
+@@ -1514,7 +1514,7 @@ void CloseEncoder( vlc_object_t *p_this )
|
|
|
encoder_t *p_enc = (encoder_t *)p_this;
|
|
|
encoder_sys_t *p_sys = p_enc->p_sys;
|
|
|
|
|
@@ -224,6 +190,74 @@ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
av_freep( &p_sys->frame );
|
|
|
|
|
|
vlc_avcodec_lock();
|
|
|
+diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c
|
|
|
+index 1d8f7fa97b..d9643d061c 100644
|
|
|
+--- a/modules/codec/avcodec/vaapi.c
|
|
|
++++ b/modules/codec/avcodec/vaapi.c
|
|
|
+@@ -595,7 +595,7 @@ static int Create( vlc_va_t *p_va, AVCodecContext *ctx,
|
|
|
+ return err;
|
|
|
+
|
|
|
+ /* Only VLD supported */
|
|
|
+- p_va->pix_fmt = PIX_FMT_VAAPI_VLD;
|
|
|
++ p_va->pix_fmt = AV_PIX_FMT_VAAPI_VLD;
|
|
|
+ p_va->setup = Setup;
|
|
|
+ p_va->get = Get;
|
|
|
+ p_va->release = Release;
|
|
|
+diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
|
|
|
+index ce5254423e..fd72d8d8e2 100644
|
|
|
+--- a/modules/codec/avcodec/video.c
|
|
|
++++ b/modules/codec/avcodec/video.c
|
|
|
+@@ -108,8 +108,8 @@ static int lavc_GetFrame(struct AVCodecContext *, AVFrame *, int);
|
|
|
+ static int ffmpeg_GetFrameBuf ( struct AVCodecContext *, AVFrame * );
|
|
|
+ static void ffmpeg_ReleaseFrameBuf( struct AVCodecContext *, AVFrame * );
|
|
|
+ #endif
|
|
|
+-static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,
|
|
|
+- const enum PixelFormat * );
|
|
|
++static enum AVPixelFormat ffmpeg_GetFormat( AVCodecContext *,
|
|
|
++ const enum AVPixelFormat * );
|
|
|
+
|
|
|
+ static uint32_t ffmpeg_CodecTag( vlc_fourcc_t fcc )
|
|
|
+ {
|
|
|
+@@ -236,7 +236,7 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
|
|
|
+ p_sys->p_codec = p_codec;
|
|
|
+ p_sys->i_codec_id = i_codec_id;
|
|
|
+ p_sys->psz_namecodec = psz_namecodec;
|
|
|
+- p_sys->p_ff_pic = avcodec_alloc_frame();
|
|
|
++ p_sys->p_ff_pic = av_frame_alloc();
|
|
|
+ p_sys->b_delayed_open = true;
|
|
|
+ p_sys->p_va = NULL;
|
|
|
+ vlc_sem_init( &p_sys->sem_mt, 0 );
|
|
|
+@@ -448,7 +448,7 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
|
|
|
+ if( ffmpeg_OpenCodec( p_dec ) < 0 )
|
|
|
+ {
|
|
|
+ msg_Err( p_dec, "cannot open codec (%s)", p_sys->psz_namecodec );
|
|
|
+- avcodec_free_frame( &p_sys->p_ff_pic );
|
|
|
++ av_frame_free( &p_sys->p_ff_pic );
|
|
|
+ vlc_sem_destroy( &p_sys->sem_mt );
|
|
|
+ free( p_sys );
|
|
|
+ return VLC_EGENERIC;
|
|
|
+@@ -849,7 +849,7 @@ void EndVideoDec( decoder_t *p_dec )
|
|
|
+ wait_mt( p_sys );
|
|
|
+
|
|
|
+ if( p_sys->p_ff_pic )
|
|
|
+- avcodec_free_frame( &p_sys->p_ff_pic );
|
|
|
++ av_frame_free( &p_sys->p_ff_pic );
|
|
|
+
|
|
|
+ if( p_sys->p_va )
|
|
|
+ vlc_va_Delete( p_sys->p_va );
|
|
|
+@@ -1336,8 +1336,8 @@ static void ffmpeg_ReleaseFrameBuf( struct AVCodecContext *p_context,
|
|
|
+ }
|
|
|
+ #endif
|
|
|
+
|
|
|
+-static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
|
|
|
+- const enum PixelFormat *pi_fmt )
|
|
|
++static enum AVPixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
|
|
|
++ const enum AVPixelFormat *pi_fmt )
|
|
|
+ {
|
|
|
+ decoder_t *p_dec = p_context->opaque;
|
|
|
+ decoder_sys_t *p_sys = p_dec->p_sys;
|
|
|
+diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
|
|
|
+index a99bdfa5b7..4e27d07d36 100644
|
|
|
--- a/modules/demux/avformat/demux.c
|
|
|
+++ b/modules/demux/avformat/demux.c
|
|
|
@@ -734,14 +734,14 @@ static int Demux( demux_t *p_demux )
|
|
@@ -270,14 +304,6 @@ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
---- a/modules/codec/avcodec/vaapi.c
|
|
|
-+++ b/modules/codec/avcodec/vaapi.c
|
|
|
-@@ -595,7 +595,7 @@ static int Create( vlc_va_t *p_va, AVCod
|
|
|
- return err;
|
|
|
-
|
|
|
- /* Only VLD supported */
|
|
|
-- p_va->pix_fmt = PIX_FMT_VAAPI_VLD;
|
|
|
-+ p_va->pix_fmt = AV_PIX_FMT_VAAPI_VLD;
|
|
|
- p_va->setup = Setup;
|
|
|
- p_va->get = Get;
|
|
|
- p_va->release = Release;
|
|
|
+--
|
|
|
+2.14.3
|
|
|
+
|