From patchwork Mon Aug 15 15:03:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Kuhls X-Patchwork-Id: 659285 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sCf166Pmhz9t2Y for ; Tue, 16 Aug 2016 01:04:58 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 632908A877; Mon, 15 Aug 2016 15:04:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IUoxxnWS5DAi; Mon, 15 Aug 2016 15:04:50 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 2458A88FD1; Mon, 15 Aug 2016 15:04:22 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 805371CEA66 for ; Mon, 15 Aug 2016 15:04:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7D31D8A5D1 for ; Mon, 15 Aug 2016 15:04:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vvNieIFzYC5E for ; Mon, 15 Aug 2016 15:04:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailout03.t-online.de (mailout03.t-online.de [194.25.134.81]) by whitealder.osuosl.org (Postfix) with ESMTPS id 2FB7586B82 for ; Mon, 15 Aug 2016 15:04:03 +0000 (UTC) Received: from fwd34.aul.t-online.de (fwd34.aul.t-online.de [172.20.26.145]) by mailout03.t-online.de (Postfix) with SMTP id DFCC44225B6D for ; Mon, 15 Aug 2016 17:04:00 +0200 (CEST) Received: from fli4l.lan.fli4l (SrtkLwZf8h7JfWe7-udJ8+jVipl4Ch1pkHlXW7CTT-w4+prciOP-RKmtF+spvOCg4b@[84.191.193.24]) by fwd34.t-online.de with (TLSv1:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1bZJQd-2wXzyi0; Mon, 15 Aug 2016 17:03:51 +0200 Received: from mahler.lan.fli4l ([192.168.1.1]:52828 helo=kuhls.lan.fli4l) by fli4l.lan.fli4l with esmtp (Exim 4.87) (envelope-from ) id 1bZJQc-0003rw-1v; Mon, 15 Aug 2016 17:03:50 +0200 From: Bernd Kuhls To: buildroot@buildroot.org Date: Mon, 15 Aug 2016 17:03:41 +0200 Message-Id: <1471273421-12076-6-git-send-email-bernd.kuhls@t-online.de> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1471273421-12076-1-git-send-email-bernd.kuhls@t-online.de> References: <1471273421-12076-1-git-send-email-bernd.kuhls@t-online.de> X-ID: SrtkLwZf8h7JfWe7-udJ8+jVipl4Ch1pkHlXW7CTT-w4+prciOP-RKmtF+spvOCg4b X-TOI-MSGID: 9c7a3cf2-46d3-417b-bae9-8748c8c80f3b Cc: Bernd Kuhls Subject: [Buildroot] [PATCH/next v5 6/6] package/vlc: add support for ffmpeg 3.0 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Bernd Kuhls --- v5: first release instead of bumping vlc to git master (no vlc 3.x release yet) we use a patch from deb-multimedia.org which provides the necessary changes for ffmpeg 3.x support to vlc 2.2, compile-tested using this defconfig: BR2_TOOLCHAIN_BUILDROOT_WCHAR=y BR2_TOOLCHAIN_BUILDROOT_CXX=y BR2_PACKAGE_FFMPEG=y BR2_PACKAGE_FFMPEG_GPL=y BR2_PACKAGE_FFMPEG_POSTPROC=y BR2_PACKAGE_FFMPEG_SWSCALE=y BR2_PACKAGE_VLC=y This patch can be removed when vlc is bumped to 3.x. package/vlc/0008-ffmpeg-3.0.patch | 283 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 283 insertions(+) create mode 100644 package/vlc/0008-ffmpeg-3.0.patch diff --git a/package/vlc/0008-ffmpeg-3.0.patch b/package/vlc/0008-ffmpeg-3.0.patch new file mode 100644 index 0000000..892c625 --- /dev/null +++ b/package/vlc/0008-ffmpeg-3.0.patch @@ -0,0 +1,283 @@ +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 + +--- a/configure.ac ++++ b/configure.ac +@@ -2324,7 +2324,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],, [ +- AC_MSG_ERROR([libavutil versions 55 and later are not supported.]) ++ AC_MSG_WARN([libavutil versions 55 and later are not supported.]) + ]) + VLC_SAVE_FLAGS + CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}" +@@ -2334,7 +2334,7 @@ AS_IF([test "${enable_avcodec}" != "no"] + VLC_RESTORE_FLAGS + have_avcodec="yes" + ],[ +- AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.]) ++ AC_MSG_WARN([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.]) + ]) + ], [ + have_avcodec="no" +@@ -2383,7 +2383,7 @@ AS_IF([test "${have_vaapi}" = "yes" -a " + case "${avfork}" in + ffmpeg) + PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [ +- AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 57.10 or libav.]) ++ AC_MSG_WARN([VA API requires FFmpeg libavcodec < 57.10 or libav.]) + ]) + ;; + esac +@@ -2417,7 +2417,7 @@ AS_IF([test "${enable_dxva2}" != "no"], + case "${avfork}" in + ffmpeg) + PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [ +- AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec < 57.10 or libav.]) ++ AC_MSG_WARN([DXVA2 requires FFmpeg libavcodec < 57.10 or libav.]) + ]) + ;; + esac +@@ -2509,7 +2509,7 @@ AS_IF([test "${enable_avformat}" != "no" + ]) + VLC_RESTORE_FLAGS + ],[ +- AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.]) ++ AC_MSG_WARN([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.]) + ]) + ]) + AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"]) +@@ -2538,7 +2538,7 @@ then + ]) + VLC_RESTORE_FLAGS + ],[ +- AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.]) ++ AC_MSG_WARN([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.]) + ]) + fi + +@@ -3181,7 +3181,7 @@ AS_IF([test "${have_vdpau}" = "yes" -a " + libav) av_vdpau_ver="55.26.0" ;; + ffmpeg) av_vdpau_ver="55.42.100" + PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [ +- AC_MSG_ERROR([VDPAU requires FFmpeg libavcodec < 57.10 or libav.]) ++ AC_MSG_WARN([VDPAU requires FFmpeg libavcodec < 57.10 or libav.]) + ]) + ;; + esac +--- a/modules/codec/avcodec/audio.c ++++ b/modules/codec/avcodec/audio.c +@@ -39,7 +39,7 @@ + #include + #include + +-#include ++#include + + #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; +--- a/modules/codec/avcodec/encoder.c ++++ b/modules/codec/avcodec/encoder.c +@@ -41,7 +41,7 @@ + #include + + #include +-#include ++#include + + #include "avcodec.h" + #include "avcommon.h" +@@ -311,7 +311,7 @@ int OpenEncoder( vlc_object_t *p_this ) + else if( !GetFfmpegCodec( p_enc->fmt_out.i_codec, &i_cat, &i_codec_id, + &psz_namecodec ) ) + { +- if( FindFfmpegChroma( p_enc->fmt_out.i_codec ) == PIX_FMT_NONE ) ++ if( FindFfmpegChroma( p_enc->fmt_out.i_codec ) == AV_PIX_FMT_NONE ) + return VLC_EGENERIC; /* handed chroma output */ + + i_cat = VIDEO_ES; +@@ -555,7 +555,7 @@ int OpenEncoder( vlc_object_t *p_this ) + + if( p_codec->pix_fmts ) + { +- const enum PixelFormat *p = p_codec->pix_fmts; ++ const enum AVPixelFormat *p = p_codec->pix_fmts; + for( ; *p != -1; p++ ) + { + if( *p == p_context->pix_fmt ) break; +@@ -1017,7 +1017,7 @@ errmsg: + } + } + +- p_sys->frame = avcodec_alloc_frame(); ++ p_sys->frame = av_frame_alloc(); + if( !p_sys->frame ) + { + goto error; +@@ -1048,7 +1048,7 @@ static void vlc_av_packet_Release(block_ + { + vlc_av_packet_t *b = (void *) block; + +- av_free_packet(&b->packet); ++ av_packet_unref(&b->packet); + free(b); + } + +@@ -1088,7 +1088,7 @@ static block_t *EncodeVideo( encoder_t * + AVFrame *frame = NULL; + if( likely(p_pict) ) { + frame = p_sys->frame; +- avcodec_get_frame_defaults( frame ); ++ av_frame_unref( frame ); + 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 * + av_pkt.duration / p_sys->p_context->time_base.den, p_sys->p_context ); + if( unlikely(p_block == NULL) ) + { +- av_free_packet( &av_pkt ); ++ av_packet_unref( &av_pkt ); + return NULL; + } + +@@ -1329,7 +1329,7 @@ static block_t *handle_delay_buffer( enc + //How much we need to copy from new packet + const int leftover = leftover_samples * p_sys->p_context->channels * p_sys->i_sample_bytes; + +- avcodec_get_frame_defaults( p_sys->frame ); ++ av_frame_unref( p_sys->frame ); + 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 * + while( ( p_aout_buf->i_nb_samples >= p_sys->i_frame_size ) || + ( p_sys->b_variable && p_aout_buf->i_nb_samples ) ) + { +- avcodec_get_frame_defaults( p_sys->frame ); ++ av_frame_unref( p_sys->frame ); + 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 + encoder_t *p_enc = (encoder_t *)p_this; + encoder_sys_t *p_sys = p_enc->p_sys; + +- /*FIXME: we should use avcodec_free_frame, but we don't require so new avcodec that has it*/ ++ /*FIXME: we should use av_frame_free, but we don't require so new avcodec that has it*/ + av_freep( &p_sys->frame ); + + vlc_avcodec_lock(); +--- a/modules/demux/avformat/demux.c ++++ b/modules/demux/avformat/demux.c +@@ -734,14 +734,14 @@ static int Demux( demux_t *p_demux ) + } + if( pkt.stream_index < 0 || pkt.stream_index >= p_sys->i_tk ) + { +- av_free_packet( &pkt ); ++ av_packet_unref( &pkt ); + return 1; + } + const AVStream *p_stream = p_sys->ic->streams[pkt.stream_index]; + if( p_stream->time_base.den <= 0 ) + { + msg_Warn( p_demux, "Invalid time base for the stream %d", pkt.stream_index ); +- av_free_packet( &pkt ); ++ av_packet_unref( &pkt ); + return 1; + } + if( p_stream->codec->codec_id == AV_CODEC_ID_SSA ) +@@ -749,7 +749,7 @@ static int Demux( demux_t *p_demux ) + p_frame = BuildSsaFrame( &pkt, p_sys->i_ssa_order++ ); + if( !p_frame ) + { +- av_free_packet( &pkt ); ++ av_packet_unref( &pkt ); + return 1; + } + } +@@ -757,7 +757,7 @@ static int Demux( demux_t *p_demux ) + { + if( ( p_frame = block_Alloc( pkt.size ) ) == NULL ) + { +- av_free_packet( &pkt ); ++ av_packet_unref( &pkt ); + return 0; + } + memcpy( p_frame->p_buffer, pkt.data, pkt.size ); +@@ -838,7 +838,7 @@ static int Demux( demux_t *p_demux ) + else + block_Release( p_frame ); + +- av_free_packet( &pkt ); ++ av_packet_unref( &pkt ); + 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;