From patchwork Thu Sep 10 12:02:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 22259 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:5387:0:0:0:0:0 with SMTP id h129csp1197266ybb; Thu, 10 Sep 2020 05:09:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8jqpzPIdh6y3wlaSnhrA/K1BgiDPOGCd5CjapM1yJToKXVHgPyNcKx4mMjiDsUMPF6826 X-Received: by 2002:adf:a48d:: with SMTP id g13mr8636499wrb.212.1599739744576; Thu, 10 Sep 2020 05:09:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599739744; cv=none; d=google.com; s=arc-20160816; b=UqVfwGRjySM2vJLNF54mvkL7FsHx2fbxehoR7CwmK0Uv27NQyPBW+x6gNHlvA9hmDR kKmMv0GnDPXDzOam2CC4WQM8QSKRtpEPGxrvZh8EqIXKXH1IzSvKt16RkfIzYr3g+bZr tqlC0J1saMVG/C0yrE8K1AbrzpLj7GFkqeJWtRgqc3cy44Cs4ngZ5Tkul5rpOZ5Yqeoy iHDO7spd8Kt5R0VQ1U+YKn9QYFKVKu2ApP/v6HdyNmqYXSVwomDrkyFDmQqO2OwS5236 ebLpe9Jd5x8+jFAKhi9R9YB9Qa4iZJRh6n2ZwC1NLea8JzuJzyIagJyowqKpURqfevpf EtvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to; bh=pw6VQJFbiNsF7wAtlPFLVi6xvWYgU6tpQ8MJ+LOWDAM=; b=psu4Y8XI6q/VEgcEiqNWiRMbarbY0UFvPCqf4jOd5Vn21Q3dnZARxF/WLarl/lx56g DY63pNt9Htxpc+KVNdQvCQLg+Hvv12bIBz6K7xObQ6V2tImCM33G33oFQ19N5b0C24g/ NmLau9KstUKezM7uM6JUlojEv1G612LqYxg8WLSUPD+NsaLuFX0QcAWcOOXa1CikrfpN sFgCPXTIv19Q8fchLxt+1/3s2Djdya5d1kykix2F9tXYwGEUO7DPRwvsbV2H9rrwRo8M EYucLgQcmIaTipz6RvCK4FbWYkoD0X+4pvf5Jl2LGQe4xm5ag1H0DysC+Ash0UIGOkFC mHsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id r13si5162105wro.245.2020.09.10.05.09.04; Thu, 10 Sep 2020 05:09:04 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E308568B90C; Thu, 10 Sep 2020 15:09:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe01-3.mx.upcmail.net (vie01a-dmta-pe01-3.mx.upcmail.net [62.179.121.156]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 69EB068B859 for ; Thu, 10 Sep 2020 15:08:55 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe01.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1kGLIP-0005NU-0D for ffmpeg-devel@ffmpeg.org; Thu, 10 Sep 2020 14:03:21 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id GLHQkHB0OIr7GGLHQkJDni; Thu, 10 Sep 2020 14:02:20 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.3 cv=QN4WuTDL c=1 sm=1 tr=0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=pGLkceISAAAA:8 a=GOvCTdvwIOrBVv2Vsw4A:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 10 Sep 2020 14:02:19 +0200 Message-Id: <20200910120220.6978-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-CMAE-Envelope: MS4wfLpQ3f4OAw8AHtoAskD1797Uv3kaAlz4Gs2yvw3pCNrgk9Q89T1NqXF3ABjG/M/f+gEskknXPEJbdSklHm2rB9MXJozXwylHyNpD9BCn9JzYDJPSSvWp Up9mu6Ba1cBUjZgtZZ2JDIGW83sr2yEZUi1+Op2T3SlXE58auymYhytk Subject: [FFmpeg-devel] [PATCH 1/2] avcodec: Set AV_CODEC_CAP_CHANNEL_CONF in more decoders X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: QoglkbRqB/2z Content-Length: 16098 Suggested-by: Paul B Mahol See: [FFmpeg-devel] [PATCH 1/3] avcodec/fastaudio: Check channels Signed-off-by: Michael Niedermayer --- libavcodec/ac3dec_fixed.c | 3 ++- libavcodec/ac3dec_float.c | 6 ++++-- libavcodec/adxdec.c | 3 ++- libavcodec/flacdec.c | 4 +++- libavcodec/mpegaudiodec_fixed.c | 15 ++++++++++----- libavcodec/mpegaudiodec_float.c | 15 ++++++++++----- libavcodec/pcm-dvd.c | 3 ++- libavcodec/ralf.c | 3 ++- libavcodec/s302m.c | 3 ++- libavcodec/shorten.c | 5 ++++- 10 files changed, 41 insertions(+), 19 deletions(-) diff --git a/libavcodec/ac3dec_fixed.c b/libavcodec/ac3dec_fixed.c index 336a538cad..f36854cdc5 100644 --- a/libavcodec/ac3dec_fixed.c +++ b/libavcodec/ac3dec_fixed.c @@ -176,7 +176,8 @@ AVCodec ff_ac3_fixed_decoder = { .init = ac3_decode_init, .close = ac3_decode_end, .decode = ac3_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/ac3dec_float.c b/libavcodec/ac3dec_float.c index b85a4ce336..57a626a181 100644 --- a/libavcodec/ac3dec_float.c +++ b/libavcodec/ac3dec_float.c @@ -61,7 +61,8 @@ AVCodec ff_ac3_decoder = { .init = ac3_decode_init, .close = ac3_decode_end, .decode = ac3_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, @@ -84,7 +85,8 @@ AVCodec ff_eac3_decoder = { .init = ac3_decode_init, .close = ac3_decode_end, .decode = ac3_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"), .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c index 40ed8e5ba7..69a391ee1f 100644 --- a/libavcodec/adxdec.c +++ b/libavcodec/adxdec.c @@ -183,7 +183,8 @@ AVCodec ff_adpcm_adx_decoder = { .init = adx_decode_init, .decode = adx_decode_frame, .flush = adx_decode_flush, - .capabilities = AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, }; diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index d1cf82b541..cf6128f897 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -669,7 +669,9 @@ AVCodec ff_flac_decoder = { .init = flac_decode_init, .close = flac_decode_close, .decode = flac_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1 | + AV_CODEC_CAP_FRAME_THREADS, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32, diff --git a/libavcodec/mpegaudiodec_fixed.c b/libavcodec/mpegaudiodec_fixed.c index ad7ceb20b6..68ba841efe 100644 --- a/libavcodec/mpegaudiodec_fixed.c +++ b/libavcodec/mpegaudiodec_fixed.c @@ -47,7 +47,8 @@ AVCodec ff_mp1_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .flush = flush, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16, @@ -63,7 +64,8 @@ AVCodec ff_mp2_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .flush = flush, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16, @@ -79,7 +81,8 @@ AVCodec ff_mp3_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .flush = flush, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16, @@ -95,7 +98,8 @@ AVCodec ff_mp3adu_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame_adu, - .capabilities = AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .flush = flush, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16, @@ -112,7 +116,8 @@ AVCodec ff_mp3on4_decoder = { .init = decode_init_mp3on4, .close = decode_close_mp3on4, .decode = decode_frame_mp3on4, - .capabilities = AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .flush = flush_mp3on4, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/mpegaudiodec_float.c b/libavcodec/mpegaudiodec_float.c index ddfa5e0daa..6ebf4c4ae9 100644 --- a/libavcodec/mpegaudiodec_float.c +++ b/libavcodec/mpegaudiodec_float.c @@ -48,7 +48,8 @@ AVCodec ff_mp1float_decoder = { .init = decode_init, .close = decode_close, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .flush = flush, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT, @@ -65,7 +66,8 @@ AVCodec ff_mp2float_decoder = { .init = decode_init, .decode = decode_frame, .close = decode_close, - .capabilities = AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .flush = flush, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT, @@ -82,7 +84,8 @@ AVCodec ff_mp3float_decoder = { .init = decode_init, .close = decode_close, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .flush = flush, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT, @@ -99,7 +102,8 @@ AVCodec ff_mp3adufloat_decoder = { .init = decode_init, .close = decode_close, .decode = decode_frame_adu, - .capabilities = AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .flush = flush, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT, @@ -116,7 +120,8 @@ AVCodec ff_mp3on4float_decoder = { .init = decode_init_mp3on4, .close = decode_close_mp3on4, .decode = decode_frame_mp3on4, - .capabilities = AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .flush = flush_mp3on4, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/pcm-dvd.c b/libavcodec/pcm-dvd.c index 0a751a8191..11a2244616 100644 --- a/libavcodec/pcm-dvd.c +++ b/libavcodec/pcm-dvd.c @@ -311,7 +311,8 @@ AVCodec ff_pcm_dvd_decoder = { .init = pcm_dvd_decode_init, .decode = pcm_dvd_decode_frame, .close = pcm_dvd_decode_uninit, - .capabilities = AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE } diff --git a/libavcodec/ralf.c b/libavcodec/ralf.c index 0080b23941..dc012d71b1 100644 --- a/libavcodec/ralf.c +++ b/libavcodec/ralf.c @@ -535,7 +535,8 @@ AVCodec ff_ralf_decoder = { .close = decode_close, .decode = decode_frame, .flush = decode_flush, - .capabilities = AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, }; diff --git a/libavcodec/s302m.c b/libavcodec/s302m.c index 584b58e28e..113590aee4 100644 --- a/libavcodec/s302m.c +++ b/libavcodec/s302m.c @@ -225,6 +225,7 @@ AVCodec ff_s302m_decoder = { .id = AV_CODEC_ID_S302M, .priv_data_size = sizeof(S302Context), .decode = s302m_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, .priv_class = &s302m_class, }; diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index 4134af74cf..517942c1b0 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -808,7 +808,10 @@ AVCodec ff_shorten_decoder = { .init = shorten_decode_init, .close = shorten_decode_close, .decode = shorten_decode_frame, - .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DELAY | + AV_CODEC_CAP_DR1 | + AV_CODEC_CAP_SUBFRAMES , .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_NONE },