From patchwork Thu Jun 17 02:31:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 28440 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5e:c91a:0:0:0:0:0 with SMTP id z26csp201176iol; Wed, 16 Jun 2021 19:35:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyX35h+MM3KrolyFaRjiN6DI/OyLLTJAXcvzu5sjb5S0kmBYJmVRFTkoDzGThzudgSAudIE X-Received: by 2002:a05:6402:440c:: with SMTP id y12mr3478843eda.208.1623897351231; Wed, 16 Jun 2021 19:35:51 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id jy9si2117ejc.578.2021.06.16.19.35.49; Wed, 16 Jun 2021 19:35:51 -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; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=lIsgzoR3; arc=fail (body hash mismatch); 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3D363689C51; Thu, 17 Jun 2021 05:33:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-oln040092074048.outbound.protection.outlook.com [40.92.74.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1FED8689888 for ; Thu, 17 Jun 2021 05:33:16 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=czKUnszX3iYHUj6UlsBjN3etDQrc7JGExAs4Q9kNznl2fjoazsp1MhL/IKazNaUdIHpKDDDdzoFFeBF7n/yhNpJsbP1Frl9CFMPx/gnGQqa9+w7N12p2kIQZJfBuf3DxqiytaGeuZVIBLuft8DRNszKdwjJloCMzXMAgEgoi5fnMENqBZJp9cmyP1Fns9MI98trKXTQtAGDvNngHdNYJ+sTyrmL1H+c22UXoCASZPFMPk6pS8nTzBbYyTEPZ2bLUpdmm15y3zb7vCOUPGadRA5T7G74CvX45yzO6zDzkedaPgeenUj2EAjBjQe8mlYf0fOI69ZUmwMfpWkddML5lng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ss4dgD6SHpFQi8LOkV+utgFQhqi5Pa3e0zEZKc+1rsc=; b=FBhaAfNxMNZmG/e9gVIKxJuuYEpYqU14DKoc+LqyujliiyoDrBdSSZ24EiF9rR8YsZm4asFJ/QHbKqe+5VYwU52mz4UAdIHlV9lSvsGtzX3HwooZ9rW+notCshhQJU84ccTtoIz0kgbKkzMr5MirVxi2h3FIngGZC6iGxSyoQtBBR2IsNrfohqJcbiv+FbHpKFCmNVoOtw27AlFA7P7WLl697+fl5P2yeXjDwbhxLKqniBGQt97XJDmUUFsIo9Me0UcbptXOG64uPzCfUwXsLo6MkmJxVocYe5j7Mapiatrb7O7WHPndCQxx5LW8DtWt+vGH7T3cSrRmcrmWd28yOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ss4dgD6SHpFQi8LOkV+utgFQhqi5Pa3e0zEZKc+1rsc=; b=lIsgzoR3pvqI3TlvV0PVr7KiDRMMWGKigPGZUIVNKlZh4DXrBvM6lUN70fDXi/MAHZQ1/ziMf38fpvBvekKWGCDH0Luth0NQ3kNNfp6FrQAFKLQxw0fMOPmdWDoRJWRhkgr2F2bS6xgFecfSDx74pI9P+LTKz6Q50l+NuUTjSkyXDWKhRq6kHRPKvhijhHsYHBf3tQ8dshTanhLqT/GuX7KTziMTAPK5/fGUH0NrG+QqNcQW8QNPpmDazfMWEmBT2t5yJd8F5SkolfTOXNq9P8fTSCVb4VHtUddR2xq+ZdDyCKQxYvhyMGInGDYk6vRsUNaJMdP2r4shvjqo/6Oq2Q== Received: from HE1EUR04FT016.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::4f) by HE1EUR04HT190.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16; Thu, 17 Jun 2021 02:33:14 +0000 Received: from VI1PR0301MB2159.eurprd03.prod.outlook.com (2a01:111:e400:7e0d::46) by HE1EUR04FT016.mail.protection.outlook.com (2a01:111:e400:7e0d::93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16 via Frontend Transport; Thu, 17 Jun 2021 02:33:14 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:0A7E8B89835AECB6CA91F4DCA1CA25794C0879096EC6FA087CE49225599FFE1A; UpperCasedChecksum:46140DEFCCCA31AB585E53EB366EB0D1AABF4B40BA493B9146F613DAFCD82FEC; SizeAsReceived:7579; Count:48 Received: from VI1PR0301MB2159.eurprd03.prod.outlook.com ([fe80::d9b:66ba:63ad:967b]) by VI1PR0301MB2159.eurprd03.prod.outlook.com ([fe80::d9b:66ba:63ad:967b%5]) with mapi id 15.20.4242.019; Thu, 17 Jun 2021 02:33:14 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 17 Jun 2021 04:31:34 +0200 Message-ID: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: X-TMN: [tbNlqxW6eeUx54Q9zQqyaM7hrQUh+nIS] X-ClientProxiedBy: AM0PR04CA0115.eurprd04.prod.outlook.com (2603:10a6:208:55::20) To VI1PR0301MB2159.eurprd03.prod.outlook.com (2603:10a6:800:26::20) X-Microsoft-Original-Message-ID: <20210617023202.1318312-12-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.97.82) by AM0PR04CA0115.eurprd04.prod.outlook.com (2603:10a6:208:55::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16 via Frontend Transport; Thu, 17 Jun 2021 02:33:14 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 5d5ac367-38bd-46f6-fa0d-08d9313841de X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNU/fTcAoeunGvvJC2vgMUdOtpMk4ZZjMF9xeoJXzVRRab7f4Vbxd/j9a0OUtyP0/KsZhhusrQ1lnO2DxLfNh4EtwEFwBzHzBwtVJKgORnM5Bppak5GCFt3hxQulZij3ZES8fEB0xpgc5cO93fEhEsaVB11GdUaMjEF6FhmGmdtRiIBhA2Y9vWgIthC+XfDNJ3XeFyzdUzkZjG16D7JERYQqMYgax9bjBdwclcxEmmCCmNok7LRnnKb/vSd+0bFmSAQMHOBflC/EQ2CmS9+HPT4QnDTDgXULGLKXOROIgymeoYbflz74t4r+wDD4eq8jOCBYxPnMpz+uTlxmdkXC0TQDvI75JGaq/pp45tXfo6szuxQ/SqdNNPWe/tAPpLkaAU+eRSHSiQvDqVjUBNtAaGM/hoUwJyEDTSwRE6OwbYB5b+stqESWmCV4yMKFz6OVYMzM8q7zm7uXR+Xrbk3yiWYaPojTvY5//mFSXB5/hA7thRLzqX/Rtofn5ztoIWrREWOQLBcvOvbdppJ24e3ZUuOUYK/s9L/B0yP9yXLHoV9Rz7J0x79P8nb657HYhmFx+gk/L2S9s5IliXm2ZSNRN2as9J3oIBVx4l8qPrs0nqnX4myDxCYD3TIMwQgcgpObQ5r/dGyiyTBWCvLwH4EokaAFmWQu85oacLdLk7XyjHj0DPRfWOlxYvsUWTuV/wezWqCP+dc2bFdMFit+w0kCdfK7T00c3A+z09k= X-MS-TrafficTypeDiagnostic: HE1EUR04HT190: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zefZGJguT6QuHadKBi+3ETyv5JOGvpor2rcqFrAsjQFUJUq5vde1arhTT5un3vRa34Ex6V0R2c4gcb6Bxm3w4HXrTKdrRxGWa7eC8Gs0owikhtUZpy7PbuwFAZKYLlJ9olufT35HwHjyhagvoU65FBBY83wu2RBrx2Gog+tcCgT1LfBkZtZkqZf4RJWfGNsNEwYudWc4xcif/zC0pC68zXkDVZP6FR0VeiVm7TQWCPwRsYy96UWu6h25Jusac8ciCMb7Nbhy300wISAIuCqLatT2ws0gwH7PfJOJnqhIQZGnq8ggL9u4qFfe/vWBKb5Gcc+RzQS3KzkAlLXxhHOXTOKLkmz+9NKvx7VF2ewFxYWbMa5y5ekNwCS8QBG5lDnmLpPSSdMiiWTuZDQTysNgsg== X-MS-Exchange-AntiSpam-MessageData: efJJfcqzQ42UZyDLwOS8K21C16qtZCPM6/xNeCWEOE5pUab2iIg3p5MaYBnnyZIQNXb0l2O94HLZKzULkHlfbULyxpX2TVP3bwoLNWazwnV55UJ+lNK8kk7Kk8ZX7i0gh0xskTkdFnbN1+oB8iJloQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d5ac367-38bd-46f6-fa0d-08d9313841de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2021 02:33:14.5186 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: HE1EUR04FT016.eop-eur04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR04HT190 Subject: [FFmpeg-devel] [PATCH 13/41] avformat/movenc: Deduplicate AVClasses X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: UVJMKLSx/A07 The child_class_next API relied on different (de)muxers to use different AVClasses; yet this API has been replaced by child_class_iterate. Signed-off-by: Andreas Rheinhardt --- libavformat/movenc.c | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 04f3e94158..fd26785f7c 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -111,12 +111,11 @@ static const AVOption options[] = { { NULL }, }; -#define MOV_CLASS(flavor)\ -static const AVClass flavor ## _muxer_class = {\ - .class_name = #flavor " muxer",\ - .item_name = av_default_item_name,\ - .option = options,\ - .version = LIBAVUTIL_VERSION_INT,\ +static const AVClass mov_isobmff_muxer_class = { + .class_name = "mov/mp4/tgp/psp/tg2/ipod/ismv/f4v muxer", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, }; static int get_moov_size(AVFormatContext *s); @@ -7211,7 +7210,6 @@ static const AVCodecTag codec_f4v_tags[] = { }; #if CONFIG_MOV_MUXER -MOV_CLASS(mov) const AVOutputFormat ff_mov_muxer = { .name = "mov", .long_name = NULL_IF_CONFIG_SMALL("QuickTime / MOV"), @@ -7230,11 +7228,10 @@ const AVOutputFormat ff_mov_muxer = { ff_codec_movvideo_tags, ff_codec_movaudio_tags, ff_codec_movsubtitle_tags, 0 }, .check_bitstream = mov_check_bitstream, - .priv_class = &mov_muxer_class, + .priv_class = &mov_isobmff_muxer_class, }; #endif #if CONFIG_TGP_MUXER -MOV_CLASS(tgp) const AVOutputFormat ff_tgp_muxer = { .name = "3gp", .long_name = NULL_IF_CONFIG_SMALL("3GP (3GPP file format)"), @@ -7250,11 +7247,10 @@ const AVOutputFormat ff_tgp_muxer = { .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, .codec_tag = codec_3gp_tags_list, .check_bitstream = mov_check_bitstream, - .priv_class = &tgp_muxer_class, + .priv_class = &mov_isobmff_muxer_class, }; #endif #if CONFIG_MP4_MUXER -MOV_CLASS(mp4) const AVOutputFormat ff_mp4_muxer = { .name = "mp4", .long_name = NULL_IF_CONFIG_SMALL("MP4 (MPEG-4 Part 14)"), @@ -7272,11 +7268,10 @@ const AVOutputFormat ff_mp4_muxer = { .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, .codec_tag = mp4_codec_tags_list, .check_bitstream = mov_check_bitstream, - .priv_class = &mp4_muxer_class, + .priv_class = &mov_isobmff_muxer_class, }; #endif #if CONFIG_PSP_MUXER -MOV_CLASS(psp) const AVOutputFormat ff_psp_muxer = { .name = "psp", .long_name = NULL_IF_CONFIG_SMALL("PSP MP4 (MPEG-4 Part 14)"), @@ -7293,11 +7288,10 @@ const AVOutputFormat ff_psp_muxer = { .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, .codec_tag = mp4_codec_tags_list, .check_bitstream = mov_check_bitstream, - .priv_class = &psp_muxer_class, + .priv_class = &mov_isobmff_muxer_class, }; #endif #if CONFIG_TG2_MUXER -MOV_CLASS(tg2) const AVOutputFormat ff_tg2_muxer = { .name = "3g2", .long_name = NULL_IF_CONFIG_SMALL("3GP2 (3GPP2 file format)"), @@ -7313,11 +7307,10 @@ const AVOutputFormat ff_tg2_muxer = { .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, .codec_tag = codec_3gp_tags_list, .check_bitstream = mov_check_bitstream, - .priv_class = &tg2_muxer_class, + .priv_class = &mov_isobmff_muxer_class, }; #endif #if CONFIG_IPOD_MUXER -MOV_CLASS(ipod) const AVOutputFormat ff_ipod_muxer = { .name = "ipod", .long_name = NULL_IF_CONFIG_SMALL("iPod H.264 MP4 (MPEG-4 Part 14)"), @@ -7334,11 +7327,10 @@ const AVOutputFormat ff_ipod_muxer = { .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE, .codec_tag = (const AVCodecTag* const []){ codec_ipod_tags, 0 }, .check_bitstream = mov_check_bitstream, - .priv_class = &ipod_muxer_class, + .priv_class = &mov_isobmff_muxer_class, }; #endif #if CONFIG_ISMV_MUXER -MOV_CLASS(ismv) const AVOutputFormat ff_ismv_muxer = { .name = "ismv", .long_name = NULL_IF_CONFIG_SMALL("ISMV/ISMA (Smooth Streaming)"), @@ -7356,11 +7348,10 @@ const AVOutputFormat ff_ismv_muxer = { .codec_tag = (const AVCodecTag* const []){ codec_mp4_tags, codec_ism_tags, 0 }, .check_bitstream = mov_check_bitstream, - .priv_class = &ismv_muxer_class, + .priv_class = &mov_isobmff_muxer_class, }; #endif #if CONFIG_F4V_MUXER -MOV_CLASS(f4v) const AVOutputFormat ff_f4v_muxer = { .name = "f4v", .long_name = NULL_IF_CONFIG_SMALL("F4V Adobe Flash Video"), @@ -7377,6 +7368,6 @@ const AVOutputFormat ff_f4v_muxer = { .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH, .codec_tag = (const AVCodecTag* const []){ codec_f4v_tags, 0 }, .check_bitstream = mov_check_bitstream, - .priv_class = &f4v_muxer_class, + .priv_class = &mov_isobmff_muxer_class, }; #endif