3 This file is a copy of debian/patches/04_ffmpeg-3.0.diff, to be found in
4 http://www.deb-multimedia.org/pool/main/v/vlc-dmo/vlc-dmo_2.2.4.orig.tar.gz
6 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
10 @@ -2324,7 +2324,7 @@ AC_ARG_ENABLE(avcodec,
11 AS_IF([test "${enable_avcodec}" != "no"], [
12 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 53.34.0 libavutil >= 51.22.0], [
13 PKG_CHECK_EXISTS([libavutil < 55],, [
14 - AC_MSG_ERROR([libavutil versions 55 and later are not supported.])
15 + AC_MSG_WARN([libavutil versions 55 and later are not supported.])
18 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
19 @@ -2334,7 +2334,7 @@ AS_IF([test "${enable_avcodec}" != "no"]
23 - AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
24 + AC_MSG_WARN([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
28 @@ -2383,7 +2383,7 @@ AS_IF([test "${have_vaapi}" = "yes" -a "
31 PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
32 - AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 57.10 or libav.])
33 + AC_MSG_WARN([VA API requires FFmpeg libavcodec < 57.10 or libav.])
37 @@ -2417,7 +2417,7 @@ AS_IF([test "${enable_dxva2}" != "no"],
40 PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
41 - AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec < 57.10 or libav.])
42 + AC_MSG_WARN([DXVA2 requires FFmpeg libavcodec < 57.10 or libav.])
46 @@ -2509,7 +2509,7 @@ AS_IF([test "${enable_avformat}" != "no"
50 - AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
51 + AC_MSG_WARN([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
54 AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
55 @@ -2538,7 +2538,7 @@ then
59 - AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
60 + AC_MSG_WARN([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
64 @@ -3181,7 +3181,7 @@ AS_IF([test "${have_vdpau}" = "yes" -a "
65 libav) av_vdpau_ver="55.26.0" ;;
66 ffmpeg) av_vdpau_ver="55.42.100"
67 PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
68 - AC_MSG_ERROR([VDPAU requires FFmpeg libavcodec < 57.10 or libav.])
69 + AC_MSG_WARN([VDPAU requires FFmpeg libavcodec < 57.10 or libav.])
73 --- a/modules/codec/avcodec/audio.c
74 +++ b/modules/codec/avcodec/audio.c
76 #include <libavcodec/avcodec.h>
77 #include <libavutil/mem.h>
79 -#include <libavutil/audioconvert.h>
80 +#include <libavutil/channel_layout.h>
84 --- a/modules/codec/avcodec/video.c
85 +++ b/modules/codec/avcodec/video.c
86 @@ -108,8 +108,8 @@ static int lavc_GetFrame(struct AVCodecC
87 static int ffmpeg_GetFrameBuf ( struct AVCodecContext *, AVFrame * );
88 static void ffmpeg_ReleaseFrameBuf( struct AVCodecContext *, AVFrame * );
90 -static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,
91 - const enum PixelFormat * );
92 +static enum AVPixelFormat ffmpeg_GetFormat( AVCodecContext *,
93 + const enum AVPixelFormat * );
95 static uint32_t ffmpeg_CodecTag( vlc_fourcc_t fcc )
97 @@ -234,7 +234,7 @@ int InitVideoDec( decoder_t *p_dec, AVCo
98 p_sys->p_codec = p_codec;
99 p_sys->i_codec_id = i_codec_id;
100 p_sys->psz_namecodec = psz_namecodec;
101 - p_sys->p_ff_pic = avcodec_alloc_frame();
102 + p_sys->p_ff_pic = av_frame_alloc();
103 p_sys->b_delayed_open = true;
105 vlc_sem_init( &p_sys->sem_mt, 0 );
106 @@ -446,7 +446,7 @@ int InitVideoDec( decoder_t *p_dec, AVCo
107 if( ffmpeg_OpenCodec( p_dec ) < 0 )
109 msg_Err( p_dec, "cannot open codec (%s)", p_sys->psz_namecodec );
110 - avcodec_free_frame( &p_sys->p_ff_pic );
111 + av_frame_free( &p_sys->p_ff_pic );
112 vlc_sem_destroy( &p_sys->sem_mt );
115 @@ -826,7 +826,7 @@ void EndVideoDec( decoder_t *p_dec )
118 if( p_sys->p_ff_pic )
119 - avcodec_free_frame( &p_sys->p_ff_pic );
120 + av_frame_free( &p_sys->p_ff_pic );
123 vlc_va_Delete( p_sys->p_va );
124 @@ -1313,8 +1313,8 @@ static void ffmpeg_ReleaseFrameBuf( stru
128 -static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
129 - const enum PixelFormat *pi_fmt )
130 +static enum AVPixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
131 + const enum AVPixelFormat *pi_fmt )
133 decoder_t *p_dec = p_context->opaque;
134 decoder_sys_t *p_sys = p_dec->p_sys;
135 --- a/modules/codec/avcodec/encoder.c
136 +++ b/modules/codec/avcodec/encoder.c
140 #include <libavcodec/avcodec.h>
141 -#include <libavutil/audioconvert.h>
142 +#include <libavutil/channel_layout.h>
145 #include "avcommon.h"
146 @@ -311,7 +311,7 @@ int OpenEncoder( vlc_object_t *p_this )
147 else if( !GetFfmpegCodec( p_enc->fmt_out.i_codec, &i_cat, &i_codec_id,
150 - if( FindFfmpegChroma( p_enc->fmt_out.i_codec ) == PIX_FMT_NONE )
151 + if( FindFfmpegChroma( p_enc->fmt_out.i_codec ) == AV_PIX_FMT_NONE )
152 return VLC_EGENERIC; /* handed chroma output */
155 @@ -555,7 +555,7 @@ int OpenEncoder( vlc_object_t *p_this )
157 if( p_codec->pix_fmts )
159 - const enum PixelFormat *p = p_codec->pix_fmts;
160 + const enum AVPixelFormat *p = p_codec->pix_fmts;
161 for( ; *p != -1; p++ )
163 if( *p == p_context->pix_fmt ) break;
164 @@ -1017,7 +1017,7 @@ errmsg:
168 - p_sys->frame = avcodec_alloc_frame();
169 + p_sys->frame = av_frame_alloc();
173 @@ -1048,7 +1048,7 @@ static void vlc_av_packet_Release(block_
175 vlc_av_packet_t *b = (void *) block;
177 - av_free_packet(&b->packet);
178 + av_packet_unref(&b->packet);
182 @@ -1088,7 +1088,7 @@ static block_t *EncodeVideo( encoder_t *
183 AVFrame *frame = NULL;
184 if( likely(p_pict) ) {
185 frame = p_sys->frame;
186 - avcodec_get_frame_defaults( frame );
187 + av_frame_unref( frame );
188 for( i_plane = 0; i_plane < p_pict->i_planes; i_plane++ )
190 p_sys->frame->data[i_plane] = p_pict->p[i_plane].p_pixels;
191 @@ -1188,7 +1188,7 @@ static block_t *EncodeVideo( encoder_t *
192 av_pkt.duration / p_sys->p_context->time_base.den, p_sys->p_context );
193 if( unlikely(p_block == NULL) )
195 - av_free_packet( &av_pkt );
196 + av_packet_unref( &av_pkt );
200 @@ -1329,7 +1329,7 @@ static block_t *handle_delay_buffer( enc
201 //How much we need to copy from new packet
202 const int leftover = leftover_samples * p_sys->p_context->channels * p_sys->i_sample_bytes;
204 - avcodec_get_frame_defaults( p_sys->frame );
205 + av_frame_unref( p_sys->frame );
206 p_sys->frame->format = p_sys->p_context->sample_fmt;
207 p_sys->frame->nb_samples = leftover_samples + p_sys->i_samples_delay;
209 @@ -1451,7 +1451,7 @@ static block_t *EncodeAudio( encoder_t *
210 while( ( p_aout_buf->i_nb_samples >= p_sys->i_frame_size ) ||
211 ( p_sys->b_variable && p_aout_buf->i_nb_samples ) )
213 - avcodec_get_frame_defaults( p_sys->frame );
214 + av_frame_unref( p_sys->frame );
215 if( p_sys->b_variable )
216 p_sys->frame->nb_samples = p_aout_buf->i_nb_samples;
218 @@ -1514,7 +1514,7 @@ void CloseEncoder( vlc_object_t *p_this
219 encoder_t *p_enc = (encoder_t *)p_this;
220 encoder_sys_t *p_sys = p_enc->p_sys;
222 - /*FIXME: we should use avcodec_free_frame, but we don't require so new avcodec that has it*/
223 + /*FIXME: we should use av_frame_free, but we don't require so new avcodec that has it*/
224 av_freep( &p_sys->frame );
227 --- a/modules/demux/avformat/demux.c
228 +++ b/modules/demux/avformat/demux.c
229 @@ -734,14 +734,14 @@ static int Demux( demux_t *p_demux )
231 if( pkt.stream_index < 0 || pkt.stream_index >= p_sys->i_tk )
233 - av_free_packet( &pkt );
234 + av_packet_unref( &pkt );
237 const AVStream *p_stream = p_sys->ic->streams[pkt.stream_index];
238 if( p_stream->time_base.den <= 0 )
240 msg_Warn( p_demux, "Invalid time base for the stream %d", pkt.stream_index );
241 - av_free_packet( &pkt );
242 + av_packet_unref( &pkt );
245 if( p_stream->codec->codec_id == AV_CODEC_ID_SSA )
246 @@ -749,7 +749,7 @@ static int Demux( demux_t *p_demux )
247 p_frame = BuildSsaFrame( &pkt, p_sys->i_ssa_order++ );
250 - av_free_packet( &pkt );
251 + av_packet_unref( &pkt );
255 @@ -757,7 +757,7 @@ static int Demux( demux_t *p_demux )
257 if( ( p_frame = block_Alloc( pkt.size ) ) == NULL )
259 - av_free_packet( &pkt );
260 + av_packet_unref( &pkt );
263 memcpy( p_frame->p_buffer, pkt.data, pkt.size );
264 @@ -838,7 +838,7 @@ static int Demux( demux_t *p_demux )
266 block_Release( p_frame );
268 - av_free_packet( &pkt );
269 + av_packet_unref( &pkt );
273 --- a/modules/codec/avcodec/vaapi.c
274 +++ b/modules/codec/avcodec/vaapi.c
275 @@ -595,7 +595,7 @@ static int Create( vlc_va_t *p_va, AVCod
278 /* Only VLD supported */
279 - p_va->pix_fmt = PIX_FMT_VAAPI_VLD;
280 + p_va->pix_fmt = AV_PIX_FMT_VAAPI_VLD;
283 p_va->release = Release;