From patchwork Wed Mar 30 22:28:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 35095 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c05:b0:7a:e998:b410 with SMTP id bw5csp1058704pzb; Wed, 30 Mar 2022 15:29:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpbyBmYssJyGCNN0oVnfUg++nUP60rOMitaxjPMAEH6dViLf8HBg66sC632bwiEDukOWC/ X-Received: by 2002:a17:907:3f12:b0:6d8:bf7c:7672 with SMTP id hq18-20020a1709073f1200b006d8bf7c7672mr2062531ejc.686.1648679356935; Wed, 30 Mar 2022 15:29:16 -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 ja19-20020a170907989300b006e0db091514si16824265ejc.769.2022.03.30.15.29.16; Wed, 30 Mar 2022 15:29:16 -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=jyLMEl4J; 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 9724468B223; Thu, 31 Mar 2022 01:29:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-oln040092075103.outbound.protection.outlook.com [40.92.75.103]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7BF8C68B07F for ; Thu, 31 Mar 2022 01:29:05 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IcjAeziuFdtIKsZnH8lSF+RfyxctHpvTnI7TPG+t/wXoeq6dYoANiqzz1VyHlHZ36P0XySFRqhm8lBv+e/XTjvxqsanM0VhIYwlX9HcgQim1Y2PGB0PkC0rUaelDh5C2qIaMo4cLWwYnXcesNr8tL+A6iapExl931XXGoxvcdZB9w9cvf1BuNkrTKpsIzqNpwwmZ0GWSh5UJzgHNXoojHc3+NRk7eS6YXpuljo3fmaXVvHEMUJYQ4WD/PG9jn+y95Jx2oD5s8Cbk+4vOh7Fr8hq2b5o+HBMb1pKOm/3ptUGkzRAFeAY8UpCQU+13ezXb50KyHudk8I2eQ1EW7nVpDA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GBpHfpJP/Doigl37OO3depMvXshTUxPH4TwSEbUMSjM=; b=By2/xA6yPJhm0hjsdwKuxJy8ch0FgQXBIu0BJ24gMoLPnync0kXnv/x8FsyNZw3NQfW/+tg/okGdDXyphXo2gP6zz0yebG/RuW9KrLx6fRZp0WOzdDBjUIfEUYcNFN8aH6zOLAdXupoTUCjIw6gNLnKXCmPsKaRBCL6P29DTe1+G1glCNZg+4CiDwdwYEWe/mrWJmFEiqkkWwr33zt7F6RoUeDk8gjFaMUrK1s3zljjdN3ikVdG8WgI6wXT4Vju+9O/1IgDK7VwZtBo7/nR00Fq7TMU7F1UM9hJWDkCf54q0c6eUsu5761WfHa/QRnQaxl8dR84SwEqwtzeeNsAfKg== 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=GBpHfpJP/Doigl37OO3depMvXshTUxPH4TwSEbUMSjM=; b=jyLMEl4JYVUvVeGmXtVmbxUSsEFfLHmK4xa5KoQdBqj1sywNNeqS72mYKh0cWecPHO1G6U9ppV0ipGnQWMfjYz1NjMmJm9jRpfPOIoEgZyDQ9ZdAk5aak49g4n4y29OGeL93uDbyOaNHUvQZpe8lmNOMHEVUP5lZoXLiPEi53SiJGutDtKhcLZ/8k6ef0s+QVS2/K7HN47dbIJ5VWGsTPralw4yFR+2QwQS79Qk54GjsL/xx5ut9r63kWgbnci5k0wYvhtvAlR6e4b1ikwU0MThbfUZeYtWvQovashQB7KRN6NETqqg+HQNvrLjpLIrql4cM17DvStfGBjUr8RIxLQ== Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) by AM6PR0102MB3621.eurprd01.prod.exchangelabs.com (2603:10a6:209:22::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.18; Wed, 30 Mar 2022 22:29:04 +0000 Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8]) by AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8%3]) with mapi id 15.20.5102.022; Wed, 30 Mar 2022 22:29:04 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 31 Mar 2022 00:28:49 +0200 Message-ID: X-Mailer: git-send-email 2.32.0 X-TMN: [yUhouPWel6qp9akp9GZ3ZQjRYYNj990c] X-ClientProxiedBy: AM6PR10CA0054.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:80::31) To AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) X-Microsoft-Original-Message-ID: <20220330222855.531823-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cd8342af-0d57-4adc-6550-08da129cb20a X-MS-Exchange-SLBlob-MailProps: +LiGfBxqLEsvqYB/Rrptbigll80VyAn5mhY8b0ndgKP2+OxhSkayaYV5imc4DVUjyAnoBC0sqIkUJqDiSHMKFx/A10V/3irLrROaHue6UiFVvmSU+i9UjIdZswZCbvx6GSNvfeRIoYPXSEDhOUdAsZ0WiDTt0nvPfl8vZ5vclaRzA392kBFPIpJvyyS6FJnI0uG2UC2kBE67mxlAOADnZFEFwkYH1yrukHDkUQ6ldXZ58wrwN5BTq4d8LXdMjim55FemG+e8IyuUPrp23uu4ETMSFSwbjRkdzMIRr0rTyLHg3Q2wrSME1qLu6UnTjp7JxtHqR3u0Gf49ni8tNsYonYZsYWvka6UxzvyOqoIJIftSIp7NOhIlHlIuDyRvve5t7bl7T3VE4CmARlNTQkGBOVnK/Cu0jV9pzbKGEKbLL1WV48gDRa8/q5fhgsE87D1C4Es0jLOmZ8cjrpuTRYHZoCjEPun4B34vtezq1gps6KozYez1/TM5SR7he9b/lSDGrWWu04o4l4+lSVyNwGQJl6jWjeX+HI8moe13+5OwG6CSBTGxkeD5IzM7RI2Vg+3AMtWGLhFZiRCWRz21l7pJQUlN/Jsvs87XXROBmPzswIVRB1q4I1bPgoGACSP1lZYRs2I3Fps4FoQVXQQphURfglrpuMXANXly/9MAWHSs/5vsV2WbAmI5eT+qL0krfjjCPcWzOHNdlxvBk+LXMcTv7Oi+YDr9ZWO7pkZhuuV8/EJJU901q61TIt91MKaoXJ0peevdXQjZVyZ8e4D9ln5rpqzgH2+c4p1v X-MS-TrafficTypeDiagnostic: AM6PR0102MB3621:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 99aATxUFHkLR8A/QY2aUQsLHK7YXDwlhojIxNHKfhaOdEQhBYvQUHWAyzqV+qumrn85c8aJkjrchFCx+3ru9IEYzfktk2cNoNjJzA1wQp8IQy4uSuzFoKE17pys/ItCCXXT2BKkc1ZitQA9/AI2qpSlm71vjjgbIF+02yJLAklyqJ7EuilCKRHHtPObAN4IVTGjyVRyybp692BOgedaZN4grwFALvaQTBJzeG1o2WPwF+P4yC86mttvjfxI1mJUEUzjsa+cGUC1KBve8yX6m2CSTkX266/bLbRWVxOdSkR12DBgTIdwligl3dSZQTRJDWgLEj9eEb1ouFJtZGjY1IqwGRxQLmIeZhI+8QXfnIUmUjaDBoDvviwfkUJw1erV9o67xVzwQzI6vfhqWIXJyMh2xmR9pFNRGyjwylG4Wb3i0OlHBwv1Jz3QaWoOSJRu03FfowYSL765r7uO1ID988FZjwIjUfVsZRA5Fsy+xTXDfAGut6X1OJP9CYLAXNgvFl/EQ5tbo7nrOF1/YM5HCQjxCN00qiFpg4oUgrjewiH5HeFIjFnBoVbqRwlSY/QQR0VavTOccFjhQCOWp6B0Psw== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: E0OoFwGD519wWZl9RKglikayczxnmY8Ra5uV3w9v666TUbPsWg3DiLwRZ+mcj3KnPRaENjcfAUphX4O/Sn269g/tC37cPtiRhIGAhMSPHXNnz6ktC/ih7b0hWC9omdEgDznljIRe9bM1K1paooV5GwRWFNSOgvBhCZeMuZ2CY3nuWDi6aVQb2OCZYCAorYY/XYoM3gx+Q0yh4nW6nyRmiSC1jW6646OSEpIBT6snMiVhgEMkcme5hbHeofCyjQpxdgX4lylekODck8Vj5i8srs0T2zHDpv/yyL4AxXSY+Jdxe2vjxFRN117kkFib9DOBpgu8wAWQzI+kednHRuXPllB7/R6AEXiK6wvL+54As5/2K70vMtWFN/Ufki9Josm4aZC5xDRqo2bFP/Xni0nIUzH/fuQBS55BGEWbdnedpFDa2nB3iqz9bs7wdsJ/CdJUqDNotdLVR7r7srieXTclPVJWDhgJy3wZL22IHc/PNB8BernZwfax1p3zzxJK09HZWXdcy5eEkNJK39+yV/TBhQykDbuhgtSyextH3+FKVj/yQTYDGniLFj04xZ3BeRr6OYLNaVYBPTsBbuOaSuv79ZS/hKaVzyo693ItrxwOtnpZ3i60wIsw3kmkd/5FmvnJWAV9VrpnBaLlgUpikEqQ0yav2wqIsnZhsbwDOGDd5DNyew098ZaWKJHdrlSEFg2ayc/6AJHhEyqI3KYOW8NOkj1x8OrBosqjClVLNJgm95Dx5/Z68tpMYOHwsZ/a8h/4f/ZK/CZpG5WXntPo8baKmy8/HE9uKnOxd7WXzb5KvrG/yUj+VCrGugCr3Un/OO+HLgXguIN06P9rUjVzs++A5RA+8ZvzL4USLspcrtxeOc+Y0paNLoq+nepCJMAJ1OU+GCEv8tWIb6Ru+bjlDNK8dVgDwT1O8Pa7TgExCt8M5AYGAeAWZAYkeJT68OD5J/mru+BTNBdfJzVBrwu0qwG/M6X72Q3dA9JdW4ohtKiYxDkROTM7XEg4V0Jl2xlqsONDHeZdHQzC6h1kkVMVZ+EDM312HzdMzPDoIAsE3eCOMatTgghPQkJaFfG8q1XrWSkfyFwCYKGsjEf+2SWxLkBlPunRb6748+AEhMfGEopC/088ShdgtXk3Wlj2vtTv0Cls6UoAh/z8l1eV6/wCakpKeQlxcY5go3lxB2CtnwyC0SkwycDHKqsrDEdgj9SxsYfxDiGHXomHcR2ruFg7IFNLg8e4S+mWOPeEObAmDIeiK8LIPIHOieosMAU8Xefv5022vQ0IlZ9rYnUbE3VExC41AZP89YRw/bFNuHX7XP00pY/86l293j03rLBfhH/iA9dSxswwAiEW8426RGZ5HpaSV1aheOTkmSabqf0j9kugfpyZlEag47r9tUpk5V+zEugfZM3vW1fPK1PO7pdc/JOYfAVQrZxor4yoarO/cYncIe9GoNTV6uTQi7rvchLPh41E X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cd8342af-0d57-4adc-6550-08da129cb20a X-MS-Exchange-CrossTenant-AuthSource: AS1PR01MB9564.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2022 22:29:04.1007 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0102MB3621 Subject: [FFmpeg-devel] [PATCH 1/7] avcodec/options: Fix AVClassCategory of decoders with .receive_frame 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: /iheiodjdNOB Signed-off-by: Andreas Rheinhardt --- libavcodec/options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/options.c b/libavcodec/options.c index 91ab994994..2e05d29e1e 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -68,7 +68,7 @@ static const AVClass *codec_child_class_iterate(void **iter) static AVClassCategory get_category(void *ptr) { AVCodecContext* avctx = ptr; - if (avctx->codec && ffcodec(avctx->codec)->decode) + if (avctx->codec && av_codec_is_decoder(avctx->codec)) return AV_CLASS_CATEGORY_DECODER; else return AV_CLASS_CATEGORY_ENCODER; From patchwork Wed Mar 30 22:49:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 35096 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c05:b0:7a:e998:b410 with SMTP id bw5csp1066454pzb; Wed, 30 Mar 2022 15:50:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1gbVUoQX81entGu6Re9qeHEUInoyQWw0dj/t93HuxsS7p+T9Mx2cUUnFYecrebPo4F+R4 X-Received: by 2002:a17:907:2d8d:b0:6df:a06c:7c55 with SMTP id gt13-20020a1709072d8d00b006dfa06c7c55mr2033210ejc.325.1648680620842; Wed, 30 Mar 2022 15:50:20 -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 w3-20020a170906480300b006dfbfcb1f69si21329519ejq.458.2022.03.30.15.50.20; Wed, 30 Mar 2022 15:50:20 -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=ZNaYkJBw; 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 7A3DE68B21E; Thu, 31 Mar 2022 01:50:16 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2022.outbound.protection.outlook.com [40.92.89.22]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9B7986801DD for ; Thu, 31 Mar 2022 01:50:09 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BQi/X3pmfRaHYcwb10K4WizbUTFfdEkeSRFhcq1wsVG51Ldct+I5NrNe8KSGDUgGENOJffZTDIvPUObsOa5L+eSkTQUMp9A5wv6DSBZp5l5YqAWyZEk4Fb49lMLRGinqYvbp4MHgSluD/3hEY2YUbonexviguS6RQOlxVnjXCiie0WrlRBo2QEscxTWaFf+yZzCWRtkWnkaiMpA5wxMF/f0syLdOKep6BYdMAgpFlddjYpzLfxwT16JGv0pgjF0braY1Jvb6qQExagbmDFUUCcFLOHH+hOUWyMnukxkh0lv0hrlwZM5kTrABhSJ3KhHp28m0TyNg581o/vmIrLxeuw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2UuOFni6f6K1N1JA1H+yBN2u8k+j6NaKUgrUZZRJovI=; b=DzpBIJ7OXUL0jYHvEH8fJPjCVDoX5UrqccXE61+LtpRBah3E6WmQipxKlnRPxnJhXBs3pDrGXOVqz+QRo24qUWGhqUSzVkgJPXZTDukBajJydXmFpmIRyKDCpsEXw7P84vYPcf1Ln/U72au2gCh87Tn3W37Hqv5OnqUNAPi70qzmxtHA2IGGN5ixQq4UGzTfLX+aw/RRBiHVYyIg9oUq1LmnTukah9JN50cK+/j3gghbRPU2BI0xZjbLoDKue5DOl1WnA4hpxgsPjT0tGtnHvpdHlanfIizDejgTerajnHZBPB3vwpJGlEFOcI2G+ta9HkGafU1/tinNvEBcskaxoA== 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=2UuOFni6f6K1N1JA1H+yBN2u8k+j6NaKUgrUZZRJovI=; b=ZNaYkJBwobDLNGwrmlHk/mBlYXHAvhkD9w2Q5eSRUiUgLOYbHcmIpMyoJLQ1qLxStlTpEf8mJBPV5WeBDC7rESimD7cyt7J74YgLPV6D8qG70NxLEJ9on4SjR3ZIOCXjgi7qWe7V0l9NDV2FM5EYrLL3nFYinLdaNT8QFONCTTBGC9CYxBrU6pfGD0lp6t8WStptrxC1DYBHw01tFRoMYYecdZutiAzIBEOAEJdtwTUpSMObKf0pCRwSOgJK+FBbrQxsOic7nPXhFkqvezuzxV6UT78iEbUPmhZBXYpsiXyPWzaiFYRA5rSpi7IvGjAfPHc0QmI4b9P6ZZhkO4gAYw== Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) by AM5PR0102MB2579.eurprd01.prod.exchangelabs.com (2603:10a6:206:d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17; Wed, 30 Mar 2022 22:50:08 +0000 Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8]) by AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8%3]) with mapi id 15.20.5102.022; Wed, 30 Mar 2022 22:50:07 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 31 Mar 2022 00:49:53 +0200 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [XPQ0uw6TcW+ohmv3kDrI+kLYYZViMl++] X-ClientProxiedBy: ZRAP278CA0002.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:10::12) To AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) X-Microsoft-Original-Message-ID: <20220330224958.538843-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c3838997-74d1-4e09-f195-08da129fa328 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNUzzYYNSosKWVK5/sI4Jn4p3+0RytsPbwRsn+C/DRFlS2Q+G32JeRfwZXRB1cdONl65kdfhDKK/OvFTuNhfGGmDXCtlGwANfDsxt3hGzo8U2ixyZnhqPXx3BzNhCCNou1FpFyOn2851dNIR+R6ZGmHUqzACyXZXnkvandz1+vtbCGTglmUwDTnGjltz73hkLoJUAtoLcBTD6+AlcM3dmroi3aaZGBl/MJNraOPalQOHmjJ6pppxP/ySlZnyUetVOr208G9SssqpCyMVnEUFEg90hoUvWjA7IBctf1VZN1YZEsGkWsd2otVrhnUyv7LvFeywxUAZ5e9qyrDBap8Q6SxAd7CV60AtqoL9HFOTh4TEsW8vBSEd9Z5s190oekU9hTkCskWZ3YTfsr0FMVTmXDRJ37WVfU5usjc6koolmN+lPeH9UNPBB5H+C4kIl750WABQt575MX3BboRxu/SBjsmtHJ01G0Ddah+Rm2hvIp9PN6P5DT3uU8Y4B581Be6FLWzdO4LKAM+lhG0TysQ55z/YrvG1R4JdEo/fTtF+3ltayX0LI2Dpt1PY5Vn1UDpv9f7ouWfBT2Ja83EBEwipAFYptPvJKquYCJCaNtlXqevRwbhTi/1uu2MXR4vJ95golRDauQ/lh9gz2lBKMwcO66J5PDI9uzeAl5YsncMtuPVvTGIL+1CQFCiOhBswqp3zg4xgsxCpp0KxjlK1C0IVKppvDm1SLO6Wd8w= X-MS-TrafficTypeDiagnostic: AM5PR0102MB2579:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HRrKkd51AyREzI0xU8qZz2um7clInrLx3djgUBu81LmJKjy1+3LosfOJZroFoR2piPumLnKqIS2hnaGzIW5Fib4BD7dQ5dM0Xjr2v14bWppeg5QtbOSNuoTBNZZlHVScxakhsJ4DB3FtVZi4NPVZSNr66xUKoJx6n6+AR7FuXgspHzTWHaDylNsT3ZfHXXSKQTrnwnmlwEPThQBLujSGIJ2LY6t+VIuDerMDR4EuyvHkuxPAtn68YtzAjZ16PvhJBozE1TSqpHDXESbNE+kBmCrPxE1R15zvo0Jt6cEdefSsIVayTdBRRMNR2arYMKCT6hayWyAzT1/D1ln0VJV1a/bGznb2x3cDNz7R1xxvxY/z6tvtPFot3+3ch+XtxnyrCxXWL2a/Tlzv4accmULa0dA9WS2aaE45sPriWuQ5VYyGr27kC3QW7MCX3hP2hk6yZbPeUhkCPw5vBuJuq2mwcose2i2Ah8FM7lZdx4R0jkcvL1MWtb7aEsMTrt/pSXOnqP/Mno9rZpSkaCMK9zQFOYTaXpaITpuvQ3oz8UYfsW8cUMMgK9X2x0moxZNbP0rj89TOjKonAz/lltpo3MnQvQ== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qHgzcPDTZGwgnGKc5ysKa1CWd4oevYk4O4/0duqZKQjR2ZEFQZXmw00yTuovlp7LkzPfKqwTtHNKFZ7EXuNjO3DY57hhq8LYDJoayDDAh+JI2T9qaaa/M5nSJ/1G8xXd24wCuSbsWL8dHMyo0dIqnFBG/A4VBkk+bTlXxWImYDlBy5PpWjfUc0fwNC8LDPgvqEmNE8L7uk2JShfXsz1ZtLjjP8WJhGSiPyFkEYj1FrBebDlvOVyUQ7vmq5GUT+YI5tW1pH8TBXPtJLN5CLRa7pC1/336TuIrJhe1eHGUeiDew9VciH+Mar35W3biwbze+H6fpdbLe/19Sqc6LukLVUg6sEAeiVuZdms09ZWk8DrmUfX0lyAT+hH02H7FXGomuamQAFbXrGaqnU1w1DZ9GqfhIGaERbXCi4KgaMTRa3RxEzKjl8spmhIDy/RcbmEBYG/GQ9fy0CW2yUh33UCuskzwbXye5RCkNdsfgFieWeTStgq4dIGuGbKAFAB4fyAx7vmL1ykqmTW9V5FUNHyXmum3Nv962k34yv8tADrnKM9hwVjVw5W2od179GC2VbCLLRWiilrtbu05zu7t2z/C67buODCUrA17LMiJeffQIZ+YYLqWBessL/VAJV/XfgoF/C/pgX/be19IkZEc1canORwutFBtB1HjeTPCpfOK9bSrfjEzMAQB4DfPV5B8EeF8cGQPrESblA9ouPQvPZQih1Cr1XiWh8QRTlxY8xGiTCpwlvHNt3RLVuKPFr/qoNSAwPpEQ3Rmh3e0HZYaCXBb9K9FetaXsaRnKU2IIwGPfrash/5fyqjnhb9Oek8MRk2m20bkwjMpEiQivclsvgACRuVVWuc8fwDMLHKLHRiBfw9MFgF/T7+tnf61y1WwC++jEdglluaJrD5DHAsUgS9X9JEpU8cDBEBQA1lLVRJGLdpqcjZHkRxd3hlUzxV38/uFJfkdAc/QM4PabaNdVECsnmOinq4/qzFsO1jYOZ/1kvh47E+yyI0wQiHFhAw/Mhfc/q7b6z4+/72BFhGkULyc3WlEjAptSUNLjYKnb/VOFlsgJNx+lV6zWGwcuTGBKvECguJyxpHFYsLaTS58Tc9UxP1puNpZJ4jqnR40fHeKRe6J+1IybbqWasZpHcokjpglga3XfSZkl3tLhC1LWnKUiTf1Y5DnXi41bo0TLQe8y2rVKTZGFL9Q4YaQk1NFlSBEMupHQ7anYT4A62NE3gddmo5tigr76C4sE1is6PpyqV6SfOfMGAB9S6Ye74gq3MFcW3KLpG6B1+1/FigPTBwThEr3M/V3OORSNzQ7GBg1avKBnkaDV369E24x7t3V5FDwm7fYxaSoqtgd6leSWPLeCiDm/YShGY7riXyJi2kt4o2+hvYbx9XU6lbQ9WBMZrKYayCf2xLAaUe+LI8xm0fr7ERPoLydYxO8rfVVKRe7ACJqa+Mvx/T9aPGBbX8xdOAi X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c3838997-74d1-4e09-f195-08da129fa328 X-MS-Exchange-CrossTenant-AuthSource: AS1PR01MB9564.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2022 22:50:07.5784 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0102MB2579 Subject: [FFmpeg-devel] [PATCH 2/7] avcodec/codec_internal: Add FFCodec.decode_sub 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: BGA2C+E5i5X7 This increases type-safety by avoiding conversions from/through void*. It also avoids the boilerplate "AVSubtitle *sub = data;" line for subtitle decoders. Its only downside is that it increases sizeof(FFCodec), yet this can be more than offset lateron. Signed-off-by: Andreas Rheinhardt --- libavcodec/assdec.c | 10 ++++------ libavcodec/ccaption_dec.c | 6 +++--- libavcodec/codec_internal.h | 11 ++++++++--- libavcodec/decode.c | 2 +- libavcodec/dvbsubdec.c | 8 +++----- libavcodec/dvdsubdec.c | 8 +++----- libavcodec/jacosubdec.c | 7 +++---- libavcodec/libaribb24.c | 6 +++--- libavcodec/libzvbi-teletextdec.c | 6 +++--- libavcodec/microdvddec.c | 7 +++---- libavcodec/movtextdec.c | 7 +++---- libavcodec/mpl2dec.c | 5 ++--- libavcodec/pgssubdec.c | 13 ++++++------- libavcodec/realtextdec.c | 7 +++---- libavcodec/samidec.c | 7 +++---- libavcodec/srtdec.c | 9 ++++----- libavcodec/subviewerdec.c | 7 +++---- libavcodec/tests/avcodec.c | 7 ++++--- libavcodec/textdec.c | 13 ++++++------- libavcodec/utils.c | 2 +- libavcodec/webvttdec.c | 7 +++---- libavcodec/xsubdec.c | 8 ++++---- 22 files changed, 76 insertions(+), 87 deletions(-) diff --git a/libavcodec/assdec.c b/libavcodec/assdec.c index 86d3e3e5a8..bf1260a947 100644 --- a/libavcodec/assdec.c +++ b/libavcodec/assdec.c @@ -40,11 +40,9 @@ static av_cold int ass_decode_init(AVCodecContext *avctx) return 0; } -static int ass_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr, - AVPacket *avpkt) +static int ass_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub_ptr, AVPacket *avpkt) { - AVSubtitle *sub = data; - if (avpkt->size <= 0) return avpkt->size; @@ -70,7 +68,7 @@ const FFCodec ff_ssa_decoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_ASS, .init = ass_decode_init, - .decode = ass_decode_frame, + .decode_sub = ass_decode_frame, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif @@ -82,7 +80,7 @@ const FFCodec ff_ass_decoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_ASS, .init = ass_decode_init, - .decode = ass_decode_frame, + .decode_sub = ass_decode_frame, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c index 371c8d18b7..32ee3a715d 100644 --- a/libavcodec/ccaption_dec.c +++ b/libavcodec/ccaption_dec.c @@ -838,10 +838,10 @@ static int process_cc608(CCaptionSubContext *ctx, uint8_t hi, uint8_t lo) return ret; } -static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt) +static int decode(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub, AVPacket *avpkt) { CCaptionSubContext *ctx = avctx->priv_data; - AVSubtitle *sub = data; int64_t in_time = sub->pts; int64_t start_time; int64_t end_time; @@ -955,6 +955,6 @@ const FFCodec ff_ccaption_decoder = { .init = init_decoder, .close = close_decoder, .flush = flush_decoder, - .decode = decode, + .decode_sub = decode, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/codec_internal.h b/libavcodec/codec_internal.h index 596cdbebd2..5c57c438f9 100644 --- a/libavcodec/codec_internal.h +++ b/libavcodec/codec_internal.h @@ -148,19 +148,24 @@ typedef struct FFCodec { int (*encode2)(struct AVCodecContext *avctx, struct AVPacket *avpkt, const struct AVFrame *frame, int *got_packet_ptr); /** - * Decode picture or subtitle data. + * Decode picture data. * * @param avctx codec context * @param outdata codec type dependent output struct * @param[out] got_frame_ptr decoder sets to 0 or 1 to indicate that a - * non-empty frame or subtitle was returned in - * outdata. + * non-empty frame was returned in outdata. * @param[in] avpkt AVPacket containing the data to be decoded * @return amount of bytes read from the packet on success, negative error * code on failure */ int (*decode)(struct AVCodecContext *avctx, void *outdata, int *got_frame_ptr, struct AVPacket *avpkt); + /** + * Decode subtitle data. Same as decode except that it uses + * a struct AVSubtitle structure for output. + */ + int (*decode_sub)(struct AVCodecContext *avctx, struct AVSubtitle *sub, + int *got_frame_ptr, struct AVPacket *avpkt); int (*close)(struct AVCodecContext *); /** * Encode API with decoupled frame/packet dataflow. This function is called diff --git a/libavcodec/decode.c b/libavcodec/decode.c index f9fdb935f6..b5b78b9ca2 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -862,7 +862,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, if (avctx->pkt_timebase.num && avpkt->pts != AV_NOPTS_VALUE) sub->pts = av_rescale_q(avpkt->pts, avctx->pkt_timebase, AV_TIME_BASE_Q); - ret = ffcodec(avctx->codec)->decode(avctx, sub, got_sub_ptr, pkt); + ret = ffcodec(avctx->codec)->decode_sub(avctx, sub, got_sub_ptr, pkt); if (pkt == avci->buffer_pkt) // did we recode? av_packet_unref(avci->buffer_pkt); if (ret < 0) { diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index 0731202aaf..c5391ea5ad 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -1607,14 +1607,12 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf, return 0; } -static int dvbsub_decode(AVCodecContext *avctx, - void *data, int *got_sub_ptr, - AVPacket *avpkt) +static int dvbsub_decode(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; DVBSubContext *ctx = avctx->priv_data; - AVSubtitle *sub = data; const uint8_t *p, *p_end; int segment_type; int page_id; @@ -1748,7 +1746,7 @@ const FFCodec ff_dvbsub_decoder = { .priv_data_size = sizeof(DVBSubContext), .init = dvbsub_init_decoder, .close = dvbsub_close_decoder, - .decode = dvbsub_decode, + .decode_sub = dvbsub_decode, .p.priv_class = &dvbsubdec_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index 734a387223..713170cdc2 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -548,14 +548,12 @@ static int append_to_cached_buf(AVCodecContext *avctx, return 0; } -static int dvdsub_decode(AVCodecContext *avctx, - void *data, int *data_size, - AVPacket *avpkt) +static int dvdsub_decode(AVCodecContext *avctx, AVSubtitle *sub, + int *data_size, AVPacket *avpkt) { DVDSubContext *ctx = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - AVSubtitle *sub = data; int appended = 0; int is_menu; @@ -762,7 +760,7 @@ const FFCodec ff_dvdsub_decoder = { .p.id = AV_CODEC_ID_DVD_SUBTITLE, .priv_data_size = sizeof(DVDSubContext), .init = dvdsub_init, - .decode = dvdsub_decode, + .decode_sub = dvdsub_decode, .flush = dvdsub_flush, .p.priv_class = &dvdsub_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/jacosubdec.c b/libavcodec/jacosubdec.c index 17a837ae70..0d8e601b28 100644 --- a/libavcodec/jacosubdec.c +++ b/libavcodec/jacosubdec.c @@ -162,11 +162,10 @@ static void jacosub_to_ass(AVCodecContext *avctx, AVBPrint *dst, const char *src } } -static int jacosub_decode_frame(AVCodecContext *avctx, - void *data, int *got_sub_ptr, AVPacket *avpkt) +static int jacosub_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub_ptr, AVPacket *avpkt) { int ret; - AVSubtitle *sub = data; const char *ptr = avpkt->data; FFASSDecoderContext *s = avctx->priv_data; @@ -200,7 +199,7 @@ const FFCodec ff_jacosub_decoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_JACOSUB, .init = ff_ass_subtitle_header_default, - .decode = jacosub_decode_frame, + .decode_sub = jacosub_decode_frame, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/libaribb24.c b/libavcodec/libaribb24.c index 1b565b2fc9..ab7e0e02d5 100644 --- a/libavcodec/libaribb24.c +++ b/libavcodec/libaribb24.c @@ -283,10 +283,10 @@ next_region: return ret; } -static int libaribb24_decode(AVCodecContext *avctx, void *data, int *got_sub_ptr, AVPacket *pkt) +static int libaribb24_decode(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub_ptr, AVPacket *pkt) { Libaribb24Context *b24 = avctx->priv_data; - AVSubtitle *sub = data; size_t parsed_data_size = 0; size_t decoded_subtitle_size = 0; const unsigned char *parsed_data = NULL; @@ -391,6 +391,6 @@ const FFCodec ff_libaribb24_decoder = { .priv_data_size = sizeof(Libaribb24Context), .init = libaribb24_init, .close = libaribb24_close, - .decode = libaribb24_decode, + .decode_sub = libaribb24_decode, .flush = libaribb24_flush, }; diff --git a/libavcodec/libzvbi-teletextdec.c b/libavcodec/libzvbi-teletextdec.c index 5ebf47f796..4920c61e0f 100644 --- a/libavcodec/libzvbi-teletextdec.c +++ b/libavcodec/libzvbi-teletextdec.c @@ -637,10 +637,10 @@ static int slice_to_vbi_lines(TeletextContext *ctx, uint8_t* buf, int size) return lines; } -static int teletext_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr, AVPacket *pkt) +static int teletext_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub_ptr, AVPacket *pkt) { TeletextContext *ctx = avctx->priv_data; - AVSubtitle *sub = data; int ret = 0; if (!ctx->vbi) { @@ -822,6 +822,6 @@ const FFCodec ff_libzvbi_teletext_decoder = { .priv_data_size = sizeof(TeletextContext), .init = teletext_init_decoder, .close = teletext_close_decoder, - .decode = teletext_decode_frame, + .decode_sub = teletext_decode_frame, .flush = teletext_flush, }; diff --git a/libavcodec/microdvddec.c b/libavcodec/microdvddec.c index 0863fe1494..1cd5d1d5f5 100644 --- a/libavcodec/microdvddec.c +++ b/libavcodec/microdvddec.c @@ -274,10 +274,9 @@ static void microdvd_close_no_persistent_tags(AVBPrint *new_line, } } -static int microdvd_decode_frame(AVCodecContext *avctx, - void *data, int *got_sub_ptr, AVPacket *avpkt) +static int microdvd_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub_ptr, AVPacket *avpkt) { - AVSubtitle *sub = data; AVBPrint new_line; char *line = avpkt->data; char *end = avpkt->data + avpkt->size; @@ -375,7 +374,7 @@ const FFCodec ff_microdvd_decoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_MICRODVD, .init = microdvd_init, - .decode = microdvd_decode_frame, + .decode_sub = microdvd_decode_frame, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c index 3ba7043180..c3e0a75e57 100644 --- a/libavcodec/movtextdec.c +++ b/libavcodec/movtextdec.c @@ -472,10 +472,9 @@ static int mov_text_init(AVCodecContext *avctx) { return ff_ass_subtitle_header_default(avctx); } -static int mov_text_decode_frame(AVCodecContext *avctx, - void *data, int *got_sub_ptr, AVPacket *avpkt) +static int mov_text_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub_ptr, AVPacket *avpkt) { - AVSubtitle *sub = data; MovTextContext *m = avctx->priv_data; int ret; AVBPrint buf; @@ -600,7 +599,7 @@ const FFCodec ff_movtext_decoder = { .priv_data_size = sizeof(MovTextContext), .p.priv_class = &mov_text_decoder_class, .init = mov_text_init, - .decode = mov_text_decode_frame, + .decode_sub = mov_text_decode_frame, .close = mov_text_decode_close, .flush = mov_text_flush, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/mpl2dec.c b/libavcodec/mpl2dec.c index bfcd72bf2d..490a3e6d45 100644 --- a/libavcodec/mpl2dec.c +++ b/libavcodec/mpl2dec.c @@ -63,12 +63,11 @@ static int mpl2_event_to_ass(AVBPrint *buf, const char *p) return 0; } -static int mpl2_decode_frame(AVCodecContext *avctx, void *data, +static int mpl2_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt) { int ret = 0; AVBPrint buf; - AVSubtitle *sub = data; const char *ptr = avpkt->data; FFASSDecoderContext *s = avctx->priv_data; @@ -87,7 +86,7 @@ const FFCodec ff_mpl2_decoder = { .p.long_name = NULL_IF_CONFIG_SMALL("MPL2 subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_MPL2, - .decode = mpl2_decode_frame, + .decode_sub = mpl2_decode_frame, .init = ff_ass_subtitle_header_default, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c index 4cd5e237f2..8b5eb5f816 100644 --- a/libavcodec/pgssubdec.c +++ b/libavcodec/pgssubdec.c @@ -494,10 +494,9 @@ static int parse_presentation_segment(AVCodecContext *avctx, * @param buf pointer to the packet to process * @param buf_size size of packet to process */ -static int display_end_segment(AVCodecContext *avctx, void *data, +static int display_end_segment(AVCodecContext *avctx, AVSubtitle *sub, const uint8_t *buf, int buf_size) { - AVSubtitle *sub = data; PGSSubContext *ctx = avctx->priv_data; int64_t pts; PGSSubPalette *palette; @@ -590,8 +589,8 @@ static int display_end_segment(AVCodecContext *avctx, void *data, return 1; } -static int decode(AVCodecContext *avctx, void *data, int *got_sub_ptr, - AVPacket *avpkt) +static int decode(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -639,7 +638,7 @@ static int decode(AVCodecContext *avctx, void *data, int *got_sub_ptr, ret = parse_object_segment(avctx, buf, segment_length); break; case PRESENTATION_SEGMENT: - ret = parse_presentation_segment(avctx, buf, segment_length, ((AVSubtitle*)(data))->pts); + ret = parse_presentation_segment(avctx, buf, segment_length, sub->pts); break; case WINDOW_SEGMENT: /* @@ -657,7 +656,7 @@ static int decode(AVCodecContext *avctx, void *data, int *got_sub_ptr, ret = AVERROR_INVALIDDATA; break; } - ret = display_end_segment(avctx, data, buf, segment_length); + ret = display_end_segment(avctx, sub, buf, segment_length); if (ret >= 0) *got_sub_ptr = ret; break; @@ -699,7 +698,7 @@ const FFCodec ff_pgssub_decoder = { .priv_data_size = sizeof(PGSSubContext), .init = init_decoder, .close = close_decoder, - .decode = decode, + .decode_sub = decode, .p.priv_class = &pgsdec_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/realtextdec.c b/libavcodec/realtextdec.c index 4c0694c8ed..1612554461 100644 --- a/libavcodec/realtextdec.c +++ b/libavcodec/realtextdec.c @@ -56,11 +56,10 @@ static int rt_event_to_ass(AVBPrint *buf, const char *p) return 0; } -static int realtext_decode_frame(AVCodecContext *avctx, - void *data, int *got_sub_ptr, AVPacket *avpkt) +static int realtext_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub_ptr, AVPacket *avpkt) { int ret = 0; - AVSubtitle *sub = data; const char *ptr = avpkt->data; FFASSDecoderContext *s = avctx->priv_data; AVBPrint buf; @@ -80,7 +79,7 @@ const FFCodec ff_realtext_decoder = { .p.long_name = NULL_IF_CONFIG_SMALL("RealText subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_REALTEXT, - .decode = realtext_decode_frame, + .decode_sub = realtext_decode_frame, .init = ff_ass_subtitle_header_default, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), diff --git a/libavcodec/samidec.c b/libavcodec/samidec.c index 2c8c31e4f6..f2cf5783af 100644 --- a/libavcodec/samidec.c +++ b/libavcodec/samidec.c @@ -132,10 +132,9 @@ end: return ret; } -static int sami_decode_frame(AVCodecContext *avctx, - void *data, int *got_sub_ptr, AVPacket *avpkt) +static int sami_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub_ptr, AVPacket *avpkt) { - AVSubtitle *sub = data; const char *ptr = avpkt->data; SAMIContext *sami = avctx->priv_data; @@ -189,7 +188,7 @@ const FFCodec ff_sami_decoder = { .priv_data_size = sizeof(SAMIContext), .init = sami_init, .close = sami_close, - .decode = sami_decode_frame, + .decode_sub = sami_decode_frame, .flush = sami_flush, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/srtdec.c b/libavcodec/srtdec.c index 5de360b821..aa975d16c7 100644 --- a/libavcodec/srtdec.c +++ b/libavcodec/srtdec.c @@ -55,10 +55,9 @@ static int srt_to_ass(AVCodecContext *avctx, AVBPrint *dst, return ff_htmlmarkup_to_ass(avctx, dst, in); } -static int srt_decode_frame(AVCodecContext *avctx, - void *data, int *got_sub_ptr, AVPacket *avpkt) +static int srt_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub_ptr, AVPacket *avpkt) { - AVSubtitle *sub = data; AVBPrint buffer; int x1 = -1, y1 = -1, x2 = -1, y2 = -1; int ret; @@ -97,7 +96,7 @@ const FFCodec ff_srt_decoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_SUBRIP, .init = ff_ass_subtitle_header_default, - .decode = srt_decode_frame, + .decode_sub = srt_decode_frame, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, @@ -111,7 +110,7 @@ const FFCodec ff_subrip_decoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_SUBRIP, .init = ff_ass_subtitle_header_default, - .decode = srt_decode_frame, + .decode_sub = srt_decode_frame, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/subviewerdec.c b/libavcodec/subviewerdec.c index cbc3056c90..9001dd3d45 100644 --- a/libavcodec/subviewerdec.c +++ b/libavcodec/subviewerdec.c @@ -47,11 +47,10 @@ static int subviewer_event_to_ass(AVBPrint *buf, const char *p) return 0; } -static int subviewer_decode_frame(AVCodecContext *avctx, - void *data, int *got_sub_ptr, AVPacket *avpkt) +static int subviewer_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub_ptr, AVPacket *avpkt) { int ret = 0; - AVSubtitle *sub = data; const char *ptr = avpkt->data; FFASSDecoderContext *s = avctx->priv_data; AVBPrint buf; @@ -71,7 +70,7 @@ const FFCodec ff_subviewer_decoder = { .p.long_name = NULL_IF_CONFIG_SMALL("SubViewer subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_SUBVIEWER, - .decode = subviewer_decode_frame, + .decode_sub = subviewer_decode_frame, .init = ff_ass_subtitle_header_default, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), diff --git a/libavcodec/tests/avcodec.c b/libavcodec/tests/avcodec.c index 075ad632c4..f77d7aebe9 100644 --- a/libavcodec/tests/avcodec.c +++ b/libavcodec/tests/avcodec.c @@ -135,12 +135,13 @@ int main(void){ codec->capabilities & AV_CODEC_CAP_ENCODER_FLUSH) ERR("Frame-threaded encoder %s claims to support flushing\n"); } else { - if (codec->type == AVMEDIA_TYPE_SUBTITLE && !codec2->decode) - ERR("Subtitle decoder %s does not implement decode callback\n"); + if (codec->type == AVMEDIA_TYPE_SUBTITLE && !codec2->decode_sub) + ERR("Subtitle decoder %s does not implement decode_sub callback\n"); if (codec->type == AVMEDIA_TYPE_SUBTITLE && codec2->bsfs) ERR("Automatic bitstream filtering unsupported for subtitles; " "yet decoder %s has it set\n"); - if (!!codec2->decode + !!codec2->receive_frame != 1) + if (codec->type != AVMEDIA_TYPE_SUBTITLE != + !!codec2->decode + !!codec2->receive_frame) ERR("Decoder %s does not implement exactly one decode API.\n"); if (codec->capabilities & (AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_VARIABLE_FRAME_SIZE | diff --git a/libavcodec/textdec.c b/libavcodec/textdec.c index 95450a18f7..48e7e14602 100644 --- a/libavcodec/textdec.c +++ b/libavcodec/textdec.c @@ -45,12 +45,11 @@ static const AVOption options[] = { { NULL } }; -static int text_decode_frame(AVCodecContext *avctx, void *data, +static int text_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt) { int ret = 0; AVBPrint buf; - AVSubtitle *sub = data; const char *ptr = avpkt->data; TextContext *text = avctx->priv_data; @@ -87,7 +86,7 @@ const FFCodec ff_text_decoder = { .priv_data_size = sizeof(TextContext), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_TEXT, - .decode = text_decode_frame, + .decode_sub = text_decode_frame, .init = ff_ass_subtitle_header_default, .p.priv_class = &textsub_decoder_class, .flush = text_flush, @@ -111,7 +110,7 @@ const FFCodec ff_vplayer_decoder = { .priv_data_size = sizeof(TextContext), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_VPLAYER, - .decode = text_decode_frame, + .decode_sub = text_decode_frame, .init = linebreak_init, .p.priv_class = &textsub_decoder_class, .flush = text_flush, @@ -126,7 +125,7 @@ const FFCodec ff_stl_decoder = { .priv_data_size = sizeof(TextContext), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_STL, - .decode = text_decode_frame, + .decode_sub = text_decode_frame, .init = linebreak_init, .p.priv_class = &textsub_decoder_class, .flush = text_flush, @@ -141,7 +140,7 @@ const FFCodec ff_pjs_decoder = { .priv_data_size = sizeof(TextContext), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_PJS, - .decode = text_decode_frame, + .decode_sub = text_decode_frame, .init = linebreak_init, .p.priv_class = &textsub_decoder_class, .flush = text_flush, @@ -156,7 +155,7 @@ const FFCodec ff_subviewer1_decoder = { .priv_data_size = sizeof(TextContext), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_SUBVIEWER1, - .decode = text_decode_frame, + .decode_sub = text_decode_frame, .init = linebreak_init, .p.priv_class = &textsub_decoder_class, .flush = text_flush, diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 1666f5dabb..34d97022b7 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -80,7 +80,7 @@ int av_codec_is_encoder(const AVCodec *avcodec) int av_codec_is_decoder(const AVCodec *avcodec) { const FFCodec *const codec = ffcodec(avcodec); - return codec && (codec->decode || codec->receive_frame); + return codec && (codec->decode || codec->decode_sub || codec->receive_frame); } int ff_set_dimensions(AVCodecContext *s, int width, int height) diff --git a/libavcodec/webvttdec.c b/libavcodec/webvttdec.c index 4ebbc63074..8cb7fea070 100644 --- a/libavcodec/webvttdec.c +++ b/libavcodec/webvttdec.c @@ -80,11 +80,10 @@ static int webvtt_event_to_ass(AVBPrint *buf, const char *p) return 0; } -static int webvtt_decode_frame(AVCodecContext *avctx, - void *data, int *got_sub_ptr, AVPacket *avpkt) +static int webvtt_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub_ptr, AVPacket *avpkt) { int ret = 0; - AVSubtitle *sub = data; const char *ptr = avpkt->data; FFASSDecoderContext *s = avctx->priv_data; AVBPrint buf; @@ -104,7 +103,7 @@ const FFCodec ff_webvtt_decoder = { .p.long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_WEBVTT, - .decode = webvtt_decode_frame, + .decode_sub = webvtt_decode_frame, .init = ff_ass_subtitle_header_default, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c index cb7b7b7cab..c2c1b920cc 100644 --- a/libavcodec/xsubdec.c +++ b/libavcodec/xsubdec.c @@ -47,11 +47,11 @@ static int64_t parse_timecode(const uint8_t *buf, int64_t packet_time) { return ms - packet_time; } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr, - AVPacket *avpkt) { +static int decode_frame(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub_ptr, AVPacket *avpkt) +{ const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - AVSubtitle *sub = data; AVSubtitleRect *rect; const uint8_t *buf_end = buf + buf_size; uint8_t *bitmap; @@ -160,6 +160,6 @@ const FFCodec ff_xsub_decoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_XSUB, .init = decode_init, - .decode = decode_frame, + .decode_sub = decode_frame, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; From patchwork Wed Mar 30 22:49:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 35097 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c05:b0:7a:e998:b410 with SMTP id bw5csp1066521pzb; Wed, 30 Mar 2022 15:50:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWG+b2d8PJRRhHQFh334RI4T5fXnE/HBCIngiqgXv7oXXfgFheXGy9dxsiLN6Ya6cQfXNe X-Received: by 2002:a05:6402:254e:b0:418:d759:dc48 with SMTP id l14-20020a056402254e00b00418d759dc48mr13752405edb.104.1648680633111; Wed, 30 Mar 2022 15:50:33 -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 g23-20020a50ee17000000b00418c2b5bd98si21117201eds.122.2022.03.30.15.50.32; Wed, 30 Mar 2022 15:50:33 -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=VJMrRIQl; 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 70F5468B255; Thu, 31 Mar 2022 01:50:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2079.outbound.protection.outlook.com [40.92.89.79]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6BBF16801DD for ; Thu, 31 Mar 2022 01:50:17 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=da1olD9qSIIAKMYGexbx6wf5FvNgCM+cQGOYBqwRtSf5A6hZKnNRg3+UHAutfRbYKVJQ+iAp39xh5tV9n8lP0JC4i14ZsghEBHb9PGua20HlV6+3hcC9wiY8HgVOTPby22u7N4BNz+wQ6Ft8/B8y5JFaSQCIolHKCxGnxliF/iLQHKoZquE9dnz6hyL8qQLia3KIoTDHPLGPPr/LpYwBWY7Nw5/u6aQwRf/9nsx4+Xtf0H8LRpDwWL5fsoE20VQlI3ieIQIDZD53A7X1DKXPZzH21jE4S0iDj+NziGWW97XYZcvpAxNn85VZ1eptqspOpL0FD8ZraIJ+F2RVILF7lg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BV/w5YEcnifrCuDismCe9ssDfZNrfUXLCO88t9Z49Qw=; b=kdyhyL4TPrpXIl28LEbFEq2JRVk9fd0i/C2Qq6ORoHNlJp+3Yp8jIwlZM2VGmDFyNcnK//x6JRUyuy3/Ks3Kd8UA66MQrWYH/taC/RgcN5HAuwjA+QtsdhBzw2tYRIyb5JOMlfqEv64Xy8INIPZQncW+LE2cG/XeZkQjXG8KACeHmDWJw7Vp3WB8tXyGRYGloZ8XXy/TccPqlZaO+OwXxMjsyvym2QJtGVfTfsBgfBSZ7a52hN9BLqsxmD1+GejzbVJQHkxN98dBlri6JvUOpbO9zHkJ70JYCgnt8MJZOMOhrg2ez/0FXZSJBFgVL/NmV2TPHqf8xHFBnpNEHgS7Xg== 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=BV/w5YEcnifrCuDismCe9ssDfZNrfUXLCO88t9Z49Qw=; b=VJMrRIQlDTqkPTXT6UpWu9NqVmyM6b5J4Hf/jpK55jG3DFVH3xaNarwfgR7UXB5No1Ya2I7YRCSF2uRXi894P32zD5kbwleIM2/ue3IO66mrBncnIYAoJWyL/p5zYrYBunPvTrEYUXuQrhaG2fL41CtTNtTDN2X2z5DXO4fKD0tU1pym0ZS8/LF2ld6tBe95rDv5YYw9COdFsOn/o3EoxdMLfu9JDp1/nmz8L5FCJ1kNk/UDGBspibMcW49m5cxYgjluBGqV9PnfVqZ5BGYeG5uERSugVq7Swm8AJ3X9KGPYKz+YYXLnuDbd2V0CxKiOBonWCai+Ns+6irBMzY0p+A== Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) by AM5PR0102MB2579.eurprd01.prod.exchangelabs.com (2603:10a6:206:d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17; Wed, 30 Mar 2022 22:50:12 +0000 Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8]) by AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8%3]) with mapi id 15.20.5102.022; Wed, 30 Mar 2022 22:50:12 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 31 Mar 2022 00:49:54 +0200 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [6F52CJ+kzazrPzdTSEDYzevkDzYbUw23] X-ClientProxiedBy: ZRAP278CA0002.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:10::12) To AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) X-Microsoft-Original-Message-ID: <20220330224958.538843-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 96776316-5806-4b56-1016-08da129fa603 X-MS-Exchange-SLBlob-MailProps: GjjEsbJCp85ADFkcnlM7G/ZV6y5pMHahj3Jm2O3IfH/TdhtmTAMeXrSQRYs4Y1DSsWOnyrfpX8mfIfGrC2V789xY3CXUAetCyL1eDosu9Qe8PzkMMl4otHZBs6jfj+eG64w77FFzkhXSGKs3v+O66QT/QCasVnPM2CwU47ifiClOQ3YEikhcPr6dUUXeq+6gVx6qHCRj2XUzY34wlTVeqkhvCdwyAjbX7J89VptiaHcLzOMSKnp//nNAhSYb/NEvgnPtWrXsEqLSWjF03/loVxfyDLwV+BhBlMEsmFAo73vGfiLAc1D63uOhS61ii10dJ7qSqiMydO4aEibk96MIgkcHiirlzGCxHRAFma2nH6n/JhOYIOB6HLJSCyF1h5kjNfKBAe2RflTs7PFinl/CfT2BjW0GSabAbOG4DPQTT8IB/FFG3LsX7Jn3alrulAfmBDKTZiHUIxDnBOAEcYWxiTKoECW6a6zohj0LPuISw5qB23kMa5/mESyLwqi3P5v+RH3XKSyD0nv7QB+E9lswAAs43+1bLGhsm4QafIGu/GapWaVnyjKcN5igGxqHxM8nQF2fSd0K6uiAsQh/u3CC3x+TKDvAMFmui0JlvLkOhW6T42vTiPz/GNXrVeiXXr96U1FvBM8MSwImJdosA8+XUy37rBEF7EC6gPQYSMMh+r1inGWzZOmKYP9/6FI2ozqv0MjH2LB6juhUBZdNOkEq/tZ5Wg64R5dWDhlBCtYGk2pESKYpbjrwtbb2jqI6ja1Pf7yA/JsB/cD2mEy3PTQMmZOVxlybcNFHmsNh/UegMTLX8SeK+gaQgRanAh7xOdCi2YLaxYpDtEcLHdT8xzdYFtnA8DoiHrRpNC9ORH2wvjidsicPQb9kjA== X-MS-TrafficTypeDiagnostic: AM5PR0102MB2579:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Agimwu6P83y2v4N3Vx5qrzs62GvCr5EN9Xh8b2v1G5YP+ilJKHmpto4tVG095fgDw8pi6Ce4/jZnWYlXyZYfVwVm3xHUFpDIsiQwc+W4i7muktlnVYoFK32W/QHaw/AXQ2v1F+G7gnQRvcot55aV1eCGdFOMse+TzFvrIdt4OdoZ2OS8oTP//DTBmuHYbKGaigHb86lgtNebnUq9aWPcJfKvycIm88tbBR9QUHnPsgfTaG8XCWoi2KjDOPDc6K3iK57LzyVI7hTD6coIE57rkkQ2SmLcR7rbc6gO8y5J3oFPXX1zRX9GXU80M/yJtKIm6DK0kM6Zkta/78Yi0knfZ/5UblZ/WhiniNRVktlmzT0Y81GmrEzdGVcVfTqI0YA7qelY868J+kmc1oDn+4nPgVw4AmPrHa4DUSBQFwVn8yZsyVuw0me23LW1BharIk5RIKpCSE8KkwACte1e6BantNlWt6FolT+BKZ+FR0sKj3uHa5f512t268d36qrIEDNpf5aDeyzCr5rswRqs2AvUEhHvOn37OX/gFT6XHwfyLBTsGUmbuaWwSA08RHBNe49+OkqpZfaOODuGw1FPxlH6hQ== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FmmGdTBMRh1TrtF2khWCPQTr6RcybTxci+zJf8Qca6KYNgmBgIBTiaZCLCxMNmljSoFQj6pj8oEWN6iF+qSw1wtKkSaWZ4heXt0A1h98s15G2ytp4EU2Gc8nrm6S0FFiSleErq9J+G7OwiRHIDzeDDMoLU51TbZ6rCyVAKHJ7N5kl/0d1hgcnHJ/20Q6VWiCp3vSPFj9Wa2jKIU31ObSQsIAj3eBZalw2nRe2cS16rVYdm6RhelZcgvpBePQyi5/JlElCL1tIwcTwnB3ReofX0Yp1+DM/tecpfZulR6epAV4xvIHrEEvyrcM5Mh90LYncDf03lcXq/f9LP2G7wLb0TJiEv34LhD/8y6r9XtG+yZp6wLzsKpFVcqZ3ckch9K0wNOBbW/2vwsYx4VJRGBUIYfkhayPnjMhgirkqajU8kpeLTBWdLIEMG/goOitiQzIo9PS1YtEXYtMhhjNHjOT0RqKD76UpWHxixax79MDDcCYfs/RNGSjj9+2M9xUrMXzmhW4s5B6e9sJUEvvU7SYeDkdKJjl5Y7VubyHEq5YbXanU0HbKQJMF14ETVxEmSEIxjoy2ivBxOTEK0M/kXt5iUF0SWjde+AVR8XbfiMvaAZYvij/X0po/2wPQ829RpNxXAp6TYzUeGjaF7sQCz7q9g5J5VecQU59XYk+ureIKwoCUoeabSRbyC9Vl1qXGN69702bFmK0+EQ/xyg4Z2uEHpa4er0UCPbcddAsDViOzrkn+RE2xyHouzoKDb8ZZUjjl8A7OEHKxuU7AYuOKsZba0epCzAnB5aXGfEaVt2m2/vP7rRXevLP40iSu412cEvVnTxDE1NBCtSqAueyB6UtsMfe7rr/Kri9jd8COl4FfqOujmrFCf3YFfsa+HzelY6ul+viRDUmBGSUNWXWny+xXj8xiyUh5m006wSbFbqSyCRDoXDspiZAtljlwZ+H3A0sR/9wCYB9sZ9irk3OXlE2EjiUYvH0BXo29KylEe2eLJK6Y0maZ5dxEP8XdhV/w4savifjuzg1natFY/8pt3j0asPedp5H8lPLTSr47+JNe9YR+uYE+yCDNWfwS2w95TDn3FqVYtA2NaHzQPjfyU6BMXSbl0e1Men1mCvnRtiHCGroLHIHlytTnBE+BVoHe21/s5UOX5iKQB+AxPEZRF5f8S1tkadap7IiVTyNHadHwOVlqj8BZfWlI2XWNm39H+HNOu52V2bHgmQ7mL6rD3OAiVbFB71VFCI5EmKUPlh6YTw/U/XG3/2VuiJ8CypzspaN3A+csSWxPta1V9LBh8mLASKizCDasosic7eiyB5j++LukzlsLh3dc4sLIjp8DAcwprA9XKOhjatUDG2W0MYW1WyjkCHEUaeamowzn9hPz4HnTl0A1QVPSeH2ihJPtqTMbcRLfZpX8Y0bSZveW1OEnEs8eS47Z/bNjl8lk99IhstxS+YWky+JKn/zkSJDxnI3 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96776316-5806-4b56-1016-08da129fa603 X-MS-Exchange-CrossTenant-AuthSource: AS1PR01MB9564.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2022 22:50:12.6145 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0102MB2579 Subject: [FFmpeg-devel] [PATCH 3/7] avcodec/codec_internal: Make FFCodec.decode use AVFrame* 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: UoJucpRerPg5 Signed-off-by: Andreas Rheinhardt --- Could be squashed into the preceding commit. libavcodec/012v.c | 3 +-- libavcodec/4xm.c | 3 +-- libavcodec/8bps.c | 3 +-- libavcodec/8svx.c | 3 +-- libavcodec/aacdec.c | 2 +- libavcodec/aacdec_template.c | 14 +++++++------- libavcodec/aasc.c | 7 +++---- libavcodec/ac3dec.c | 3 +-- libavcodec/adpcm.c | 3 +-- libavcodec/adxdec.c | 3 +-- libavcodec/agm.c | 3 +-- libavcodec/aic.c | 6 +++--- libavcodec/alac.c | 3 +-- libavcodec/aliaspixdec.c | 5 ++--- libavcodec/alsdec.c | 5 ++--- libavcodec/amrnbdec.c | 3 +-- libavcodec/amrwbdec.c | 3 +-- libavcodec/anm.c | 7 +++---- libavcodec/ansi.c | 7 +++---- libavcodec/apedec.c | 3 +-- libavcodec/aptxdec.c | 3 +-- libavcodec/arbc.c | 3 +-- libavcodec/argo.c | 4 ++-- libavcodec/asvdec.c | 5 ++--- libavcodec/atrac1.c | 3 +-- libavcodec/atrac3.c | 6 ++---- libavcodec/atrac3plusdec.c | 3 +-- libavcodec/atrac9dec.c | 3 +-- libavcodec/audiotoolboxdec.c | 3 +-- libavcodec/aura.c | 6 ++---- libavcodec/av1dec.c | 2 +- libavcodec/avrndec.c | 3 +-- libavcodec/avs.c | 6 ++---- libavcodec/avuidec.c | 3 +-- libavcodec/bethsoftvideo.c | 7 +++---- libavcodec/bfi.c | 3 +-- libavcodec/bink.c | 4 ++-- libavcodec/bintext.c | 7 +++---- libavcodec/bitpacked_dec.c | 5 ++--- libavcodec/bmp.c | 6 ++---- libavcodec/bmvaudio.c | 3 +-- libavcodec/bmvvideo.c | 5 ++--- libavcodec/brenderpix.c | 6 ++---- libavcodec/c93.c | 4 ++-- libavcodec/cavsdec.c | 12 ++++++------ libavcodec/cdgraphics.c | 5 ++--- libavcodec/cdtoons.c | 4 ++-- libavcodec/cdxl.c | 3 +-- libavcodec/cfhd.c | 5 ++--- libavcodec/cinepak.c | 7 +++---- libavcodec/clearvideo.c | 4 ++-- libavcodec/cljrdec.c | 6 ++---- libavcodec/cllc.c | 3 +-- libavcodec/cngdec.c | 3 +-- libavcodec/codec_internal.h | 6 +++--- libavcodec/cook.c | 3 +-- libavcodec/cpia.c | 6 +++--- libavcodec/cri.c | 3 +-- libavcodec/cscd.c | 6 +++--- libavcodec/cyuv.c | 6 ++---- libavcodec/dcadec.c | 3 +-- libavcodec/dds.c | 3 +-- libavcodec/dfa.c | 6 ++---- libavcodec/dfpwmdec.c | 5 ++--- libavcodec/diracdec.c | 10 +++++----- libavcodec/dnxhddec.c | 3 +-- libavcodec/dolby_e.c | 4 ++-- libavcodec/dpcm.c | 3 +-- libavcodec/dpx.c | 7 ++----- libavcodec/dsddec.c | 3 +-- libavcodec/dsicinaudio.c | 3 +-- libavcodec/dsicinvideo.c | 7 +++---- libavcodec/dss_sp.c | 3 +-- libavcodec/dstdec.c | 3 +-- libavcodec/dvaudiodec.c | 3 +-- libavcodec/dvdec.c | 3 +-- libavcodec/dxa.c | 4 ++-- libavcodec/dxtory.c | 5 ++--- libavcodec/dxv.c | 3 +-- libavcodec/eacmv.c | 6 ++---- libavcodec/eamad.c | 6 ++---- libavcodec/eatgq.c | 6 ++---- libavcodec/eatgv.c | 6 ++---- libavcodec/eatqi.c | 6 ++---- libavcodec/escape124.c | 6 ++---- libavcodec/escape130.c | 3 +-- libavcodec/evrcdec.c | 3 +-- libavcodec/exr.c | 3 +-- libavcodec/fastaudio.c | 3 +-- libavcodec/ffv1dec.c | 5 +++-- libavcodec/ffwavesynth.c | 5 ++--- libavcodec/fic.c | 4 ++-- libavcodec/fitsdec.c | 4 ++-- libavcodec/flacdec.c | 3 +-- libavcodec/flashsv.c | 4 ++-- libavcodec/flicvideo.c | 23 +++++++++++------------ libavcodec/fmvc.c | 3 +-- libavcodec/fraps.c | 6 ++---- libavcodec/frwu.c | 5 ++--- libavcodec/g2meet.c | 3 +-- libavcodec/g722dec.c | 3 +-- libavcodec/g723_1dec.c | 3 +-- libavcodec/g726.c | 3 +-- libavcodec/g729dec.c | 5 ++--- libavcodec/gdv.c | 3 +-- libavcodec/gemdec.c | 6 ++---- libavcodec/gifdec.c | 5 +++-- libavcodec/gsmdec.c | 3 +-- libavcodec/h261dec.c | 3 +-- libavcodec/h263dec.c | 5 ++--- libavcodec/h263dec.h | 5 ++--- libavcodec/h264dec.c | 3 +-- libavcodec/hapdec.c | 3 +-- libavcodec/hcadec.c | 3 +-- libavcodec/hcom.c | 3 +-- libavcodec/hevcdec.c | 8 ++++---- libavcodec/hnm4video.c | 3 +-- libavcodec/hq_hqa.c | 3 +-- libavcodec/hqx.c | 5 ++--- libavcodec/huffyuvdec.c | 5 ++--- libavcodec/idcinvideo.c | 6 ++---- libavcodec/iff.c | 6 ++---- libavcodec/ilbcdec.c | 3 +-- libavcodec/imc.c | 3 +-- libavcodec/imm4.c | 3 +-- libavcodec/imm5.c | 3 +-- libavcodec/imx.c | 4 ++-- libavcodec/indeo2.c | 6 ++---- libavcodec/indeo3.c | 5 ++--- libavcodec/interplayacm.c | 3 +-- libavcodec/interplayvideo.c | 6 ++---- libavcodec/ivi.c | 7 +++---- libavcodec/ivi.h | 4 ++-- libavcodec/jpeg2000dec.c | 3 +-- libavcodec/jvdec.c | 6 +++--- libavcodec/kgv1dec.c | 5 ++--- libavcodec/kmvc.c | 5 ++--- libavcodec/lagarith.c | 5 ++--- libavcodec/lcldec.c | 4 ++-- libavcodec/libaomdec.c | 5 ++--- libavcodec/libcelt_dec.c | 3 +-- libavcodec/libcodec2.c | 3 +-- libavcodec/libdavs2.c | 3 +-- libavcodec/libfdk-aacdec.c | 3 +-- libavcodec/libgsmdec.c | 3 +-- libavcodec/libilbc.c | 3 +-- libavcodec/libopencore-amr.c | 6 ++---- libavcodec/libopenh264dec.c | 3 +-- libavcodec/libopenjpegdec.c | 6 ++---- libavcodec/libopusdec.c | 3 +-- libavcodec/librsvgdec.c | 4 ++-- libavcodec/libspeexdec.c | 3 +-- libavcodec/libuavs3d.c | 8 ++++---- libavcodec/libvorbisdec.c | 5 ++--- libavcodec/libvpxdec.c | 5 ++--- libavcodec/loco.c | 6 ++---- libavcodec/lscrdec.c | 7 +++---- libavcodec/m101.c | 5 ++--- libavcodec/mace.c | 3 +-- libavcodec/magicyuv.c | 3 +-- libavcodec/mdec.c | 6 ++---- libavcodec/midivid.c | 4 ++-- libavcodec/mimic.c | 6 +++--- libavcodec/mjpegbdec.c | 7 +++---- libavcodec/mlpdec.c | 4 ++-- libavcodec/mmvideo.c | 7 +++---- libavcodec/mobiclip.c | 6 +++--- libavcodec/motionpixels.c | 7 +++---- libavcodec/mpc7.c | 3 +-- libavcodec/mpc8.c | 3 +-- libavcodec/mpeg12dec.c | 6 ++---- libavcodec/mpegaudiodec_template.c | 13 ++++++------- libavcodec/mscc.c | 6 ++---- libavcodec/msp2dec.c | 6 ++---- libavcodec/msrle.c | 7 +++---- libavcodec/mss1.c | 6 +++--- libavcodec/mss2.c | 5 ++--- libavcodec/mss3.c | 8 ++++---- libavcodec/mss4.c | 8 ++++---- libavcodec/msvideo1.c | 7 +++---- libavcodec/mv30.c | 3 +-- libavcodec/mvcdec.c | 5 ++--- libavcodec/mvha.c | 6 ++---- libavcodec/mwsc.c | 6 ++---- libavcodec/mxpegdec.c | 7 +++---- libavcodec/nellymoserdec.c | 3 +-- libavcodec/notchlc.c | 6 ++---- libavcodec/nuv.c | 5 ++--- libavcodec/on2avc.c | 3 +-- libavcodec/opusdec.c | 3 +-- libavcodec/pafaudio.c | 3 +-- libavcodec/pafvideo.c | 4 ++-- libavcodec/pcm-bluray.c | 3 +-- libavcodec/pcm-dvd.c | 3 +-- libavcodec/pcm.c | 5 ++--- libavcodec/pcx.c | 5 ++--- libavcodec/pgxdec.c | 3 +-- libavcodec/photocd.c | 3 +-- libavcodec/pictordec.c | 6 ++---- libavcodec/pixlet.c | 3 +-- libavcodec/pngdec.c | 12 ++++-------- libavcodec/pnmdec.c | 3 +-- libavcodec/proresdec2.c | 5 ++--- libavcodec/prosumer.c | 3 +-- libavcodec/psd.c | 4 +--- libavcodec/ptx.c | 6 +++--- libavcodec/qcelpdec.c | 3 +-- libavcodec/qdm2.c | 3 +-- libavcodec/qdmc.c | 3 +-- libavcodec/qdrw.c | 6 ++---- libavcodec/qpeg.c | 6 ++---- libavcodec/qsvdec.c | 3 +-- libavcodec/qtrle.c | 7 +++---- libavcodec/r210dec.c | 5 ++--- libavcodec/ra144dec.c | 3 +-- libavcodec/ra288.c | 3 +-- libavcodec/ralf.c | 5 ++--- libavcodec/rasc.c | 6 ++---- libavcodec/rawdec.c | 6 ++---- libavcodec/rl2.c | 6 ++---- libavcodec/roqvideodec.c | 7 +++---- libavcodec/rpza.c | 7 +++---- libavcodec/rscc.c | 5 ++--- libavcodec/rv10.c | 5 ++--- libavcodec/rv34.c | 6 ++---- libavcodec/rv34.h | 3 ++- libavcodec/s302m.c | 3 +-- libavcodec/sanm.c | 4 ++-- libavcodec/sbcdec.c | 6 ++---- libavcodec/scpr.c | 7 +++---- libavcodec/screenpresso.c | 3 +-- libavcodec/sga.c | 3 +-- libavcodec/sgidec.c | 6 ++---- libavcodec/sgirledec.c | 3 +-- libavcodec/sheervideo.c | 6 ++---- libavcodec/shorten.c | 3 +-- libavcodec/sipr.c | 3 +-- libavcodec/siren.c | 3 +-- libavcodec/smacker.c | 9 ++++----- libavcodec/smc.c | 7 +++---- libavcodec/snowdec.c | 5 ++--- libavcodec/sonic.c | 6 ++---- libavcodec/speedhq.c | 6 ++---- libavcodec/speexdec.c | 3 +-- libavcodec/sunrast.c | 3 +-- libavcodec/svq1dec.c | 3 +-- libavcodec/svq3.c | 8 ++++---- libavcodec/takdec.c | 3 +-- libavcodec/targa.c | 6 ++---- libavcodec/targa_y216dec.c | 3 +-- libavcodec/tdsc.c | 3 +-- libavcodec/tiertexseqv.c | 7 +++---- libavcodec/tiff.c | 7 +++---- libavcodec/tmv.c | 3 +-- libavcodec/truemotion1.c | 7 +++---- libavcodec/truemotion2.c | 7 +++---- libavcodec/truemotion2rt.c | 3 +-- libavcodec/truespeech.c | 3 +-- libavcodec/tscc.c | 6 +++--- libavcodec/tscc2.c | 4 ++-- libavcodec/tta.c | 3 +-- libavcodec/twinvq.c | 3 +-- libavcodec/twinvq.h | 2 +- libavcodec/txd.c | 6 +++--- libavcodec/ulti.c | 7 +++---- libavcodec/utvideodec.c | 5 ++--- libavcodec/v210dec.c | 5 ++--- libavcodec/v210x.c | 5 ++--- libavcodec/v308dec.c | 3 +-- libavcodec/v408dec.c | 3 +-- libavcodec/v410dec.c | 3 +-- libavcodec/vb.c | 5 ++--- libavcodec/vble.c | 5 ++--- libavcodec/vc1dec.c | 3 +-- libavcodec/vcr1.c | 3 +-- libavcodec/vima.c | 3 +-- libavcodec/vmdaudio.c | 3 +-- libavcodec/vmdvideo.c | 6 ++---- libavcodec/vmnc.c | 6 +++--- libavcodec/vorbisdec.c | 3 +-- libavcodec/vp3.c | 8 +++----- libavcodec/vp56.c | 6 +++--- libavcodec/vp56.h | 4 ++-- libavcodec/vp8.c | 16 ++++++++-------- libavcodec/vp8.h | 4 ++-- libavcodec/vp9.c | 6 +++--- libavcodec/vqavideo.c | 7 +++---- libavcodec/wavpack.c | 4 ++-- libavcodec/wcmv.c | 6 ++---- libavcodec/webp.c | 7 +++---- libavcodec/wmadec.c | 7 +++---- libavcodec/wmalosslessdec.c | 6 +++--- libavcodec/wmaprodec.c | 21 +++++++-------------- libavcodec/wmavoice.c | 6 +++--- libavcodec/wnv1.c | 6 ++---- libavcodec/wrapped_avframe.c | 5 ++--- libavcodec/ws-snd1.c | 3 +-- libavcodec/xan.c | 6 ++---- libavcodec/xbmdec.c | 3 +-- libavcodec/xfacedec.c | 6 ++---- libavcodec/xl.c | 6 ++---- libavcodec/xpmdec.c | 3 +-- libavcodec/xwddec.c | 3 +-- libavcodec/xxan.c | 7 +++---- libavcodec/y41pdec.c | 3 +-- libavcodec/ylc.c | 6 ++---- libavcodec/yop.c | 6 +++--- libavcodec/yuv4dec.c | 3 +-- libavcodec/zerocodec.c | 3 +-- libavcodec/zmbv.c | 4 ++-- 310 files changed, 588 insertions(+), 903 deletions(-) diff --git a/libavcodec/012v.c b/libavcodec/012v.c index 9c7fb56d59..4d57b57082 100644 --- a/libavcodec/012v.c +++ b/libavcodec/012v.c @@ -36,12 +36,11 @@ static av_cold int zero12v_decode_init(AVCodecContext *avctx) return 0; } -static int zero12v_decode_frame(AVCodecContext *avctx, void *data, +static int zero12v_decode_frame(AVCodecContext *avctx, AVFrame *pic, int *got_frame, AVPacket *avpkt) { int line, ret; const int width = avctx->width; - AVFrame *pic = data; uint16_t *y, *u, *v; const uint8_t *line_end, *src = avpkt->data; int stride = avctx->width * 8 / 3; diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index 1c4446fe13..413b4f9330 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -834,13 +834,12 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; FourXContext *const f = avctx->priv_data; - AVFrame *picture = data; int i, frame_4cc, frame_size, ret; if (buf_size < 20) diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c index 3e8cd2591f..d5146043ac 100644 --- a/libavcodec/8bps.c +++ b/libavcodec/8bps.c @@ -54,10 +54,9 @@ typedef struct EightBpsContext { uint32_t pal[256]; } EightBpsContext; -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; EightBpsContext * const c = avctx->priv_data; diff --git a/libavcodec/8svx.c b/libavcodec/8svx.c index 7317ea3117..937800304c 100644 --- a/libavcodec/8svx.c +++ b/libavcodec/8svx.c @@ -86,11 +86,10 @@ static void delta_decode(uint8_t *dst, const uint8_t *src, int src_size, } /** decode a frame */ -static int eightsvx_decode_frame(AVCodecContext *avctx, void *data, +static int eightsvx_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { EightSvxContext *esc = avctx->priv_data; - AVFrame *frame = data; int channels = avctx->ch_layout.nb_channels; int buf_size; int ch, ret; diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 6f560909f3..5fc6738b38 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -480,7 +480,7 @@ static int read_audio_mux_element(struct LATMContext *latmctx, } -static int latm_decode_frame(AVCodecContext *avctx, void *out, +static int latm_decode_frame(AVCodecContext *avctx, AVFrame *out, int *got_frame_ptr, AVPacket *avpkt) { struct LATMContext *latmctx = avctx->priv_data; diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index 524f656cff..463bf92fc0 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -3235,7 +3235,7 @@ static int aac_decode_er_frame(AVCodecContext *avctx, void *data, return 0; } -static int aac_decode_frame_int(AVCodecContext *avctx, void *data, +static int aac_decode_frame_int(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, GetBitContext *gb, const AVPacket *avpkt) { @@ -3248,7 +3248,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data, int payload_alignment; uint8_t che_presence[4][MAX_ELEM_ID] = {{0}}; - ac->frame = data; + ac->frame = frame; if (show_bits(gb, 12) == 0xfff) { if ((err = parse_adts_frame_header(ac, gb)) < 0) { @@ -3437,9 +3437,9 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data, &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO); if (is_dmono) { if (ac->dmono_mode == 1) - ((AVFrame *)data)->data[1] =((AVFrame *)data)->data[0]; + frame->data[1] = frame->data[0]; else if (ac->dmono_mode == 2) - ((AVFrame *)data)->data[0] =((AVFrame *)data)->data[1]; + frame->data[0] = frame->data[1]; } return 0; @@ -3448,7 +3448,7 @@ fail: return err; } -static int aac_decode_frame(AVCodecContext *avctx, void *data, +static int aac_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { AACContext *ac = avctx->priv_data; @@ -3495,10 +3495,10 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data, case AOT_ER_AAC_LTP: case AOT_ER_AAC_LD: case AOT_ER_AAC_ELD: - err = aac_decode_er_frame(avctx, data, got_frame_ptr, &gb); + err = aac_decode_er_frame(avctx, frame, got_frame_ptr, &gb); break; default: - err = aac_decode_frame_int(avctx, data, got_frame_ptr, &gb, avpkt); + err = aac_decode_frame_int(avctx, frame, got_frame_ptr, &gb, avpkt); } if (err < 0) return err; diff --git a/libavcodec/aasc.c b/libavcodec/aasc.c index 9b1b64106e..a462e2f05e 100644 --- a/libavcodec/aasc.c +++ b/libavcodec/aasc.c @@ -78,9 +78,8 @@ static av_cold int aasc_decode_init(AVCodecContext *avctx) return 0; } -static int aasc_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int aasc_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -134,7 +133,7 @@ static int aasc_decode_frame(AVCodecContext *avctx, memcpy(s->frame->data[1], s->palette, s->palette_size); *got_frame = 1; - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; /* report that the buffer was completely consumed */ diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index c4ba781d9e..fe330d0d3b 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -1481,10 +1481,9 @@ static int decode_audio_block(AC3DecodeContext *s, int blk, int offset) /** * Decode a single AC-3 frame. */ -static int ac3_decode_frame(AVCodecContext * avctx, void *data, +static int ac3_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size, full_buf_size = avpkt->size; AC3DecodeContext *s = avctx->priv_data; diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index f5ad14d331..ccb625ab54 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -1062,10 +1062,9 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb, return nb_samples; } -static int adpcm_decode_frame(AVCodecContext *avctx, void *data, +static int adpcm_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; ADPCMDecodeContext *c = avctx->priv_data; diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c index fd540f7d54..870f485726 100644 --- a/libavcodec/adxdec.c +++ b/libavcodec/adxdec.c @@ -93,10 +93,9 @@ static int adx_decode(ADXContext *c, int16_t *out, int offset, return 0; } -static int adx_decode_frame(AVCodecContext *avctx, void *data, +static int adx_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; int buf_size = avpkt->size; ADXContext *c = avctx->priv_data; int16_t **samples; diff --git a/libavcodec/agm.c b/libavcodec/agm.c index 28b66cd30d..795b34a415 100644 --- a/libavcodec/agm.c +++ b/libavcodec/agm.c @@ -1094,13 +1094,12 @@ static int decode_huffman2(AVCodecContext *avctx, int header, int size) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { AGMContext *s = avctx->priv_data; GetBitContext *gb = &s->gb; GetByteContext *gbyte = &s->gbyte; - AVFrame *frame = data; int w, h, width, height, header; unsigned compressed_size; long skip; diff --git a/libavcodec/aic.c b/libavcodec/aic.c index fa99205533..7f124f5126 100644 --- a/libavcodec/aic.c +++ b/libavcodec/aic.c @@ -381,8 +381,8 @@ static int aic_decode_slice(AICContext *ctx, int mb_x, int mb_y, return 0; } -static int aic_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int aic_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { AICContext *ctx = avctx->priv_data; const uint8_t *buf = avpkt->data; @@ -392,7 +392,7 @@ static int aic_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, int x, y, ret; int slice_size; - ctx->frame = data; + ctx->frame = frame; ctx->frame->pict_type = AV_PICTURE_TYPE_I; ctx->frame->key_frame = 1; diff --git a/libavcodec/alac.c b/libavcodec/alac.c index 90bd246fa6..b2d47e27c1 100644 --- a/libavcodec/alac.c +++ b/libavcodec/alac.c @@ -413,11 +413,10 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index, return 0; } -static int alac_decode_frame(AVCodecContext *avctx, void *data, +static int alac_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { ALACContext *alac = avctx->priv_data; - AVFrame *frame = data; enum AlacRawDataBlockType element; int channels; int ch, ret, got_end; diff --git a/libavcodec/aliaspixdec.c b/libavcodec/aliaspixdec.c index 1c156c3825..8dc579079f 100644 --- a/libavcodec/aliaspixdec.c +++ b/libavcodec/aliaspixdec.c @@ -28,10 +28,9 @@ #define ALIAS_HEADER_SIZE 10 -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *f, + int *got_frame, AVPacket *avpkt) { - AVFrame *f = data; GetByteContext gb; int width, height, ret, bits_pixel, pixel; uint8_t *out_buf; diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index 8f0b061602..1a517916d5 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -1791,11 +1791,10 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame) /** Decode an ALS frame. */ -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame_ptr, AVPacket *avpkt) { ALSDecContext *ctx = avctx->priv_data; - AVFrame *frame = data; ALSSpecificConfig *sconf = &ctx->sconf; const uint8_t *buffer = avpkt->data; int buffer_size = avpkt->size; diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c index 86fbd17700..72482b25e4 100644 --- a/libavcodec/amrnbdec.c +++ b/libavcodec/amrnbdec.c @@ -955,12 +955,11 @@ static void postfilter(AMRContext *p, float *lpc, float *buf_out) /// @} -static int amrnb_decode_frame(AVCodecContext *avctx, void *data, +static int amrnb_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { AMRChannelsContext *s = avctx->priv_data; // pointer to private data - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int ret; diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c index 6f019e3a6f..e12078e028 100644 --- a/libavcodec/amrwbdec.c +++ b/libavcodec/amrwbdec.c @@ -1102,11 +1102,10 @@ static void update_sub_state(AMRWBContext *ctx) LP_ORDER_16k * sizeof(float)); } -static int amrwb_decode_frame(AVCodecContext *avctx, void *data, +static int amrwb_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { AMRWBChannelsContext *s = avctx->priv_data; - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int sub, i, ret; diff --git a/libavcodec/anm.c b/libavcodec/anm.c index 8b05a20eb8..5e07247992 100644 --- a/libavcodec/anm.c +++ b/libavcodec/anm.c @@ -108,9 +108,8 @@ exhausted: return 1; } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { AnmContext *s = avctx->priv_data; const int buf_size = avpkt->size; @@ -176,7 +175,7 @@ static int decode_frame(AVCodecContext *avctx, memcpy(s->frame->data[1], s->palette, AVPALETTE_SIZE); *got_frame = 1; - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; return buf_size; diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c index 0ccd351794..80b3df0d92 100644 --- a/libavcodec/ansi.c +++ b/libavcodec/ansi.c @@ -354,9 +354,8 @@ static int execute_code(AVCodecContext * avctx, int c) return 0; } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { AnsiContext *s = avctx->priv_data; uint8_t *buf = avpkt->data; @@ -463,7 +462,7 @@ static int decode_frame(AVCodecContext *avctx, } *got_frame = 1; - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; return buf_size; } diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index f7f8a88994..89b6bb04e5 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -1461,10 +1461,9 @@ static void ape_unpack_stereo(APEContext *ctx, int count) } } -static int ape_decode_frame(AVCodecContext *avctx, void *data, +static int ape_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; APEContext *s = avctx->priv_data; uint8_t *sample8; diff --git a/libavcodec/aptxdec.c b/libavcodec/aptxdec.c index 3e30336964..03eb27cd5c 100644 --- a/libavcodec/aptxdec.c +++ b/libavcodec/aptxdec.c @@ -137,11 +137,10 @@ static int aptx_decode_samples(AptXContext *ctx, return ret; } -static int aptx_decode_frame(AVCodecContext *avctx, void *data, +static int aptx_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { AptXContext *s = avctx->priv_data; - AVFrame *frame = data; int pos, opos, channel, sample, ret; if (avpkt->size < s->block_size) { diff --git a/libavcodec/arbc.c b/libavcodec/arbc.c index 04d10c33bb..d5171ee41e 100644 --- a/libavcodec/arbc.c +++ b/libavcodec/arbc.c @@ -116,11 +116,10 @@ static int fill_tileX(AVCodecContext *avctx, int tile_width, int tile_height, return pixels_overwritten; } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { ARBCContext *s = avctx->priv_data; - AVFrame *frame = data; int ret, nb_segments; int prev_pixels = avctx->width * avctx->height; diff --git a/libavcodec/argo.c b/libavcodec/argo.c index 44ab7a22b7..5c52b35b61 100644 --- a/libavcodec/argo.c +++ b/libavcodec/argo.c @@ -599,7 +599,7 @@ static int decode_rle(AVCodecContext *avctx, AVFrame *frame) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt) { ArgoContext *s = avctx->priv_data; @@ -665,7 +665,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, if (avctx->pix_fmt == AV_PIX_FMT_PAL8) memcpy(frame->data[1], s->pal, AVPALETTE_SIZE); - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; frame->pict_type = s->key ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; diff --git a/libavcodec/asvdec.c b/libavcodec/asvdec.c index 3bed903516..0cce79d8b8 100644 --- a/libavcodec/asvdec.c +++ b/libavcodec/asvdec.c @@ -213,13 +213,12 @@ static inline void idct_put(ASV1Context *a, AVFrame *frame, int mb_x, int mb_y) } } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { ASV1Context *const a = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - AVFrame *const p = data; int mb_x, mb_y, ret; if (buf_size * 8LL < a->mb_height * a->mb_width * 13LL) diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c index aaf58da7d6..9c953d8772 100644 --- a/libavcodec/atrac1.c +++ b/libavcodec/atrac1.c @@ -273,10 +273,9 @@ static void at1_subband_synthesis(AT1Ctx *q, AT1SUCtx* su, float *pOut) } -static int atrac1_decode_frame(AVCodecContext *avctx, void *data, +static int atrac1_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; AT1Ctx *q = avctx->priv_data; diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c index be53fe44f9..123acdc7e3 100644 --- a/libavcodec/atrac3.c +++ b/libavcodec/atrac3.c @@ -790,10 +790,9 @@ static int al_decode_frame(AVCodecContext *avctx, const uint8_t *databuf, return 0; } -static int atrac3_decode_frame(AVCodecContext *avctx, void *data, +static int atrac3_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; ATRAC3Context *q = avctx->priv_data; @@ -830,10 +829,9 @@ static int atrac3_decode_frame(AVCodecContext *avctx, void *data, return avctx->block_align; } -static int atrac3al_decode_frame(AVCodecContext *avctx, void *data, +static int atrac3al_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; int ret; frame->nb_samples = SAMPLES_PER_FRAME; diff --git a/libavcodec/atrac3plusdec.c b/libavcodec/atrac3plusdec.c index 435fe75152..3524ed22e3 100644 --- a/libavcodec/atrac3plusdec.c +++ b/libavcodec/atrac3plusdec.c @@ -331,11 +331,10 @@ static void reconstruct_frame(ATRAC3PContext *ctx, Atrac3pChanUnitCtx *ch_unit, FFSWAP(Atrac3pWaveSynthParams *, ch_unit->waves_info, ch_unit->waves_info_prev); } -static int atrac3p_decode_frame(AVCodecContext *avctx, void *data, +static int atrac3p_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { ATRAC3PContext *ctx = avctx->priv_data; - AVFrame *frame = data; int i, ret, ch_unit_id, ch_block = 0, out_ch_index = 0, channels_to_process; float **samples_p = (float **)frame->extended_data; diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c index 4af5f7e0ba..5d51c23f19 100644 --- a/libavcodec/atrac9dec.c +++ b/libavcodec/atrac9dec.c @@ -787,12 +787,11 @@ imdct: return 0; } -static int atrac9_decode_frame(AVCodecContext *avctx, void *data, +static int atrac9_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { int ret; GetBitContext gb; - AVFrame *frame = data; ATRAC9Context *s = avctx->priv_data; const int frames = FFMIN(avpkt->size / s->avg_frame_size, s->frame_count); diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c index 3b5fc942bb..3f6089f29a 100644 --- a/libavcodec/audiotoolboxdec.c +++ b/libavcodec/audiotoolboxdec.c @@ -478,11 +478,10 @@ static void ffat_copy_samples(AVCodecContext *avctx, AVFrame *frame) } } -static int ffat_decode(AVCodecContext *avctx, void *data, +static int ffat_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { ATDecodeContext *at = avctx->priv_data; - AVFrame *frame = data; int pkt_size = avpkt->size; OSStatus ret; AudioBufferList out_buffers; diff --git a/libavcodec/aura.c b/libavcodec/aura.c index 290fd83de4..1896013cfb 100644 --- a/libavcodec/aura.c +++ b/libavcodec/aura.c @@ -38,11 +38,9 @@ static av_cold int aura_decode_init(AVCodecContext *avctx) return 0; } -static int aura_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *pkt) +static int aura_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *pkt) { - AVFrame *frame = data; uint8_t *Y, *U, *V; uint8_t val; int x, y, ret; diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index 0646b86908..517fa701f4 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -999,7 +999,7 @@ static int get_current_frame(AVCodecContext *avctx) return ret; } -static int av1_decode_frame(AVCodecContext *avctx, void *frame, +static int av1_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt) { AV1DecContext *s = avctx->priv_data; diff --git a/libavcodec/avrndec.c b/libavcodec/avrndec.c index dd00a6fd39..8f716a129e 100644 --- a/libavcodec/avrndec.c +++ b/libavcodec/avrndec.c @@ -50,11 +50,10 @@ static av_cold int init(AVCodecContext *avctx) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { AVRnContext *a = avctx->priv_data; - AVFrame *p = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int y, ret, true_height; diff --git a/libavcodec/avs.c b/libavcodec/avs.c index 1367491ea2..a26a3bbc00 100644 --- a/libavcodec/avs.c +++ b/libavcodec/avs.c @@ -43,15 +43,13 @@ typedef enum { } AvsVideoSubType; -static int -avs_decode_frame(AVCodecContext * avctx, - void *data, int *got_frame, AVPacket *avpkt) +static int avs_decode_frame(AVCodecContext * avctx, AVFrame *picture, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; const uint8_t *buf_end = avpkt->data + avpkt->size; int buf_size = avpkt->size; AvsContext *const avs = avctx->priv_data; - AVFrame *picture = data; AVFrame *const p = avs->frame; const uint8_t *table, *vect; uint8_t *out; diff --git a/libavcodec/avuidec.c b/libavcodec/avuidec.c index b9ead39d6f..a86b0d5668 100644 --- a/libavcodec/avuidec.c +++ b/libavcodec/avuidec.c @@ -31,11 +31,10 @@ static av_cold int avui_decode_init(AVCodecContext *avctx) return 0; } -static int avui_decode_frame(AVCodecContext *avctx, void *data, +static int avui_decode_frame(AVCodecContext *avctx, AVFrame *pic, int *got_frame, AVPacket *avpkt) { int ret; - AVFrame *pic = data; const uint8_t *src = avpkt->data, *extradata = avctx->extradata; const uint8_t *srca; uint8_t *y, *u, *v, *a; diff --git a/libavcodec/bethsoftvideo.c b/libavcodec/bethsoftvideo.c index 74dce58f73..44175805f1 100644 --- a/libavcodec/bethsoftvideo.c +++ b/libavcodec/bethsoftvideo.c @@ -67,9 +67,8 @@ static int set_palette(BethsoftvidContext *ctx) return 0; } -static int bethsoftvid_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int bethsoftvid_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { BethsoftvidContext * vid = avctx->priv_data; char block_type; @@ -144,7 +143,7 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx, } end: - if ((ret = av_frame_ref(data, vid->frame)) < 0) + if ((ret = av_frame_ref(rframe, vid->frame)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/bfi.c b/libavcodec/bfi.c index 6e838df02b..fb22b0e1b1 100644 --- a/libavcodec/bfi.c +++ b/libavcodec/bfi.c @@ -48,10 +48,9 @@ static av_cold int bfi_decode_init(AVCodecContext *avctx) return 0; } -static int bfi_decode_frame(AVCodecContext *avctx, void *data, +static int bfi_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { - AVFrame *frame = data; GetByteContext g; int buf_size = avpkt->size; BFIContext *bfi = avctx->priv_data; diff --git a/libavcodec/bink.c b/libavcodec/bink.c index 9b83d73348..941c2244a7 100644 --- a/libavcodec/bink.c +++ b/libavcodec/bink.c @@ -1253,10 +1253,10 @@ end: return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *pkt) { BinkContext * const c = avctx->priv_data; - AVFrame *frame = data; GetBitContext gb; int plane, plane_idx, ret; int bits_count = pkt->size << 3; diff --git a/libavcodec/bintext.c b/libavcodec/bintext.c index 0fad8305f8..183fea5b84 100644 --- a/libavcodec/bintext.c +++ b/libavcodec/bintext.c @@ -140,9 +140,8 @@ static void draw_char(AVCodecContext *avctx, int c, int a) } } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { XbinContext *s = avctx->priv_data; const uint8_t *buf = avpkt->data; @@ -153,7 +152,7 @@ static int decode_frame(AVCodecContext *avctx, if ((avctx->width / FONT_WIDTH) * (avctx->height / s->font_height) / 256 > buf_size) return AVERROR_INVALIDDATA; - s->frame = data; + s->frame = frame; s->x = s->y = 0; if ((ret = ff_get_buffer(avctx, s->frame, 0)) < 0) return ret; diff --git a/libavcodec/bitpacked_dec.c b/libavcodec/bitpacked_dec.c index 3301a72752..3b8f2d8fd9 100644 --- a/libavcodec/bitpacked_dec.c +++ b/libavcodec/bitpacked_dec.c @@ -122,12 +122,11 @@ static av_cold int bitpacked_init_decoder(AVCodecContext *avctx) return 0; } -static int bitpacked_decode(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int bitpacked_decode(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { struct BitpackedContext *bc = avctx->priv_data; int buf_size = avpkt->size; - AVFrame *frame = data; int res; res = bc->decode(avctx, frame, avpkt); diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c index d8ff7b8342..c971ff0f59 100644 --- a/libavcodec/bmp.c +++ b/libavcodec/bmp.c @@ -28,13 +28,11 @@ #include "internal.h" #include "msrledec.h" -static int bmp_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int bmp_decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - AVFrame *p = data; unsigned int fsize, hsize; int width, height; unsigned int depth; diff --git a/libavcodec/bmvaudio.c b/libavcodec/bmvaudio.c index be04f7be94..d21370938f 100644 --- a/libavcodec/bmvaudio.c +++ b/libavcodec/bmvaudio.c @@ -39,10 +39,9 @@ static av_cold int bmv_aud_decode_init(AVCodecContext *avctx) return 0; } -static int bmv_aud_decode_frame(AVCodecContext *avctx, void *data, +static int bmv_aud_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int blocks = 0, total_blocks, i; diff --git a/libavcodec/bmvvideo.c b/libavcodec/bmvvideo.c index 94e9734e38..baa8e37e46 100644 --- a/libavcodec/bmvvideo.c +++ b/libavcodec/bmvvideo.c @@ -196,11 +196,10 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame, } } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *pkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *pkt) { BMVDecContext * const c = avctx->priv_data; - AVFrame *frame = data; int type, scr_off; int i, ret; uint8_t *srcptr, *outptr; diff --git a/libavcodec/brenderpix.c b/libavcodec/brenderpix.c index 8cb0c16d4d..98db6e6950 100644 --- a/libavcodec/brenderpix.c +++ b/libavcodec/brenderpix.c @@ -130,11 +130,9 @@ static int pix_decode_header(PixHeader *out, GetByteContext *pgb) return 0; } -static int pix_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int pix_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { - AVFrame *frame = data; - int ret, i; GetByteContext gb; diff --git a/libavcodec/c93.c b/libavcodec/c93.c index bc66ad6b0c..a5dee1d1a3 100644 --- a/libavcodec/c93.c +++ b/libavcodec/c93.c @@ -120,7 +120,7 @@ static inline void draw_n_color(uint8_t *out, int stride, int width, } } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -251,7 +251,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, memcpy(newpic->data[1], oldpic->data[1], 256 * 4); } - if ((ret = av_frame_ref(data, newpic)) < 0) + if ((ret = av_frame_ref(rframe, newpic)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 760dd792cb..6e424f4763 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -1226,8 +1226,8 @@ static void cavs_flush(AVCodecContext * avctx) h->got_keyframe = 0; } -static int cavs_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int cavs_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { AVSContext *h = avctx->priv_data; const uint8_t *buf = avpkt->data; @@ -1241,7 +1241,7 @@ static int cavs_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, if (buf_size == 0) { if (!h->low_delay && h->DPB[0].f->data[0]) { *got_frame = 1; - av_frame_move_ref(data, h->DPB[0].f); + av_frame_move_ref(rframe, h->DPB[0].f); } return 0; } @@ -1274,7 +1274,7 @@ static int cavs_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return AVERROR_INVALIDDATA; frame_start ++; if (*got_frame) - av_frame_unref(data); + av_frame_unref(rframe); *got_frame = 0; if (!h->got_keyframe) break; @@ -1285,13 +1285,13 @@ static int cavs_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, *got_frame = 1; if (h->cur.f->pict_type != AV_PICTURE_TYPE_B) { if (h->DPB[!h->low_delay].f->data[0]) { - if ((ret = av_frame_ref(data, h->DPB[!h->low_delay].f)) < 0) + if ((ret = av_frame_ref(rframe, h->DPB[!h->low_delay].f)) < 0) return ret; } else { *got_frame = 0; } } else { - av_frame_move_ref(data, h->cur.f); + av_frame_move_ref(rframe, h->cur.f); } break; case EXT_START_CODE: diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c index 5797134d10..8d72e6d87c 100644 --- a/libavcodec/cdgraphics.c +++ b/libavcodec/cdgraphics.c @@ -262,15 +262,14 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data, } -static int cdg_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, AVPacket *avpkt) +static int cdg_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { GetByteContext gb; int buf_size = avpkt->size; int ret; uint8_t command, inst; uint8_t cdg_data[CDG_DATA_SIZE] = {0}; - AVFrame *frame = data; CDGraphicsContext *cc = avctx->priv_data; if (buf_size < CDG_MINIMUM_PKT_SIZE) { diff --git a/libavcodec/cdtoons.c b/libavcodec/cdtoons.c index e99d703e53..1b1c1f827e 100644 --- a/libavcodec/cdtoons.c +++ b/libavcodec/cdtoons.c @@ -151,7 +151,7 @@ static int cdtoons_render_sprite(AVCodecContext *avctx, const uint8_t *data, return 0; } -static int cdtoons_decode_frame(AVCodecContext *avctx, void *data, +static int cdtoons_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt) { CDToonsContext *c = avctx->priv_data; @@ -398,7 +398,7 @@ done: memcpy(c->frame->data[1], c->pal, AVPALETTE_SIZE); - if ((ret = av_frame_ref(data, c->frame)) < 0) + if ((ret = av_frame_ref(rframe, c->frame)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/cdxl.c b/libavcodec/cdxl.c index d11106a4e4..34481fe2a3 100644 --- a/libavcodec/cdxl.c +++ b/libavcodec/cdxl.c @@ -243,11 +243,10 @@ static void cdxl_decode_ham8(CDXLVideoContext *c, AVFrame *frame) } } -static int cdxl_decode_frame(AVCodecContext *avctx, void *data, +static int cdxl_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *pkt) { CDXLVideoContext *c = avctx->priv_data; - AVFrame * const p = data; int ret, w, h, encoding, aligned_width, buf_size = pkt->size; const uint8_t *buf = pkt->data; diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c index 97cfdebba2..ab074043c1 100644 --- a/libavcodec/cfhd.c +++ b/libavcodec/cfhd.c @@ -373,13 +373,12 @@ static int alloc_buffers(AVCodecContext *avctx) return 0; } -static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int cfhd_decode(AVCodecContext *avctx, AVFrame *pic, + int *got_frame, AVPacket *avpkt) { CFHDContext *s = avctx->priv_data; CFHDDSPContext *dsp = &s->dsp; GetByteContext gb; - AVFrame *const pic = data; int ret = 0, i, j, plane, got_buffer = 0; int16_t *coeff_data; diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c index d215e0c11c..9bc7a681e5 100644 --- a/libavcodec/cinepak.c +++ b/libavcodec/cinepak.c @@ -449,9 +449,8 @@ static av_cold int cinepak_decode_init(AVCodecContext *avctx) return 0; } -static int cinepak_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int cinepak_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int ret = 0, buf_size = avpkt->size; @@ -489,7 +488,7 @@ static int cinepak_decode_frame(AVCodecContext *avctx, if (s->palette_video) memcpy (s->frame->data[1], s->pal, AVPALETTE_SIZE); - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index 8400fafd78..4e54ccb680 100644 --- a/libavcodec/clearvideo.c +++ b/libavcodec/clearvideo.c @@ -499,7 +499,7 @@ static void extend_edges(AVFrame *buf, int tile_size) } } -static int clv_decode_frame(AVCodecContext *avctx, void *data, +static int clv_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -638,7 +638,7 @@ static int clv_decode_frame(AVCodecContext *avctx, void *data, c->pic->pict_type = AV_PICTURE_TYPE_P; } - if ((ret = av_frame_ref(data, c->pic)) < 0) + if ((ret = av_frame_ref(rframe, c->pic)) < 0) return ret; FFSWAP(AVFrame *, c->pic, c->prev); diff --git a/libavcodec/cljrdec.c b/libavcodec/cljrdec.c index 47b75186c0..e3a278f16f 100644 --- a/libavcodec/cljrdec.c +++ b/libavcodec/cljrdec.c @@ -29,14 +29,12 @@ #include "get_bits.h" #include "internal.h" -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; GetBitContext gb; - AVFrame * const p = data; int x, y, ret; if (avctx->height <= 0 || avctx->width <= 0) { diff --git a/libavcodec/cllc.c b/libavcodec/cllc.c index dd7c6fcad6..f01498310a 100644 --- a/libavcodec/cllc.c +++ b/libavcodec/cllc.c @@ -355,11 +355,10 @@ static int decode_yuv_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) return 0; } -static int cllc_decode_frame(AVCodecContext *avctx, void *data, +static int cllc_decode_frame(AVCodecContext *avctx, AVFrame *pic, int *got_picture_ptr, AVPacket *avpkt) { CLLCContext *ctx = avctx->priv_data; - AVFrame *pic = data; uint8_t *src = avpkt->data; uint32_t info_tag, info_offset; int data_size; diff --git a/libavcodec/cngdec.c b/libavcodec/cngdec.c index e59aa2e60e..f396d5a5d0 100644 --- a/libavcodec/cngdec.c +++ b/libavcodec/cngdec.c @@ -102,10 +102,9 @@ static void cng_decode_flush(AVCodecContext *avctx) p->inited = 0; } -static int cng_decode_frame(AVCodecContext *avctx, void *data, +static int cng_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; CNGContext *p = avctx->priv_data; int buf_size = avpkt->size; int ret, i; diff --git a/libavcodec/codec_internal.h b/libavcodec/codec_internal.h index 5c57c438f9..4e8c06a49e 100644 --- a/libavcodec/codec_internal.h +++ b/libavcodec/codec_internal.h @@ -148,17 +148,17 @@ typedef struct FFCodec { int (*encode2)(struct AVCodecContext *avctx, struct AVPacket *avpkt, const struct AVFrame *frame, int *got_packet_ptr); /** - * Decode picture data. + * Decode to an AVFrame. * * @param avctx codec context - * @param outdata codec type dependent output struct + * @param frame AVFrame for output * @param[out] got_frame_ptr decoder sets to 0 or 1 to indicate that a * non-empty frame was returned in outdata. * @param[in] avpkt AVPacket containing the data to be decoded * @return amount of bytes read from the packet on success, negative error * code on failure */ - int (*decode)(struct AVCodecContext *avctx, void *outdata, + int (*decode)(struct AVCodecContext *avctx, struct AVFrame *frame, int *got_frame_ptr, struct AVPacket *avpkt); /** * Decode subtitle data. Same as decode except that it uses diff --git a/libavcodec/cook.c b/libavcodec/cook.c index c305f5e56d..783623d7db 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -978,10 +978,9 @@ static int decode_subpacket(COOKContext *q, COOKSubpacket *p, } -static int cook_decode_frame(AVCodecContext *avctx, void *data, +static int cook_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; COOKContext *q = avctx->priv_data; diff --git a/libavcodec/cpia.c b/libavcodec/cpia.c index e19160a506..1b50aa9d30 100644 --- a/libavcodec/cpia.c +++ b/libavcodec/cpia.c @@ -48,8 +48,8 @@ typedef struct { } CpiaContext; -static int cpia_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, AVPacket* avpkt) +static int cpia_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket* avpkt) { CpiaContext* const cpia = avctx->priv_data; int i,j,ret; @@ -185,7 +185,7 @@ static int cpia_decode_frame(AVCodecContext *avctx, } *got_frame = 1; - if ((ret = av_frame_ref(data, cpia->frame)) < 0) + if ((ret = av_frame_ref(rframe, cpia->frame)) < 0) return ret; return avpkt->size; diff --git a/libavcodec/cri.c b/libavcodec/cri.c index 4757a1da03..b1922d5e9b 100644 --- a/libavcodec/cri.c +++ b/libavcodec/cri.c @@ -170,7 +170,7 @@ static void unpack_10bit(GetByteContext *gb, uint16_t *dst, int shift, } } -static int cri_decode_frame(AVCodecContext *avctx, void *data, +static int cri_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { CRIContext *s = avctx->priv_data; @@ -178,7 +178,6 @@ static int cri_decode_frame(AVCodecContext *avctx, void *data, int ret, bps, hflip = 0, vflip = 0; AVFrameSideData *rotation; int compressed = 0; - AVFrame *p = data; s->data = NULL; s->data_size = 0; diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c index fd513d8402..9b87c1b91d 100644 --- a/libavcodec/cscd.c +++ b/libavcodec/cscd.c @@ -65,8 +65,8 @@ static void add_frame_default(AVFrame *f, const uint8_t *src, } } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -123,7 +123,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } *got_frame = 1; - if ((ret = av_frame_ref(data, c->pic)) < 0) + if ((ret = av_frame_ref(rframe, c->pic)) < 0) return ret; return buf_size; diff --git a/libavcodec/cyuv.c b/libavcodec/cyuv.c index a59dd358bf..ba20cd02da 100644 --- a/libavcodec/cyuv.c +++ b/libavcodec/cyuv.c @@ -59,14 +59,12 @@ static av_cold int cyuv_decode_init(AVCodecContext *avctx) return 0; } -static int cyuv_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int cyuv_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; CyuvDecodeContext *s=avctx->priv_data; - AVFrame *frame = data; unsigned char *y_plane; unsigned char *u_plane; diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c index 3fc1bc705f..62684b8042 100644 --- a/libavcodec/dcadec.c +++ b/libavcodec/dcadec.c @@ -147,11 +147,10 @@ void ff_dca_downmix_to_stereo_float(AVFloatDSPContext *fdsp, float **samples, } } -static int dcadec_decode_frame(AVCodecContext *avctx, void *data, +static int dcadec_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { DCAContext *s = avctx->priv_data; - AVFrame *frame = data; uint8_t *input = avpkt->data; int input_size = avpkt->size; int i, ret, prev_packet = s->packet; diff --git a/libavcodec/dds.c b/libavcodec/dds.c index 32690e1fd7..c5691a4afd 100644 --- a/libavcodec/dds.c +++ b/libavcodec/dds.c @@ -606,12 +606,11 @@ static void run_postproc(AVCodecContext *avctx, AVFrame *frame) } } -static int dds_decode(AVCodecContext *avctx, void *data, +static int dds_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { DDSContext *ctx = avctx->priv_data; GetByteContext *gbc = &ctx->gbc; - AVFrame *frame = data; int mipmap; int ret; int width, height; diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c index 97a9bd5a1f..4625f62ec6 100644 --- a/libavcodec/dfa.c +++ b/libavcodec/dfa.c @@ -337,11 +337,9 @@ static const char chunk_name[8][5] = { "COPY", "TSW1", "BDLT", "WDLT", "TDLT", "DSW1", "BLCK", "DDS1" }; -static int dfa_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int dfa_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { - AVFrame *frame = data; DfaContext *s = avctx->priv_data; GetByteContext gb; const uint8_t *buf = avpkt->data; diff --git a/libavcodec/dfpwmdec.c b/libavcodec/dfpwmdec.c index dca7678795..4237200c6b 100644 --- a/libavcodec/dfpwmdec.c +++ b/libavcodec/dfpwmdec.c @@ -100,11 +100,10 @@ static av_cold int dfpwm_dec_init(struct AVCodecContext *ctx) return 0; } -static int dfpwm_dec_frame(struct AVCodecContext *ctx, void *data, - int *got_frame, struct AVPacket *packet) +static int dfpwm_dec_frame(struct AVCodecContext *ctx, AVFrame *frame, + int *got_frame, struct AVPacket *packet) { DFPWMState *state = ctx->priv_data; - AVFrame *frame = data; int ret; if (packet->size * 8LL % ctx->ch_layout.nb_channels) diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index d5c095c689..319067bc79 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -2260,10 +2260,10 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int return 0; } -static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt) +static int dirac_decode_frame(AVCodecContext *avctx, AVFrame *picture, + int *got_frame, AVPacket *pkt) { DiracContext *s = avctx->priv_data; - AVFrame *picture = data; uint8_t *buf = pkt->data; int buf_size = pkt->size; int i, buf_idx = 0; @@ -2282,7 +2282,7 @@ static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, /* end of stream, so flush delayed pics */ if (buf_size == 0) - return get_delayed_pic(s, (AVFrame *)data, got_frame); + return get_delayed_pic(s, picture, got_frame); for (;;) { /*[DIRAC_STD] Here starts the code from parse_info() defined in 9.6 @@ -2339,13 +2339,13 @@ static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, if (delayed_frame) { delayed_frame->reference ^= DELAYED_PIC_REF; - if((ret=av_frame_ref(data, delayed_frame->avframe)) < 0) + if((ret = av_frame_ref(picture, delayed_frame->avframe)) < 0) return ret; *got_frame = 1; } } else if (s->current_picture->avframe->display_picture_number == s->frame_number) { /* The right frame at the right time :-) */ - if((ret=av_frame_ref(data, s->current_picture->avframe)) < 0) + if((ret = av_frame_ref(picture, s->current_picture->avframe)) < 0) return ret; *got_frame = 1; } diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 141ca94359..4b22a4134e 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -613,13 +613,12 @@ static int dnxhd_decode_row(AVCodecContext *avctx, void *data, return 0; } -static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, +static int dnxhd_decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; DNXHDContext *ctx = avctx->priv_data; - AVFrame *picture = data; int first_field = 1; int ret, i; diff --git a/libavcodec/dolby_e.c b/libavcodec/dolby_e.c index 20435f8f25..6c86f74c94 100644 --- a/libavcodec/dolby_e.c +++ b/libavcodec/dolby_e.c @@ -1084,7 +1084,7 @@ static int filter_frame(DBEDecodeContext *s, AVFrame *frame) return 0; } -static int dolby_e_decode_frame(AVCodecContext *avctx, void *data, +static int dolby_e_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { DBEDecodeContext *s1 = avctx->priv_data; @@ -1135,7 +1135,7 @@ static int dolby_e_decode_frame(AVCodecContext *avctx, void *data, return ret; if ((ret = parse_meter(s1)) < 0) return ret; - if ((ret = filter_frame(s1, data)) < 0) + if ((ret = filter_frame(s1, frame)) < 0) return ret; *got_frame_ptr = 1; diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c index ddd6b47ff4..db09ef274b 100644 --- a/libavcodec/dpcm.c +++ b/libavcodec/dpcm.c @@ -207,12 +207,11 @@ static av_cold int dpcm_decode_init(AVCodecContext *avctx) } -static int dpcm_decode_frame(AVCodecContext *avctx, void *data, +static int dpcm_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { int buf_size = avpkt->size; DPCMContext *s = avctx->priv_data; - AVFrame *frame = data; int out = 0, ret; int predictor[2]; int ch = 0; diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index fb7005e8a8..7a3054b140 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -150,14 +150,11 @@ static uint16_t read12in32(const uint8_t **ptr, uint32_t *lbuf, } } -static int decode_frame(AVCodecContext *avctx, - void *data, - int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - AVFrame *const p = data; uint8_t *ptr[AV_NUM_DATA_POINTERS]; uint32_t header_version, version = 0; char creator[101] = { 0 }; diff --git a/libavcodec/dsddec.c b/libavcodec/dsddec.c index 2838392e77..e0578bc9cc 100644 --- a/libavcodec/dsddec.c +++ b/libavcodec/dsddec.c @@ -95,11 +95,10 @@ static int dsd_channel(AVCodecContext *avctx, void *tdata, int j, int threadnr) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { ThreadData td; - AVFrame *frame = data; int ret; frame->nb_samples = avpkt->size / avctx->ch_layout.nb_channels; diff --git a/libavcodec/dsicinaudio.c b/libavcodec/dsicinaudio.c index 14a0c6fec3..231afb2a69 100644 --- a/libavcodec/dsicinaudio.c +++ b/libavcodec/dsicinaudio.c @@ -87,10 +87,9 @@ static av_cold int cinaudio_decode_init(AVCodecContext *avctx) return 0; } -static int cinaudio_decode_frame(AVCodecContext *avctx, void *data, +static int cinaudio_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; CinAudioContext *cin = avctx->priv_data; const uint8_t *buf_end = buf + avpkt->size; diff --git a/libavcodec/dsicinvideo.c b/libavcodec/dsicinvideo.c index 41e90344e9..b33959ef77 100644 --- a/libavcodec/dsicinvideo.c +++ b/libavcodec/dsicinvideo.c @@ -194,9 +194,8 @@ static int cin_decode_rle(const unsigned char *src, int src_size, return 0; } -static int cinvideo_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int cinvideo_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -303,7 +302,7 @@ static int cinvideo_decode_frame(AVCodecContext *avctx, FFSWAP(uint8_t *, cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_table[CIN_PRE_BMP]); - if ((res = av_frame_ref(data, cin->frame)) < 0) + if ((res = av_frame_ref(rframe, cin->frame)) < 0) return res; *got_frame = 1; diff --git a/libavcodec/dss_sp.c b/libavcodec/dss_sp.c index d305f993b4..4d7a169f26 100644 --- a/libavcodec/dss_sp.c +++ b/libavcodec/dss_sp.c @@ -740,11 +740,10 @@ static int dss_sp_decode_one_frame(DssSpContext *p, return 0; } -static int dss_sp_decode_frame(AVCodecContext *avctx, void *data, +static int dss_sp_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { DssSpContext *p = avctx->priv_data; - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; diff --git a/libavcodec/dstdec.c b/libavcodec/dstdec.c index 3ea3f38eee..e1d06a9c36 100644 --- a/libavcodec/dstdec.c +++ b/libavcodec/dstdec.c @@ -237,7 +237,7 @@ static void build_filter(int16_t table[DST_MAX_ELEMENTS][16][256], const Table * } } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { unsigned samples_per_frame = DST_SAMPLES_PER_FRAME(avctx->sample_rate); @@ -249,7 +249,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, DSTContext *s = avctx->priv_data; GetBitContext *gb = &s->gb; ArithCoder *ac = &s->ac; - AVFrame *frame = data; uint8_t *dsd; float *pcm; int ret; diff --git a/libavcodec/dvaudiodec.c b/libavcodec/dvaudiodec.c index 96aa1c2005..97851981c5 100644 --- a/libavcodec/dvaudiodec.c +++ b/libavcodec/dvaudiodec.c @@ -85,11 +85,10 @@ static inline uint16_t dv_audio_12to16(uint16_t sample) return result; } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt) { DVAudioContext *s = avctx->priv_data; - AVFrame *frame = data; const uint8_t *src = pkt->data; int16_t *dst; int ret, i; diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index 2e64cb2f55..5a1de7a409 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -607,13 +607,12 @@ retry: /* NOTE: exactly one frame must be given (120000 bytes for NTSC, * 144000 bytes for PAL - or twice those for 50Mbps) */ -static int dvvideo_decode_frame(AVCodecContext *avctx, void *data, +static int dvvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { uint8_t *buf = avpkt->data; int buf_size = avpkt->size; DVVideoContext *s = avctx->priv_data; - AVFrame *const frame = data; const uint8_t *vsc_pack; int apt, is16_9, ret; const AVDVProfile *sys; diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c index a3a7cf217b..1a383f182e 100644 --- a/libavcodec/dxa.c +++ b/libavcodec/dxa.c @@ -208,9 +208,9 @@ static int decode_13(AVCodecContext *avctx, DxaDecContext *c, uint8_t* dst, return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { - AVFrame *frame = data; DxaDecContext * const c = avctx->priv_data; uint8_t *outptr, *srcptr, *tmpptr; unsigned long dsize; diff --git a/libavcodec/dxtory.c b/libavcodec/dxtory.c index bd51e5c1b9..e7aaee7cb6 100644 --- a/libavcodec/dxtory.c +++ b/libavcodec/dxtory.c @@ -784,10 +784,9 @@ static int dxtory_decode_v2_444(AVCodecContext *avctx, AVFrame *pic, AV_PIX_FMT_YUV444P, vflipped); } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *pic, + int *got_frame, AVPacket *avpkt) { - AVFrame *pic = data; const uint8_t *src = avpkt->data; uint32_t type; int vflipped, ret; diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c index 9aa7aa0d35..63fec7a14e 100644 --- a/libavcodec/dxv.c +++ b/libavcodec/dxv.c @@ -1038,11 +1038,10 @@ static int dxv_decompress_raw(AVCodecContext *avctx) return 0; } -static int dxv_decode(AVCodecContext *avctx, void *data, +static int dxv_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { DXVContext *ctx = avctx->priv_data; - AVFrame *const frame = data; GetByteContext *gbc = &ctx->gbc; int (*decompress_tex)(AVCodecContext *avctx); const char *msgcomp, *msgtext; diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c index f060b57459..bd332a9106 100644 --- a/libavcodec/eacmv.c +++ b/libavcodec/eacmv.c @@ -169,15 +169,13 @@ static int cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t * #define EA_PREAMBLE_SIZE 8 #define MVIh_TAG MKTAG('M', 'V', 'I', 'h') -static int cmv_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int cmv_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; CmvContext *s = avctx->priv_data; const uint8_t *buf_end = buf + buf_size; - AVFrame *frame = data; int ret; if (buf_end - buf < EA_PREAMBLE_SIZE) diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c index 239ee1b38e..e6e90d6bd7 100644 --- a/libavcodec/eamad.c +++ b/libavcodec/eamad.c @@ -247,14 +247,12 @@ static void calc_quant_matrix(MadContext *s, int qscale) s->quant_matrix[i] = (ff_inv_aanscales[i]*ff_mpeg1_default_intra_matrix[i]*qscale + 32) >> 10; } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MadContext *s = avctx->priv_data; - AVFrame *frame = data; GetByteContext gb; int width, height; int chunk_type; diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c index 93024b7e9f..ea5f4386bc 100644 --- a/libavcodec/eatgq.c +++ b/libavcodec/eatgq.c @@ -201,14 +201,12 @@ static void tgq_calculate_qtable(TgqContext *s, int quant) ff_inv_aanscales[j * 8 + i]) >> (14 - 4); } -static int tgq_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int tgq_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; TgqContext *s = avctx->priv_data; - AVFrame *frame = data; int x, y, ret; int big_endian; diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c index 8475509ccb..525c80a570 100644 --- a/libavcodec/eatgv.c +++ b/libavcodec/eatgv.c @@ -262,15 +262,13 @@ static int tgv_decode_inter(TgvContext *s, AVFrame *frame, return 0; } -static int tgv_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int tgv_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; TgvContext *s = avctx->priv_data; const uint8_t *buf_end = buf + buf_size; - AVFrame *frame = data; int chunk_type, ret; if (buf_end - buf < EA_PREAMBLE_SIZE) diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c index 59dec04137..dad742996c 100644 --- a/libavcodec/eatqi.c +++ b/libavcodec/eatqi.c @@ -124,15 +124,13 @@ static void tqi_calculate_qtable(TqiContext *t, int quant) t->intra_matrix[i] = (ff_inv_aanscales[i] * ff_mpeg1_default_intra_matrix[i] * qscale + 32) >> 14; } -static int tqi_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int tqi_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; const uint8_t *buf_end = buf+buf_size; TqiContext *t = avctx->priv_data; - AVFrame *frame = data; int ret, w, h; if (buf_size < 12) diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c index 94af68edae..f52573107c 100644 --- a/libavcodec/escape124.c +++ b/libavcodec/escape124.c @@ -196,13 +196,11 @@ static const uint16_t mask_matrix[] = {0x1, 0x2, 0x10, 0x20, 0x100, 0x200, 0x1000, 0x2000, 0x400, 0x800, 0x4000, 0x8000}; -static int escape124_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int escape124_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { int buf_size = avpkt->size; Escape124Context *s = avctx->priv_data; - AVFrame *frame = data; GetBitContext gb; unsigned frame_flags, frame_size; diff --git a/libavcodec/escape130.c b/libavcodec/escape130.c index 1826d4ec68..ffa2274ea9 100644 --- a/libavcodec/escape130.c +++ b/libavcodec/escape130.c @@ -187,12 +187,11 @@ static int decode_skip_count(GetBitContext* gb) return -1; } -static int escape130_decode_frame(AVCodecContext *avctx, void *data, +static int escape130_decode_frame(AVCodecContext *avctx, AVFrame *pic, int *got_frame, AVPacket *avpkt) { int buf_size = avpkt->size; Escape130Context *s = avctx->priv_data; - AVFrame *pic = data; GetBitContext gb; int ret; diff --git a/libavcodec/evrcdec.c b/libavcodec/evrcdec.c index 904994f7c2..d3703977ba 100644 --- a/libavcodec/evrcdec.c +++ b/libavcodec/evrcdec.c @@ -741,11 +741,10 @@ static void frame_erasure(EVRCContext *e, float *samples) } } -static int evrc_decode_frame(AVCodecContext *avctx, void *data, +static int evrc_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; - AVFrame *frame = data; EVRCContext *e = avctx->priv_data; int buf_size = avpkt->size; float ilspf[FILTER_ORDER], ilpc[FILTER_ORDER], idelay[NB_SUBFRAMES]; diff --git a/libavcodec/exr.c b/libavcodec/exr.c index dd5924245f..88e7c01488 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -2023,12 +2023,11 @@ fail: return ret; } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt) { EXRContext *s = avctx->priv_data; GetByteContext *gb = &s->gb; - AVFrame *picture = data; uint8_t *ptr; int i, y, ret, ymax; diff --git a/libavcodec/fastaudio.c b/libavcodec/fastaudio.c index 151f03931a..fc525e58d1 100644 --- a/libavcodec/fastaudio.c +++ b/libavcodec/fastaudio.c @@ -105,12 +105,11 @@ static void set_sample(int i, int j, int v, float *result, int *pads, float valu result[i * 64 + pads[i] + j * 3] = value * (2 * v - 7); } -static int fastaudio_decode(AVCodecContext *avctx, void *data, +static int fastaudio_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt) { FastAudioContext *s = avctx->priv_data; GetByteContext gb; - AVFrame *frame = data; int subframes; int ret; diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index d1f69ae6e1..81fa249885 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -831,7 +831,8 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -969,7 +970,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac if (f->last_picture.f) ff_thread_release_ext_buffer(avctx, &f->last_picture); - if ((ret = av_frame_ref(data, f->picture.f)) < 0) + if ((ret = av_frame_ref(rframe, f->picture.f)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/ffwavesynth.c b/libavcodec/ffwavesynth.c index ea939b9009..0426386058 100644 --- a/libavcodec/ffwavesynth.c +++ b/libavcodec/ffwavesynth.c @@ -413,11 +413,10 @@ static void wavesynth_enter_intervals(struct wavesynth_context *ws, int64_t ts) *last = -1; } -static int wavesynth_decode(AVCodecContext *avc, void *rframe, int *rgot_frame, - AVPacket *packet) +static int wavesynth_decode(AVCodecContext *avc, AVFrame *frame, + int *rgot_frame, AVPacket *packet) { struct wavesynth_context *ws = avc->priv_data; - AVFrame *frame = rframe; int64_t ts; int duration; int s, c, r; diff --git a/libavcodec/fic.c b/libavcodec/fic.c index 79e45ec0d8..86a5012587 100644 --- a/libavcodec/fic.c +++ b/libavcodec/fic.c @@ -267,7 +267,7 @@ static void fic_draw_cursor(AVCodecContext *avctx, int cur_x, int cur_y) } } -static int fic_decode_frame(AVCodecContext *avctx, void *data, +static int fic_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt) { FICContext *ctx = avctx->priv_data; @@ -436,7 +436,7 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data, skip: *got_frame = 1; - if ((ret = av_frame_ref(data, ctx->final_frame)) < 0) + if ((ret = av_frame_ref(rframe, ctx->final_frame)) < 0) return ret; return avpkt->size; diff --git a/libavcodec/fitsdec.c b/libavcodec/fitsdec.c index b285787056..25857a1799 100644 --- a/libavcodec/fitsdec.c +++ b/libavcodec/fitsdec.c @@ -181,9 +181,9 @@ static int fits_read_header(AVCodecContext *avctx, const uint8_t **ptr, FITSHead return 0; } -static int fits_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) +static int fits_decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { - AVFrame *p=data; const uint8_t *ptr8 = avpkt->data, *end; uint8_t t8; int16_t t16; diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index dd6026f9de..11a62daab5 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -554,10 +554,9 @@ static int decode_frame(FLACContext *s) return 0; } -static int flac_decode_frame(AVCodecContext *avctx, void *data, +static int flac_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; FLACContext *s = avctx->priv_data; diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c index 013f0c7989..3cf01336c8 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -263,7 +263,7 @@ static int flashsv_decode_block(AVCodecContext *avctx, const AVPacket *avpkt, return 0; } -static int flashsv_decode_frame(AVCodecContext *avctx, void *data, +static int flashsv_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt) { int buf_size = avpkt->size; @@ -480,7 +480,7 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data, s->frame->linesize[0] * avctx->height); } - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c index 2169202f4f..79e50aa71d 100644 --- a/libavcodec/flicvideo.c +++ b/libavcodec/flicvideo.c @@ -149,7 +149,7 @@ static av_cold int flic_decode_init(AVCodecContext *avctx) } static int flic_decode_frame_8BPP(AVCodecContext *avctx, - void *data, int *got_frame, + AVFrame *rframe, int *got_frame, const uint8_t *buf, int buf_size) { FlicDecodeContext *s = avctx->priv_data; @@ -479,7 +479,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, s->new_palette = 0; } - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; *got_frame = 1; @@ -488,7 +488,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, } static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, - void *data, int *got_frame, + AVFrame *rframe, int *got_frame, const uint8_t *buf, int buf_size) { /* Note, the only difference between the 15Bpp and 16Bpp */ @@ -781,7 +781,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, av_log(avctx, AV_LOG_ERROR, "Processed FLI chunk where chunk size = %d " \ "and final chunk ptr = %d\n", buf_size, bytestream2_tell(&g2)); - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; *got_frame = 1; @@ -790,7 +790,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, } static int flic_decode_frame_24BPP(AVCodecContext *avctx, - void *data, int *got_frame, + AVFrame *rframe, int *got_frame, const uint8_t *buf, int buf_size) { FlicDecodeContext *s = avctx->priv_data; @@ -1061,7 +1061,7 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, av_log(avctx, AV_LOG_ERROR, "Processed FLI chunk where chunk size = %d " \ "and final chunk ptr = %d\n", buf_size, bytestream2_tell(&g2)); - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; *got_frame = 1; @@ -1069,21 +1069,20 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, return buf_size; } -static int flic_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int flic_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; if (avctx->pix_fmt == AV_PIX_FMT_PAL8) { - return flic_decode_frame_8BPP(avctx, data, got_frame, + return flic_decode_frame_8BPP(avctx, frame, got_frame, buf, buf_size); } else if ((avctx->pix_fmt == AV_PIX_FMT_RGB555) || (avctx->pix_fmt == AV_PIX_FMT_RGB565)) { - return flic_decode_frame_15_16BPP(avctx, data, got_frame, + return flic_decode_frame_15_16BPP(avctx, frame, got_frame, buf, buf_size); } else if (avctx->pix_fmt == AV_PIX_FMT_BGR24) { - return flic_decode_frame_24BPP(avctx, data, got_frame, + return flic_decode_frame_24BPP(avctx, frame, got_frame, buf, buf_size); } diff --git a/libavcodec/fmvc.c b/libavcodec/fmvc.c index 385c737e0e..0dc918bc8c 100644 --- a/libavcodec/fmvc.c +++ b/libavcodec/fmvc.c @@ -394,13 +394,12 @@ static int decode_type1(GetByteContext *gb, PutByteContext *pb) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { FMVCContext *s = avctx->priv_data; GetByteContext *gb = &s->gb; PutByteContext *pb = &s->pb; - AVFrame *frame = data; int ret, y, x; if (avpkt->size < 8) diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c index 7a8acc418f..82851e74de 100644 --- a/libavcodec/fraps.c +++ b/libavcodec/fraps.c @@ -133,14 +133,12 @@ static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w, return 0; } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *f, + int *got_frame, AVPacket *avpkt) { FrapsContext * const s = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - AVFrame * const f = data; uint32_t header; unsigned int version,header_size; unsigned int x, y; diff --git a/libavcodec/frwu.c b/libavcodec/frwu.c index 558fac8d54..6ec88808df 100644 --- a/libavcodec/frwu.c +++ b/libavcodec/frwu.c @@ -42,12 +42,11 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *pic, + int *got_frame, AVPacket *avpkt) { FRWUContext *s = avctx->priv_data; int field, ret; - AVFrame *pic = data; const uint8_t *buf = avpkt->data; const uint8_t *buf_end = buf + avpkt->size; diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c index 30432867e3..72368d9f4f 100644 --- a/libavcodec/g2meet.c +++ b/libavcodec/g2meet.c @@ -1372,13 +1372,12 @@ static void g2m_paint_cursor(G2MContext *c, uint8_t *dst, int stride) } } -static int g2m_decode_frame(AVCodecContext *avctx, void *data, +static int g2m_decode_frame(AVCodecContext *avctx, AVFrame *pic, int *got_picture_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; G2MContext *c = avctx->priv_data; - AVFrame *pic = data; GetByteContext bc, tbc; int magic; int got_header = 0; diff --git a/libavcodec/g722dec.c b/libavcodec/g722dec.c index 727d88b7ba..e7e846b264 100644 --- a/libavcodec/g722dec.c +++ b/libavcodec/g722dec.c @@ -84,11 +84,10 @@ static const int16_t * const low_inv_quants[3] = { ff_g722_low_inv_quant6, low_inv_quant5, ff_g722_low_inv_quant4 }; -static int g722_decode_frame(AVCodecContext *avctx, void *data, +static int g722_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { G722Context *c = avctx->priv_data; - AVFrame *frame = data; int16_t *out_buf; int j, ret; const int skip = 8 - c->bits_per_codeword; diff --git a/libavcodec/g723_1dec.c b/libavcodec/g723_1dec.c index 71f758b55b..b025cb2b8e 100644 --- a/libavcodec/g723_1dec.c +++ b/libavcodec/g723_1dec.c @@ -925,11 +925,10 @@ static void generate_noise(G723_1_ChannelContext *p) PITCH_MAX * sizeof(*p->excitation)); } -static int g723_1_decode_frame(AVCodecContext *avctx, void *data, +static int g723_1_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { G723_1_Context *s = avctx->priv_data; - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int dec_mode = buf[0] & 3; diff --git a/libavcodec/g726.c b/libavcodec/g726.c index 5c944d95b6..0e19a2a8fc 100644 --- a/libavcodec/g726.c +++ b/libavcodec/g726.c @@ -461,10 +461,9 @@ static av_cold int g726_decode_init(AVCodecContext *avctx) return 0; } -static int g726_decode_frame(AVCodecContext *avctx, void *data, +static int g726_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; G726Context *c = avctx->priv_data; diff --git a/libavcodec/g729dec.c b/libavcodec/g729dec.c index 3ca141a2da..0d54f555bd 100644 --- a/libavcodec/g729dec.c +++ b/libavcodec/g729dec.c @@ -401,8 +401,8 @@ static av_cold int decoder_init(AVCodecContext * avctx) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -427,7 +427,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, int16_t synth[SUBFRAME_SIZE+10]; // fixed-codebook vector int j, ret; int gain_before, gain_after; - AVFrame *frame = data; frame->nb_samples = SUBFRAME_SIZE<<1; if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) diff --git a/libavcodec/gdv.c b/libavcodec/gdv.c index e8af2f563f..d4c763cffb 100644 --- a/libavcodec/gdv.c +++ b/libavcodec/gdv.c @@ -456,13 +456,12 @@ static int decompress_68(AVCodecContext *avctx, unsigned skip, unsigned use8) return 0; } -static int gdv_decode_frame(AVCodecContext *avctx, void *data, +static int gdv_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { GDVContext *gdv = avctx->priv_data; GetByteContext *gb = &gdv->gb; PutByteContext *pb = &gdv->pb; - AVFrame *frame = data; int ret, i; int compression; unsigned flags; diff --git a/libavcodec/gemdec.c b/libavcodec/gemdec.c index 83b71727d6..0844f8cfb3 100644 --- a/libavcodec/gemdec.c +++ b/libavcodec/gemdec.c @@ -85,14 +85,12 @@ static void put_lines_bytes(AVCodecContext *avctx, int planes, int row_width, in state->vdup = 1; } -static int gem_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int gem_decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; const uint8_t *buf_end = buf + buf_size; - AVFrame *p = data; int header_size, planes, pattern_size, tag = 0, count_scalar = 1, ret; unsigned int x, count, v; GetByteContext gb; diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c index aeeefe477d..adb8d0cec3 100644 --- a/libavcodec/gifdec.c +++ b/libavcodec/gifdec.c @@ -465,7 +465,8 @@ static av_cold int gif_decode_init(AVCodecContext *avctx) return 0; } -static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) +static int gif_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { GifState *s = avctx->priv_data; int ret; @@ -520,7 +521,7 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, A if (ret < 0) return ret; - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/gsmdec.c b/libavcodec/gsmdec.c index 02d988ae40..84852c8b11 100644 --- a/libavcodec/gsmdec.c +++ b/libavcodec/gsmdec.c @@ -65,10 +65,9 @@ static av_cold int gsm_init(AVCodecContext *avctx) return 0; } -static int gsm_decode_frame(AVCodecContext *avctx, void *data, +static int gsm_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; int res; GetBitContext gb; const uint8_t *buf = avpkt->data; diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index 2830966eb6..a826c1ca1c 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -594,7 +594,7 @@ static int get_consumed_bytes(MpegEncContext *s, int buf_size) return pos; } -static int h261_decode_frame(AVCodecContext *avctx, void *data, +static int h261_decode_frame(AVCodecContext *avctx, AVFrame *pict, int *got_frame, AVPacket *avpkt) { H261DecContext *const h = avctx->priv_data; @@ -602,7 +602,6 @@ static int h261_decode_frame(AVCodecContext *avctx, void *data, int buf_size = avpkt->size; MpegEncContext *s = &h->s; int ret; - AVFrame *pict = data; ff_dlog(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size); ff_dlog(avctx, "bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]); diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 965a7d30c4..731f442b01 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -425,15 +425,14 @@ static int decode_slice(MpegEncContext *s) return AVERROR_INVALIDDATA; } -int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MpegEncContext *s = avctx->priv_data; int ret; int slice_ret = 0; - AVFrame *pict = data; /* no supplementary picture */ if (buf_size == 0) { diff --git a/libavcodec/h263dec.h b/libavcodec/h263dec.h index 8d5f9a7add..9f1db72903 100644 --- a/libavcodec/h263dec.h +++ b/libavcodec/h263dec.h @@ -42,9 +42,8 @@ extern const enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[]; int ff_h263_decode_motion(MpegEncContext * s, int pred, int f_code); int ff_h263_decode_init(AVCodecContext *avctx); -int ff_h263_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt); +int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt); int ff_h263_decode_end(AVCodecContext *avctx); void ff_h263_decode_init_vlc(void); int ff_h263_decode_picture_header(MpegEncContext *s); diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index 9faa35e36d..1dbf136934 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -974,13 +974,12 @@ static int send_next_delayed_frame(H264Context *h, AVFrame *dst_frame, return buf_index; } -static int h264_decode_frame(AVCodecContext *avctx, void *data, +static int h264_decode_frame(AVCodecContext *avctx, AVFrame *pict, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; H264Context *h = avctx->priv_data; - AVFrame *pict = data; int buf_index; int ret; diff --git a/libavcodec/hapdec.c b/libavcodec/hapdec.c index 4a7ac15a8e..1a0472d432 100644 --- a/libavcodec/hapdec.c +++ b/libavcodec/hapdec.c @@ -301,11 +301,10 @@ static int decompress_texture2_thread(AVCodecContext *avctx, void *arg, return decompress_texture_thread_internal(avctx, arg, slice, thread_nb, 1); } -static int hap_decode(AVCodecContext *avctx, void *data, +static int hap_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { HapContext *ctx = avctx->priv_data; - AVFrame *const frame = data; int ret, i, t; int section_size; enum HapSectionType section_type; diff --git a/libavcodec/hcadec.c b/libavcodec/hcadec.c index b178456e1c..8539c772d8 100644 --- a/libavcodec/hcadec.c +++ b/libavcodec/hcadec.c @@ -387,10 +387,9 @@ static void unpack(HCAContext *c, ChannelContext *ch, ch->base[i] = dequantizer_scaling_table[ch->scale_factors[i]] * quant_step_size[ch->scale[i]]; } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; HCAContext *c = avctx->priv_data; int ch, ret, packed_noise_level; GetBitContext *gb = &c->gb; diff --git a/libavcodec/hcom.c b/libavcodec/hcom.c index 17e99c91bf..4d55360294 100644 --- a/libavcodec/hcom.c +++ b/libavcodec/hcom.c @@ -80,11 +80,10 @@ static av_cold int hcom_init(AVCodecContext *avctx) return 0; } -static int hcom_decode(AVCodecContext *avctx, void *data, +static int hcom_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt) { HCOMContext *s = avctx->priv_data; - AVFrame *frame = data; GetBitContext gb; int ret, n = 0; diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 09c07acdc2..9c2958b643 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -3474,8 +3474,8 @@ static int hevc_decode_extradata(HEVCContext *s, uint8_t *buf, int length, int f return 0; } -static int hevc_decode_frame(AVCodecContext *avctx, void *data, int *got_output, - AVPacket *avpkt) +static int hevc_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_output, AVPacket *avpkt) { int ret; uint8_t *sd; @@ -3483,7 +3483,7 @@ static int hevc_decode_frame(AVCodecContext *avctx, void *data, int *got_output, HEVCContext *s = avctx->priv_data; if (!avpkt->size) { - ret = ff_hevc_output_frame(s, data, 1); + ret = ff_hevc_output_frame(s, rframe, 1); if (ret < 0) return ret; @@ -3533,7 +3533,7 @@ static int hevc_decode_frame(AVCodecContext *avctx, void *data, int *got_output, } if (s->output_frame->buf[0]) { - av_frame_move_ref(data, s->output_frame); + av_frame_move_ref(rframe, s->output_frame); *got_output = 1; } diff --git a/libavcodec/hnm4video.c b/libavcodec/hnm4video.c index 25228420ec..deba534766 100644 --- a/libavcodec/hnm4video.c +++ b/libavcodec/hnm4video.c @@ -388,10 +388,9 @@ static void hnm_update_palette(AVCodecContext *avctx, uint8_t *src, } } -static int hnm_decode_frame(AVCodecContext *avctx, void *data, +static int hnm_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { - AVFrame *frame = data; Hnm4VideoContext *hnm = avctx->priv_data; int ret; uint16_t chunk_id; diff --git a/libavcodec/hq_hqa.c b/libavcodec/hq_hqa.c index fac22e95f6..a53b4641a0 100644 --- a/libavcodec/hq_hqa.c +++ b/libavcodec/hq_hqa.c @@ -301,11 +301,10 @@ static int hqa_decode_frame(HQContext *ctx, AVFrame *pic, size_t data_size) return 0; } -static int hq_hqa_decode_frame(AVCodecContext *avctx, void *data, +static int hq_hqa_decode_frame(AVCodecContext *avctx, AVFrame *pic, int *got_frame, AVPacket *avpkt) { HQContext *ctx = avctx->priv_data; - AVFrame *pic = data; uint32_t info_tag; unsigned int data_size; int ret; diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c index a1b3b39a0a..8c7fc9b1ec 100644 --- a/libavcodec/hqx.c +++ b/libavcodec/hqx.c @@ -400,11 +400,10 @@ static int decode_slice_thread(AVCodecContext *avctx, void *arg, return decode_slice(ctx, slice_no); } -static int hqx_decode_frame(AVCodecContext *avctx, void *data, +static int hqx_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_picture_ptr, AVPacket *avpkt) { HQXContext *ctx = avctx->priv_data; - AVFrame *const frame = data; uint8_t *src = avpkt->data; uint32_t info_tag; int data_start; @@ -433,7 +432,7 @@ static int hqx_decode_frame(AVCodecContext *avctx, void *data, data_start = src - avpkt->data; ctx->data_size = avpkt->size - data_start; ctx->src = src; - ctx->pic = data; + ctx->pic = frame; if (ctx->data_size < HQX_HEADER_SIZE) { av_log(avctx, AV_LOG_ERROR, "Frame too small.\n"); diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c index 5fdefa9bd5..d98156e26d 100644 --- a/libavcodec/huffyuvdec.c +++ b/libavcodec/huffyuvdec.c @@ -1179,15 +1179,14 @@ static int decode_slice(AVCodecContext *avctx, AVFrame *p, int height, return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; HYuvContext *s = avctx->priv_data; const int width = s->width; const int height = s->height; - AVFrame *const p = data; int slice, table_size = 0, ret, nb_slices; unsigned slices_info_offset; int slice_height; diff --git a/libavcodec/idcinvideo.c b/libavcodec/idcinvideo.c index a73c82b8fa..1a3792be0e 100644 --- a/libavcodec/idcinvideo.c +++ b/libavcodec/idcinvideo.c @@ -209,14 +209,12 @@ static int idcin_decode_vlcs(IdcinContext *s, AVFrame *frame) return 0; } -static int idcin_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int idcin_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; IdcinContext *s = avctx->priv_data; - AVFrame *frame = data; int ret; s->buf = buf; diff --git a/libavcodec/iff.c b/libavcodec/iff.c index 95ce10b554..184e3b865e 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -1527,12 +1527,10 @@ static int unsupported(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { IffContext *s = avctx->priv_data; - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; const uint8_t *buf_end = buf + buf_size; diff --git a/libavcodec/ilbcdec.c b/libavcodec/ilbcdec.c index 19ecd14411..182a014d11 100644 --- a/libavcodec/ilbcdec.c +++ b/libavcodec/ilbcdec.c @@ -1356,11 +1356,10 @@ static void hp_output(int16_t *signal, const int16_t *ba, int16_t *y, } } -static int ilbc_decode_frame(AVCodecContext *avctx, void *data, +static int ilbc_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; - AVFrame *frame = data; ILBCContext *s = avctx->priv_data; int mode = s->mode, ret; int16_t *plc_data = &s->plc_residual[LPC_FILTERORDER]; diff --git a/libavcodec/imc.c b/libavcodec/imc.c index f11d28d28c..7b0e9d3b55 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -1020,10 +1020,9 @@ static int imc_decode_block(AVCodecContext *avctx, IMCContext *q, int ch) return 0; } -static int imc_decode_frame(AVCodecContext *avctx, void *data, +static int imc_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int ret, i; diff --git a/libavcodec/imm4.c b/libavcodec/imm4.c index 40dc67f5d0..d531bbdc3d 100644 --- a/libavcodec/imm4.c +++ b/libavcodec/imm4.c @@ -353,12 +353,11 @@ static int decode_inter(AVCodecContext *avctx, GetBitContext *gb, return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { IMM4Context *s = avctx->priv_data; GetBitContext *gb = &s->gb; - AVFrame *frame = data; int width, height; unsigned type; int ret, scaled; diff --git a/libavcodec/imm5.c b/libavcodec/imm5.c index eed3f89cc7..eb30cc5509 100644 --- a/libavcodec/imm5.c +++ b/libavcodec/imm5.c @@ -83,11 +83,10 @@ static av_cold int imm5_init(AVCodecContext *avctx) return 0; } -static int imm5_decode_frame(AVCodecContext *avctx, void *data, +static int imm5_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { IMM5Context *ctx = avctx->priv_data; - AVFrame *frame = data; AVCodecContext *codec_avctx = ctx->h264_avctx; int ret; diff --git a/libavcodec/imx.c b/libavcodec/imx.c index 0f94c1ec57..0d8924bf45 100644 --- a/libavcodec/imx.c +++ b/libavcodec/imx.c @@ -47,7 +47,7 @@ static av_cold int imx_decode_init(AVCodecContext *avctx) return 0; } -static int imx_decode_frame(AVCodecContext *avctx, void *data, +static int imx_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt) { SimbiosisIMXContext *imx = avctx->priv_data; @@ -153,7 +153,7 @@ static int imx_decode_frame(AVCodecContext *avctx, void *data, frame->pict_type = frame->key_frame ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; - if ((ret = av_frame_ref(data, frame)) < 0) + if ((ret = av_frame_ref(rframe, frame)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c index aec118c84c..8b47b59f79 100644 --- a/libavcodec/indeo2.c +++ b/libavcodec/indeo2.c @@ -151,14 +151,12 @@ static int ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_ return 0; } -static int ir2_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int ir2_decode_frame(AVCodecContext *avctx, AVFrame *picture, + int *got_frame, AVPacket *avpkt) { Ir2Context * const s = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - AVFrame *picture = data; AVFrame * const p = s->picture; int start, ret; int ltab, ctab; diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index c697432cbe..753f1b2560 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -1065,13 +1065,12 @@ static av_cold int decode_init(AVCodecContext *avctx) } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { Indeo3DecodeContext *ctx = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - AVFrame *frame = data; int res; res = decode_frame_headers(ctx, avctx, buf, buf_size); diff --git a/libavcodec/interplayacm.c b/libavcodec/interplayacm.c index c6aab6c4c3..f669d6cd31 100644 --- a/libavcodec/interplayacm.c +++ b/libavcodec/interplayacm.c @@ -552,12 +552,11 @@ static int decode_block(InterplayACMContext *s) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt) { InterplayACMContext *s = avctx->priv_data; GetBitContext *gb = &s->gb; - AVFrame *frame = data; const uint8_t *buf; int16_t *samples; int ret, n, buf_size, input_buf_size; diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c index 8b86d5513a..ff0efc127c 100644 --- a/libavcodec/interplayvideo.c +++ b/libavcodec/interplayvideo.c @@ -1189,14 +1189,12 @@ static av_cold int ipvideo_decode_init(AVCodecContext *avctx) return 0; } -static int ipvideo_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int ipvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; IpvideoContext *s = avctx->priv_data; - AVFrame *frame = data; int ret; int send_buffer; int frame_format; diff --git a/libavcodec/ivi.c b/libavcodec/ivi.c index 77979d04e7..48fcf9bfd8 100644 --- a/libavcodec/ivi.c +++ b/libavcodec/ivi.c @@ -1065,12 +1065,11 @@ static int decode_band(IVI45DecContext *ctx, return result; } -int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +int ff_ivi_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { IVI45DecContext *ctx = avctx->priv_data; const uint8_t *buf = avpkt->data; - AVFrame *frame = data; int buf_size = avpkt->size; int result, p, b; @@ -1091,7 +1090,7 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, if (ctx->is_indeo4 && ctx->frame_type == IVI4_FRAMETYPE_NULL_LAST) { if (ctx->got_p_frame) { - av_frame_move_ref(data, ctx->p_frame); + av_frame_move_ref(frame, ctx->p_frame); *got_frame = 1; ctx->got_p_frame = 0; } else { diff --git a/libavcodec/ivi.h b/libavcodec/ivi.h index 1427535547..06cd4d95ff 100644 --- a/libavcodec/ivi.h +++ b/libavcodec/ivi.h @@ -335,8 +335,8 @@ int ff_ivi_init_planes(AVCodecContext *avctx, IVIPlaneDesc *planes, */ int ff_ivi_init_tiles(IVIPlaneDesc *planes, int tile_width, int tile_height); -int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt); +int ff_ivi_decode_frame(AVCodecContext *avctx, AVFrame *data, + int *got_frame, AVPacket *avpkt); int ff_ivi_decode_close(AVCodecContext *avctx); #endif /* AVCODEC_IVI_H */ diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index 67638e589f..23f4cb768b 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -2473,11 +2473,10 @@ static av_cold int jpeg2000_decode_init(AVCodecContext *avctx) return 0; } -static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data, +static int jpeg2000_decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt) { Jpeg2000DecoderContext *s = avctx->priv_data; - AVFrame *picture = data; int ret; s->avctx = avctx; diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c index 5849f4d1fd..805ff9dda5 100644 --- a/libavcodec/jvdec.c +++ b/libavcodec/jvdec.c @@ -144,8 +144,8 @@ static inline void decode8x8(GetBitContext *gb, uint8_t *dst, int linesize, } } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { JvContext *s = avctx->priv_data; const uint8_t *buf = avpkt->data; @@ -217,7 +217,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, s->palette_has_changed = 0; memcpy(s->frame->data[1], s->palette, AVPALETTE_SIZE); - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; *got_frame = 1; } diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c index 8378dd20ff..83dbc8291f 100644 --- a/libavcodec/kgv1dec.c +++ b/libavcodec/kgv1dec.c @@ -44,10 +44,9 @@ static void decode_flush(AVCodecContext *avctx) av_freep(&c->last_frame_buffer); } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; const uint8_t *buf_end = buf + avpkt->size; KgvContext * const c = avctx->priv_data; diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c index c9b54c3514..f031d37b7f 100644 --- a/libavcodec/kmvc.c +++ b/libavcodec/kmvc.c @@ -261,11 +261,10 @@ static int kmvc_decode_inter_8x8(KmvcContext * ctx, int w, int h) return 0; } -static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext * avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { KmvcContext *const ctx = avctx->priv_data; - AVFrame *frame = data; uint8_t *out, *src; int i, ret; int header; diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c index 39fbfab94f..2276616bb8 100644 --- a/libavcodec/lagarith.c +++ b/libavcodec/lagarith.c @@ -534,13 +534,12 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst, * @param avpkt input packet * @return number of consumed bytes on success or negative if decode fails */ -static int lag_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, AVPacket *avpkt) +static int lag_decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; unsigned int buf_size = avpkt->size; LagarithContext *l = avctx->priv_data; - AVFrame *const p = data; uint8_t frametype; uint32_t offset_gu = 0, offset_bv = 0, offset_ry = 9; uint32_t offs[4]; diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c index 254ed503ab..6285e71d6e 100644 --- a/libavcodec/lcldec.c +++ b/libavcodec/lcldec.c @@ -159,9 +159,9 @@ static int zlib_decomp(AVCodecContext *avctx, const uint8_t *src, int src_len, i #endif -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; LclDecContext * const c = avctx->priv_data; diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c index 7bcade4628..a083487c33 100644 --- a/libavcodec/libaomdec.c +++ b/libavcodec/libaomdec.c @@ -156,11 +156,10 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img) } } -static int aom_decode(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int aom_decode(AVCodecContext *avctx, AVFrame *picture, + int *got_frame, AVPacket *avpkt) { AV1DecodeContext *ctx = avctx->priv_data; - AVFrame *picture = data; const void *iter = NULL; struct aom_image *img; int ret; diff --git a/libavcodec/libcelt_dec.c b/libavcodec/libcelt_dec.c index bae6e680d3..b5fc391731 100644 --- a/libavcodec/libcelt_dec.c +++ b/libavcodec/libcelt_dec.c @@ -103,11 +103,10 @@ static av_cold int libcelt_dec_close(AVCodecContext *c) return 0; } -static int libcelt_dec_decode(AVCodecContext *c, void *data, +static int libcelt_dec_decode(AVCodecContext *c, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt) { struct libcelt_context *celt = c->priv_data; - AVFrame *frame = data; int err; int16_t *pcm; diff --git a/libavcodec/libcodec2.c b/libavcodec/libcodec2.c index f59cb31bf2..2cfa1542e4 100644 --- a/libavcodec/libcodec2.c +++ b/libavcodec/libcodec2.c @@ -130,11 +130,10 @@ static av_cold int libcodec2_close(AVCodecContext *avctx) return 0; } -static int libcodec2_decode(AVCodecContext *avctx, void *data, +static int libcodec2_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt) { LibCodec2Context *c2 = avctx->priv_data; - AVFrame *frame = data; int ret, nframes, i; uint8_t *input; int16_t *output; diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c index caf030b877..564f9fb7c5 100644 --- a/libavcodec/libdavs2.c +++ b/libavcodec/libdavs2.c @@ -176,13 +176,12 @@ static av_cold int davs2_end(AVCodecContext *avctx) return 0; } -static int davs2_decode_frame(AVCodecContext *avctx, void *data, +static int davs2_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { DAVS2Context *cad = avctx->priv_data; int buf_size = avpkt->size; uint8_t *buf_ptr = avpkt->data; - AVFrame *frame = data; int ret = DAVS2_DEFAULT; /* end of stream, output what is still in the buffers */ diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c index e9096a08e6..c90324a3c8 100644 --- a/libavcodec/libfdk-aacdec.c +++ b/libavcodec/libfdk-aacdec.c @@ -377,11 +377,10 @@ FF_ENABLE_DEPRECATION_WARNINGS return 0; } -static int fdk_aac_decode_frame(AVCodecContext *avctx, void *data, +static int fdk_aac_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { FDKAACDecContext *s = avctx->priv_data; - AVFrame *frame = data; int ret; AAC_DECODER_ERROR err; UINT valid = avpkt->size; diff --git a/libavcodec/libgsmdec.c b/libavcodec/libgsmdec.c index 07fae624ff..88f0a0b3d6 100644 --- a/libavcodec/libgsmdec.c +++ b/libavcodec/libgsmdec.c @@ -82,12 +82,11 @@ static av_cold int libgsm_decode_close(AVCodecContext *avctx) { return 0; } -static int libgsm_decode_frame(AVCodecContext *avctx, void *data, +static int libgsm_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { int i, ret; LibGSMDecodeContext *s = avctx->priv_data; - AVFrame *frame = data; uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int16_t *samples; diff --git a/libavcodec/libilbc.c b/libavcodec/libilbc.c index 83d8e33ed9..0fecbd4bba 100644 --- a/libavcodec/libilbc.c +++ b/libavcodec/libilbc.c @@ -87,13 +87,12 @@ static av_cold int ilbc_decode_init(AVCodecContext *avctx) return 0; } -static int ilbc_decode_frame(AVCodecContext *avctx, void *data, +static int ilbc_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; ILBCDecContext *s = avctx->priv_data; - AVFrame *frame = data; int ret; if (s->decoder.no_of_bytes > buf_size) { diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c index 82e0bd708e..8650296113 100644 --- a/libavcodec/libopencore-amr.c +++ b/libavcodec/libopencore-amr.c @@ -96,10 +96,9 @@ static av_cold int amr_nb_decode_close(AVCodecContext *avctx) return 0; } -static int amr_nb_decode_frame(AVCodecContext *avctx, void *data, +static int amr_nb_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; AMRContext *s = avctx->priv_data; @@ -330,10 +329,9 @@ static av_cold int amr_wb_decode_init(AVCodecContext *avctx) return 0; } -static int amr_wb_decode_frame(AVCodecContext *avctx, void *data, +static int amr_wb_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; AMRWBContext *s = avctx->priv_data; diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c index 2cef2fbd47..a88974cc62 100644 --- a/libavcodec/libopenh264dec.c +++ b/libavcodec/libopenh264dec.c @@ -87,14 +87,13 @@ static av_cold int svc_decode_init(AVCodecContext *avctx) return 0; } -static int svc_decode_frame(AVCodecContext *avctx, void *data, +static int svc_decode_frame(AVCodecContext *avctx, AVFrame *avframe, int *got_frame, AVPacket *avpkt) { SVCContext *s = avctx->priv_data; SBufferInfo info = { 0 }; uint8_t *ptrs[4] = { NULL }; int ret, linesize[4]; - AVFrame *avframe = data; DECODING_STATE state; #if OPENH264_VER_AT_LEAST(1, 7) int opt; diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c index 451dc7f65f..1458ea3fdf 100644 --- a/libavcodec/libopenjpegdec.c +++ b/libavcodec/libopenjpegdec.c @@ -318,14 +318,12 @@ static av_cold int libopenjpeg_decode_init(AVCodecContext *avctx) return 0; } -static int libopenjpeg_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int libopenjpeg_decode_frame(AVCodecContext *avctx, AVFrame *picture, + int *got_frame, AVPacket *avpkt) { uint8_t *buf = avpkt->data; int buf_size = avpkt->size; LibOpenJPEGContext *ctx = avctx->priv_data; - AVFrame *picture = data; const AVPixFmtDescriptor *desc; int width, height, ret; int pixel_size = 0; diff --git a/libavcodec/libopusdec.c b/libavcodec/libopusdec.c index 2271eed917..dcc1599d63 100644 --- a/libavcodec/libopusdec.c +++ b/libavcodec/libopusdec.c @@ -156,11 +156,10 @@ static av_cold int libopus_decode_close(AVCodecContext *avc) #define MAX_FRAME_SIZE (960 * 6) -static int libopus_decode(AVCodecContext *avc, void *data, +static int libopus_decode(AVCodecContext *avc, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt) { struct libopus_context *opus = avc->priv_data; - AVFrame *frame = data; int ret, nb_samples; frame->nb_samples = MAX_FRAME_SIZE; diff --git a/libavcodec/librsvgdec.c b/libavcodec/librsvgdec.c index 4a3b0c8ce7..c37fbbb0c9 100644 --- a/libavcodec/librsvgdec.c +++ b/libavcodec/librsvgdec.c @@ -33,11 +33,11 @@ typedef struct LibRSVGContext { int keep_ar; } LibRSVGContext; -static int librsvg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt) +static int librsvg_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *pkt) { int ret; LibRSVGContext *s = avctx->priv_data; - AVFrame *frame = data; RsvgHandle *handle; RsvgDimensionData unscaled_dimensions, dimensions; diff --git a/libavcodec/libspeexdec.c b/libavcodec/libspeexdec.c index bb7ccea647..da47b271e0 100644 --- a/libavcodec/libspeexdec.c +++ b/libavcodec/libspeexdec.c @@ -124,13 +124,12 @@ static av_cold int libspeex_decode_init(AVCodecContext *avctx) return 0; } -static int libspeex_decode_frame(AVCodecContext *avctx, void *data, +static int libspeex_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { uint8_t *buf = avpkt->data; int buf_size = avpkt->size; LibSpeexContext *s = avctx->priv_data; - AVFrame *frame = data; int16_t *output; int ret, consumed = 0; avctx->sample_fmt = AV_SAMPLE_FMT_S16; diff --git a/libavcodec/libuavs3d.c b/libavcodec/libuavs3d.c index a228082f59..b5e861bd1f 100644 --- a/libavcodec/libuavs3d.c +++ b/libavcodec/libuavs3d.c @@ -142,14 +142,14 @@ static void libuavs3d_flush(AVCodecContext * avctx) } #define UAVS3D_CHECK_INVALID_RANGE(v, l, r) ((v)<(l)||(v)>(r)) -static int libuavs3d_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) +static int libuavs3d_decode_frame(AVCodecContext *avctx, AVFrame *frm, + int *got_frame, AVPacket *avpkt) { uavs3d_context *h = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; const uint8_t *buf_end; const uint8_t *buf_ptr; - AVFrame *frm = data; int left_bytes; int ret, finish = 0; @@ -162,7 +162,7 @@ static int libuavs3d_decode_frame(AVCodecContext *avctx, void *data, int *got_fr if (!frm->data[0] && (ret = ff_get_buffer(avctx, frm, 0)) < 0) { return ret; } - h->dec_frame.priv = data; // AVFrame + h->dec_frame.priv = frm; // AVFrame } do { ret = uavs3d_flush(h->dec_handle, &h->dec_frame); @@ -182,7 +182,7 @@ static int libuavs3d_decode_frame(AVCodecContext *avctx, void *data, int *got_fr if (!frm->data[0] && (ret = ff_get_buffer(avctx, frm, 0)) < 0) { return ret; } - h->dec_frame.priv = data; // AVFrame + h->dec_frame.priv = frm; // AVFrame } if (uavs3d_find_next_start_code(buf_ptr, buf_end - buf_ptr, &left_bytes)) { diff --git a/libavcodec/libvorbisdec.c b/libavcodec/libvorbisdec.c index 7d2fdcf785..26bd0c994e 100644 --- a/libavcodec/libvorbisdec.c +++ b/libavcodec/libvorbisdec.c @@ -149,11 +149,10 @@ static inline int conv(int samples, float **pcm, char *buf, int channels) { return 0 ; } -static int oggvorbis_decode_frame(AVCodecContext *avccontext, void *data, - int *got_frame_ptr, AVPacket *avpkt) +static int oggvorbis_decode_frame(AVCodecContext *avccontext, AVFrame *frame, + int *got_frame_ptr, AVPacket *avpkt) { OggVorbisDecContext *context = avccontext->priv_data ; - AVFrame *frame = data; float **pcm ; ogg_packet *op= &context->op; int samples, total_samples, total_bytes; diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c index 592474b301..51bdd13832 100644 --- a/libavcodec/libvpxdec.c +++ b/libavcodec/libvpxdec.c @@ -215,11 +215,10 @@ static int decode_frame(AVCodecContext *avctx, vpx_codec_ctx_t *decoder, return 0; } -static int vpx_decode(AVCodecContext *avctx, - void *data, int *got_frame, AVPacket *avpkt) +static int vpx_decode(AVCodecContext *avctx, AVFrame *picture, + int *got_frame, AVPacket *avpkt) { VPxContext *ctx = avctx->priv_data; - AVFrame *picture = data; const void *iter = NULL; const void *iter_alpha = NULL; struct vpx_image *img, *img_alpha; diff --git a/libavcodec/loco.c b/libavcodec/loco.c index 0501a70ceb..c21214a626 100644 --- a/libavcodec/loco.c +++ b/libavcodec/loco.c @@ -196,14 +196,12 @@ static void rotate_faulty_loco(uint8_t *data, int width, int height, int stride) } } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { LOCOContext * const l = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - AVFrame * const p = data; int decoded, ret; if ((ret = ff_get_buffer(avctx, p, 0)) < 0) diff --git a/libavcodec/lscrdec.c b/libavcodec/lscrdec.c index ab5a391c94..dc2c7a51c2 100644 --- a/libavcodec/lscrdec.c +++ b/libavcodec/lscrdec.c @@ -107,9 +107,8 @@ static int decode_idat(LSCRContext *s, z_stream *zstream, int length) return 0; } -static int decode_frame_lscr(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame_lscr(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { LSCRContext *const s = avctx->priv_data; GetByteContext *gb = &s->gb; @@ -202,7 +201,7 @@ static int decode_frame_lscr(AVCodecContext *avctx, frame->pict_type = frame->key_frame ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; - if ((ret = av_frame_ref(data, frame)) < 0) + if ((ret = av_frame_ref(rframe, frame)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/m101.c b/libavcodec/m101.c index 2c9e084ef1..a635b153f7 100644 --- a/libavcodec/m101.c +++ b/libavcodec/m101.c @@ -44,15 +44,14 @@ static av_cold int m101_decode_init(AVCodecContext *avctx) return 0; } -static int m101_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int m101_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int stride, ret; int x, y; int min_stride = 2 * avctx->width; int bits = avctx->extradata[2*4]; - AVFrame *frame = data; if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) return ret; diff --git a/libavcodec/mace.c b/libavcodec/mace.c index bb96acfba3..b32890c578 100644 --- a/libavcodec/mace.c +++ b/libavcodec/mace.c @@ -234,10 +234,9 @@ static av_cold int mace_decode_init(AVCodecContext * avctx) return 0; } -static int mace_decode_frame(AVCodecContext *avctx, void *data, +static int mace_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int channels = avctx->ch_layout.nb_channels; diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c index 2d698251cb..b99905f4ad 100644 --- a/libavcodec/magicyuv.c +++ b/libavcodec/magicyuv.c @@ -428,11 +428,10 @@ static int build_huffman(AVCodecContext *avctx, const uint8_t *table, return 0; } -static int magy_decode_frame(AVCodecContext *avctx, void *data, +static int magy_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { MagicYUVContext *s = avctx->priv_data; - AVFrame *p = data; GetByteContext gb; uint32_t first_offset, offset, next_offset, header_size, slice_width; int width, height, format, version, table_size; diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index 579fd59b00..24c0fc1adc 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -167,14 +167,12 @@ static inline void idct_put(MDECContext *a, AVFrame *frame, int mb_x, int mb_y) } } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { MDECContext * const a = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - AVFrame *const frame = data; int ret; if ((ret = ff_thread_get_buffer(avctx, frame, 0)) < 0) diff --git a/libavcodec/midivid.c b/libavcodec/midivid.c index fa338c71ec..55fca27085 100644 --- a/libavcodec/midivid.c +++ b/libavcodec/midivid.c @@ -188,7 +188,7 @@ static ptrdiff_t lzss_uncompress(MidiVidContext *s, GetByteContext *gb, uint8_t return dst - dst_start; } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt) { MidiVidContext *s = avctx->priv_data; @@ -224,7 +224,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, return ret; key = ret; - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; frame->pict_type = key ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index 377c84c4c2..05c193989b 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -339,7 +339,7 @@ static void flip_swap_frame(AVFrame *f) f->linesize[i] *= -1; } -static int mimic_decode_frame(AVCodecContext *avctx, void *data, +static int mimic_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -425,11 +425,11 @@ static int mimic_decode_frame(AVCodecContext *avctx, void *data, return res; } - if ((res = av_frame_ref(data, ctx->frames[ctx->cur_index].f)) < 0) + if ((res = av_frame_ref(rframe, ctx->frames[ctx->cur_index].f)) < 0) return res; *got_frame = 1; - flip_swap_frame(data); + flip_swap_frame(rframe); ctx->prev_index = ctx->next_prev_index; ctx->cur_index = ctx->next_cur_index; diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c index e73ae1d35f..b04d61c0e0 100644 --- a/libavcodec/mjpegbdec.c +++ b/libavcodec/mjpegbdec.c @@ -40,9 +40,8 @@ static uint32_t read_offs(AVCodecContext *avctx, GetBitContext *gb, uint32_t siz return offs; } -static int mjpegb_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int mjpegb_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -145,7 +144,7 @@ read_header: return buf_size; } - if ((ret = av_frame_ref(data, s->picture_ptr)) < 0) + if ((ret = av_frame_ref(rframe, s->picture_ptr)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index 5a4d272f78..a3c1850d33 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -1164,7 +1164,7 @@ static int output_data(MLPDecodeContext *m, unsigned int substr, * @return negative on error, 0 if not enough data is present in the input stream, * otherwise the number of bytes consumed. */ -static int read_access_unit(AVCodecContext *avctx, void* data, +static int read_access_unit(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -1356,7 +1356,7 @@ skip_substr: buf += substream_data_len[substr]; } - if ((ret = output_data(m, m->max_decoded_substream, data, got_frame_ptr)) < 0) + if ((ret = output_data(m, m->max_decoded_substream, frame, got_frame_ptr)) < 0) return ret; for (substr = 0; substr <= m->max_decoded_substream; substr++){ diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c index fcc9602666..54ed5fad14 100644 --- a/libavcodec/mmvideo.c +++ b/libavcodec/mmvideo.c @@ -186,9 +186,8 @@ static int mm_decode_inter(MmContext * s, int half_horiz, int half_vert) return 0; } -static int mm_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int mm_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -222,7 +221,7 @@ static int mm_decode_frame(AVCodecContext *avctx, memcpy(s->frame->data[1], s->palette, AVPALETTE_SIZE); - if ((res = av_frame_ref(data, s->frame)) < 0) + if ((res = av_frame_ref(rframe, s->frame)) < 0) return res; *got_frame = 1; diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c index 1f619d6a52..0b7230f326 100644 --- a/libavcodec/mobiclip.c +++ b/libavcodec/mobiclip.c @@ -1208,8 +1208,8 @@ static int predict_motion(AVCodecContext *avctx, return 0; } -static int mobiclip_decode(AVCodecContext *avctx, void *data, - int *got_frame, AVPacket *pkt) +static int mobiclip_decode(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *pkt) { MobiClipContext *s = avctx->priv_data; GetBitContext *gb = &s->gb; @@ -1308,7 +1308,7 @@ static int mobiclip_decode(AVCodecContext *avctx, void *data, avctx->colorspace = AVCOL_SPC_YCGCO; s->current_pic = (s->current_pic + 1) % 6; - ret = av_frame_ref(data, frame); + ret = av_frame_ref(rframe, frame); if (ret < 0) return ret; *got_frame = 1; diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index fcc848f59a..aeea4e6865 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -278,9 +278,8 @@ static void mp_decode_frame_helper(MotionPixelsContext *mp, GetBitContext *gb) mp_decode_line(mp, gb, y); } -static int mp_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int mp_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -340,7 +339,7 @@ static int mp_decode_frame(AVCodecContext *avctx, ff_free_vlc(&mp->vlc); end: - if ((ret = av_frame_ref(data, mp->frame)) < 0) + if ((ret = av_frame_ref(rframe, mp->frame)) < 0) return ret; *got_frame = 1; return buf_size; diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index 2fb0e38e77..5d8280ee2e 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.c @@ -172,10 +172,9 @@ static int get_scale_idx(GetBitContext *gb, int ref) return ref + t; } -static int mpc7_decode_frame(AVCodecContext * avctx, void *data, +static int mpc7_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size; MPCContext *c = avctx->priv_data; diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index 4c5b7fe23e..e876de4813 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -178,10 +178,9 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) return 0; } -static int mpc8_decode_frame(AVCodecContext * avctx, void *data, +static int mpc8_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MPCContext *c = avctx->priv_data; diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 887b8036f8..599ee8dcb1 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -2762,14 +2762,13 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture, } } -static int mpeg_decode_frame(AVCodecContext *avctx, void *data, +static int mpeg_decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_output, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int ret; int buf_size = avpkt->size; Mpeg1Context *s = avctx->priv_data; - AVFrame *picture = data; MpegEncContext *s2 = &s->mpeg_enc_ctx; if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == SEQ_END_CODE)) { @@ -2969,13 +2968,12 @@ typedef struct IPUContext { DECLARE_ALIGNED(32, int16_t, block)[6][64]; } IPUContext; -static int ipu_decode_frame(AVCodecContext *avctx, void *data, +static int ipu_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { IPUContext *s = avctx->priv_data; MpegEncContext *m = &s->m; GetBitContext *gb = &m->gb; - AVFrame * const frame = data; int ret; ret = ff_get_buffer(avctx, frame, 0); diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index 77b4addaf5..a28cac9867 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -1548,8 +1548,8 @@ static int mp_decode_frame(MPADecodeContext *s, OUT_INT **samples, return nb_frames * 32 * sizeof(OUT_INT) * s->nb_channels; } -static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame_ptr, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -1596,7 +1596,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame_ptr, buf_size= s->frame_size; } - s->frame = data; + s->frame = frame; ret = mp_decode_frame(s, NULL, buf, buf_size); if (ret >= 0) { @@ -1633,7 +1633,7 @@ static void flush(AVCodecContext *avctx) } #if CONFIG_MP3ADU_DECODER || CONFIG_MP3ADUFLOAT_DECODER -static int decode_frame_adu(AVCodecContext *avctx, void *data, +static int decode_frame_adu(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -1672,7 +1672,7 @@ static int decode_frame_adu(AVCodecContext *avctx, void *data, s->frame_size = len; - s->frame = data; + s->frame = frame; ret = mp_decode_frame(s, NULL, buf, buf_size); if (ret < 0) { @@ -1813,10 +1813,9 @@ static void flush_mp3on4(AVCodecContext *avctx) } -static int decode_frame_mp3on4(AVCodecContext *avctx, void *data, +static int decode_frame_mp3on4(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MP3On4DecodeContext *s = avctx->priv_data; diff --git a/libavcodec/mscc.c b/libavcodec/mscc.c index a0cd18adab..e7f6015554 100644 --- a/libavcodec/mscc.c +++ b/libavcodec/mscc.c @@ -129,13 +129,11 @@ static int rle_uncompress(AVCodecContext *avctx, GetByteContext *gb, PutByteCont return AVERROR_INVALIDDATA; } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { MSCCContext *s = avctx->priv_data; z_stream *const zstream = &s->zstream.zstream; - AVFrame *frame = data; uint8_t *buf = avpkt->data; int buf_size = avpkt->size; GetByteContext gb; diff --git a/libavcodec/msp2dec.c b/libavcodec/msp2dec.c index b0c772ce4f..99dcf7e9f9 100644 --- a/libavcodec/msp2dec.c +++ b/libavcodec/msp2dec.c @@ -29,13 +29,11 @@ #include "codec_internal.h" #include "internal.h" -static int msp2_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int msp2_decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - AVFrame *p = data; int ret; unsigned int x, y, width = (avctx->width + 7) / 8; GetByteContext idx, gb; diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c index 2506fe1acd..49fd3c86e2 100644 --- a/libavcodec/msrle.c +++ b/libavcodec/msrle.c @@ -82,9 +82,8 @@ static av_cold int msrle_decode_init(AVCodecContext *avctx) return 0; } -static int msrle_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int msrle_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -134,7 +133,7 @@ static int msrle_decode_frame(AVCodecContext *avctx, ff_msrle_decode(avctx, s->frame, avctx->bits_per_coded_sample, &s->gb); } - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/mss1.c b/libavcodec/mss1.c index 6641bec89b..844a6bde9c 100644 --- a/libavcodec/mss1.c +++ b/libavcodec/mss1.c @@ -140,8 +140,8 @@ static int decode_pal(MSS12Context *ctx, ArithCoder *acoder) return !!ncol; } -static int mss1_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int mss1_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { MSS1Context *ctx = avctx->priv_data; MSS12Context *c = &ctx->ctx; @@ -180,7 +180,7 @@ static int mss1_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, memcpy(ctx->pic->data[1], c->pal, AVPALETTE_SIZE); ctx->pic->palette_has_changed = pal_changed; - if ((ret = av_frame_ref(data, ctx->pic)) < 0) + if ((ret = av_frame_ref(rframe, ctx->pic)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c index efe656d1f1..235149b906 100644 --- a/libavcodec/mss2.c +++ b/libavcodec/mss2.c @@ -472,14 +472,13 @@ struct Rectangle { #define MAX_WMV9_RECTANGLES 20 #define ARITH2_PADDING 2 -static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int mss2_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MSS2Context *ctx = avctx->priv_data; MSS12Context *c = &ctx->c; - AVFrame *frame = data; GetBitContext gb; GetByteContext gB; ArithCoder acoder; diff --git a/libavcodec/mss3.c b/libavcodec/mss3.c index 7b615e9b80..3e12ea0399 100644 --- a/libavcodec/mss3.c +++ b/libavcodec/mss3.c @@ -682,8 +682,8 @@ static av_cold void init_coders(MSS3Context *ctx) } } -static int mss3_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int mss3_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -743,7 +743,7 @@ static int mss3_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, c->pic->key_frame = keyframe; c->pic->pict_type = keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; if (!bytestream2_get_bytes_left(&gb)) { - if ((ret = av_frame_ref(data, c->pic)) < 0) + if ((ret = av_frame_ref(rframe, c->pic)) < 0) return ret; *got_frame = 1; @@ -802,7 +802,7 @@ static int mss3_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, dst[2] += c->pic->linesize[2] * 8; } - if ((ret = av_frame_ref(data, c->pic)) < 0) + if ((ret = av_frame_ref(rframe, c->pic)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c index 2d1953729d..c29d885077 100644 --- a/libavcodec/mss4.c +++ b/libavcodec/mss4.c @@ -444,8 +444,8 @@ static inline void mss4_update_dc_cache(MSS4Context *c, int mb_x) } } -static int mss4_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int mss4_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -504,7 +504,7 @@ static int mss4_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, : AV_PICTURE_TYPE_P; if (frame_type == SKIP_FRAME) { *got_frame = 1; - if ((ret = av_frame_ref(data, c->pic)) < 0) + if ((ret = av_frame_ref(rframe, c->pic)) < 0) return ret; return buf_size; @@ -559,7 +559,7 @@ static int mss4_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, dst[2] += c->pic->linesize[2] * 16; } - if ((ret = av_frame_ref(data, c->pic)) < 0) + if ((ret = av_frame_ref(rframe, c->pic)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/msvideo1.c b/libavcodec/msvideo1.c index 416f3c5798..fa08e2cdfd 100644 --- a/libavcodec/msvideo1.c +++ b/libavcodec/msvideo1.c @@ -294,9 +294,8 @@ static void msvideo1_decode_16bit(Msvideo1Context *s) } } -static int msvideo1_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int msvideo1_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -324,7 +323,7 @@ static int msvideo1_decode_frame(AVCodecContext *avctx, else msvideo1_decode_16bit(s); - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/mv30.c b/libavcodec/mv30.c index fd2acedbb2..75ed23d493 100644 --- a/libavcodec/mv30.c +++ b/libavcodec/mv30.c @@ -601,12 +601,11 @@ fail: return ret; } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { MV30Context *s = avctx->priv_data; GetBitContext *gb = &s->gb; - AVFrame *frame = data; int ret; if ((ret = init_get_bits8(gb, avpkt->data, avpkt->size)) < 0) diff --git a/libavcodec/mvcdec.c b/libavcodec/mvcdec.c index 7d69eaefae..2bef903bfa 100644 --- a/libavcodec/mvcdec.c +++ b/libavcodec/mvcdec.c @@ -225,11 +225,10 @@ static int decode_mvc2(AVCodecContext *avctx, GetByteContext *gb, return 0; } -static int mvc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int mvc_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { MvcContext *s = avctx->priv_data; - AVFrame *frame = data; GetByteContext gb; int ret; diff --git a/libavcodec/mvha.c b/libavcodec/mvha.c index c5b5ce0615..7c312d8562 100644 --- a/libavcodec/mvha.c +++ b/libavcodec/mvha.c @@ -148,12 +148,10 @@ static int build_vlc(AVCodecContext *avctx, VLC *vlc) return ff_init_vlc_sparse(vlc, 12, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { MVHAContext *s = avctx->priv_data; - AVFrame *frame = data; uint32_t type, size; int ret; diff --git a/libavcodec/mwsc.c b/libavcodec/mwsc.c index 67fc5a03dd..82d149a295 100644 --- a/libavcodec/mwsc.c +++ b/libavcodec/mwsc.c @@ -87,13 +87,11 @@ static int rle_uncompress(GetByteContext *gb, PutByteContext *pb, GetByteContext return intra; } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { MWSCContext *s = avctx->priv_data; z_stream *const zstream = &s->zstream.zstream; - AVFrame *frame = data; uint8_t *buf = avpkt->data; int buf_size = avpkt->size; GetByteContext gb; diff --git a/libavcodec/mxpegdec.c b/libavcodec/mxpegdec.c index 6fa650124b..19a4bfcd8b 100644 --- a/libavcodec/mxpegdec.c +++ b/libavcodec/mxpegdec.c @@ -180,9 +180,8 @@ static int mxpeg_check_dimensions(MXpegDecodeContext *s, MJpegDecodeContext *jpg return 0; } -static int mxpeg_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int mxpeg_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -324,7 +323,7 @@ static int mxpeg_decode_frame(AVCodecContext *avctx, the_end: if (jpg->got_picture) { - int ret = av_frame_ref(data, jpg->picture_ptr); + int ret = av_frame_ref(rframe, jpg->picture_ptr); if (ret < 0) return ret; *got_frame = 1; diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c index dfd96da80b..1d51b989a5 100644 --- a/libavcodec/nellymoserdec.c +++ b/libavcodec/nellymoserdec.c @@ -139,10 +139,9 @@ static av_cold int decode_init(AVCodecContext * avctx) { return 0; } -static int decode_tag(AVCodecContext *avctx, void *data, +static int decode_tag(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; NellyMoserDecodeContext *s = avctx->priv_data; diff --git a/libavcodec/notchlc.c b/libavcodec/notchlc.c index f3c68905c7..36967a6f63 100644 --- a/libavcodec/notchlc.c +++ b/libavcodec/notchlc.c @@ -460,15 +460,13 @@ static int decode_blocks(AVCodecContext *avctx, AVFrame *p, return 0; } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { NotchLCContext *s = avctx->priv_data; GetByteContext *gb = &s->gb; PutByteContext *pb = &s->pb; unsigned uncompressed_size; - AVFrame *p = data; int ret; if (avpkt->size <= 40) diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index ab0279ebfc..2fdb023751 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -152,13 +152,12 @@ static int codec_reinit(AVCodecContext *avctx, int width, int height, return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *picture, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; NuvContext *c = avctx->priv_data; - AVFrame *picture = data; int orig_size = buf_size; int keyframe, ret; int size_change = 0; diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c index 79af3d9692..9ba4d764a0 100644 --- a/libavcodec/on2avc.c +++ b/libavcodec/on2avc.c @@ -839,10 +839,9 @@ static int on2avc_decode_subframe(On2AVCContext *c, const uint8_t *buf, return 0; } -static int on2avc_decode_frame(AVCodecContext * avctx, void *data, +static int on2avc_decode_frame(AVCodecContext * avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; On2AVCContext *c = avctx->priv_data; diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c index 8ad53c7cb3..ff7dd6c631 100644 --- a/libavcodec/opusdec.c +++ b/libavcodec/opusdec.c @@ -412,11 +412,10 @@ finish: return output_samples; } -static int opus_decode_packet(AVCodecContext *avctx, void *data, +static int opus_decode_packet(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { OpusContext *c = avctx->priv_data; - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int coded_samples = 0; diff --git a/libavcodec/pafaudio.c b/libavcodec/pafaudio.c index a71b0eb50a..6e8da3d3c4 100644 --- a/libavcodec/pafaudio.c +++ b/libavcodec/pafaudio.c @@ -42,10 +42,9 @@ static av_cold int paf_audio_init(AVCodecContext *avctx) return 0; } -static int paf_audio_decode(AVCodecContext *avctx, void *data, +static int paf_audio_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt) { - AVFrame *frame = data; int16_t *output_samples; const uint8_t *src = pkt->data; int frames, ret, i, j; diff --git a/libavcodec/pafvideo.c b/libavcodec/pafvideo.c index 68f6b9b4df..3199e7f44c 100644 --- a/libavcodec/pafvideo.c +++ b/libavcodec/pafvideo.c @@ -268,7 +268,7 @@ static int decode_0(PAFVideoDecContext *c, uint8_t *pkt, uint8_t code) return 0; } -static int paf_video_decode(AVCodecContext *avctx, void *data, +static int paf_video_decode(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *pkt) { PAFVideoDecContext *c = avctx->priv_data; @@ -400,7 +400,7 @@ static int paf_video_decode(AVCodecContext *avctx, void *data, c->width, c->height); c->current_frame = (c->current_frame + 1) & 3; - if ((ret = av_frame_ref(data, c->pic)) < 0) + if ((ret = av_frame_ref(rframe, c->pic)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/pcm-bluray.c b/libavcodec/pcm-bluray.c index 9493b10ecd..fb9d06a36f 100644 --- a/libavcodec/pcm-bluray.c +++ b/libavcodec/pcm-bluray.c @@ -122,10 +122,9 @@ static int pcm_bluray_parse_header(AVCodecContext *avctx, return 0; } -static int pcm_bluray_decode_frame(AVCodecContext *avctx, void *data, +static int pcm_bluray_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *src = avpkt->data; int buf_size = avpkt->size; GetByteContext gb; diff --git a/libavcodec/pcm-dvd.c b/libavcodec/pcm-dvd.c index 6c11bb7792..f7a5ba6600 100644 --- a/libavcodec/pcm-dvd.c +++ b/libavcodec/pcm-dvd.c @@ -225,10 +225,9 @@ static void *pcm_dvd_decode_samples(AVCodecContext *avctx, const uint8_t *src, } } -static int pcm_dvd_decode_frame(AVCodecContext *avctx, void *data, +static int pcm_dvd_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *src = avpkt->data; int buf_size = avpkt->size; PCMDVDContext *s = avctx->priv_data; diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c index aaccd86199..dfb10095c2 100644 --- a/libavcodec/pcm.c +++ b/libavcodec/pcm.c @@ -326,13 +326,12 @@ static av_cold int pcm_decode_init(AVCodecContext *avctx) } \ } -static int pcm_decode_frame(AVCodecContext *avctx, void *data, - int *got_frame_ptr, AVPacket *avpkt) +static int pcm_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *src = avpkt->data; int buf_size = avpkt->size; PCMDecode *s = avctx->priv_data; - AVFrame *frame = data; int channels = avctx->ch_layout.nb_channels; int sample_size, c, n, ret, samples_per_block; uint8_t *samples; diff --git a/libavcodec/pcx.c b/libavcodec/pcx.c index 9c36e76343..2831f1bc3b 100644 --- a/libavcodec/pcx.c +++ b/libavcodec/pcx.c @@ -70,11 +70,10 @@ static void pcx_palette(GetByteContext *gb, uint32_t *dst, int pallen) memset(dst, 0, (256 - pallen) * sizeof(*dst)); } -static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int pcx_decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { GetByteContext gb; - AVFrame * const p = data; int compressed, xmin, ymin, xmax, ymax; int ret; unsigned int w, h, bits_per_pixel, bytes_per_line, nplanes, stride, y, x, diff --git a/libavcodec/pgxdec.c b/libavcodec/pgxdec.c index 2dba42cafb..01cd484da2 100644 --- a/libavcodec/pgxdec.c +++ b/libavcodec/pgxdec.c @@ -117,10 +117,9 @@ error: WRITE_FRAME(8, int8_t, byte) WRITE_FRAME(16, int16_t, be16) -static int pgx_decode_frame(AVCodecContext *avctx, void *data, +static int pgx_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { - AVFrame *p = data; int ret; int bpp; int width, height, depth; diff --git a/libavcodec/photocd.c b/libavcodec/photocd.c index a088ed0fa3..48dc1b88c4 100644 --- a/libavcodec/photocd.c +++ b/libavcodec/photocd.c @@ -290,13 +290,12 @@ static av_noinline int decode_huff(AVCodecContext *avctx, AVFrame *frame, return 0; } -static int photocd_decode_frame(AVCodecContext *avctx, void *data, +static int photocd_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { PhotoCDContext *s = avctx->priv_data; const uint8_t *buf = avpkt->data; GetByteContext *gb = &s->gb; - AVFrame *p = data; uint8_t *ptr, *ptr1, *ptr2; int ret; diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c index 987212e8b7..3c32cbc4e6 100644 --- a/libavcodec/pictordec.c +++ b/libavcodec/pictordec.c @@ -119,12 +119,10 @@ static const uint8_t cga_mode45_index[6][4] = { [5] = { 0, 11, 12, 15 }, // mode5, high intensity }; -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { PicContext *s = avctx->priv_data; - AVFrame *frame = data; uint32_t *palette; int bits_per_plane, bpp, etype, esize, npal, pos_after_pal; int i, x, y, plane, tmp, ret, val; diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c index 9b61a8b1cd..12857919fe 100644 --- a/libavcodec/pixlet.c +++ b/libavcodec/pixlet.c @@ -601,12 +601,11 @@ static int decode_plane(AVCodecContext *avctx, int plane, return 0; } -static int pixlet_decode_frame(AVCodecContext *avctx, void *data, +static int pixlet_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { PixletContext *ctx = avctx->priv_data; int i, w, h, width, height, ret, version; - AVFrame *p = data; uint32_t pktsize, depth; bytestream2_init(&ctx->gb, avpkt->data, avpkt->size); diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 73fda21ca0..59302c898a 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -1515,14 +1515,12 @@ fail: } #if CONFIG_PNG_DECODER -static int decode_frame_png(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame_png(AVCodecContext *avctx, AVFrame *dst_frame, + int *got_frame, AVPacket *avpkt) { PNGDecContext *const s = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - AVFrame *dst_frame = data; AVFrame *p = s->picture.f; int64_t sig; int ret; @@ -1576,12 +1574,10 @@ the_end: #endif #if CONFIG_APNG_DECODER -static int decode_frame_apng(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame_apng(AVCodecContext *avctx, AVFrame *dst_frame, + int *got_frame, AVPacket *avpkt) { PNGDecContext *const s = avctx->priv_data; - AVFrame *dst_frame = data; int ret; AVFrame *p = s->picture.f; diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c index 5984b60999..a6f5d7c55d 100644 --- a/libavcodec/pnmdec.c +++ b/libavcodec/pnmdec.c @@ -39,13 +39,12 @@ static void samplecpy(uint8_t *dst, const uint8_t *src, int n, int maxval) } } -static int pnm_decode_frame(AVCodecContext *avctx, void *data, +static int pnm_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; PNMContext * const s = avctx->priv_data; - AVFrame * const p = data; int i, j, k, n, linesize, h, upgrade = 0, is_mono = 0; unsigned char *ptr; int components, sample_len, ret; diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c index 020206ab22..46ca26150b 100644 --- a/libavcodec/proresdec2.c +++ b/libavcodec/proresdec2.c @@ -778,11 +778,10 @@ static int decode_picture(AVCodecContext *avctx) return ctx->slices[0].ret; } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { ProresContext *ctx = avctx->priv_data; - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int frame_hdr_size, pic_size, ret; diff --git a/libavcodec/prosumer.c b/libavcodec/prosumer.c index b890a42a32..db17cd5083 100644 --- a/libavcodec/prosumer.c +++ b/libavcodec/prosumer.c @@ -144,11 +144,10 @@ static void vertical_predict(uint32_t *dst, int offset, const uint32_t *src, int } } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { ProSumerContext *s = avctx->priv_data; - AVFrame * const frame = data; int ret; if (avpkt->size <= 32) diff --git a/libavcodec/psd.c b/libavcodec/psd.c index 3496759c5b..da802a5585 100644 --- a/libavcodec/psd.c +++ b/libavcodec/psd.c @@ -289,7 +289,7 @@ static int decode_rle(PSDContext * s){ return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt) { int ret; @@ -299,8 +299,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, uint8_t eq_channel[4] = {2,0,1,3};/* RGBA -> GBRA channel order */ uint8_t plane_number; - AVFrame *picture = data; - PSDContext *s = avctx->priv_data; s->avctx = avctx; s->channel_count = 0; diff --git a/libavcodec/ptx.c b/libavcodec/ptx.c index 5f00f7fbee..b782bf1db3 100644 --- a/libavcodec/ptx.c +++ b/libavcodec/ptx.c @@ -26,11 +26,11 @@ #include "codec_internal.h" #include "internal.h" -static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) { +static int ptx_decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) +{ const uint8_t *buf = avpkt->data; const uint8_t *buf_end = avpkt->data + avpkt->size; - AVFrame * const p = data; unsigned int offset, w, h, y, stride, bytes_per_pixel; int ret; uint8_t *ptr; diff --git a/libavcodec/qcelpdec.c b/libavcodec/qcelpdec.c index 2338ec240c..16ece70e63 100644 --- a/libavcodec/qcelpdec.c +++ b/libavcodec/qcelpdec.c @@ -684,13 +684,12 @@ static void postfilter(QCELPContext *q, float *samples, float *lpc) 160, 0.9375, &q->postfilter_agc_mem); } -static int qcelp_decode_frame(AVCodecContext *avctx, void *data, +static int qcelp_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; QCELPContext *q = avctx->priv_data; - AVFrame *frame = data; float *outbuffer; int i, ret; float quantized_lspf[10], lpc[10]; diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index b6a3a7be50..9d0b541964 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -1838,10 +1838,9 @@ static int qdm2_decode(QDM2Context *q, const uint8_t *in, int16_t *out) return 0; } -static int qdm2_decode_frame(AVCodecContext *avctx, void *data, +static int qdm2_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; QDM2Context *s = avctx->priv_data; diff --git a/libavcodec/qdmc.c b/libavcodec/qdmc.c index 44cb6e3b99..4ef4be19f5 100644 --- a/libavcodec/qdmc.c +++ b/libavcodec/qdmc.c @@ -696,11 +696,10 @@ static av_cold void qdmc_flush(AVCodecContext *avctx) s->buffer_offset = 0; } -static int qdmc_decode_frame(AVCodecContext *avctx, void *data, +static int qdmc_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { QDMCContext *s = avctx->priv_data; - AVFrame *frame = data; GetBitContext gb; int ret; diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c index a4cda83096..bf67f8523d 100644 --- a/libavcodec/qdrw.c +++ b/libavcodec/qdrw.c @@ -288,11 +288,9 @@ static int check_header(const char *buf, int buf_size) } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { - AVFrame * const p = data; GetByteContext gbc; int colors; int w, h, ret; diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c index 658cb028ea..0f33e87de1 100644 --- a/libavcodec/qpeg.c +++ b/libavcodec/qpeg.c @@ -266,13 +266,11 @@ static void av_noinline qpeg_decode_inter(QpegContext *qctx, uint8_t *dst, } } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { uint8_t ctable[128]; QpegContext * const a = avctx->priv_data; - AVFrame * const p = data; AVFrame * const ref = a->ref; uint8_t* outdata; int delta, intra, ret; diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index 661f15bc75..08eda5bc26 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -910,11 +910,10 @@ fail: return ret; } -static int qsv_decode_frame(AVCodecContext *avctx, void *data, +static int qsv_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { QSVDecContext *s = avctx->priv_data; - AVFrame *frame = data; int ret; /* buffer the input packet */ diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c index 0e28884b9d..b7f114bdec 100644 --- a/libavcodec/qtrle.c +++ b/libavcodec/qtrle.c @@ -446,9 +446,8 @@ static av_cold int qtrle_decode_init(AVCodecContext *avctx) return 0; } -static int qtrle_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int qtrle_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { QtrleContext *s = avctx->priv_data; int header, start_line; @@ -558,7 +557,7 @@ done: return ret; } - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/r210dec.c b/libavcodec/r210dec.c index cfe6401a21..da20ffe067 100644 --- a/libavcodec/r210dec.c +++ b/libavcodec/r210dec.c @@ -35,11 +35,10 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *pic, + int *got_frame, AVPacket *avpkt) { int h, w, ret; - AVFrame *pic = data; const uint32_t *src = (const uint32_t *)avpkt->data; int aligned_width = FFALIGN(avctx->width, avctx->codec_id == AV_CODEC_ID_R10K ? 1 : 64); diff --git a/libavcodec/ra144dec.c b/libavcodec/ra144dec.c index b3683db549..b795e327a2 100644 --- a/libavcodec/ra144dec.c +++ b/libavcodec/ra144dec.c @@ -60,10 +60,9 @@ static void do_output_subblock(RA144Context *ractx, const int16_t *lpc_coefs, } /** Uncompress one block (20 bytes -> 160*2 bytes). */ -static int ra144_decode_frame(AVCodecContext * avctx, void *data, +static int ra144_decode_frame(AVCodecContext * avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; static const uint8_t sizes[LPC_ORDER] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2}; diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c index ddf9331e39..f904d471a3 100644 --- a/libavcodec/ra288.c +++ b/libavcodec/ra288.c @@ -187,10 +187,9 @@ static void backward_filter(RA288Context *ractx, memmove(hist, hist + n, move_size*sizeof(*hist)); } -static int ra288_decode_frame(AVCodecContext * avctx, void *data, +static int ra288_decode_frame(AVCodecContext * avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; float *out; diff --git a/libavcodec/ralf.c b/libavcodec/ralf.c index 93970fd1ee..3887c29ee9 100644 --- a/libavcodec/ralf.c +++ b/libavcodec/ralf.c @@ -410,11 +410,10 @@ static int decode_block(AVCodecContext *avctx, GetBitContext *gb, return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame_ptr, AVPacket *avpkt) { RALFContext *ctx = avctx->priv_data; - AVFrame *frame = data; int16_t *samples0; int16_t *samples1; int ret; diff --git a/libavcodec/rasc.c b/libavcodec/rasc.c index 8a4e2b7600..6966ada2d0 100644 --- a/libavcodec/rasc.c +++ b/libavcodec/rasc.c @@ -671,14 +671,12 @@ static void draw_cursor(AVCodecContext *avctx) } } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { RASCContext *s = avctx->priv_data; GetByteContext *gb = &s->gb; int ret, intra = 0; - AVFrame *frame = data; bytestream2_init(gb, avpkt->data, avpkt->size); diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index b1c12a500b..7ed7492337 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -163,8 +163,8 @@ static void name(AVCodecContext *avctx, uint8_t * dst, const uint8_t *buf, int b MKSCALE16(scale16be, AV_RB16, AV_WB16) MKSCALE16(scale16le, AV_RL16, AV_WL16) -static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int raw_decode(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { const AVPixFmtDescriptor *desc; RawVideoContext *context = avctx->priv_data; @@ -175,8 +175,6 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame, int res, len; int need_copy; - AVFrame *frame = data; - if (avctx->width <= 0) { av_log(avctx, AV_LOG_ERROR, "width is not set\n"); return AVERROR_INVALIDDATA; diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c index b4548c0247..37c9bf5d82 100644 --- a/libavcodec/rl2.c +++ b/libavcodec/rl2.c @@ -178,11 +178,9 @@ static av_cold int rl2_decode_init(AVCodecContext *avctx) } -static int rl2_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int rl2_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int ret, buf_size = avpkt->size; Rl2Context *s = avctx->priv_data; diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c index 7ce3dc8b59..99aa1ce24c 100644 --- a/libavcodec/roqvideodec.c +++ b/libavcodec/roqvideodec.c @@ -191,9 +191,8 @@ static av_cold int roq_decode_init(AVCodecContext *avctx) return 0; } -static int roq_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int roq_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -214,7 +213,7 @@ static int roq_decode_frame(AVCodecContext *avctx, bytestream2_init(&gb, buf, buf_size); roqvideo_decode_frame(s, &gb); - if ((ret = av_frame_ref(data, s->current_frame)) < 0) + if ((ret = av_frame_ref(rframe, s->current_frame)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c index e3989f7d9f..4482dfc8c8 100644 --- a/libavcodec/rpza.c +++ b/libavcodec/rpza.c @@ -256,9 +256,8 @@ static av_cold int rpza_decode_init(AVCodecContext *avctx) return 0; } -static int rpza_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int rpza_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { RpzaContext *s = avctx->priv_data; int ret; @@ -269,7 +268,7 @@ static int rpza_decode_frame(AVCodecContext *avctx, if (ret < 0) return ret; - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/rscc.c b/libavcodec/rscc.c index bbbf14c6e6..3891cf24e4 100644 --- a/libavcodec/rscc.c +++ b/libavcodec/rscc.c @@ -148,13 +148,12 @@ static av_cold int rscc_close(AVCodecContext *avctx) return 0; } -static int rscc_decode_frame(AVCodecContext *avctx, void *data, - int *got_frame, AVPacket *avpkt) +static int rscc_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { RsccContext *ctx = avctx->priv_data; GetByteContext *gbc = &ctx->gbc; GetByteContext tiles_gbc; - AVFrame *frame = data; const uint8_t *pixels, *raw; uint8_t *inflated_tiles = NULL; int tiles_nb, packed_size, pixel_size = 0; diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 23d0ea8516..8c2188bc05 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -593,13 +593,12 @@ static int get_slice_offset(AVCodecContext *avctx, const uint8_t *buf, int n) return AV_RL32(buf + n * 8); } -static int rv10_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int rv10_decode_frame(AVCodecContext *avctx, AVFrame *pict, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MpegEncContext *s = avctx->priv_data; - AVFrame *pict = data; int i, ret; int slice_count; const uint8_t *slices_hdr = NULL; diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c index fb5b19c913..3494c0c579 100644 --- a/libavcodec/rv34.c +++ b/libavcodec/rv34.c @@ -1596,15 +1596,13 @@ static AVRational update_sar(int old_w, int old_h, AVRational sar, int new_w, in return sar; } -int ff_rv34_decode_frame(AVCodecContext *avctx, - void *data, int *got_picture_ptr, - AVPacket *avpkt) +int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict, + int *got_picture_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; RV34DecContext *r = avctx->priv_data; MpegEncContext *s = &r->s; - AVFrame *pict = data; SliceInfo si; int i, ret; int slice_count; diff --git a/libavcodec/rv34.h b/libavcodec/rv34.h index 53b29dc245..84789625ce 100644 --- a/libavcodec/rv34.h +++ b/libavcodec/rv34.h @@ -136,7 +136,8 @@ typedef struct RV34DecContext{ */ int ff_rv34_get_start_offset(GetBitContext *gb, int blocks); int ff_rv34_decode_init(AVCodecContext *avctx); -int ff_rv34_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt); +int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt); int ff_rv34_decode_end(AVCodecContext *avctx); int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src); diff --git a/libavcodec/s302m.c b/libavcodec/s302m.c index d90549e487..68533be6c6 100644 --- a/libavcodec/s302m.c +++ b/libavcodec/s302m.c @@ -98,11 +98,10 @@ static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf, return frame_size; } -static int s302m_decode_frame(AVCodecContext *avctx, void *data, +static int s302m_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { S302Context *s = avctx->priv_data; - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int block_size, ret, channels; diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 7d8a45a298..b5e12fccc1 100644 --- a/libavcodec/sanm.c +++ b/libavcodec/sanm.c @@ -1387,13 +1387,13 @@ static int copy_output(SANMVideoContext *ctx, SANMFrameHeader *hdr) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt) { SANMVideoContext *ctx = avctx->priv_data; int i, ret; - ctx->frame = data; + ctx->frame = frame; bytestream2_init(&ctx->gb, pkt->data, pkt->size); if (!ctx->version) { diff --git a/libavcodec/sbcdec.c b/libavcodec/sbcdec.c index 53e5ce2583..6b79136fac 100644 --- a/libavcodec/sbcdec.c +++ b/libavcodec/sbcdec.c @@ -337,12 +337,10 @@ static int sbc_decode_init(AVCodecContext *avctx) return 0; } -static int sbc_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame_ptr, - AVPacket *avpkt) +static int sbc_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame_ptr, AVPacket *avpkt) { SBCDecContext *sbc = avctx->priv_data; - AVFrame *frame = data; int ret, frame_length; if (!sbc) diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c index 9e10c960b6..c744db2539 100644 --- a/libavcodec/scpr.c +++ b/libavcodec/scpr.c @@ -492,12 +492,11 @@ static int decompress_p(AVCodecContext *avctx, return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { SCPRContext *s = avctx->priv_data; GetByteContext *gb = &s->gb; - AVFrame *frame = data; int ret, type; if (avctx->bits_per_coded_sample == 16) { @@ -582,7 +581,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return AVERROR_INVALIDDATA; if (avctx->bits_per_coded_sample != 16) { - ret = av_frame_ref(data, s->current_frame); + ret = av_frame_ref(frame, s->current_frame); if (ret < 0) return ret; } else { diff --git a/libavcodec/screenpresso.c b/libavcodec/screenpresso.c index c51fd513c8..b2b71a00b3 100644 --- a/libavcodec/screenpresso.c +++ b/libavcodec/screenpresso.c @@ -102,11 +102,10 @@ static void sum_delta_flipped(uint8_t *dst, int dst_linesize, } } -static int screenpresso_decode_frame(AVCodecContext *avctx, void *data, +static int screenpresso_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { ScreenpressoContext *ctx = avctx->priv_data; - AVFrame *frame = data; uLongf length = ctx->inflated_size; int keyframe, component_size, src_linesize; int ret; diff --git a/libavcodec/sga.c b/libavcodec/sga.c index 566a53ee75..cb6d8db3f4 100644 --- a/libavcodec/sga.c +++ b/libavcodec/sga.c @@ -306,12 +306,11 @@ static int decode_tiledata(AVCodecContext *avctx) return 0; } -static int sga_decode_frame(AVCodecContext *avctx, void *data, +static int sga_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { SGAVideoContext *s = avctx->priv_data; GetByteContext *gb = &s->gb; - AVFrame *frame = data; int ret, type; if (avpkt->size <= 14) diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c index 8ff6b4f024..a0669590ed 100644 --- a/libavcodec/sgidec.c +++ b/libavcodec/sgidec.c @@ -199,12 +199,10 @@ static int read_uncompressed_sgi(unsigned char *out_buf, SgiState *s) return 0; } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { SgiState *s = avctx->priv_data; - AVFrame *p = data; unsigned int dimension, rle; int ret = 0; uint8_t *out_buf, *out_end; diff --git a/libavcodec/sgirledec.c b/libavcodec/sgirledec.c index fc3231a5b4..8e00fdf183 100644 --- a/libavcodec/sgirledec.c +++ b/libavcodec/sgirledec.c @@ -110,10 +110,9 @@ static int decode_sgirle8(AVCodecContext *avctx, uint8_t *dst, return 0; } -static int sgirle_decode_frame(AVCodecContext *avctx, void *data, +static int sgirle_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { - AVFrame *frame = data; int ret; if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) diff --git a/libavcodec/sheervideo.c b/libavcodec/sheervideo.c index 8ed48b1cee..ecde9e1637 100644 --- a/libavcodec/sheervideo.c +++ b/libavcodec/sheervideo.c @@ -1801,13 +1801,11 @@ static av_cold int build_vlc(VLC *vlc, const SheerTable *table) lens, sizeof(*lens), NULL, 0, 0, 0, 0, NULL); } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { SheerVideoContext *s = avctx->priv_data; const SheerTable *table; - AVFrame *p = data; GetBitContext gb; unsigned format; int ret; diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index bbb955c177..96dec88191 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -522,10 +522,9 @@ end: return 0; } -static int shorten_decode_frame(AVCodecContext *avctx, void *data, +static int shorten_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; ShortenContext *s = avctx->priv_data; diff --git a/libavcodec/sipr.c b/libavcodec/sipr.c index 67450c94a3..dde39f154a 100644 --- a/libavcodec/sipr.c +++ b/libavcodec/sipr.c @@ -520,11 +520,10 @@ static av_cold int sipr_decoder_init(AVCodecContext * avctx) return 0; } -static int sipr_decode_frame(AVCodecContext *avctx, void *data, +static int sipr_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { SiprContext *ctx = avctx->priv_data; - AVFrame *frame = data; const uint8_t *buf=avpkt->data; SiprParameters parm; const SiprModeParam *mode_par = &modes[ctx->mode]; diff --git a/libavcodec/siren.c b/libavcodec/siren.c index 96907bfbf1..70e8267dad 100644 --- a/libavcodec/siren.c +++ b/libavcodec/siren.c @@ -703,12 +703,11 @@ static int decode_vector(SirenContext *s, int number_of_regions, return error == 1 ? AVERROR_INVALIDDATA : (get_bits_left(gb) - s->checksum_bits); } -static int siren_decode(AVCodecContext *avctx, void *data, +static int siren_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { SirenContext *s = avctx->priv_data; GetBitContext *gb = &s->gb; - AVFrame *frame = data; int ret, number_of_valid_coefs = REGION_SIZE * s->number_of_regions; int frame_error = 0, rate_control = 0; int bits_per_frame; diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index c1b94213c0..1ef2161dbb 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -371,8 +371,8 @@ static av_always_inline int smk_get_code(GetBitContext *gb, int *recode, int *la return v; } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { SmackVContext * const smk = avctx->priv_data; uint8_t *out; @@ -518,7 +518,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } - if ((ret = av_frame_ref(data, smk->pic)) < 0) + if ((ret = av_frame_ref(rframe, smk->pic)) < 0) return ret; *got_frame = 1; @@ -588,10 +588,9 @@ static av_cold int smka_decode_init(AVCodecContext *avctx) /** * Decode Smacker audio data */ -static int smka_decode_frame(AVCodecContext *avctx, void *data, +static int smka_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; GetBitContext gb; diff --git a/libavcodec/smc.c b/libavcodec/smc.c index 0a32773944..2f87937c49 100644 --- a/libavcodec/smc.c +++ b/libavcodec/smc.c @@ -428,9 +428,8 @@ static av_cold int smc_decode_init(AVCodecContext *avctx) return 0; } -static int smc_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int smc_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -453,7 +452,7 @@ static int smc_decode_frame(AVCodecContext *avctx, return ret; *got_frame = 1; - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; /* always report that the buffer was completely consumed */ diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c index d1e11cd5f6..4208707da0 100644 --- a/libavcodec/snowdec.c +++ b/libavcodec/snowdec.c @@ -436,15 +436,14 @@ static int decode_blocks(SnowContext *s){ return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *picture, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; SnowContext *s = avctx->priv_data; RangeCoder * const c= &s->c; int bytes_read; - AVFrame *picture = data; int level, orientation, plane_index; int res; diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index 264a5ff2b3..f20365485d 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -980,9 +980,8 @@ static av_cold int sonic_decode_close(AVCodecContext *avctx) return 0; } -static int sonic_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame_ptr, - AVPacket *avpkt) +static int sonic_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -991,7 +990,6 @@ static int sonic_decode_frame(AVCodecContext *avctx, uint8_t state[32]; int i, quant, ch, j, ret; int16_t *samples; - AVFrame *frame = data; if (buf_size == 0) return 0; diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c index 1e441862d9..fbe2d584d0 100644 --- a/libavcodec/speedhq.c +++ b/libavcodec/speedhq.c @@ -489,14 +489,12 @@ static void compute_quant_matrix(int *output, int qscale) for (i = 0; i < 64; i++) output[i] = unscaled_quant_matrix[ff_zigzag_direct[i]] * qscale; } -static int speedhq_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int speedhq_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { SHQContext * const s = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - AVFrame *frame = data; uint8_t quality; uint32_t second_field_offset; int ret; diff --git a/libavcodec/speexdec.c b/libavcodec/speexdec.c index 940f521686..28a6b67a66 100644 --- a/libavcodec/speexdec.c +++ b/libavcodec/speexdec.c @@ -1533,11 +1533,10 @@ static void speex_decode_stereo(float *data, int frame_size, StereoState *stereo } } -static int speex_decode_frame(AVCodecContext *avctx, void *data, +static int speex_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { SpeexContext *s = avctx->priv_data; - AVFrame *frame = data; const float scale = 1.f / 32768.f; int buf_size = avpkt->size; float *dst; diff --git a/libavcodec/sunrast.c b/libavcodec/sunrast.c index d52a34df0f..65b4f359b2 100644 --- a/libavcodec/sunrast.c +++ b/libavcodec/sunrast.c @@ -27,12 +27,11 @@ #include "internal.h" #include "sunrast.h" -static int sunrast_decode_frame(AVCodecContext *avctx, void *data, +static int sunrast_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; const uint8_t *buf_end = avpkt->data + avpkt->size; - AVFrame * const p = data; unsigned int w, h, depth, type, maptype, maplength, stride, x, y, len, alen; uint8_t *ptr, *ptr2 = NULL; const uint8_t *bufstart = buf; diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c index a223cb4da3..e0a599bb36 100644 --- a/libavcodec/svq1dec.c +++ b/libavcodec/svq1dec.c @@ -617,13 +617,12 @@ static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame) return 0; } -static int svq1_decode_frame(AVCodecContext *avctx, void *data, +static int svq1_decode_frame(AVCodecContext *avctx, AVFrame *cur, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; SVQ1Context *s = avctx->priv_data; - AVFrame *cur = data; uint8_t *current; int result, i, x, y, width, height; int ret; diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 7c2d5147b0..69949b7e63 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -1371,7 +1371,7 @@ fail: return ret; } -static int svq3_decode_frame(AVCodecContext *avctx, void *data, +static int svq3_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt) { SVQ3Context *s = avctx->priv_data; @@ -1382,7 +1382,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data, /* special case for last picture */ if (buf_size == 0) { if (s->next_pic->f->data[0] && !s->low_delay && !s->last_frame_output) { - ret = av_frame_ref(data, s->next_pic->f); + ret = av_frame_ref(rframe, s->next_pic->f); if (ret < 0) return ret; s->last_frame_output = 1; @@ -1553,9 +1553,9 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data, } if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) - ret = av_frame_ref(data, s->cur_pic->f); + ret = av_frame_ref(rframe, s->cur_pic->f); else if (s->last_pic->f->data[0]) - ret = av_frame_ref(data, s->last_pic->f); + ret = av_frame_ref(rframe, s->last_pic->f); if (ret < 0) return ret; diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c index 0ce08b564c..0ef42adc81 100644 --- a/libavcodec/takdec.c +++ b/libavcodec/takdec.c @@ -674,11 +674,10 @@ static int decorrelate(TAKDecContext *s, int c1, int c2, int length) return 0; } -static int tak_decode_frame(AVCodecContext *avctx, void *data, +static int tak_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt) { TAKDecContext *s = avctx->priv_data; - AVFrame *frame = data; GetBitContext *gb = &s->gb; int chan, i, ret, hsize; diff --git a/libavcodec/targa.c b/libavcodec/targa.c index a354bca06e..d6c46f8dce 100644 --- a/libavcodec/targa.c +++ b/libavcodec/targa.c @@ -107,12 +107,10 @@ static int targa_decode_rle(AVCodecContext *avctx, TargaContext *s, return 0; } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { TargaContext * const s = avctx->priv_data; - AVFrame * const p = data; uint8_t *dst; int stride; int idlen, pal, compr, y, w, h, bpp, flags, ret; diff --git a/libavcodec/targa_y216dec.c b/libavcodec/targa_y216dec.c index 57c8211118..c6339ab92a 100644 --- a/libavcodec/targa_y216dec.c +++ b/libavcodec/targa_y216dec.c @@ -31,10 +31,9 @@ static av_cold int y216_decode_init(AVCodecContext *avctx) return 0; } -static int y216_decode_frame(AVCodecContext *avctx, void *data, +static int y216_decode_frame(AVCodecContext *avctx, AVFrame *pic, int *got_frame, AVPacket *avpkt) { - AVFrame *pic = data; const uint16_t *src = (uint16_t *)avpkt->data; uint16_t *y, *u, *v; int aligned_width = FFALIGN(avctx->width, 4); diff --git a/libavcodec/tdsc.c b/libavcodec/tdsc.c index d25a4d4dd0..701cd8b9ad 100644 --- a/libavcodec/tdsc.c +++ b/libavcodec/tdsc.c @@ -522,11 +522,10 @@ static int tdsc_parse_dtsm(AVCodecContext *avctx) return 0; } -static int tdsc_decode_frame(AVCodecContext *avctx, void *data, +static int tdsc_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { TDSCContext *ctx = avctx->priv_data; - AVFrame *frame = data; int ret, tag_header, keyframe = 0; uLongf dlen; diff --git a/libavcodec/tiertexseqv.c b/libavcodec/tiertexseqv.c index d269fb96c9..06d9c39880 100644 --- a/libavcodec/tiertexseqv.c +++ b/libavcodec/tiertexseqv.c @@ -230,9 +230,8 @@ static av_cold int seqvideo_decode_init(AVCodecContext *avctx) return 0; } -static int seqvideo_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int seqvideo_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -246,7 +245,7 @@ static int seqvideo_decode_frame(AVCodecContext *avctx, if (seqvideo_decode(seq, buf, buf_size)) return AVERROR_INVALIDDATA; - if ((ret = av_frame_ref(data, seq->frame)) < 0) + if ((ret = av_frame_ref(rframe, seq->frame)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index fdd3ae5c68..3d5b3c28ac 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -1740,11 +1740,10 @@ end: return 0; } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { TiffContext *const s = avctx->priv_data; - AVFrame *const p = data; unsigned off, last_off; int le, ret, plane, planes; int i, j, entries, stride; @@ -1940,7 +1939,7 @@ again: avpriv_report_missing_feature(avctx, "DNG JPG-compressed tiled non-bayer-encoded images"); return AVERROR_PATCHWELCOME; } else { - if ((ret = dng_decode_tiles(avctx, (AVFrame*)data, avpkt)) > 0) + if ((ret = dng_decode_tiles(avctx, p, avpkt)) > 0) *got_frame = 1; return ret; } diff --git a/libavcodec/tmv.c b/libavcodec/tmv.c index f4c7474136..263a63aa55 100644 --- a/libavcodec/tmv.c +++ b/libavcodec/tmv.c @@ -36,10 +36,9 @@ #include "cga_data.h" -static int tmv_decode_frame(AVCodecContext *avctx, void *data, +static int tmv_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *src = avpkt->data; uint8_t *dst; unsigned char_cols = avctx->width >> 3; diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c index f8da11b6b3..7ef025b43e 100644 --- a/libavcodec/truemotion1.c +++ b/libavcodec/truemotion1.c @@ -869,9 +869,8 @@ static void truemotion1_decode_24bit(TrueMotion1Context *s) } -static int truemotion1_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int truemotion1_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int ret, buf_size = avpkt->size; @@ -892,7 +891,7 @@ static int truemotion1_decode_frame(AVCodecContext *avctx, truemotion1_decode_16bit(s); } - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c index eff7d77e03..a89f999ce5 100644 --- a/libavcodec/truemotion2.c +++ b/libavcodec/truemotion2.c @@ -886,9 +886,8 @@ static const int tm2_stream_order[TM2_NUM_STREAMS] = { #define TM2_HEADER_SIZE 40 -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { TM2Context * const l = avctx->priv_data; const uint8_t *buf = avpkt->data; @@ -939,7 +938,7 @@ static int decode_frame(AVCodecContext *avctx, l->cur = !l->cur; *got_frame = 1; - ret = av_frame_ref(data, l->pic); + ret = av_frame_ref(rframe, l->pic); return (ret < 0) ? ret : buf_size; } diff --git a/libavcodec/truemotion2rt.c b/libavcodec/truemotion2rt.c index d2a78a35ef..0383cb090f 100644 --- a/libavcodec/truemotion2rt.c +++ b/libavcodec/truemotion2rt.c @@ -102,11 +102,10 @@ static int truemotion2rt_decode_header(AVCodecContext *avctx, const AVPacket *av return header_size; } -static int truemotion2rt_decode_frame(AVCodecContext *avctx, void *data, +static int truemotion2rt_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { TrueMotion2RTContext *s = avctx->priv_data; - AVFrame * const p = data; GetBitContext *gb = &s->gb; uint8_t *dst; int x, y, delta_mode; diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c index 1d0a8d3f1e..a8bf43d2a4 100644 --- a/libavcodec/truespeech.c +++ b/libavcodec/truespeech.c @@ -306,10 +306,9 @@ static void truespeech_save_prevvec(TSContext *c) c->prevfilt[i] = c->cvector[i]; } -static int truespeech_decode_frame(AVCodecContext *avctx, void *data, +static int truespeech_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; TSContext *c = avctx->priv_data; diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c index 83db8b46ff..a841fd2c9d 100644 --- a/libavcodec/tscc.c +++ b/libavcodec/tscc.c @@ -64,8 +64,8 @@ typedef struct TsccContext { uint32_t pal[256]; } CamtasiaContext; -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -114,7 +114,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, memcpy(frame->data[1], c->pal, AVPALETTE_SIZE); } - if ((ret = av_frame_ref(data, frame)) < 0) + if ((ret = av_frame_ref(rframe, frame)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c index 5ff15656ce..6879f42cd9 100644 --- a/libavcodec/tscc2.c +++ b/libavcodec/tscc2.c @@ -205,7 +205,7 @@ static int tscc2_decode_slice(TSCC2Context *c, int mb_y, return 0; } -static int tscc2_decode_frame(AVCodecContext *avctx, void *data, +static int tscc2_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; @@ -313,7 +313,7 @@ static int tscc2_decode_frame(AVCodecContext *avctx, void *data, } *got_frame = 1; - if ((ret = av_frame_ref(data, c->pic)) < 0) + if ((ret = av_frame_ref(rframe, c->pic)) < 0) return ret; /* always report that the buffer was completely consumed */ diff --git a/libavcodec/tta.c b/libavcodec/tta.c index 7fa36a6926..506a61b881 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -224,10 +224,9 @@ static av_cold int tta_decode_init(AVCodecContext * avctx) return allocate_buffers(avctx); } -static int tta_decode_frame(AVCodecContext *avctx, void *data, +static int tta_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; TTAContext *s = avctx->priv_data; diff --git a/libavcodec/twinvq.c b/libavcodec/twinvq.c index 77dfa31dc2..ba84c8c6b0 100644 --- a/libavcodec/twinvq.c +++ b/libavcodec/twinvq.c @@ -475,10 +475,9 @@ const enum TwinVQFrameType ff_twinvq_wtype_to_ftype_table[] = { TWINVQ_FT_MEDIUM }; -int ff_twinvq_decode_frame(AVCodecContext *avctx, void *data, +int ff_twinvq_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; TwinVQContext *tctx = avctx->priv_data; diff --git a/libavcodec/twinvq.h b/libavcodec/twinvq.h index 5f49796f03..b3c881cfac 100644 --- a/libavcodec/twinvq.h +++ b/libavcodec/twinvq.h @@ -194,7 +194,7 @@ static inline float twinvq_mulawinv(float y, float clip, float mu) return clip * FFSIGN(y) * (exp(log(1 + mu) * fabs(y)) - 1) / mu; } -int ff_twinvq_decode_frame(AVCodecContext *avctx, void *data, +int ff_twinvq_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt); int ff_twinvq_decode_close(AVCodecContext *avctx); /** Requires the caller to call ff_twinvq_decode_close() upon failure. */ diff --git a/libavcodec/txd.c b/libavcodec/txd.c index dec033182c..854ef1522d 100644 --- a/libavcodec/txd.c +++ b/libavcodec/txd.c @@ -32,11 +32,11 @@ #define TXD_DXT1 0x31545844 #define TXD_DXT3 0x33545844 -static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) { +static int txd_decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) +{ GetByteContext gb; TextureDSPContext dxtc; - AVFrame * const p = data; unsigned int version, w, h, d3d_format, depth, stride, flags; unsigned int y, v; uint8_t *ptr; diff --git a/libavcodec/ulti.c b/libavcodec/ulti.c index fa689a1e89..c5be1dffda 100644 --- a/libavcodec/ulti.c +++ b/libavcodec/ulti.c @@ -214,9 +214,8 @@ static void ulti_grad(AVFrame *frame, int x, int y, uint8_t *Y, int chroma, int ulti_convert_yuv(frame, x, y, Luma, chroma); } -static int ulti_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int ulti_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -408,7 +407,7 @@ static int ulti_decode_frame(AVCodecContext *avctx, } *got_frame = 1; - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; return buf_size; diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c index 4d41da4543..051f90c9db 100644 --- a/libavcodec/utvideodec.c +++ b/libavcodec/utvideodec.c @@ -557,13 +557,12 @@ static void restore_gradient_planar_il(UtvideoContext *c, uint8_t *src, ptrdiff_ } } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; UtvideoContext *c = avctx->priv_data; - AVFrame *const frame = data; int i, j; const uint8_t *plane_start[5]; int plane_size, max_slice_size = 0, slice_start, slice_end, slice_size; diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c index 47af2e6655..f208a0786f 100644 --- a/libavcodec/v210dec.c +++ b/libavcodec/v210dec.c @@ -136,13 +136,12 @@ static int v210_decode_slice(AVCodecContext *avctx, void *arg, int jobnr, int th return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *pic, + int *got_frame, AVPacket *avpkt) { V210DecContext *s = avctx->priv_data; ThreadData td; int ret, stride, aligned_input; - AVFrame *pic = data; const uint8_t *psrc = avpkt->data; if (s->custom_stride ) diff --git a/libavcodec/v210x.c b/libavcodec/v210x.c index 7273694ed8..34eb54e447 100644 --- a/libavcodec/v210x.c +++ b/libavcodec/v210x.c @@ -36,11 +36,10 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *pic, + int *got_frame, AVPacket *avpkt) { const uint32_t *src = (const uint32_t *)avpkt->data; - AVFrame *pic = data; int width = avctx->width; int y = 0; uint16_t *ydst, *udst, *vdst, *yend; diff --git a/libavcodec/v308dec.c b/libavcodec/v308dec.c index 99b92cc227..6c85bc585d 100644 --- a/libavcodec/v308dec.c +++ b/libavcodec/v308dec.c @@ -33,10 +33,9 @@ static av_cold int v308_decode_init(AVCodecContext *avctx) return 0; } -static int v308_decode_frame(AVCodecContext *avctx, void *data, +static int v308_decode_frame(AVCodecContext *avctx, AVFrame *pic, int *got_frame, AVPacket *avpkt) { - AVFrame *pic = data; const uint8_t *src = avpkt->data; uint8_t *y, *u, *v; int i, j, ret; diff --git a/libavcodec/v408dec.c b/libavcodec/v408dec.c index cbddc723de..32ea98b724 100644 --- a/libavcodec/v408dec.c +++ b/libavcodec/v408dec.c @@ -32,10 +32,9 @@ static av_cold int v408_decode_init(AVCodecContext *avctx) return 0; } -static int v408_decode_frame(AVCodecContext *avctx, void *data, +static int v408_decode_frame(AVCodecContext *avctx, AVFrame *pic, int *got_frame, AVPacket *avpkt) { - AVFrame *pic = data; const uint8_t *src = avpkt->data; uint8_t *y, *u, *v, *a; int i, j, ret; diff --git a/libavcodec/v410dec.c b/libavcodec/v410dec.c index a91a3384e6..bb1dd5d0c6 100644 --- a/libavcodec/v410dec.c +++ b/libavcodec/v410dec.c @@ -85,11 +85,10 @@ static int v410_decode_slice(AVCodecContext *avctx, void *arg, int jobnr, int th return 0; } -static int v410_decode_frame(AVCodecContext *avctx, void *data, +static int v410_decode_frame(AVCodecContext *avctx, AVFrame *pic, int *got_frame, AVPacket *avpkt) { ThreadData td; - AVFrame *pic = data; uint8_t *src = avpkt->data; int ret; int thread_count = av_clip(avctx->thread_count, 1, avctx->height/4); diff --git a/libavcodec/vb.c b/libavcodec/vb.c index 362221982e..1a05bd949f 100644 --- a/libavcodec/vb.c +++ b/libavcodec/vb.c @@ -189,11 +189,10 @@ static int vb_decode_framedata(VBDecContext *c, int offset) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { VBDecContext * const c = avctx->priv_data; - AVFrame *frame = data; uint8_t *outptr, *srcptr; int i, j, ret; int flags; diff --git a/libavcodec/vble.c b/libavcodec/vble.c index a7646cedcf..85b1fec855 100644 --- a/libavcodec/vble.c +++ b/libavcodec/vble.c @@ -114,11 +114,10 @@ static void vble_restore_plane(VBLEContext *ctx, AVFrame *pic, } } -static int vble_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int vble_decode_frame(AVCodecContext *avctx, AVFrame *pic, + int *got_frame, AVPacket *avpkt) { VBLEContext *ctx = avctx->priv_data; - AVFrame *pic = data; GetBitContext gb; const uint8_t *src = avpkt->data; int version; diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index e279ffd1c1..0f5a07ff33 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -623,14 +623,13 @@ av_cold int ff_vc1_decode_end(AVCodecContext *avctx) /** Decode a VC1/WMV3 frame * @todo TODO: Handle VC-1 IDUs (Transport level?) */ -static int vc1_decode_frame(AVCodecContext *avctx, void *data, +static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size, n_slices = 0, i, ret; VC1Context *v = avctx->priv_data; MpegEncContext *s = &v->s; - AVFrame *pict = data; uint8_t *buf2 = NULL; const uint8_t *buf_start = buf, *buf_start_second_field = NULL; int mb_height, n_slices1=-1; diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c index 17a1f9b710..d062700259 100644 --- a/libavcodec/vcr1.c +++ b/libavcodec/vcr1.c @@ -47,11 +47,10 @@ static av_cold int vcr1_decode_init(AVCodecContext *avctx) return 0; } -static int vcr1_decode_frame(AVCodecContext *avctx, void *data, +static int vcr1_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { VCR1Context *const a = avctx->priv_data; - AVFrame *const p = data; const uint8_t *bytestream = avpkt->data; const uint8_t *bytestream_end = bytestream + avpkt->size; int i, x, y, ret; diff --git a/libavcodec/vima.c b/libavcodec/vima.c index 9ca4406802..e429855245 100644 --- a/libavcodec/vima.c +++ b/libavcodec/vima.c @@ -117,11 +117,10 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *pkt) { GetBitContext gb; - AVFrame *frame = data; int16_t pcm_data[2]; uint32_t samples; int8_t channel_hint[2]; diff --git a/libavcodec/vmdaudio.c b/libavcodec/vmdaudio.c index 875930061a..b81e5b0ced 100644 --- a/libavcodec/vmdaudio.c +++ b/libavcodec/vmdaudio.c @@ -132,10 +132,9 @@ static void decode_audio_s16(int16_t *out, const uint8_t *buf, int buf_size, } } -static int vmdaudio_decode_frame(AVCodecContext *avctx, void *data, +static int vmdaudio_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; const uint8_t *buf_end; int buf_size = avpkt->size; diff --git a/libavcodec/vmdvideo.c b/libavcodec/vmdvideo.c index 1d39b6a4d8..fd48dc3255 100644 --- a/libavcodec/vmdvideo.c +++ b/libavcodec/vmdvideo.c @@ -430,14 +430,12 @@ static av_cold int vmdvideo_decode_init(AVCodecContext *avctx) return 0; } -static int vmdvideo_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int vmdvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; VmdVideoContext *s = avctx->priv_data; - AVFrame *frame = data; int ret; s->buf = buf; diff --git a/libavcodec/vmnc.c b/libavcodec/vmnc.c index b6884b7aa6..e7db38e85c 100644 --- a/libavcodec/vmnc.c +++ b/libavcodec/vmnc.c @@ -324,8 +324,8 @@ static void reset_buffers(VmncContext *c) } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -518,7 +518,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } } *got_frame = 1; - if ((ret = av_frame_ref(data, c->pic)) < 0) + if ((ret = av_frame_ref(rframe, c->pic)) < 0) return ret; /* always report that the buffer was completely consumed */ diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index e83a83f641..433fbfc6f9 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -1767,13 +1767,12 @@ static int vorbis_parse_audio_packet(vorbis_context *vc, float **floor_ptr) // Return the decoded audio packet through the standard api -static int vorbis_decode_frame(AVCodecContext *avctx, void *data, +static int vorbis_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; vorbis_context *vc = avctx->priv_data; - AVFrame *frame = data; GetBitContext *gb = &vc->gb; float *channel_ptrs[255]; int i, len, ret; diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index d493b331ef..528029203d 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -2586,11 +2586,9 @@ static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext * } #endif -static int vp3_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; Vp3DecodeContext *s = avctx->priv_data; @@ -2818,7 +2816,7 @@ static int vp3_decode_frame(AVCodecContext *avctx, vp3_draw_horiz_band(s, s->height); /* output frame, offset as needed */ - if ((ret = av_frame_ref(data, s->current_frame.f)) < 0) + if ((ret = av_frame_ref(frame, s->current_frame.f)) < 0) return ret; frame->crop_left = s->offset_x; diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c index 9819393447..a2efca1c9c 100644 --- a/libavcodec/vp56.c +++ b/libavcodec/vp56.c @@ -565,8 +565,8 @@ static int vp56_size_changed(VP56Context *s) static int ff_vp56_decode_mbs(AVCodecContext *avctx, void *, int, int); -int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +int ff_vp56_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; VP56Context *s = avctx->priv_data; @@ -649,7 +649,7 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, if (s->discard_frame) return AVERROR_INVALIDDATA; - if ((res = av_frame_ref(data, p)) < 0) + if ((res = av_frame_ref(rframe, p)) < 0) return res; *got_frame = 1; diff --git a/libavcodec/vp56.h b/libavcodec/vp56.h index e0dfaa8981..d2e6ad3ed0 100644 --- a/libavcodec/vp56.h +++ b/libavcodec/vp56.h @@ -224,8 +224,8 @@ int ff_vp56_init_context(AVCodecContext *avctx, VP56Context *s, int flip, int has_alpha); int ff_vp56_free_context(VP56Context *s); void ff_vp56_init_dequant(VP56Context *s, int quantizer); -int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt); +int ff_vp56_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt); /** diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 2e7ca63236..acb61ceede 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -2625,7 +2625,7 @@ static int vp8_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata, } static av_always_inline -int vp78_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, +int vp78_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, const AVPacket *avpkt, int is_vp7) { VP8Context *s = avctx->priv_data; @@ -2800,7 +2800,7 @@ skip_decode: s->prob[0] = s->prob[1]; if (!s->invisible) { - if ((ret = av_frame_ref(data, curframe->tf.f)) < 0) + if ((ret = av_frame_ref(rframe, curframe->tf.f)) < 0) return ret; *got_frame = 1; } @@ -2811,17 +2811,17 @@ err: return ret; } -int ff_vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +int ff_vp8_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { - return vp78_decode_frame(avctx, data, got_frame, avpkt, IS_VP8); + return vp78_decode_frame(avctx, frame, got_frame, avpkt, IS_VP8); } #if CONFIG_VP7_DECODER -static int vp7_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int vp7_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { - return vp78_decode_frame(avctx, data, got_frame, avpkt, IS_VP7); + return vp78_decode_frame(avctx, frame, got_frame, avpkt, IS_VP7); } #endif /* CONFIG_VP7_DECODER */ diff --git a/libavcodec/vp8.h b/libavcodec/vp8.h index fc2662bf0d..8fe45573ed 100644 --- a/libavcodec/vp8.h +++ b/libavcodec/vp8.h @@ -344,8 +344,8 @@ typedef struct VP8Context { int ff_vp8_decode_init(AVCodecContext *avctx); -int ff_vp8_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt); +int ff_vp8_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt); int ff_vp8_decode_free(AVCodecContext *avctx); diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index 1b822c4592..8f2c52da87 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -1550,7 +1550,7 @@ static int vp9_export_enc_params(VP9Context *s, VP9Frame *frame) return 0; } -static int vp9_decode_frame(AVCodecContext *avctx, void *frame, +static int vp9_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt) { const uint8_t *data = pkt->data; @@ -1570,8 +1570,8 @@ static int vp9_decode_frame(AVCodecContext *avctx, void *frame, } if ((ret = av_frame_ref(frame, s->s.refs[ref].f)) < 0) return ret; - ((AVFrame *)frame)->pts = pkt->pts; - ((AVFrame *)frame)->pkt_dts = pkt->dts; + frame->pts = pkt->pts; + frame->pkt_dts = pkt->dts; for (i = 0; i < 8; i++) { if (s->next_refs[i].f->buf[0]) ff_thread_release_ext_buffer(avctx, &s->next_refs[i]); diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c index 4a25a5cd07..e8555e2570 100644 --- a/libavcodec/vqavideo.c +++ b/libavcodec/vqavideo.c @@ -794,9 +794,8 @@ static int vqa_decode_frame_hicolor(VqaContext *s, AVFrame *frame) return 0; } -static int vqa_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int vqa_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { VqaContext *s = avctx->priv_data; int res; @@ -821,7 +820,7 @@ static int vqa_decode_frame(AVCodecContext *avctx, return AVERROR_BUG; } - if ((res = av_frame_ref(data, s->frame)) < 0) + if ((res = av_frame_ref(rframe, s->frame)) < 0) return res; *got_frame = 1; diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index e0ba525893..8bb03e5b4f 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1627,7 +1627,7 @@ static int dsd_channel(AVCodecContext *avctx, void *frmptr, int jobnr, int threa return 0; } -static int wavpack_decode_frame(AVCodecContext *avctx, void *data, +static int wavpack_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame_ptr, AVPacket *avpkt) { WavpackContext *s = avctx->priv_data; @@ -1685,7 +1685,7 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data, ff_thread_report_progress(&s->curr_frame, INT_MAX, 0); - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; *got_frame_ptr = 1; diff --git a/libavcodec/wcmv.c b/libavcodec/wcmv.c index 99584b9da2..8dfc1363a5 100644 --- a/libavcodec/wcmv.c +++ b/libavcodec/wcmv.c @@ -41,13 +41,11 @@ typedef struct WCMVContext { uint8_t block_data[65536*8]; } WCMVContext; -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { WCMVContext *s = avctx->priv_data; z_stream *const zstream = &s->zstream.zstream; - AVFrame *frame = data; int skip, blocks, zret, ret, intra = 0, flags = 0, bpp = s->bpp; GetByteContext gb; uint8_t *dst; diff --git a/libavcodec/webp.c b/libavcodec/webp.c index 696868f854..a0b51ac1e7 100644 --- a/libavcodec/webp.c +++ b/libavcodec/webp.c @@ -1334,10 +1334,9 @@ static int vp8_lossy_decode_frame(AVCodecContext *avctx, AVFrame *p, return ret; } -static int webp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int webp_decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { - AVFrame * const p = data; WebPContext *s = avctx->priv_data; GetByteContext gb; int ret; @@ -1480,7 +1479,7 @@ static int webp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, goto exif_end; } - av_dict_copy(&((AVFrame *) data)->metadata, exif_metadata, 0); + av_dict_copy(&p->metadata, exif_metadata, 0); exif_end: av_dict_free(&exif_metadata); diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index 24542ffced..945fd8c843 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -820,10 +820,9 @@ static int wma_decode_frame(WMACodecContext *s, float **samples, return 0; } -static int wma_decode_superframe(AVCodecContext *avctx, void *data, +static int wma_decode_superframe(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; WMACodecContext *s = avctx->priv_data; @@ -974,9 +973,9 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data, samples_offset += s->frame_len; } - ff_dlog(s->avctx, "%d %d %d %d outbytes:%"PTRDIFF_SPECIFIER" eaten:%d\n", + ff_dlog(s->avctx, "%d %d %d %d eaten:%d\n", s->frame_len_bits, s->block_len_bits, s->frame_len, s->block_len, - (int8_t *) samples - (int8_t *) data, avctx->block_align); + avctx->block_align); *got_frame_ptr = 1; diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c index d4f3462804..daa775314d 100644 --- a/libavcodec/wmalosslessdec.c +++ b/libavcodec/wmalosslessdec.c @@ -1184,8 +1184,8 @@ static void save_bits(WmallDecodeCtx *s, GetBitContext* gb, int len, skip_bits(&s->gb, s->frame_offset); } -static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr, - AVPacket* avpkt) +static int decode_packet(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame_ptr, AVPacket* avpkt) { WmallDecodeCtx *s = avctx->priv_data; GetBitContext* gb = &s->pgb; @@ -1298,7 +1298,7 @@ static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr, } *got_frame_ptr = s->frame->nb_samples > 0; - av_frame_move_ref(data, s->frame); + av_frame_move_ref(rframe, s->frame); s->packet_offset = get_bits_count(gb) & 7; diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 8e1675dc78..245241aa50 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -1610,7 +1610,7 @@ static void save_bits(WMAProDecodeCtx *s, GetBitContext* gb, int len, } static int decode_packet(AVCodecContext *avctx, WMAProDecodeCtx *s, - void *data, int *got_frame_ptr, AVPacket *avpkt) + AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { GetBitContext* gb = &s->pgb; const uint8_t* buf = avpkt->data; @@ -1622,7 +1622,6 @@ static int decode_packet(AVCodecContext *avctx, WMAProDecodeCtx *s, *got_frame_ptr = 0; if (!buf_size) { - AVFrame *frame = data; int i; /** Must output remaining samples after stream end. WMAPRO 5.1 created @@ -1714,7 +1713,7 @@ static int decode_packet(AVCodecContext *avctx, WMAProDecodeCtx *s, /** decode the cross packet frame if it is valid */ if (!s->packet_loss) - decode_frame(s, data, got_frame_ptr); + decode_frame(s, frame, got_frame_ptr); } else if (s->num_saved_bits - s->frame_offset) { ff_dlog(avctx, "ignoring %x previously saved bits\n", s->num_saved_bits - s->frame_offset); @@ -1745,7 +1744,7 @@ static int decode_packet(AVCodecContext *avctx, WMAProDecodeCtx *s, frame_size <= remaining_bits(s, gb)) { save_bits(s, gb, frame_size, 0); if (!s->packet_loss) - s->packet_done = !decode_frame(s, data, got_frame_ptr); + s->packet_done = !decode_frame(s, frame, got_frame_ptr); } else if (!s->len_prefix && s->num_saved_bits > get_bits_count(&s->gb)) { /** when the frames do not have a length prefix, we don't know @@ -1755,7 +1754,7 @@ static int decode_packet(AVCodecContext *avctx, WMAProDecodeCtx *s, therefore we save the incoming packet first, then we append the "previous frame" data from the next packet so that we get a buffer that only contains full frames */ - s->packet_done = !decode_frame(s, data, got_frame_ptr); + s->packet_done = !decode_frame(s, frame, got_frame_ptr); } else { s->packet_done = 1; } @@ -1778,8 +1777,6 @@ static int decode_packet(AVCodecContext *avctx, WMAProDecodeCtx *s, return AVERROR_INVALIDDATA; if (s->trim_start && avctx->codec_id == AV_CODEC_ID_WMAPRO) { - AVFrame *frame = data; - if (s->trim_start < frame->nb_samples) { for (int ch = 0; ch < frame->ch_layout.nb_channels; ch++) frame->extended_data[ch] += s->trim_start * 4; @@ -1793,8 +1790,6 @@ static int decode_packet(AVCodecContext *avctx, WMAProDecodeCtx *s, } if (s->trim_end && avctx->codec_id == AV_CODEC_ID_WMAPRO) { - AVFrame *frame = data; - if (s->trim_end < frame->nb_samples) { frame->nb_samples -= s->trim_end; } else { @@ -1814,11 +1809,10 @@ static int decode_packet(AVCodecContext *avctx, WMAProDecodeCtx *s, *@param avpkt input packet *@return number of bytes that were read from the input buffer */ -static int wmapro_decode_packet(AVCodecContext *avctx, void *data, +static int wmapro_decode_packet(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { WMAProDecodeCtx *s = avctx->priv_data; - AVFrame *frame = data; int ret; /* get output buffer */ @@ -1828,15 +1822,14 @@ static int wmapro_decode_packet(AVCodecContext *avctx, void *data, return 0; } - return decode_packet(avctx, s, data, got_frame_ptr, avpkt); + return decode_packet(avctx, s, frame, got_frame_ptr, avpkt); } -static int xma_decode_packet(AVCodecContext *avctx, void *data, +static int xma_decode_packet(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { XMADecodeCtx *s = avctx->priv_data; int got_stream_frame_ptr = 0; - AVFrame *frame = data; int i, ret = 0, eof = 0; if (!s->frames[s->current_stream]->data[0]) { diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c index c251c9e1ec..571dd5803b 100644 --- a/libavcodec/wmavoice.c +++ b/libavcodec/wmavoice.c @@ -1903,7 +1903,7 @@ static void copy_bits(PutBitContext *pb, * * For more information about frames, see #synth_superframe(). */ -static int wmavoice_decode_packet(AVCodecContext *ctx, void *data, +static int wmavoice_decode_packet(AVCodecContext *ctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { WMAVoiceContext *s = ctx->priv_data; @@ -1942,7 +1942,7 @@ static int wmavoice_decode_packet(AVCodecContext *ctx, void *data, copy_bits(&s->pb, avpkt->data, size, gb, s->spillover_nbits); flush_put_bits(&s->pb); s->sframe_cache_size += s->spillover_nbits; - if ((res = synth_superframe(ctx, data, got_frame_ptr)) == 0 && + if ((res = synth_superframe(ctx, frame, got_frame_ptr)) == 0 && *got_frame_ptr) { cnt += s->spillover_nbits; s->skip_bits_next = cnt & 7; @@ -1965,7 +1965,7 @@ static int wmavoice_decode_packet(AVCodecContext *ctx, void *data, *got_frame_ptr = 0; return size; } else if (s->nb_superframes > 0) { - if ((res = synth_superframe(ctx, data, got_frame_ptr)) < 0) { + if ((res = synth_superframe(ctx, frame, got_frame_ptr)) < 0) { return res; } else if (*got_frame_ptr) { int cnt = get_bits_count(gb); diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index 156a8a09a4..913b42a78f 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -52,13 +52,11 @@ static inline int wnv1_get_code(GetBitContext *gb, int shift, int base_value) return base_value + v * (1 << shift); } -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - AVFrame * const p = data; GetBitContext gb; unsigned char *Y,*U,*V; int i, j, ret, shift; diff --git a/libavcodec/wrapped_avframe.c b/libavcodec/wrapped_avframe.c index 291f4d5d31..6794dd2045 100644 --- a/libavcodec/wrapped_avframe.c +++ b/libavcodec/wrapped_avframe.c @@ -76,10 +76,10 @@ static int wrapped_avframe_encode(AVCodecContext *avctx, AVPacket *pkt, return 0; } -static int wrapped_avframe_decode(AVCodecContext *avctx, void *data, +static int wrapped_avframe_decode(AVCodecContext *avctx, AVFrame *out, int *got_frame, AVPacket *pkt) { - AVFrame *in, *out; + AVFrame *in; int err; if (!(pkt->flags & AV_PKT_FLAG_TRUSTED)) { @@ -91,7 +91,6 @@ static int wrapped_avframe_decode(AVCodecContext *avctx, void *data, return AVERROR(EINVAL); in = (AVFrame*)pkt->data; - out = data; err = ff_decode_frame_props(avctx, out); if (err < 0) diff --git a/libavcodec/ws-snd1.c b/libavcodec/ws-snd1.c index f99f492988..00e4d91d4f 100644 --- a/libavcodec/ws-snd1.c +++ b/libavcodec/ws-snd1.c @@ -51,10 +51,9 @@ static av_cold int ws_snd_decode_init(AVCodecContext *avctx) return 0; } -static int ws_snd_decode_frame(AVCodecContext *avctx, void *data, +static int ws_snd_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; diff --git a/libavcodec/xan.c b/libavcodec/xan.c index c7916de569..e9f6c334a1 100644 --- a/libavcodec/xan.c +++ b/libavcodec/xan.c @@ -538,11 +538,9 @@ static const uint8_t gamma_lookup[256] = { }; #endif -static int xan_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int xan_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int ret, buf_size = avpkt->size; XanContext *s = avctx->priv_data; diff --git a/libavcodec/xbmdec.c b/libavcodec/xbmdec.c index 9dbd0ac571..bf9446195f 100644 --- a/libavcodec/xbmdec.c +++ b/libavcodec/xbmdec.c @@ -65,10 +65,9 @@ static int parse_str_int(const uint8_t *p, const uint8_t *end, const uint8_t *ke return INT_MIN; } -static int xbm_decode_frame(AVCodecContext *avctx, void *data, +static int xbm_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { - AVFrame *p = data; int ret, linesize, i, j; int width = 0; int height = 0; diff --git a/libavcodec/xfacedec.c b/libavcodec/xfacedec.c index 32b484a667..0542a36a5d 100644 --- a/libavcodec/xfacedec.c +++ b/libavcodec/xfacedec.c @@ -109,9 +109,8 @@ static av_cold int xface_decode_init(AVCodecContext *avctx) return 0; } -static int xface_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int xface_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { XFaceContext *xface = avctx->priv_data; int ret, i, j, k; @@ -119,7 +118,6 @@ static int xface_decode_frame(AVCodecContext *avctx, BigInt b = {0}; char *buf; int64_t c; - AVFrame *frame = data; if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) return ret; diff --git a/libavcodec/xl.c b/libavcodec/xl.c index 8b3e950af6..d414bcf95d 100644 --- a/libavcodec/xl.c +++ b/libavcodec/xl.c @@ -37,13 +37,11 @@ static const int xl_table[32] = { 120, 121, 122, 123, 124, 125, 126, 127 }; -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - AVFrame *const p = data; uint8_t *Y, *U, *V; int i, j, ret; int stride; diff --git a/libavcodec/xpmdec.c b/libavcodec/xpmdec.c index 584ffaa995..468175fc4b 100644 --- a/libavcodec/xpmdec.c +++ b/libavcodec/xpmdec.c @@ -303,11 +303,10 @@ static int ascii2index(const uint8_t *cpixel, int cpp) return n; } -static int xpm_decode_frame(AVCodecContext *avctx, void *data, +static int xpm_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { XPMDecContext *x = avctx->priv_data; - AVFrame *p=data; const uint8_t *end, *ptr; int ncolors, cpp, ret, i, j; int64_t size; diff --git a/libavcodec/xwddec.c b/libavcodec/xwddec.c index 3d86b2b82d..650a0bf774 100644 --- a/libavcodec/xwddec.c +++ b/libavcodec/xwddec.c @@ -29,10 +29,9 @@ #include "internal.h" #include "xwd.h" -static int xwd_decode_frame(AVCodecContext *avctx, void *data, +static int xwd_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt) { - AVFrame *p = data; const uint8_t *buf = avpkt->data; int i, ret, buf_size = avpkt->size; uint32_t version, header_size, vclass, ncolors; diff --git a/libavcodec/xxan.c b/libavcodec/xxan.c index 759ec2c90b..9a79e58d8a 100644 --- a/libavcodec/xxan.c +++ b/libavcodec/xxan.c @@ -399,9 +399,8 @@ static int xan_decode_frame_type1(AVCodecContext *avctx) return 0; } -static int xan_decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int xan_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { XanContext *s = avctx->priv_data; int ftype; @@ -426,7 +425,7 @@ static int xan_decode_frame(AVCodecContext *avctx, if (ret) return ret; - if ((ret = av_frame_ref(data, s->pic)) < 0) + if ((ret = av_frame_ref(rframe, s->pic)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/y41pdec.c b/libavcodec/y41pdec.c index 507e784d3c..663a1cc910 100644 --- a/libavcodec/y41pdec.c +++ b/libavcodec/y41pdec.c @@ -36,10 +36,9 @@ static av_cold int y41p_decode_init(AVCodecContext *avctx) return 0; } -static int y41p_decode_frame(AVCodecContext *avctx, void *data, +static int y41p_decode_frame(AVCodecContext *avctx, AVFrame *pic, int *got_frame, AVPacket *avpkt) { - AVFrame *pic = data; uint8_t *src = avpkt->data; uint8_t *y, *u, *v; int i, j, ret; diff --git a/libavcodec/ylc.c b/libavcodec/ylc.c index b49b960b3a..9b19405b24 100644 --- a/libavcodec/ylc.c +++ b/libavcodec/ylc.c @@ -278,16 +278,14 @@ static const uint8_t table_v[] = { 0x01, 0x00, }; -static int decode_frame(AVCodecContext *avctx, - void *data, int *got_frame, - AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *p, + int *got_frame, AVPacket *avpkt) { int TL[4] = { 128, 128, 128, 128 }; int L[4] = { 128, 128, 128, 128 }; YLCContext *s = avctx->priv_data; const uint8_t *buf = avpkt->data; int ret, x, y, toffset, boffset; - AVFrame * const p = data; GetBitContext gb; uint8_t *dst; diff --git a/libavcodec/yop.c b/libavcodec/yop.c index 01090ddbf8..3079af061f 100644 --- a/libavcodec/yop.c +++ b/libavcodec/yop.c @@ -191,8 +191,8 @@ static uint8_t yop_get_next_nibble(YopDecContext *s) return ret; } -static int yop_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int yop_decode_frame(AVCodecContext *avctx, AVFrame *rframe, + int *got_frame, AVPacket *avpkt) { YopDecContext *s = avctx->priv_data; AVFrame *frame = s->frame; @@ -259,7 +259,7 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, s->dstptr += 2*frame->linesize[0] - x; } - if ((ret = av_frame_ref(data, s->frame)) < 0) + if ((ret = av_frame_ref(rframe, s->frame)) < 0) return ret; *got_frame = 1; diff --git a/libavcodec/yuv4dec.c b/libavcodec/yuv4dec.c index 83e03ba782..3c6d6eda6e 100644 --- a/libavcodec/yuv4dec.c +++ b/libavcodec/yuv4dec.c @@ -31,10 +31,9 @@ static av_cold int yuv4_decode_init(AVCodecContext *avctx) return 0; } -static int yuv4_decode_frame(AVCodecContext *avctx, void *data, +static int yuv4_decode_frame(AVCodecContext *avctx, AVFrame *pic, int *got_frame, AVPacket *avpkt) { - AVFrame *pic = data; const uint8_t *src = avpkt->data; uint8_t *y, *u, *v; int i, j, ret; diff --git a/libavcodec/zerocodec.c b/libavcodec/zerocodec.c index 49b0968129..b4d189cd7a 100644 --- a/libavcodec/zerocodec.c +++ b/libavcodec/zerocodec.c @@ -29,11 +29,10 @@ typedef struct ZeroCodecContext { FFZStream zstream; } ZeroCodecContext; -static int zerocodec_decode_frame(AVCodecContext *avctx, void *data, +static int zerocodec_decode_frame(AVCodecContext *avctx, AVFrame *pic, int *got_frame, AVPacket *avpkt) { ZeroCodecContext *zc = avctx->priv_data; - AVFrame *pic = data; AVFrame *prev_pic = zc->previous_frame; z_stream *const zstream = &zc->zstream.zstream; uint8_t *prev = prev_pic->data[0]; diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c index 86f7f265c6..4a845a333d 100644 --- a/libavcodec/zmbv.c +++ b/libavcodec/zmbv.c @@ -410,9 +410,9 @@ static int zmbv_decode_intra(ZmbvContext *c) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt) { - AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; ZmbvContext * const c = avctx->priv_data; From patchwork Wed Mar 30 22:49:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 35101 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c05:b0:7a:e998:b410 with SMTP id bw5csp1066805pzb; Wed, 30 Mar 2022 15:51:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9Nx8TClU+XAB0yCgSuG5qX32ykVCjqjPB1JglNdSHoyuEBLyuH1RvuG8sg4KdH1oSEoPH X-Received: by 2002:aa7:d947:0:b0:419:3e8d:3e37 with SMTP id l7-20020aa7d947000000b004193e8d3e37mr13500547eds.247.1648680676756; Wed, 30 Mar 2022 15:51:16 -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 r13-20020a170906704d00b006df76385ea7si19298209ejj.839.2022.03.30.15.51.16; Wed, 30 Mar 2022 15:51:16 -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=TWawhpwJ; 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 B741768B2A0; Thu, 31 Mar 2022 01:50:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-oln040092071049.outbound.protection.outlook.com [40.92.71.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 253C368B278 for ; Thu, 31 Mar 2022 01:50:43 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mlF5s6os5KnoNAs/MDCt/4JOssZPY5o2EPJtZweLwrR/I1UUg7IMcBVSwrVqa26vNzzctnmb/yvv884TSuEUwCFcZQIZooqqzRlLCPpQZLmWYtNY08Vv1vbXjLXPXdRITn+7UaCVmj+Pls1QqaqekPvSdQvUSthOxQmG8ZKsJUmx/qDB7EK9bS0I3KqVE/l1CK84XLwK88VPIWfSkXpExDcpg5kHXgLa/BzJn97smBxcHuNVsOvTM1XfoQo15Rd1EKkoqV7qyJQr/y3PS8/67qix3VuBkOSx671heSFmR9rAppHGk/2wOamdw2zx0MQN+x0d1njOR9HGvQ/DpMjWQg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=E01X2BvWZcE/Tw3HTEqFfkEGp4fJQ2D6d50NsChPTqw=; b=XNv1N3q5mYdwHhBiMyOekWTJ6tkqPzv3Xro8OTvBiAT/VfcFxLbqiRA8+S16viVWpS4YwGaKmfQfmUXj5eXZUDgrWyguNrZ2iekfsIeaSt2ecFFAWKRkIfyjTTj6i6WCE2wPMmZq7b49PqFCR+heszN0SYlFTiIR2b/3JSpiPxX1uMpOKCU6dWJnvm7LWkbDOCvd8u+zuZC4ynJ1xyu0QBfN/PwnpqXbsqvvfWTg4PxwbU43uJ2BtuShUn4dcICvvMwEsuAK6s3079aBr2zstTfGRhzgKJENu1ThevBVCN1blAA7YFJcEs81Qz0FBE8BPC1gwtfTOLiwg6hbg7PSyw== 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=E01X2BvWZcE/Tw3HTEqFfkEGp4fJQ2D6d50NsChPTqw=; b=TWawhpwJnptZCkCq/TOfT7KkH9Y7ixBbohfLb7XvTE+vttAMqnuBBreFZDMnrU1tFm1Tqe9OGU84MXYVfEbpBMEaI1Jg6y3w3vqwinACfycZNJOVyaDQBUgSmJuzTkOdzw3VX83XrO6Q1OG2sf2meDEZ0a78ZOGryErhfWBpjYNwKbCPC9cGuFTfuT9A8Gz/3WlH70e3915BdpGlYgSg6PSrXh7+OUX7qMhADV2hbYBYqzSGF/UbU8Ta61dliMaQRaURhmi8UpUJZqpI8xHnNihYtpHiCs0h1nGLqR9Zl77WsRyENXigK1sEmJ9h5zSz5ObsPKkcJ5b/A8gTxuLSZQ== Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) by AM5PR0102MB2579.eurprd01.prod.exchangelabs.com (2603:10a6:206:d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17; Wed, 30 Mar 2022 22:50:16 +0000 Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8]) by AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8%3]) with mapi id 15.20.5102.022; Wed, 30 Mar 2022 22:50:16 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 31 Mar 2022 00:49:55 +0200 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [QT+DH7XGI0r5uY2Oftw5Xzpi0XRUFcJ6] X-ClientProxiedBy: ZRAP278CA0002.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:10::12) To AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) X-Microsoft-Original-Message-ID: <20220330224958.538843-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1ffb03ae-4be3-4149-3f1a-08da129fa87d X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiQvrz79k5T5N22eDaDjTtMW2K5ddfdkOKwuUgXB6flGrgkxA5pp51fXDJR6gIpjM+RxQlbLFvaMhaHxkGkWE5Qw0MKw1lSHQ+Br4uZjsx4DYmRqzKEO4PgxYxUGB4O/DEnc3WjDGhJkbLNOo0cewQun/Ydl4NhH+b0cteS0IR6sTMZpaUxaSwNkLLPO9qBj9c2is1Tuh6LL+PABZCbbsLOjYcFFdI/hon7XrerD0GTuo1sn2USRpMHAFr9n4Uk0p8LEIM81z8Ad2JnB9YLePVYgeViRc9zaNF1Avi9nsUALonEBaM2htBuCQwsetkQdVRwIzUWwzUyC7AVxPfcKNGWm4+eXwdtPaQKm1Tfx5moOJ7gm2SgHZ15lwrq6kifFOUmUH7NEARmMTRTo0+/8IOlXUokWrPaFp6HvCewu7MvEnTJSO0SfRv/gDQmKoYzORdYlxJCgeqg/aGAQoeBKOwTq/OVU2/0ryZ634juW8FoCXHGYgMngQbHjRiqU+s47FhKUyYAEaBH0EbxDuHQ4SNGz97I07bnHRxrhEpILTNhsvlfPM8HH1U/9ULI2TGU3VEpziHPFJuy0brvMz8lkyQHN9NL36uI2M9+XPzVCkNEh63OKZy5r0LfXmwDDxMoUkBdKUQJL1YCqda06oJE0AAy1fylN5XrqTTUYQlPZieFtJUDVjpQFbtK3N2AN2Jsiq5alLWsc8UE7ZqeBH3UwJlkicGvBDR1KFcE9wR4xirm8CP7vQ8ymmtlIskSQkQRHpjw= X-MS-TrafficTypeDiagnostic: AM5PR0102MB2579:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ccvlYmGfoOGF7OVsb8Usw/x+oBDIcNagbfn0+Xwsqd1s0bb3mk0JIrDCcCHwamOspzVSnCa61fSlI0bcUcIEczeWo/1TwbU8IyJU4fkLEmLjiuW7HhElHf/Byr3RBsTqrD6Cl2tIYKxnDYJk2tgB+qrwmBi76p+dnHxDiRhquAcg+cYRVs5PAqItxLz7gQ8nFDG4N3VF8Ix5SOHzh5W1Uj/5+EYi/aKu0I9aEarucysMwXFiFCbTYft0YY+l2hBGY0L9AjKrUH46XmlRRr7hUYdzVbx7tu9EFZFYW/IGDYBPU1rILR8H50Gipro8W5Oie6dt5XZFRm9WCoZwltl7ZjnTH2zU7T3nF39Oib7LEWmM453rwD6B14qh/qXe7jeSiGxoh7ciDIbIWlj8MHLMBmxu3SNjNEA4Kub5Yc3DrJ/ETpIF/D/J8wRYoZn3Rwe7SK55YO/TKSTZKu8+QbKOkAYv7T+eY/FQDJSbHbCLWKVB/wXS4fnUd5MGGcxPFSqb5aIKG08/EPcSioBtxzJ/dFi098fwWsRrZxwJzHoAy2v3RKoPRC6jR+xEa3w6h+lBhQnGgb3PomLKNJQU1EoSuw== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pQ8kPYSjNIz1/ma3vaWha7A58O3TIHmy+djMVBOrO0PcHuKUzH/+FBpm+rlamIeVBLL3gfpspIeczoKF4LTWHbqEuaVjOOBhStDe+CbhHLVDcepK4EEDcQxZq28Zb2ki3IjvC5MZbiJ30xYe0H1+dGc00oLiFszqnYE3YhLoDpzh3O5iwcVvYdVGbXotkJ5rri8MXc2E06Yd0mkTNHURi5Cru3TbkF5ZdUO0KqteXvGdTkOuR/NX7G/XjWpxOYoyqW+WpzZ/1Ty/oepB/iAlHQoKfO+krr8CZQkv4OUPzA1yEYG+VA60syJqqD2zlpcopISy4T63ng9uBo7C9AvSXaolMnR5ink4mmckybY5jjRBkXHPR8/W1mu7752g0vt23YDaYettnZbU3ic1xCTyPrMXfQFw85vKcZpVu5y9Vqxuytj3lYZPqXrQSPxwvfZ3uTMYnd/QYJYJ7ZDkxkH0jd2rBMTqBYLwwZDVWPLl2PMA0PbR0SR07f8OLR36AfGAf01ltRsjUoXinBESi4u20tuzDGXjmrJdCa6J4f+dCW4fYmpw0JWi0Uu1z6y7F/vUwkjjZO2pHAwlQ3iqgfkSjwcMFI52QSKqTtx84+pF+BEUL325Ur7apSoccGZ3Vay3MntNHnTA8bz/Jh0K2Q8sZag/HHfNBIHbCR1uUvMCSvKC59i89DeO/7jmOXw/1Fmy7ojaulscRyPcSI9laCO2hAaPsknXRjcVPJgE/mWiLbZw/IxT4yly8ZAI+bsvd3DEDLxQUkmzZm/mf16bF/QXkv5Lu8HxShNq5utzSUuNf23YQJ/NSBARlrO9a+VR5BYkcwlLmNaEkCWUMvygTpd3BZ8qgcM3BiyX48+kalXjGvzyVyO0IAnF0jK1hvkResg49Wg6E4LUlT/TkufP05ESqRvlwSA1bHJBTsElQjzqHpB1OTi+NKtqXbNnjC8/nPvRJaiGTyG12YOIX9Ryg8Lkq0ErGftnClCG8ZdH6n/KUEGxKna4fm8aRvTU0NHmClM0/80E8FrEKwa1cn23OlcUxjHNoVFID64/MHJ20HJJnVm5N65oAmSC2gpvT/0J6tg/uhHK8XL2YLEEk8cbhvDQSK5yAT1MAgWxqIhNK6TvMDBb9DVMuofmex9tnne3Tmw9hDifd5pRz2NSzE50RQsCub48hjyjxTrkyhEnUT+hz33G+B2ovBeS+hR9QH/fUb1kbRlPBd54bSk6BzL/C9zL+Ve8qAO6RbCWNtPjJvgwykL31Q/RQswzAOghyzYu42hitRAp1fKImAVl0g2+lEQl+4456gigYHZiB0FrygRbQC22VJckTzT0CcCWZN/M5i4Sw7uWSVIypBHAAu6FklnGmj2PmhopFH+FfgQS6fZuKQjdc3hlFoD9aGXWfFEdIm5M+DSv6OAdbLiW/RiICqWkAB3Cf+F6++ZDRaGvnNdMN2MEoR1hBu+B4uc4M+1bV9fw X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ffb03ae-4be3-4149-3f1a-08da129fa87d X-MS-Exchange-CrossTenant-AuthSource: AS1PR01MB9564.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2022 22:50:16.8489 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0102MB2579 Subject: [FFmpeg-devel] [PATCH 4/7] avcodec/codec_internal: Use union for FFCodec decode/encode callbacks 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: EIR8rseh4Rjg This is possible, because every given FFCodec has to implement exactly one of these. Doing so decreases sizeof(FFCodec) and therefore decreases the size of the binary. Notice that in case of position-independent code the decrease is in .data.rel.ro, so that this translates to decreased memory consumption. Signed-off-by: Andreas Rheinhardt --- libavcodec/012v.c | 2 +- libavcodec/4xm.c | 2 +- libavcodec/8bps.c | 2 +- libavcodec/8svx.c | 4 +- libavcodec/a64multienc.c | 4 +- libavcodec/aacdec.c | 4 +- libavcodec/aacdec_fixed.c | 2 +- libavcodec/aacenc.c | 2 +- libavcodec/aasc.c | 2 +- libavcodec/ac3dec_fixed.c | 2 +- libavcodec/ac3dec_float.c | 4 +- libavcodec/ac3enc_fixed.c | 2 +- libavcodec/ac3enc_float.c | 2 +- libavcodec/adpcm.c | 2 +- libavcodec/adpcmenc.c | 2 +- libavcodec/adxdec.c | 2 +- libavcodec/adxenc.c | 2 +- libavcodec/agm.c | 2 +- libavcodec/aic.c | 2 +- libavcodec/alac.c | 2 +- libavcodec/alacenc.c | 2 +- libavcodec/aliaspixdec.c | 2 +- libavcodec/aliaspixenc.c | 2 +- libavcodec/alsdec.c | 2 +- libavcodec/amfenc_h264.c | 2 +- libavcodec/amfenc_hevc.c | 2 +- libavcodec/amrnbdec.c | 2 +- libavcodec/amrwbdec.c | 2 +- libavcodec/anm.c | 2 +- libavcodec/ansi.c | 2 +- libavcodec/apedec.c | 2 +- libavcodec/aptxdec.c | 4 +- libavcodec/aptxenc.c | 4 +- libavcodec/arbc.c | 2 +- libavcodec/argo.c | 2 +- libavcodec/assdec.c | 4 +- libavcodec/assenc.c | 4 +- libavcodec/asvdec.c | 4 +- libavcodec/asvenc.c | 4 +- libavcodec/atrac1.c | 2 +- libavcodec/atrac3.c | 4 +- libavcodec/atrac3plusdec.c | 4 +- libavcodec/atrac9dec.c | 2 +- libavcodec/audiotoolboxdec.c | 2 +- libavcodec/audiotoolboxenc.c | 2 +- libavcodec/aura.c | 2 +- libavcodec/av1dec.c | 2 +- libavcodec/avrndec.c | 2 +- libavcodec/avs.c | 2 +- libavcodec/avuidec.c | 2 +- libavcodec/avuienc.c | 2 +- libavcodec/bethsoftvideo.c | 2 +- libavcodec/bfi.c | 2 +- libavcodec/bink.c | 2 +- libavcodec/binkaudio.c | 4 +- libavcodec/bintext.c | 6 +- libavcodec/bitpacked_dec.c | 2 +- libavcodec/bitpacked_enc.c | 2 +- libavcodec/bmp.c | 2 +- libavcodec/bmpenc.c | 2 +- libavcodec/bmvaudio.c | 2 +- libavcodec/bmvvideo.c | 2 +- libavcodec/brenderpix.c | 2 +- libavcodec/c93.c | 2 +- libavcodec/cavsdec.c | 2 +- libavcodec/ccaption_dec.c | 2 +- libavcodec/cdgraphics.c | 2 +- libavcodec/cdtoons.c | 2 +- libavcodec/cdxl.c | 2 +- libavcodec/cfhd.c | 2 +- libavcodec/cfhdenc.c | 2 +- libavcodec/cinepak.c | 2 +- libavcodec/cinepakenc.c | 2 +- libavcodec/clearvideo.c | 2 +- libavcodec/cljrdec.c | 2 +- libavcodec/cljrenc.c | 2 +- libavcodec/cllc.c | 2 +- libavcodec/cngdec.c | 2 +- libavcodec/cngenc.c | 2 +- libavcodec/codec_internal.h | 153 ++++++++++++++++++++-------- libavcodec/cook.c | 2 +- libavcodec/cpia.c | 2 +- libavcodec/cri.c | 2 +- libavcodec/crystalhd.c | 2 +- libavcodec/cscd.c | 2 +- libavcodec/cuviddec.c | 2 +- libavcodec/cyuv.c | 4 +- libavcodec/dcadec.c | 2 +- libavcodec/dcaenc.c | 2 +- libavcodec/dds.c | 2 +- libavcodec/decode.c | 8 +- libavcodec/dfa.c | 2 +- libavcodec/dfpwmdec.c | 2 +- libavcodec/dfpwmenc.c | 2 +- libavcodec/diracdec.c | 2 +- libavcodec/dnxhddec.c | 2 +- libavcodec/dnxhdenc.c | 2 +- libavcodec/dolby_e.c | 2 +- libavcodec/dpcm.c | 2 +- libavcodec/dpx.c | 2 +- libavcodec/dpxenc.c | 2 +- libavcodec/dsddec.c | 2 +- libavcodec/dsicinaudio.c | 2 +- libavcodec/dsicinvideo.c | 2 +- libavcodec/dss_sp.c | 2 +- libavcodec/dstdec.c | 2 +- libavcodec/dvaudiodec.c | 2 +- libavcodec/dvbsubdec.c | 2 +- libavcodec/dvbsubenc.c | 2 +- libavcodec/dvdec.c | 2 +- libavcodec/dvdsubdec.c | 2 +- libavcodec/dvdsubenc.c | 2 +- libavcodec/dvenc.c | 2 +- libavcodec/dxa.c | 2 +- libavcodec/dxtory.c | 2 +- libavcodec/dxv.c | 2 +- libavcodec/eac3enc.c | 2 +- libavcodec/eacmv.c | 2 +- libavcodec/eamad.c | 2 +- libavcodec/eatgq.c | 2 +- libavcodec/eatgv.c | 2 +- libavcodec/eatqi.c | 2 +- libavcodec/encode.c | 10 +- libavcodec/escape124.c | 2 +- libavcodec/escape130.c | 2 +- libavcodec/evrcdec.c | 2 +- libavcodec/exr.c | 2 +- libavcodec/exrenc.c | 2 +- libavcodec/fastaudio.c | 2 +- libavcodec/ffv1dec.c | 2 +- libavcodec/ffv1enc.c | 2 +- libavcodec/ffwavesynth.c | 2 +- libavcodec/fic.c | 2 +- libavcodec/fitsdec.c | 2 +- libavcodec/fitsenc.c | 2 +- libavcodec/flacdec.c | 2 +- libavcodec/flacenc.c | 2 +- libavcodec/flashsv.c | 4 +- libavcodec/flashsv2enc.c | 2 +- libavcodec/flashsvenc.c | 2 +- libavcodec/flicvideo.c | 2 +- libavcodec/flvdec.c | 2 +- libavcodec/flvenc.c | 2 +- libavcodec/fmvc.c | 2 +- libavcodec/frame_thread_encoder.c | 2 +- libavcodec/fraps.c | 2 +- libavcodec/frwu.c | 2 +- libavcodec/g2meet.c | 2 +- libavcodec/g722dec.c | 2 +- libavcodec/g722enc.c | 2 +- libavcodec/g723_1dec.c | 2 +- libavcodec/g723_1enc.c | 2 +- libavcodec/g726.c | 8 +- libavcodec/g729dec.c | 4 +- libavcodec/gdv.c | 2 +- libavcodec/gemdec.c | 2 +- libavcodec/gif.c | 2 +- libavcodec/gifdec.c | 2 +- libavcodec/gsmdec.c | 4 +- libavcodec/h261dec.c | 2 +- libavcodec/h261enc.c | 2 +- libavcodec/h263dec.c | 4 +- libavcodec/h264dec.c | 2 +- libavcodec/hapdec.c | 2 +- libavcodec/hapenc.c | 2 +- libavcodec/hcadec.c | 2 +- libavcodec/hcom.c | 2 +- libavcodec/hevcdec.c | 2 +- libavcodec/hnm4video.c | 2 +- libavcodec/hq_hqa.c | 2 +- libavcodec/hqx.c | 2 +- libavcodec/huffyuvdec.c | 6 +- libavcodec/huffyuvenc.c | 4 +- libavcodec/idcinvideo.c | 2 +- libavcodec/iff.c | 2 +- libavcodec/ilbcdec.c | 2 +- libavcodec/imc.c | 4 +- libavcodec/imm4.c | 2 +- libavcodec/imm5.c | 2 +- libavcodec/imx.c | 2 +- libavcodec/indeo2.c | 2 +- libavcodec/indeo3.c | 2 +- libavcodec/indeo4.c | 2 +- libavcodec/indeo5.c | 2 +- libavcodec/intelh263dec.c | 2 +- libavcodec/interplayacm.c | 2 +- libavcodec/interplayvideo.c | 2 +- libavcodec/ituh263enc.c | 4 +- libavcodec/j2kenc.c | 2 +- libavcodec/jacosubdec.c | 2 +- libavcodec/jpeg2000dec.c | 2 +- libavcodec/jpeglsdec.c | 2 +- libavcodec/jpeglsenc.c | 2 +- libavcodec/jvdec.c | 2 +- libavcodec/kgv1dec.c | 2 +- libavcodec/kmvc.c | 2 +- libavcodec/lagarith.c | 2 +- libavcodec/lcldec.c | 4 +- libavcodec/lclenc.c | 2 +- libavcodec/libaomdec.c | 2 +- libavcodec/libaomenc.c | 2 +- libavcodec/libaribb24.c | 2 +- libavcodec/libcelt_dec.c | 2 +- libavcodec/libcodec2.c | 4 +- libavcodec/libdav1d.c | 2 +- libavcodec/libdavs2.c | 2 +- libavcodec/libfdk-aacdec.c | 2 +- libavcodec/libfdk-aacenc.c | 2 +- libavcodec/libgsmdec.c | 4 +- libavcodec/libgsmenc.c | 4 +- libavcodec/libilbc.c | 4 +- libavcodec/libkvazaar.c | 2 +- libavcodec/libmp3lame.c | 2 +- libavcodec/libopencore-amr.c | 6 +- libavcodec/libopenh264dec.c | 2 +- libavcodec/libopenh264enc.c | 2 +- libavcodec/libopenjpegdec.c | 2 +- libavcodec/libopenjpegenc.c | 2 +- libavcodec/libopusdec.c | 2 +- libavcodec/libopusenc.c | 2 +- libavcodec/librav1e.c | 2 +- libavcodec/librsvgdec.c | 2 +- libavcodec/libshine.c | 2 +- libavcodec/libspeexdec.c | 2 +- libavcodec/libspeexenc.c | 2 +- libavcodec/libsvtav1.c | 2 +- libavcodec/libtheoraenc.c | 2 +- libavcodec/libtwolame.c | 2 +- libavcodec/libuavs3d.c | 2 +- libavcodec/libvo-amrwbenc.c | 2 +- libavcodec/libvorbisdec.c | 2 +- libavcodec/libvorbisenc.c | 2 +- libavcodec/libvpxdec.c | 4 +- libavcodec/libvpxenc.c | 4 +- libavcodec/libwebpenc.c | 2 +- libavcodec/libwebpenc_animencoder.c | 2 +- libavcodec/libx264.c | 6 +- libavcodec/libx265.c | 2 +- libavcodec/libxavs.c | 2 +- libavcodec/libxavs2.c | 2 +- libavcodec/libxvid.c | 2 +- libavcodec/libzvbi-teletextdec.c | 2 +- libavcodec/ljpegenc.c | 2 +- libavcodec/loco.c | 2 +- libavcodec/lscrdec.c | 2 +- libavcodec/m101.c | 2 +- libavcodec/mace.c | 4 +- libavcodec/magicyuv.c | 2 +- libavcodec/magicyuvenc.c | 2 +- libavcodec/mdec.c | 2 +- libavcodec/mediacodecdec.c | 2 +- libavcodec/metasound.c | 2 +- libavcodec/mfenc.c | 2 +- libavcodec/microdvddec.c | 2 +- libavcodec/midivid.c | 2 +- libavcodec/mimic.c | 2 +- libavcodec/mjpegbdec.c | 2 +- libavcodec/mjpegdec.c | 6 +- libavcodec/mjpegenc.c | 4 +- libavcodec/mlpdec.c | 4 +- libavcodec/mlpenc.c | 4 +- libavcodec/mmaldec.c | 2 +- libavcodec/mmvideo.c | 2 +- libavcodec/mobiclip.c | 2 +- libavcodec/motionpixels.c | 2 +- libavcodec/movtextdec.c | 2 +- libavcodec/movtextenc.c | 2 +- libavcodec/mpc7.c | 2 +- libavcodec/mpc8.c | 2 +- libavcodec/mpeg12dec.c | 8 +- libavcodec/mpeg12enc.c | 4 +- libavcodec/mpeg4videodec.c | 2 +- libavcodec/mpeg4videoenc.c | 2 +- libavcodec/mpegaudiodec_fixed.c | 10 +- libavcodec/mpegaudiodec_float.c | 10 +- libavcodec/mpegaudioenc_fixed.c | 2 +- libavcodec/mpegaudioenc_float.c | 2 +- libavcodec/mpl2dec.c | 2 +- libavcodec/mscc.c | 4 +- libavcodec/msmpeg4dec.c | 8 +- libavcodec/msmpeg4enc.c | 6 +- libavcodec/msp2dec.c | 2 +- libavcodec/msrle.c | 2 +- libavcodec/mss1.c | 2 +- libavcodec/mss2.c | 2 +- libavcodec/mss3.c | 2 +- libavcodec/mss4.c | 2 +- libavcodec/msvideo1.c | 2 +- libavcodec/msvideo1enc.c | 2 +- libavcodec/mv30.c | 2 +- libavcodec/mvcdec.c | 4 +- libavcodec/mvha.c | 2 +- libavcodec/mwsc.c | 2 +- libavcodec/mxpegdec.c | 2 +- libavcodec/nellymoserdec.c | 2 +- libavcodec/nellymoserenc.c | 2 +- libavcodec/notchlc.c | 2 +- libavcodec/nuv.c | 2 +- libavcodec/nvenc_h264.c | 2 +- libavcodec/nvenc_hevc.c | 2 +- libavcodec/omx.c | 4 +- libavcodec/on2avc.c | 2 +- libavcodec/opusdec.c | 2 +- libavcodec/opusenc.c | 2 +- libavcodec/pafaudio.c | 2 +- libavcodec/pafvideo.c | 2 +- libavcodec/pamenc.c | 2 +- libavcodec/pcm-bluray.c | 2 +- libavcodec/pcm-blurayenc.c | 2 +- libavcodec/pcm-dvd.c | 2 +- libavcodec/pcm-dvdenc.c | 2 +- libavcodec/pcm.c | 4 +- libavcodec/pcx.c | 2 +- libavcodec/pcxenc.c | 2 +- libavcodec/pgssubdec.c | 2 +- libavcodec/pgxdec.c | 2 +- libavcodec/photocd.c | 2 +- libavcodec/pictordec.c | 2 +- libavcodec/pixlet.c | 2 +- libavcodec/pngdec.c | 4 +- libavcodec/pngenc.c | 4 +- libavcodec/pnmdec.c | 12 +-- libavcodec/pnmenc.c | 10 +- libavcodec/proresdec2.c | 2 +- libavcodec/proresenc_anatoliy.c | 4 +- libavcodec/proresenc_kostya.c | 2 +- libavcodec/prosumer.c | 2 +- libavcodec/psd.c | 2 +- libavcodec/pthread_frame.c | 2 +- libavcodec/ptx.c | 2 +- libavcodec/qcelpdec.c | 2 +- libavcodec/qdm2.c | 2 +- libavcodec/qdmc.c | 2 +- libavcodec/qdrw.c | 2 +- libavcodec/qpeg.c | 2 +- libavcodec/qsvdec.c | 2 +- libavcodec/qsvenc_h264.c | 2 +- libavcodec/qsvenc_hevc.c | 2 +- libavcodec/qsvenc_jpeg.c | 2 +- libavcodec/qsvenc_mpeg2.c | 2 +- libavcodec/qsvenc_vp9.c | 2 +- libavcodec/qtrle.c | 2 +- libavcodec/qtrleenc.c | 2 +- libavcodec/r210dec.c | 6 +- libavcodec/r210enc.c | 6 +- libavcodec/ra144dec.c | 2 +- libavcodec/ra144enc.c | 2 +- libavcodec/ra288.c | 2 +- libavcodec/ralf.c | 2 +- libavcodec/rasc.c | 2 +- libavcodec/rawdec.c | 2 +- libavcodec/rawenc.c | 2 +- libavcodec/realtextdec.c | 2 +- libavcodec/rkmppdec.c | 2 +- libavcodec/rl2.c | 2 +- libavcodec/roqaudioenc.c | 2 +- libavcodec/roqvideodec.c | 2 +- libavcodec/roqvideoenc.c | 2 +- libavcodec/rpza.c | 2 +- libavcodec/rpzaenc.c | 2 +- libavcodec/rscc.c | 2 +- libavcodec/rv10.c | 4 +- libavcodec/rv10enc.c | 2 +- libavcodec/rv20enc.c | 2 +- libavcodec/rv30.c | 2 +- libavcodec/rv40.c | 2 +- libavcodec/s302m.c | 2 +- libavcodec/s302menc.c | 2 +- libavcodec/samidec.c | 2 +- libavcodec/sanm.c | 2 +- libavcodec/sbcdec.c | 2 +- libavcodec/sbcenc.c | 2 +- libavcodec/scpr.c | 2 +- libavcodec/screenpresso.c | 2 +- libavcodec/sga.c | 2 +- libavcodec/sgidec.c | 2 +- libavcodec/sgienc.c | 2 +- libavcodec/sgirledec.c | 2 +- libavcodec/sheervideo.c | 2 +- libavcodec/shorten.c | 2 +- libavcodec/sipr.c | 2 +- libavcodec/siren.c | 4 +- libavcodec/smacker.c | 4 +- libavcodec/smc.c | 2 +- libavcodec/smcenc.c | 2 +- libavcodec/snowdec.c | 2 +- libavcodec/snowenc.c | 2 +- libavcodec/sonic.c | 6 +- libavcodec/sp5xdec.c | 4 +- libavcodec/speedhq.c | 2 +- libavcodec/speedhqenc.c | 2 +- libavcodec/speexdec.c | 2 +- libavcodec/srtdec.c | 4 +- libavcodec/srtenc.c | 6 +- libavcodec/subviewerdec.c | 2 +- libavcodec/sunrast.c | 2 +- libavcodec/sunrastenc.c | 2 +- libavcodec/svq1dec.c | 2 +- libavcodec/svq1enc.c | 2 +- libavcodec/svq3.c | 2 +- libavcodec/takdec.c | 2 +- libavcodec/targa.c | 2 +- libavcodec/targa_y216dec.c | 2 +- libavcodec/targaenc.c | 2 +- libavcodec/tdsc.c | 2 +- libavcodec/tests/avcodec.c | 42 +++++--- libavcodec/textdec.c | 10 +- libavcodec/tiertexseqv.c | 2 +- libavcodec/tiff.c | 2 +- libavcodec/tiffenc.c | 2 +- libavcodec/tmv.c | 2 +- libavcodec/truemotion1.c | 2 +- libavcodec/truemotion2.c | 2 +- libavcodec/truemotion2rt.c | 2 +- libavcodec/truespeech.c | 2 +- libavcodec/tscc.c | 2 +- libavcodec/tscc2.c | 2 +- libavcodec/tta.c | 2 +- libavcodec/ttaenc.c | 2 +- libavcodec/ttmlenc.c | 2 +- libavcodec/twinvqdec.c | 2 +- libavcodec/txd.c | 2 +- libavcodec/ulti.c | 2 +- libavcodec/utils.c | 8 +- libavcodec/utvideodec.c | 2 +- libavcodec/utvideoenc.c | 2 +- libavcodec/v210dec.c | 2 +- libavcodec/v210enc.c | 2 +- libavcodec/v210x.c | 2 +- libavcodec/v308dec.c | 2 +- libavcodec/v308enc.c | 2 +- libavcodec/v408dec.c | 4 +- libavcodec/v408enc.c | 4 +- libavcodec/v410dec.c | 2 +- libavcodec/v410enc.c | 2 +- libavcodec/v4l2_m2m_dec.c | 2 +- libavcodec/v4l2_m2m_enc.c | 2 +- libavcodec/vaapi_encode_h264.c | 2 +- libavcodec/vaapi_encode_h265.c | 2 +- libavcodec/vaapi_encode_mjpeg.c | 2 +- libavcodec/vaapi_encode_mpeg2.c | 2 +- libavcodec/vaapi_encode_vp8.c | 2 +- libavcodec/vaapi_encode_vp9.c | 2 +- libavcodec/vb.c | 2 +- libavcodec/vble.c | 2 +- libavcodec/vc1dec.c | 8 +- libavcodec/vc2enc.c | 2 +- libavcodec/vcr1.c | 2 +- libavcodec/videotoolboxenc.c | 6 +- libavcodec/vima.c | 2 +- libavcodec/vmdaudio.c | 2 +- libavcodec/vmdvideo.c | 2 +- libavcodec/vmnc.c | 2 +- libavcodec/vorbisdec.c | 2 +- libavcodec/vorbisenc.c | 2 +- libavcodec/vp3.c | 6 +- libavcodec/vp5.c | 2 +- libavcodec/vp6.c | 6 +- libavcodec/vp8.c | 4 +- libavcodec/vp9.c | 2 +- libavcodec/vqavideo.c | 2 +- libavcodec/wavpack.c | 2 +- libavcodec/wavpackenc.c | 2 +- libavcodec/wcmv.c | 2 +- libavcodec/webp.c | 2 +- libavcodec/webvttdec.c | 2 +- libavcodec/webvttenc.c | 2 +- libavcodec/wmadec.c | 4 +- libavcodec/wmaenc.c | 4 +- libavcodec/wmalosslessdec.c | 2 +- libavcodec/wmaprodec.c | 6 +- libavcodec/wmavoice.c | 2 +- libavcodec/wmv2dec.c | 2 +- libavcodec/wmv2enc.c | 2 +- libavcodec/wnv1.c | 2 +- libavcodec/wrapped_avframe.c | 4 +- libavcodec/ws-snd1.c | 2 +- libavcodec/xan.c | 2 +- libavcodec/xbmdec.c | 2 +- libavcodec/xbmenc.c | 2 +- libavcodec/xfacedec.c | 2 +- libavcodec/xfaceenc.c | 2 +- libavcodec/xl.c | 2 +- libavcodec/xpmdec.c | 2 +- libavcodec/xsubdec.c | 2 +- libavcodec/xsubenc.c | 2 +- libavcodec/xwddec.c | 2 +- libavcodec/xwdenc.c | 2 +- libavcodec/xxan.c | 2 +- libavcodec/y41pdec.c | 2 +- libavcodec/y41penc.c | 2 +- libavcodec/ylc.c | 2 +- libavcodec/yop.c | 2 +- libavcodec/yuv4dec.c | 2 +- libavcodec/yuv4enc.c | 2 +- libavcodec/zerocodec.c | 2 +- libavcodec/zmbv.c | 2 +- libavcodec/zmbvenc.c | 2 +- 498 files changed, 758 insertions(+), 673 deletions(-) diff --git a/libavcodec/012v.c b/libavcodec/012v.c index 4d57b57082..c03afd0bc7 100644 --- a/libavcodec/012v.c +++ b/libavcodec/012v.c @@ -150,7 +150,7 @@ const FFCodec ff_zero12v_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_012V, .init = zero12v_decode_init, - .decode = zero12v_decode_frame, + FF_CODEC_DECODE_CB(zero12v_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index 413b4f9330..3fb3568afd 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -1034,7 +1034,7 @@ const FFCodec ff_fourxm_decoder = { .priv_data_size = sizeof(FourXContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c index d5146043ac..95a35159e3 100644 --- a/libavcodec/8bps.c +++ b/libavcodec/8bps.c @@ -180,7 +180,7 @@ const FFCodec ff_eightbps_decoder = { .p.id = AV_CODEC_ID_8BPS, .priv_data_size = sizeof(EightBpsContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/8svx.c b/libavcodec/8svx.c index 937800304c..6eb90834b9 100644 --- a/libavcodec/8svx.c +++ b/libavcodec/8svx.c @@ -194,7 +194,7 @@ const FFCodec ff_eightsvx_fib_decoder = { .p.id = AV_CODEC_ID_8SVX_FIB, .priv_data_size = sizeof (EightSvxContext), .init = eightsvx_decode_init, - .decode = eightsvx_decode_frame, + FF_CODEC_DECODE_CB(eightsvx_decode_frame), .close = eightsvx_decode_close, .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, @@ -210,7 +210,7 @@ const FFCodec ff_eightsvx_exp_decoder = { .p.id = AV_CODEC_ID_8SVX_EXP, .priv_data_size = sizeof (EightSvxContext), .init = eightsvx_decode_init, - .decode = eightsvx_decode_frame, + FF_CODEC_DECODE_CB(eightsvx_decode_frame), .close = eightsvx_decode_close, .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, diff --git a/libavcodec/a64multienc.c b/libavcodec/a64multienc.c index b642a575f1..e80139ee51 100644 --- a/libavcodec/a64multienc.c +++ b/libavcodec/a64multienc.c @@ -401,7 +401,7 @@ const FFCodec ff_a64multi_encoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .priv_data_size = sizeof(A64Context), .init = a64multi_encode_init, - .encode2 = a64multi_encode_frame, + FF_CODEC_ENCODE_CB(a64multi_encode_frame), .close = a64multi_close_encoder, .p.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE}, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, @@ -416,7 +416,7 @@ const FFCodec ff_a64multi5_encoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .priv_data_size = sizeof(A64Context), .init = a64multi_encode_init, - .encode2 = a64multi_encode_frame, + FF_CODEC_ENCODE_CB(a64multi_encode_frame), .close = a64multi_close_encoder, .p.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE}, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 5fc6738b38..88c128f396 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -560,7 +560,7 @@ const FFCodec ff_aac_decoder = { .priv_data_size = sizeof(AACContext), .init = aac_decode_init, .close = aac_decode_close, - .decode = aac_decode_frame, + FF_CODEC_DECODE_CB(aac_decode_frame), .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, @@ -588,7 +588,7 @@ const FFCodec ff_aac_latm_decoder = { .priv_data_size = sizeof(struct LATMContext), .init = latm_decode_init, .close = aac_decode_close, - .decode = latm_decode_frame, + FF_CODEC_DECODE_CB(latm_decode_frame), .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index bdce588b26..c7ac75024f 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -458,7 +458,7 @@ const FFCodec ff_aac_fixed_decoder = { .priv_data_size = sizeof(AACContext), .init = aac_decode_init, .close = aac_decode_close, - .decode = aac_decode_frame, + FF_CODEC_DECODE_CB(aac_decode_frame), .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 820d9b60cb..eb091326b1 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -1144,7 +1144,7 @@ const FFCodec ff_aac_encoder = { .p.id = AV_CODEC_ID_AAC, .priv_data_size = sizeof(AACEncContext), .init = aac_encode_init, - .encode2 = aac_encode_frame, + FF_CODEC_ENCODE_CB(aac_encode_frame), .close = aac_encode_end, .defaults = aac_encode_defaults, .p.supported_samplerates = ff_mpeg4audio_sample_rates, diff --git a/libavcodec/aasc.c b/libavcodec/aasc.c index a462e2f05e..d297cfad76 100644 --- a/libavcodec/aasc.c +++ b/libavcodec/aasc.c @@ -157,7 +157,7 @@ const FFCodec ff_aasc_decoder = { .priv_data_size = sizeof(AascContext), .init = aasc_decode_init, .close = aasc_decode_end, - .decode = aasc_decode_frame, + FF_CODEC_DECODE_CB(aasc_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/ac3dec_fixed.c b/libavcodec/ac3dec_fixed.c index de44bf80cf..4c0d4d6f5c 100644 --- a/libavcodec/ac3dec_fixed.c +++ b/libavcodec/ac3dec_fixed.c @@ -178,7 +178,7 @@ const FFCodec ff_ac3_fixed_decoder = { .priv_data_size = sizeof (AC3DecodeContext), .init = ac3_decode_init, .close = ac3_decode_end, - .decode = ac3_decode_frame, + FF_CODEC_DECODE_CB(ac3_decode_frame), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, diff --git a/libavcodec/ac3dec_float.c b/libavcodec/ac3dec_float.c index 5aeb378bc6..2147b36afe 100644 --- a/libavcodec/ac3dec_float.c +++ b/libavcodec/ac3dec_float.c @@ -66,7 +66,7 @@ const FFCodec ff_ac3_decoder = { .priv_data_size = sizeof (AC3DecodeContext), .init = ac3_decode_init, .close = ac3_decode_end, - .decode = ac3_decode_frame, + FF_CODEC_DECODE_CB(ac3_decode_frame), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), @@ -84,7 +84,7 @@ const FFCodec ff_eac3_decoder = { .priv_data_size = sizeof (AC3DecodeContext), .init = ac3_decode_init, .close = ac3_decode_end, - .decode = ac3_decode_frame, + FF_CODEC_DECODE_CB(ac3_decode_frame), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"), diff --git a/libavcodec/ac3enc_fixed.c b/libavcodec/ac3enc_fixed.c index af6b2a20f9..92bf31b039 100644 --- a/libavcodec/ac3enc_fixed.c +++ b/libavcodec/ac3enc_fixed.c @@ -128,7 +128,7 @@ const FFCodec ff_ac3_fixed_encoder = { .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(AC3EncodeContext), .init = ac3_fixed_encode_init, - .encode2 = ff_ac3_fixed_encode_frame, + FF_CODEC_ENCODE_CB(ff_ac3_fixed_encode_frame), .close = ff_ac3_encode_close, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/ac3enc_float.c b/libavcodec/ac3enc_float.c index 1323df74a9..9f5341cf2d 100644 --- a/libavcodec/ac3enc_float.c +++ b/libavcodec/ac3enc_float.c @@ -132,7 +132,7 @@ const FFCodec ff_ac3_encoder = { .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(AC3EncodeContext), .init = ff_ac3_float_encode_init, - .encode2 = ff_ac3_float_encode_frame, + FF_CODEC_ENCODE_CB(ff_ac3_float_encode_frame), .close = ff_ac3_encode_close, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index ccb625ab54..b2ef7dfbec 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -2294,7 +2294,7 @@ const FFCodec ff_ ## name_ ## _decoder = { \ .p.sample_fmts = sample_fmts_, \ .priv_data_size = sizeof(ADPCMDecodeContext), \ .init = adpcm_decode_init, \ - .decode = adpcm_decode_frame, \ + FF_CODEC_DECODE_CB(adpcm_decode_frame), \ .flush = adpcm_flush, \ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \ }; diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c index 0a2e6bb3be..4ff77662b4 100644 --- a/libavcodec/adpcmenc.c +++ b/libavcodec/adpcmenc.c @@ -1007,7 +1007,7 @@ const FFCodec ff_ ## name_ ## _encoder = { \ .p.priv_class = &adpcm_encoder_class, \ .priv_data_size = sizeof(ADPCMEncodeContext), \ .init = adpcm_encode_init, \ - .encode2 = adpcm_encode_frame, \ + FF_CODEC_ENCODE_CB(adpcm_encode_frame), \ .close = adpcm_encode_close, \ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, \ }; diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c index 870f485726..1ebc250e47 100644 --- a/libavcodec/adxdec.c +++ b/libavcodec/adxdec.c @@ -197,7 +197,7 @@ const FFCodec ff_adpcm_adx_decoder = { .p.id = AV_CODEC_ID_ADPCM_ADX, .priv_data_size = sizeof(ADXContext), .init = adx_decode_init, - .decode = adx_decode_frame, + FF_CODEC_DECODE_CB(adx_decode_frame), .flush = adx_decode_flush, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, diff --git a/libavcodec/adxenc.c b/libavcodec/adxenc.c index af8d2861e7..9277cab7c9 100644 --- a/libavcodec/adxenc.c +++ b/libavcodec/adxenc.c @@ -197,7 +197,7 @@ const FFCodec ff_adpcm_adx_encoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .priv_data_size = sizeof(ADXContext), .init = adx_encode_init, - .encode2 = adx_encode_frame, + FF_CODEC_ENCODE_CB(adx_encode_frame), .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/agm.c b/libavcodec/agm.c index 795b34a415..27438dd1a4 100644 --- a/libavcodec/agm.c +++ b/libavcodec/agm.c @@ -1294,7 +1294,7 @@ const FFCodec ff_agm_decoder = { .priv_data_size = sizeof(AGMContext), .init = decode_init, .close = decode_close, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .flush = decode_flush, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | diff --git a/libavcodec/aic.c b/libavcodec/aic.c index 7f124f5126..5f0eec6b80 100644 --- a/libavcodec/aic.c +++ b/libavcodec/aic.c @@ -503,7 +503,7 @@ const FFCodec ff_aic_decoder = { .priv_data_size = sizeof(AICContext), .init = aic_decode_init, .close = aic_decode_close, - .decode = aic_decode_frame, + FF_CODEC_DECODE_CB(aic_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/alac.c b/libavcodec/alac.c index b2d47e27c1..9aaf7066b2 100644 --- a/libavcodec/alac.c +++ b/libavcodec/alac.c @@ -618,7 +618,7 @@ const FFCodec ff_alac_decoder = { .priv_data_size = sizeof(ALACContext), .init = alac_decode_init, .close = alac_decode_close, - .decode = alac_decode_frame, + FF_CODEC_DECODE_CB(alac_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .p.priv_class = &alac_class diff --git a/libavcodec/alacenc.c b/libavcodec/alacenc.c index 62ac32e345..72ce65e265 100644 --- a/libavcodec/alacenc.c +++ b/libavcodec/alacenc.c @@ -657,7 +657,7 @@ const FFCodec ff_alac_encoder = { .priv_data_size = sizeof(AlacEncodeContext), .p.priv_class = &alacenc_class, .init = alac_encode_init, - .encode2 = alac_encode_frame, + FF_CODEC_ENCODE_CB(alac_encode_frame), .close = alac_encode_close, .p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, #if FF_API_OLD_CHANNEL_LAYOUT diff --git a/libavcodec/aliaspixdec.c b/libavcodec/aliaspixdec.c index 8dc579079f..73c83528f5 100644 --- a/libavcodec/aliaspixdec.c +++ b/libavcodec/aliaspixdec.c @@ -127,5 +127,5 @@ const FFCodec ff_alias_pix_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ALIAS_PIX, .p.capabilities = AV_CODEC_CAP_DR1, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), }; diff --git a/libavcodec/aliaspixenc.c b/libavcodec/aliaspixenc.c index 74b5450132..9c43cfa9e7 100644 --- a/libavcodec/aliaspixenc.c +++ b/libavcodec/aliaspixenc.c @@ -106,7 +106,7 @@ const FFCodec ff_alias_pix_encoder = { .p.long_name = NULL_IF_CONFIG_SMALL("Alias/Wavefront PIX image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_ALIAS_PIX, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }, diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index 1a517916d5..bf961a03f5 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -2183,7 +2183,7 @@ const FFCodec ff_als_decoder = { .priv_data_size = sizeof(ALSDecContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .flush = flush, .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/amfenc_h264.c b/libavcodec/amfenc_h264.c index 7df2e8eb1d..efb04589f6 100644 --- a/libavcodec/amfenc_h264.c +++ b/libavcodec/amfenc_h264.c @@ -384,7 +384,7 @@ const FFCodec ff_h264_amf_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H264, .init = amf_encode_init_h264, - .receive_packet = ff_amf_receive_packet, + FF_CODEC_RECEIVE_PACKET_CB(ff_amf_receive_packet), .close = ff_amf_encode_close, .priv_data_size = sizeof(AmfContext), .p.priv_class = &h264_amf_class, diff --git a/libavcodec/amfenc_hevc.c b/libavcodec/amfenc_hevc.c index ed7230ee21..8ab9330730 100644 --- a/libavcodec/amfenc_hevc.c +++ b/libavcodec/amfenc_hevc.c @@ -316,7 +316,7 @@ const FFCodec ff_hevc_amf_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HEVC, .init = amf_encode_init_hevc, - .receive_packet = ff_amf_receive_packet, + FF_CODEC_RECEIVE_PACKET_CB(ff_amf_receive_packet), .close = ff_amf_encode_close, .priv_data_size = sizeof(AmfContext), .p.priv_class = &hevc_amf_class, diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c index 72482b25e4..f67ed1d02e 100644 --- a/libavcodec/amrnbdec.c +++ b/libavcodec/amrnbdec.c @@ -1103,7 +1103,7 @@ const FFCodec ff_amrnb_decoder = { .p.id = AV_CODEC_ID_AMR_NB, .priv_data_size = sizeof(AMRChannelsContext), .init = amrnb_decode_init, - .decode = amrnb_decode_frame, + FF_CODEC_DECODE_CB(amrnb_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c index e12078e028..7566f250d2 100644 --- a/libavcodec/amrwbdec.c +++ b/libavcodec/amrwbdec.c @@ -1299,7 +1299,7 @@ const FFCodec ff_amrwb_decoder = { .p.id = AV_CODEC_ID_AMR_WB, .priv_data_size = sizeof(AMRWBChannelsContext), .init = amrwb_decode_init, - .decode = amrwb_decode_frame, + FF_CODEC_DECODE_CB(amrwb_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/anm.c b/libavcodec/anm.c index 5e07247992..a9006be9c0 100644 --- a/libavcodec/anm.c +++ b/libavcodec/anm.c @@ -197,7 +197,7 @@ const FFCodec ff_anm_decoder = { .priv_data_size = sizeof(AnmContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c index 80b3df0d92..909ebe7396 100644 --- a/libavcodec/ansi.c +++ b/libavcodec/ansi.c @@ -488,7 +488,7 @@ const FFCodec ff_ansi_decoder = { .priv_data_size = sizeof(AnsiContext), .init = decode_init, .close = decode_close, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .defaults = ansi_defaults, diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index 89b6bb04e5..f4000725f1 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -1666,7 +1666,7 @@ const FFCodec ff_ape_decoder = { .priv_data_size = sizeof(APEContext), .init = ape_decode_init, .close = ape_decode_close, - .decode = ape_decode_frame, + FF_CODEC_DECODE_CB(ape_decode_frame), .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/aptxdec.c b/libavcodec/aptxdec.c index 03eb27cd5c..6ac070ba99 100644 --- a/libavcodec/aptxdec.c +++ b/libavcodec/aptxdec.c @@ -181,7 +181,7 @@ const FFCodec ff_aptx_decoder = { .p.id = AV_CODEC_ID_APTX, .priv_data_size = sizeof(AptXContext), .init = ff_aptx_init, - .decode = aptx_decode_frame, + FF_CODEC_DECODE_CB(aptx_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, #if FF_API_OLD_CHANNEL_LAYOUT @@ -201,7 +201,7 @@ const FFCodec ff_aptx_hd_decoder = { .p.id = AV_CODEC_ID_APTX_HD, .priv_data_size = sizeof(AptXContext), .init = ff_aptx_init, - .decode = aptx_decode_frame, + FF_CODEC_DECODE_CB(aptx_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, #if FF_API_OLD_CHANNEL_LAYOUT diff --git a/libavcodec/aptxenc.c b/libavcodec/aptxenc.c index 206eb439e1..89ab3974c5 100644 --- a/libavcodec/aptxenc.c +++ b/libavcodec/aptxenc.c @@ -253,7 +253,7 @@ const FFCodec ff_aptx_encoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(AptXContext), .init = ff_aptx_init, - .encode2 = aptx_encode_frame, + FF_CODEC_ENCODE_CB(aptx_encode_frame), .close = aptx_close, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, #if FF_API_OLD_CHANNEL_LAYOUT @@ -275,7 +275,7 @@ const FFCodec ff_aptx_hd_encoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(AptXContext), .init = ff_aptx_init, - .encode2 = aptx_encode_frame, + FF_CODEC_ENCODE_CB(aptx_encode_frame), .close = aptx_close, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, #if FF_API_OLD_CHANNEL_LAYOUT diff --git a/libavcodec/arbc.c b/libavcodec/arbc.c index d5171ee41e..78600963eb 100644 --- a/libavcodec/arbc.c +++ b/libavcodec/arbc.c @@ -218,7 +218,7 @@ const FFCodec ff_arbc_decoder = { .p.id = AV_CODEC_ID_ARBC, .priv_data_size = sizeof(ARBCContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .flush = decode_flush, .close = decode_close, .p.capabilities = AV_CODEC_CAP_DR1, diff --git a/libavcodec/argo.c b/libavcodec/argo.c index 5c52b35b61..efd1056f16 100644 --- a/libavcodec/argo.c +++ b/libavcodec/argo.c @@ -740,7 +740,7 @@ const FFCodec ff_argo_decoder = { .p.id = AV_CODEC_ID_ARGO, .priv_data_size = sizeof(ArgoContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .flush = decode_flush, .close = decode_close, .p.capabilities = AV_CODEC_CAP_DR1, diff --git a/libavcodec/assdec.c b/libavcodec/assdec.c index bf1260a947..b94629ea1d 100644 --- a/libavcodec/assdec.c +++ b/libavcodec/assdec.c @@ -68,7 +68,7 @@ const FFCodec ff_ssa_decoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_ASS, .init = ass_decode_init, - .decode_sub = ass_decode_frame, + FF_CODEC_DECODE_SUB_CB(ass_decode_frame), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif @@ -80,7 +80,7 @@ const FFCodec ff_ass_decoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_ASS, .init = ass_decode_init, - .decode_sub = ass_decode_frame, + FF_CODEC_DECODE_SUB_CB(ass_decode_frame), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff --git a/libavcodec/assenc.c b/libavcodec/assenc.c index 948ccdf083..2ac40d5afe 100644 --- a/libavcodec/assenc.c +++ b/libavcodec/assenc.c @@ -75,7 +75,7 @@ const FFCodec ff_ssa_encoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_ASS, .init = ass_encode_init, - .encode_sub = ass_encode_frame, + FF_CODEC_ENCODE_SUB_CB(ass_encode_frame), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif @@ -87,7 +87,7 @@ const FFCodec ff_ass_encoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_ASS, .init = ass_encode_init, - .encode_sub = ass_encode_frame, + FF_CODEC_ENCODE_SUB_CB(ass_encode_frame), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff --git a/libavcodec/asvdec.c b/libavcodec/asvdec.c index 0cce79d8b8..5b2c71be82 100644 --- a/libavcodec/asvdec.c +++ b/libavcodec/asvdec.c @@ -336,7 +336,7 @@ const FFCodec ff_asv1_decoder = { .priv_data_size = sizeof(ASV1Context), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; @@ -350,7 +350,7 @@ const FFCodec ff_asv2_decoder = { .p.id = AV_CODEC_ID_ASV2, .priv_data_size = sizeof(ASV1Context), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c index 8dd15f29bd..520173e6c9 100644 --- a/libavcodec/asvenc.c +++ b/libavcodec/asvenc.c @@ -350,7 +350,7 @@ const FFCodec ff_asv1_encoder = { .p.id = AV_CODEC_ID_ASV1, .priv_data_size = sizeof(ASV1Context), .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, @@ -365,7 +365,7 @@ const FFCodec ff_asv2_encoder = { .p.id = AV_CODEC_ID_ASV2, .priv_data_size = sizeof(ASV1Context), .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c index 9c953d8772..7265891ac1 100644 --- a/libavcodec/atrac1.c +++ b/libavcodec/atrac1.c @@ -392,7 +392,7 @@ const FFCodec ff_atrac1_decoder = { .priv_data_size = sizeof(AT1Ctx), .init = atrac1_decode_init, .close = atrac1_decode_end, - .decode = atrac1_decode_frame, + FF_CODEC_DECODE_CB(atrac1_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c index 123acdc7e3..97f59438e1 100644 --- a/libavcodec/atrac3.c +++ b/libavcodec/atrac3.c @@ -1023,7 +1023,7 @@ const FFCodec ff_atrac3_decoder = { .priv_data_size = sizeof(ATRAC3Context), .init = atrac3_decode_init, .close = atrac3_decode_close, - .decode = atrac3_decode_frame, + FF_CODEC_DECODE_CB(atrac3_decode_frame), .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, @@ -1038,7 +1038,7 @@ const FFCodec ff_atrac3al_decoder = { .priv_data_size = sizeof(ATRAC3Context), .init = atrac3_decode_init, .close = atrac3_decode_close, - .decode = atrac3al_decode_frame, + FF_CODEC_DECODE_CB(atrac3al_decode_frame), .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/atrac3plusdec.c b/libavcodec/atrac3plusdec.c index 3524ed22e3..f87ffb8938 100644 --- a/libavcodec/atrac3plusdec.c +++ b/libavcodec/atrac3plusdec.c @@ -400,7 +400,7 @@ const FFCodec ff_atrac3p_decoder = { .priv_data_size = sizeof(ATRAC3PContext), .init = atrac3p_decode_init, .close = atrac3p_decode_close, - .decode = atrac3p_decode_frame, + FF_CODEC_DECODE_CB(atrac3p_decode_frame), }; const FFCodec ff_atrac3pal_decoder = { @@ -413,5 +413,5 @@ const FFCodec ff_atrac3pal_decoder = { .priv_data_size = sizeof(ATRAC3PContext), .init = atrac3p_decode_init, .close = atrac3p_decode_close, - .decode = atrac3p_decode_frame, + FF_CODEC_DECODE_CB(atrac3p_decode_frame), }; diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c index 5d51c23f19..d9ad03140c 100644 --- a/libavcodec/atrac9dec.c +++ b/libavcodec/atrac9dec.c @@ -995,7 +995,7 @@ const FFCodec ff_atrac9_decoder = { .priv_data_size = sizeof(ATRAC9Context), .init = atrac9_decode_init, .close = atrac9_decode_close, - .decode = atrac9_decode_frame, + FF_CODEC_DECODE_CB(atrac9_decode_frame), .flush = atrac9_decode_flush, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c index 3f6089f29a..b8d0e868f7 100644 --- a/libavcodec/audiotoolboxdec.c +++ b/libavcodec/audiotoolboxdec.c @@ -592,7 +592,7 @@ static av_cold int ffat_close_decoder(AVCodecContext *avctx) .priv_data_size = sizeof(ATDecodeContext), \ .init = ffat_init_decoder, \ .close = ffat_close_decoder, \ - .decode = ffat_decode, \ + FF_CODEC_DECODE_CB(ffat_decode), \ .flush = ffat_decode_flush, \ .p.priv_class = &ffat_##NAME##_dec_class, \ .bsfs = bsf_name, \ diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c index 4e7073064f..f8305ab89b 100644 --- a/libavcodec/audiotoolboxenc.c +++ b/libavcodec/audiotoolboxenc.c @@ -621,7 +621,7 @@ static const AVOption options[] = { .priv_data_size = sizeof(ATDecodeContext), \ .init = ffat_init_encoder, \ .close = ffat_close_encoder, \ - .encode2 = ffat_encode, \ + FF_CODEC_ENCODE_CB(ffat_encode), \ .flush = ffat_encode_flush, \ .p.priv_class = &ffat_##NAME##_enc_class, \ .p.capabilities = AV_CODEC_CAP_DELAY | \ diff --git a/libavcodec/aura.c b/libavcodec/aura.c index 1896013cfb..b4167cacfd 100644 --- a/libavcodec/aura.c +++ b/libavcodec/aura.c @@ -102,7 +102,7 @@ const FFCodec ff_aura2_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AURA2, .init = aura_decode_init, - .decode = aura_decode_frame, + FF_CODEC_DECODE_CB(aura_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index 517fa701f4..1c09b1d6d6 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -1246,7 +1246,7 @@ const FFCodec ff_av1_decoder = { .priv_data_size = sizeof(AV1DecContext), .init = av1_decode_init, .close = av1_decode_free, - .decode = av1_decode_frame, + FF_CODEC_DECODE_CB(av1_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | diff --git a/libavcodec/avrndec.c b/libavcodec/avrndec.c index 8f716a129e..9bb0c1ffa2 100644 --- a/libavcodec/avrndec.c +++ b/libavcodec/avrndec.c @@ -96,7 +96,7 @@ const FFCodec ff_avrn_decoder = { .p.id = AV_CODEC_ID_AVRN, .priv_data_size = sizeof(AVRnContext), .init = init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/avs.c b/libavcodec/avs.c index a26a3bbc00..6dda3393b5 100644 --- a/libavcodec/avs.c +++ b/libavcodec/avs.c @@ -182,7 +182,7 @@ const FFCodec ff_avs_decoder = { .p.id = AV_CODEC_ID_AVS, .priv_data_size = sizeof(AvsContext), .init = avs_decode_init, - .decode = avs_decode_frame, + FF_CODEC_DECODE_CB(avs_decode_frame), .close = avs_decode_end, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/avuidec.c b/libavcodec/avuidec.c index a86b0d5668..f545c41154 100644 --- a/libavcodec/avuidec.c +++ b/libavcodec/avuidec.c @@ -126,6 +126,6 @@ const FFCodec ff_avui_decoder = { .p.id = AV_CODEC_ID_AVUI, .p.capabilities = AV_CODEC_CAP_DR1, .init = avui_decode_init, - .decode = avui_decode_frame, + FF_CODEC_DECODE_CB(avui_decode_frame), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/avuienc.c b/libavcodec/avuienc.c index dccfd65c90..e2bd3181f5 100644 --- a/libavcodec/avuienc.c +++ b/libavcodec/avuienc.c @@ -99,6 +99,6 @@ const FFCodec ff_avui_encoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_UYVY422, AV_PIX_FMT_NONE }, .init = avui_encode_init, - .encode2 = avui_encode_frame, + FF_CODEC_ENCODE_CB(avui_encode_frame), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/bethsoftvideo.c b/libavcodec/bethsoftvideo.c index 44175805f1..9fc286fb00 100644 --- a/libavcodec/bethsoftvideo.c +++ b/libavcodec/bethsoftvideo.c @@ -166,7 +166,7 @@ const FFCodec ff_bethsoftvid_decoder = { .priv_data_size = sizeof(BethsoftvidContext), .init = bethsoftvid_decode_init, .close = bethsoftvid_decode_end, - .decode = bethsoftvid_decode_frame, + FF_CODEC_DECODE_CB(bethsoftvid_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/bfi.c b/libavcodec/bfi.c index fb22b0e1b1..6f9fbb0e96 100644 --- a/libavcodec/bfi.c +++ b/libavcodec/bfi.c @@ -183,7 +183,7 @@ const FFCodec ff_bfi_decoder = { .priv_data_size = sizeof(BFIContext), .init = bfi_decode_init, .close = bfi_decode_close, - .decode = bfi_decode_frame, + FF_CODEC_DECODE_CB(bfi_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/bink.c b/libavcodec/bink.c index 941c2244a7..ce740ad275 100644 --- a/libavcodec/bink.c +++ b/libavcodec/bink.c @@ -1427,7 +1427,7 @@ const FFCodec ff_bink_decoder = { .priv_data_size = sizeof(BinkContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .flush = flush, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c index c4f3e743e2..fb5233f0ab 100644 --- a/libavcodec/binkaudio.c +++ b/libavcodec/binkaudio.c @@ -372,7 +372,7 @@ const FFCodec ff_binkaudio_rdft_decoder = { .init = decode_init, .flush = decode_flush, .close = decode_end, - .receive_frame = binkaudio_receive_frame, + FF_CODEC_RECEIVE_FRAME_CB(binkaudio_receive_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; @@ -386,7 +386,7 @@ const FFCodec ff_binkaudio_dct_decoder = { .init = decode_init, .flush = decode_flush, .close = decode_end, - .receive_frame = binkaudio_receive_frame, + FF_CODEC_RECEIVE_FRAME_CB(binkaudio_receive_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/bintext.c b/libavcodec/bintext.c index 183fea5b84..e153198c32 100644 --- a/libavcodec/bintext.c +++ b/libavcodec/bintext.c @@ -224,7 +224,7 @@ const FFCodec ff_bintext_decoder = { .p.id = AV_CODEC_ID_BINTEXT, .priv_data_size = sizeof(XbinContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; @@ -237,7 +237,7 @@ const FFCodec ff_xbin_decoder = { .p.id = AV_CODEC_ID_XBIN, .priv_data_size = sizeof(XbinContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; @@ -250,7 +250,7 @@ const FFCodec ff_idf_decoder = { .p.id = AV_CODEC_ID_IDF, .priv_data_size = sizeof(XbinContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/bitpacked_dec.c b/libavcodec/bitpacked_dec.c index 3b8f2d8fd9..4723a3c7eb 100644 --- a/libavcodec/bitpacked_dec.c +++ b/libavcodec/bitpacked_dec.c @@ -149,7 +149,7 @@ const FFCodec ff_bitpacked_decoder = { .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .priv_data_size = sizeof(struct BitpackedContext), .init = bitpacked_init_decoder, - .decode = bitpacked_decode, + FF_CODEC_DECODE_CB(bitpacked_decode), .codec_tags = (const uint32_t []){ MKTAG('U', 'Y', 'V', 'Y'), FF_CODEC_TAGS_END, diff --git a/libavcodec/bitpacked_enc.c b/libavcodec/bitpacked_enc.c index c9c0501f39..127f1af59b 100644 --- a/libavcodec/bitpacked_enc.c +++ b/libavcodec/bitpacked_enc.c @@ -112,7 +112,7 @@ const FFCodec ff_bitpacked_encoder = { .priv_data_size = sizeof(struct BitpackedContext), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P10, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c index c971ff0f59..410065aba1 100644 --- a/libavcodec/bmp.c +++ b/libavcodec/bmp.c @@ -370,5 +370,5 @@ const FFCodec ff_bmp_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_BMP, .p.capabilities = AV_CODEC_CAP_DR1, - .decode = bmp_decode_frame, + FF_CODEC_DECODE_CB(bmp_decode_frame), }; diff --git a/libavcodec/bmpenc.c b/libavcodec/bmpenc.c index 1f2303c1e0..f28ce01f59 100644 --- a/libavcodec/bmpenc.c +++ b/libavcodec/bmpenc.c @@ -162,7 +162,7 @@ const FFCodec ff_bmp_encoder = { .p.id = AV_CODEC_ID_BMP, .p.capabilities = AV_CODEC_CAP_DR1, .init = bmp_encode_init, - .encode2 = bmp_encode_frame, + FF_CODEC_ENCODE_CB(bmp_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGRA, AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB565, AV_PIX_FMT_RGB555, AV_PIX_FMT_RGB444, diff --git a/libavcodec/bmvaudio.c b/libavcodec/bmvaudio.c index d21370938f..f57ece0320 100644 --- a/libavcodec/bmvaudio.c +++ b/libavcodec/bmvaudio.c @@ -84,7 +84,7 @@ const FFCodec ff_bmv_audio_decoder = { .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_BMV_AUDIO, .init = bmv_aud_decode_init, - .decode = bmv_aud_decode_frame, + FF_CODEC_DECODE_CB(bmv_aud_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/bmvvideo.c b/libavcodec/bmvvideo.c index baa8e37e46..c492d7fcfa 100644 --- a/libavcodec/bmvvideo.c +++ b/libavcodec/bmvvideo.c @@ -292,7 +292,7 @@ const FFCodec ff_bmv_video_decoder = { .p.id = AV_CODEC_ID_BMV_VIDEO, .priv_data_size = sizeof(BMVDecContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/brenderpix.c b/libavcodec/brenderpix.c index 98db6e6950..9807a11cf9 100644 --- a/libavcodec/brenderpix.c +++ b/libavcodec/brenderpix.c @@ -290,5 +290,5 @@ const FFCodec ff_brender_pix_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_BRENDER_PIX, .p.capabilities = AV_CODEC_CAP_DR1, - .decode = pix_decode_frame, + FF_CODEC_DECODE_CB(pix_decode_frame), }; diff --git a/libavcodec/c93.c b/libavcodec/c93.c index a5dee1d1a3..050bb42741 100644 --- a/libavcodec/c93.c +++ b/libavcodec/c93.c @@ -266,7 +266,7 @@ const FFCodec ff_c93_decoder = { .priv_data_size = sizeof(C93DecoderContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 6e424f4763..7aaf3f2bcf 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -1318,7 +1318,7 @@ const FFCodec ff_cavs_decoder = { .priv_data_size = sizeof(AVSContext), .init = ff_cavs_init, .close = ff_cavs_end, - .decode = cavs_decode_frame, + FF_CODEC_DECODE_CB(cavs_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .flush = cavs_flush, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c index 32ee3a715d..e33fb36824 100644 --- a/libavcodec/ccaption_dec.c +++ b/libavcodec/ccaption_dec.c @@ -955,6 +955,6 @@ const FFCodec ff_ccaption_decoder = { .init = init_decoder, .close = close_decoder, .flush = flush_decoder, - .decode_sub = decode, + FF_CODEC_DECODE_SUB_CB(decode), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c index 8d72e6d87c..b851ec430b 100644 --- a/libavcodec/cdgraphics.c +++ b/libavcodec/cdgraphics.c @@ -395,7 +395,7 @@ const FFCodec ff_cdgraphics_decoder = { .priv_data_size = sizeof(CDGraphicsContext), .init = cdg_decode_init, .close = cdg_decode_end, - .decode = cdg_decode_frame, + FF_CODEC_DECODE_CB(cdg_decode_frame), .flush = cdg_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/cdtoons.c b/libavcodec/cdtoons.c index 1b1c1f827e..eb53a324db 100644 --- a/libavcodec/cdtoons.c +++ b/libavcodec/cdtoons.c @@ -451,7 +451,7 @@ const FFCodec ff_cdtoons_decoder = { .priv_data_size = sizeof(CDToonsContext), .init = cdtoons_decode_init, .close = cdtoons_decode_end, - .decode = cdtoons_decode_frame, + FF_CODEC_DECODE_CB(cdtoons_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .flush = cdtoons_flush, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/cdxl.c b/libavcodec/cdxl.c index 34481fe2a3..1f25d8eb99 100644 --- a/libavcodec/cdxl.c +++ b/libavcodec/cdxl.c @@ -344,7 +344,7 @@ const FFCodec ff_cdxl_decoder = { .priv_data_size = sizeof(CDXLVideoContext), .init = cdxl_decode_init, .close = cdxl_decode_end, - .decode = cdxl_decode_frame, + FF_CODEC_DECODE_CB(cdxl_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c index ab074043c1..5adb0b2008 100644 --- a/libavcodec/cfhd.c +++ b/libavcodec/cfhd.c @@ -1463,7 +1463,7 @@ const FFCodec ff_cfhd_decoder = { .priv_data_size = sizeof(CFHDContext), .init = cfhd_init, .close = cfhd_close, - .decode = cfhd_decode, + FF_CODEC_DECODE_CB(cfhd_decode), .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/cfhdenc.c b/libavcodec/cfhdenc.c index f9b8ed2625..6b33b29da9 100644 --- a/libavcodec/cfhdenc.c +++ b/libavcodec/cfhdenc.c @@ -854,7 +854,7 @@ const FFCodec ff_cfhd_encoder = { .p.priv_class = &cfhd_class, .init = cfhd_encode_init, .close = cfhd_encode_close, - .encode2 = cfhd_encode_frame, + FF_CODEC_ENCODE_CB(cfhd_encode_frame), .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV422P10, diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c index 9bc7a681e5..e69232efb1 100644 --- a/libavcodec/cinepak.c +++ b/libavcodec/cinepak.c @@ -514,7 +514,7 @@ const FFCodec ff_cinepak_decoder = { .priv_data_size = sizeof(CinepakContext), .init = cinepak_decode_init, .close = cinepak_decode_end, - .decode = cinepak_decode_frame, + FF_CODEC_DECODE_CB(cinepak_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/cinepakenc.c b/libavcodec/cinepakenc.c index 66baae3a1a..8b32c02780 100644 --- a/libavcodec/cinepakenc.c +++ b/libavcodec/cinepakenc.c @@ -1201,7 +1201,7 @@ const FFCodec ff_cinepak_encoder = { .p.id = AV_CODEC_ID_CINEPAK, .priv_data_size = sizeof(CinepakEncContext), .init = cinepak_encode_init, - .encode2 = cinepak_encode_frame, + FF_CODEC_ENCODE_CB(cinepak_encode_frame), .close = cinepak_encode_end, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }, .p.priv_class = &cinepak_class, diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index 4e54ccb680..37283d4ddd 100644 --- a/libavcodec/clearvideo.c +++ b/libavcodec/clearvideo.c @@ -775,7 +775,7 @@ const FFCodec ff_clearvideo_decoder = { .priv_data_size = sizeof(CLVContext), .init = clv_decode_init, .close = clv_decode_end, - .decode = clv_decode_frame, + FF_CODEC_DECODE_CB(clv_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/cljrdec.c b/libavcodec/cljrdec.c index e3a278f16f..bb7c9bfb65 100644 --- a/libavcodec/cljrdec.c +++ b/libavcodec/cljrdec.c @@ -87,7 +87,7 @@ const FFCodec ff_cljr_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_CLJR, .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/cljrenc.c b/libavcodec/cljrenc.c index 6bd8537316..2d171a9376 100644 --- a/libavcodec/cljrenc.c +++ b/libavcodec/cljrenc.c @@ -115,7 +115,7 @@ const FFCodec ff_cljr_encoder = { .p.id = AV_CODEC_ID_CLJR, .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(CLJRContext), - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P, AV_PIX_FMT_NONE }, .p.priv_class = &cljr_class, diff --git a/libavcodec/cllc.c b/libavcodec/cllc.c index f01498310a..f7283ca4f8 100644 --- a/libavcodec/cllc.c +++ b/libavcodec/cllc.c @@ -498,7 +498,7 @@ const FFCodec ff_cllc_decoder = { .p.id = AV_CODEC_ID_CLLC, .priv_data_size = sizeof(CLLCContext), .init = cllc_decode_init, - .decode = cllc_decode_frame, + FF_CODEC_DECODE_CB(cllc_decode_frame), .close = cllc_decode_close, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/cngdec.c b/libavcodec/cngdec.c index f396d5a5d0..d549ff4c05 100644 --- a/libavcodec/cngdec.c +++ b/libavcodec/cngdec.c @@ -169,7 +169,7 @@ const FFCodec ff_comfortnoise_decoder = { .p.id = AV_CODEC_ID_COMFORT_NOISE, .priv_data_size = sizeof(CNGContext), .init = cng_decode_init, - .decode = cng_decode_frame, + FF_CODEC_DECODE_CB(cng_decode_frame), .flush = cng_decode_flush, .close = cng_decode_close, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, diff --git a/libavcodec/cngenc.c b/libavcodec/cngenc.c index 650bfa1938..1f5d25e5b3 100644 --- a/libavcodec/cngenc.c +++ b/libavcodec/cngenc.c @@ -104,7 +104,7 @@ const FFCodec ff_comfortnoise_encoder = { .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(CNGContext), .init = cng_encode_init, - .encode2 = cng_encode_frame, + FF_CODEC_ENCODE_CB(cng_encode_frame), .close = cng_encode_close, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/codec_internal.h b/libavcodec/codec_internal.h index 4e8c06a49e..a14f6592fe 100644 --- a/libavcodec/codec_internal.h +++ b/libavcodec/codec_internal.h @@ -88,6 +88,27 @@ struct AVCodecContext; struct AVSubtitle; struct AVPacket; +enum FFCodecType { + /* The codec is a decoder using the decode callback; + * audio and video codecs only. */ + FF_CODEC_CB_TYPE_DECODE, + /* The codec is a decoder using the decode_sub callback; + * subtitle codecs only. */ + FF_CODEC_CB_TYPE_DECODE_SUB, + /* The codec is a decoder using the receive_frame callback; + * audio and video codecs only. */ + FF_CODEC_CB_TYPE_RECEIVE_FRAME, + /* The codec is an encoder using the encode callback; + * audio and video codecs only. */ + FF_CODEC_CB_TYPE_ENCODE, + /* The codec is an encoder using the encode_sub callback; + * subtitle codecs only. */ + FF_CODEC_CB_TYPE_ENCODE_SUB, + /* The codec is an encoder using the receive_packet callback; + * audio and video codecs only. */ + FF_CODEC_CB_TYPE_RECEIVE_PACKET, +}; + typedef struct FFCodec { /** * The public AVCodec. See codec.h for it. @@ -97,7 +118,14 @@ typedef struct FFCodec { /** * Internal codec capabilities FF_CODEC_CAP_*. */ - int caps_internal; + unsigned caps_internal:29; + + /** + * This field determines the type of the codec (decoder/encoder) + * and also the exact callback cb implemented by the codec. + * cb_type uses enum FFCodecType values. + */ + unsigned cb_type:3; int priv_data_size; /** @@ -133,53 +161,69 @@ typedef struct FFCodec { void (*init_static_data)(struct FFCodec *codec); int (*init)(struct AVCodecContext *); - int (*encode_sub)(struct AVCodecContext *, uint8_t *buf, int buf_size, - const struct AVSubtitle *sub); - /** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - */ - int (*encode2)(struct AVCodecContext *avctx, struct AVPacket *avpkt, - const struct AVFrame *frame, int *got_packet_ptr); - /** - * Decode to an AVFrame. - * - * @param avctx codec context - * @param frame AVFrame for output - * @param[out] got_frame_ptr decoder sets to 0 or 1 to indicate that a - * non-empty frame was returned in outdata. - * @param[in] avpkt AVPacket containing the data to be decoded - * @return amount of bytes read from the packet on success, negative error - * code on failure - */ - int (*decode)(struct AVCodecContext *avctx, struct AVFrame *frame, - int *got_frame_ptr, struct AVPacket *avpkt); - /** - * Decode subtitle data. Same as decode except that it uses - * a struct AVSubtitle structure for output. - */ - int (*decode_sub)(struct AVCodecContext *avctx, struct AVSubtitle *sub, + + union { + /** + * Decode to an AVFrame. + * cb is in this state if cb_type is FF_CODEC_CB_TYPE_DECODE. + * + * @param avctx codec context + * @param[out] frame AVFrame for output + * @param[out] got_frame_ptr decoder sets to 0 or 1 to indicate that + * a non-empty frame was returned in frame. + * @param[in] avpkt AVPacket containing the data to be decoded + * @return amount of bytes read from the packet on success, + * negative error code on failure + */ + int (*decode)(struct AVCodecContext *avctx, struct AVFrame *frame, int *got_frame_ptr, struct AVPacket *avpkt); + /** + * Decode subtitle data to an AVSubtitle. + * cb is in this state if cb_type is FF_CODEC_CB_TYPE_DECODE_SUB. + * + * Apart from that this is like the decode callback. + */ + int (*decode_sub)(struct AVCodecContext *avctx, struct AVSubtitle *sub, + int *got_frame_ptr, struct AVPacket *avpkt); + /** + * Decode API with decoupled packet/frame dataflow. + * cb is in this state if cb_type is FF_CODEC_CB_TYPE_RECEIVE_FRAME. + * + * This function is called to get one output frame. It should call + * ff_decode_get_packet() to obtain input data. + */ + int (*receive_frame)(struct AVCodecContext *avctx, struct AVFrame *frame); + /** + * Encode data to an AVPacket. + * cb is in this state if cb_type is FF_CODEC_CB_TYPE_ENCODE + * + * @param avctx codec context + * @param[out] avpkt output AVPacket + * @param[in] frame AVFrame containing the input to be encoded + * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a + * non-empty packet was returned in avpkt. + * @return 0 on success, negative error code on failure + */ + int (*encode)(struct AVCodecContext *avctx, struct AVPacket *avpkt, + const struct AVFrame *frame, int *got_packet_ptr); + /** + * Encode subtitles to a raw buffer. + * cb is in this state if cb_type is FF_CODEC_CB_TYPE_ENCODE_SUB. + */ + int (*encode_sub)(struct AVCodecContext *avctx, uint8_t *buf, + int buf_size, const struct AVSubtitle *sub); + /** + * Encode API with decoupled frame/packet dataflow. + * cb is in this state if cb_type is FF_CODEC_CB_TYPE_RECEIVE_PACKET. + * + * This function is called to get one output packet. + * It should call ff_encode_get_frame() to obtain input data. + */ + int (*receive_packet)(struct AVCodecContext *avctx, struct AVPacket *avpkt); + } cb; + int (*close)(struct AVCodecContext *); - /** - * Encode API with decoupled frame/packet dataflow. This function is called - * to get one output packet. It should call ff_encode_get_frame() to obtain - * input data. - */ - int (*receive_packet)(struct AVCodecContext *avctx, struct AVPacket *avpkt); - /** - * Decode API with decoupled packet/frame dataflow. This function is called - * to get one output frame. It should call ff_decode_get_packet() to obtain - * input data. - */ - int (*receive_frame)(struct AVCodecContext *avctx, struct AVFrame *frame); /** * Flush buffers. * Will be called when seeking @@ -207,6 +251,25 @@ typedef struct FFCodec { const uint32_t *codec_tags; } FFCodec; +#define FF_CODEC_DECODE_CB(func) \ + .cb_type = FF_CODEC_CB_TYPE_DECODE, \ + .cb.decode = (func) +#define FF_CODEC_DECODE_SUB_CB(func) \ + .cb_type = FF_CODEC_CB_TYPE_DECODE_SUB, \ + .cb.decode_sub = (func) +#define FF_CODEC_RECEIVE_FRAME_CB(func) \ + .cb_type = FF_CODEC_CB_TYPE_RECEIVE_FRAME, \ + .cb.receive_frame = (func) +#define FF_CODEC_ENCODE_CB(func) \ + .cb_type = FF_CODEC_CB_TYPE_ENCODE, \ + .cb.encode = (func) +#define FF_CODEC_ENCODE_SUB_CB(func) \ + .cb_type = FF_CODEC_CB_TYPE_ENCODE_SUB, \ + .cb.encode_sub = (func) +#define FF_CODEC_RECEIVE_PACKET_CB(func) \ + .cb_type = FF_CODEC_CB_TYPE_RECEIVE_PACKET, \ + .cb.receive_packet = (func) + static av_always_inline const FFCodec *ffcodec(const AVCodec *codec) { return (const FFCodec*)codec; diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 783623d7db..7161209db3 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -1304,7 +1304,7 @@ const FFCodec ff_cook_decoder = { .priv_data_size = sizeof(COOKContext), .init = cook_decode_init, .close = cook_decode_close, - .decode = cook_decode_frame, + FF_CODEC_DECODE_CB(cook_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/cpia.c b/libavcodec/cpia.c index 1b50aa9d30..2f4ad1fb5b 100644 --- a/libavcodec/cpia.c +++ b/libavcodec/cpia.c @@ -230,7 +230,7 @@ const FFCodec ff_cpia_decoder = { .priv_data_size = sizeof(CpiaContext), .init = cpia_decode_init, .close = cpia_decode_end, - .decode = cpia_decode_frame, + FF_CODEC_DECODE_CB(cpia_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/cri.c b/libavcodec/cri.c index b1922d5e9b..728983797a 100644 --- a/libavcodec/cri.c +++ b/libavcodec/cri.c @@ -429,7 +429,7 @@ const FFCodec ff_cri_decoder = { .p.id = AV_CODEC_ID_CRI, .priv_data_size = sizeof(CRIContext), .init = cri_decode_init, - .decode = cri_decode_frame, + FF_CODEC_DECODE_CB(cri_decode_frame), .close = cri_decode_close, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c index d4cf385cbd..cf74f22e7d 100644 --- a/libavcodec/crystalhd.c +++ b/libavcodec/crystalhd.c @@ -783,7 +783,7 @@ static int crystalhd_receive_frame(AVCodecContext *avctx, AVFrame *frame) .p.priv_class = &x##_crystalhd_class, \ .init = init, \ .close = uninit, \ - .receive_frame = crystalhd_receive_frame, \ + FF_CODEC_RECEIVE_FRAME_CB(crystalhd_receive_frame), \ .flush = flush, \ .bsfs = bsf_name, \ .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \ diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c index 9b87c1b91d..ea84711299 100644 --- a/libavcodec/cscd.c +++ b/libavcodec/cscd.c @@ -175,7 +175,7 @@ const FFCodec ff_cscd_decoder = { .priv_data_size = sizeof(CamStudioContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c index 0060e51c91..81d4c89215 100644 --- a/libavcodec/cuviddec.c +++ b/libavcodec/cuviddec.c @@ -1112,7 +1112,7 @@ static const AVCodecHWConfigInternal *const cuvid_hw_configs[] = { .p.priv_class = &x##_cuvid_class, \ .init = cuvid_decode_init, \ .close = cuvid_decode_end, \ - .receive_frame = cuvid_output_frame, \ + FF_CODEC_RECEIVE_FRAME_CB(cuvid_output_frame), \ .flush = cuvid_flush, \ .bsfs = bsf_name, \ .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \ diff --git a/libavcodec/cyuv.c b/libavcodec/cyuv.c index ba20cd02da..8fa4d1f3a7 100644 --- a/libavcodec/cyuv.c +++ b/libavcodec/cyuv.c @@ -184,7 +184,7 @@ const FFCodec ff_aura_decoder = { .p.id = AV_CODEC_ID_AURA, .priv_data_size = sizeof(CyuvDecodeContext), .init = cyuv_decode_init, - .decode = cyuv_decode_frame, + FF_CODEC_DECODE_CB(cyuv_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; @@ -198,7 +198,7 @@ const FFCodec ff_cyuv_decoder = { .p.id = AV_CODEC_ID_CYUV, .priv_data_size = sizeof(CyuvDecodeContext), .init = cyuv_decode_init, - .decode = cyuv_decode_frame, + FF_CODEC_DECODE_CB(cyuv_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c index 62684b8042..38ea8733e4 100644 --- a/libavcodec/dcadec.c +++ b/libavcodec/dcadec.c @@ -417,7 +417,7 @@ const FFCodec ff_dca_decoder = { .p.id = AV_CODEC_ID_DTS, .priv_data_size = sizeof(DCAContext), .init = dcadec_init, - .decode = dcadec_decode_frame, + FF_CODEC_DECODE_CB(dcadec_decode_frame), .close = dcadec_close, .flush = dcadec_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c index 7b92b861e3..aad06adb7e 100644 --- a/libavcodec/dcaenc.c +++ b/libavcodec/dcaenc.c @@ -1249,7 +1249,7 @@ const FFCodec ff_dca_encoder = { .priv_data_size = sizeof(DCAEncContext), .init = encode_init, .close = encode_close, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/dds.c b/libavcodec/dds.c index c5691a4afd..d4f6800ec9 100644 --- a/libavcodec/dds.c +++ b/libavcodec/dds.c @@ -753,7 +753,7 @@ const FFCodec ff_dds_decoder = { .p.long_name = NULL_IF_CONFIG_SMALL("DirectDraw Surface image decoder"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DDS, - .decode = dds_decode, + FF_CODEC_DECODE_CB(dds_decode), .priv_data_size = sizeof(DDSContext), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE diff --git a/libavcodec/decode.c b/libavcodec/decode.c index b5b78b9ca2..e51a39e70a 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -322,7 +322,7 @@ static inline int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame, if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME) { ret = ff_thread_decode_frame(avctx, frame, &got_frame, pkt); } else { - ret = codec->decode(avctx, frame, &got_frame, pkt); + ret = codec->cb.decode(avctx, frame, &got_frame, pkt); if (!(codec->caps_internal & FF_CODEC_CAP_SETS_PKT_DTS)) frame->pkt_dts = pkt->dts; @@ -546,8 +546,8 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) av_assert0(!frame->buf[0]); - if (codec->receive_frame) { - ret = codec->receive_frame(avctx, frame); + if (codec->cb_type == FF_CODEC_CB_TYPE_RECEIVE_FRAME) { + ret = codec->cb.receive_frame(avctx, frame); if (ret != AVERROR(EAGAIN)) av_packet_unref(avci->last_pkt_props); } else @@ -862,7 +862,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, if (avctx->pkt_timebase.num && avpkt->pts != AV_NOPTS_VALUE) sub->pts = av_rescale_q(avpkt->pts, avctx->pkt_timebase, AV_TIME_BASE_Q); - ret = ffcodec(avctx->codec)->decode_sub(avctx, sub, got_sub_ptr, pkt); + ret = ffcodec(avctx->codec)->cb.decode_sub(avctx, sub, got_sub_ptr, pkt); if (pkt == avci->buffer_pkt) // did we recode? av_packet_unref(avci->buffer_pkt); if (ret < 0) { diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c index 4625f62ec6..e74fd071d3 100644 --- a/libavcodec/dfa.c +++ b/libavcodec/dfa.c @@ -429,7 +429,7 @@ const FFCodec ff_dfa_decoder = { .priv_data_size = sizeof(DfaContext), .init = dfa_decode_init, .close = dfa_decode_end, - .decode = dfa_decode_frame, + FF_CODEC_DECODE_CB(dfa_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dfpwmdec.c b/libavcodec/dfpwmdec.c index 4237200c6b..77c6d2cb18 100644 --- a/libavcodec/dfpwmdec.c +++ b/libavcodec/dfpwmdec.c @@ -131,7 +131,7 @@ const FFCodec ff_dfpwm_decoder = { .p.id = AV_CODEC_ID_DFPWM, .priv_data_size = sizeof(DFPWMState), .init = dfpwm_dec_init, - .decode = dfpwm_dec_frame, + FF_CODEC_DECODE_CB(dfpwm_dec_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dfpwmenc.c b/libavcodec/dfpwmenc.c index e3a001aea7..85ee1a980a 100644 --- a/libavcodec/dfpwmenc.c +++ b/libavcodec/dfpwmenc.c @@ -114,7 +114,7 @@ const FFCodec ff_dfpwm_encoder = { .p.id = AV_CODEC_ID_DFPWM, .priv_data_size = sizeof(DFPWMState), .init = dfpwm_enc_init, - .encode2 = dfpwm_enc_frame, + FF_CODEC_ENCODE_CB(dfpwm_enc_frame), .p.sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_NONE}, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_VARIABLE_FRAME_SIZE, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index 319067bc79..d6d8168bd6 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -2364,7 +2364,7 @@ const FFCodec ff_dirac_decoder = { .priv_data_size = sizeof(DiracContext), .init = dirac_decode_init, .close = dirac_decode_end, - .decode = dirac_decode_frame, + FF_CODEC_DECODE_CB(dirac_decode_frame), .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .flush = dirac_decode_flush, diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 4b22a4134e..65cd6d9398 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -732,7 +732,7 @@ const FFCodec ff_dnxhd_decoder = { .priv_data_size = sizeof(DNXHDContext), .init = dnxhd_decode_init, .close = dnxhd_decode_close, - .decode = dnxhd_decode_frame, + FF_CODEC_DECODE_CB(dnxhd_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, .p.profiles = NULL_IF_CONFIG_SMALL(ff_dnxhd_profiles), diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c index 1795993efe..c6378f8ecb 100644 --- a/libavcodec/dnxhdenc.c +++ b/libavcodec/dnxhdenc.c @@ -1361,7 +1361,7 @@ const FFCodec ff_dnxhd_encoder = { AV_CODEC_CAP_SLICE_THREADS, .priv_data_size = sizeof(DNXHDEncContext), .init = dnxhd_encode_init, - .encode2 = dnxhd_encode_picture, + FF_CODEC_ENCODE_CB(dnxhd_encode_picture), .close = dnxhd_encode_end, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV422P, diff --git a/libavcodec/dolby_e.c b/libavcodec/dolby_e.c index 6c86f74c94..a734af8d45 100644 --- a/libavcodec/dolby_e.c +++ b/libavcodec/dolby_e.c @@ -1305,7 +1305,7 @@ const FFCodec ff_dolby_e_decoder = { .priv_data_size = sizeof(DBEDecodeContext), .p.priv_class = &dolby_e_decoder_class, .init = dolby_e_init, - .decode = dolby_e_decode_frame, + FF_CODEC_DECODE_CB(dolby_e_decode_frame), .close = dolby_e_close, .flush = dolby_e_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c index db09ef274b..ad020b52f6 100644 --- a/libavcodec/dpcm.c +++ b/libavcodec/dpcm.c @@ -418,7 +418,7 @@ const FFCodec ff_ ## name_ ## _decoder = { \ .p.capabilities = AV_CODEC_CAP_DR1, \ .priv_data_size = sizeof(DPCMContext), \ .init = dpcm_decode_init, \ - .decode = dpcm_decode_frame, \ + FF_CODEC_DECODE_CB(dpcm_decode_frame), \ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \ } diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index 7a3054b140..bb2c5e588e 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -765,6 +765,6 @@ const FFCodec ff_dpx_decoder = { .p.long_name = NULL_IF_CONFIG_SMALL("DPX (Digital Picture Exchange) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DPX, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/dpxenc.c b/libavcodec/dpxenc.c index 15023d615e..1f2b1b8f5d 100644 --- a/libavcodec/dpxenc.c +++ b/libavcodec/dpxenc.c @@ -282,7 +282,7 @@ const FFCodec ff_dpx_encoder = { .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(DPXContext), .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_GRAY8, AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_ABGR, diff --git a/libavcodec/dsddec.c b/libavcodec/dsddec.c index e0578bc9cc..f0e54db100 100644 --- a/libavcodec/dsddec.c +++ b/libavcodec/dsddec.c @@ -121,7 +121,7 @@ const FFCodec ff_ ## name_ ## _decoder = { \ .p.type = AVMEDIA_TYPE_AUDIO, \ .p.id = AV_CODEC_ID_##id_, \ .init = decode_init, \ - .decode = decode_frame, \ + FF_CODEC_DECODE_CB(decode_frame), \ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, \ .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, \ AV_SAMPLE_FMT_NONE }, \ diff --git a/libavcodec/dsicinaudio.c b/libavcodec/dsicinaudio.c index 231afb2a69..2cfaebca40 100644 --- a/libavcodec/dsicinaudio.c +++ b/libavcodec/dsicinaudio.c @@ -128,7 +128,7 @@ const FFCodec ff_dsicinaudio_decoder = { .p.id = AV_CODEC_ID_DSICINAUDIO, .priv_data_size = sizeof(CinAudioContext), .init = cinaudio_decode_init, - .decode = cinaudio_decode_frame, + FF_CODEC_DECODE_CB(cinaudio_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dsicinvideo.c b/libavcodec/dsicinvideo.c index b33959ef77..71f6071412 100644 --- a/libavcodec/dsicinvideo.c +++ b/libavcodec/dsicinvideo.c @@ -329,7 +329,7 @@ const FFCodec ff_dsicinvideo_decoder = { .priv_data_size = sizeof(CinVideoContext), .init = cinvideo_decode_init, .close = cinvideo_decode_end, - .decode = cinvideo_decode_frame, + FF_CODEC_DECODE_CB(cinvideo_decode_frame), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .p.capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/dss_sp.c b/libavcodec/dss_sp.c index 4d7a169f26..b465bfe932 100644 --- a/libavcodec/dss_sp.c +++ b/libavcodec/dss_sp.c @@ -779,7 +779,7 @@ const FFCodec ff_dss_sp_decoder = { .p.id = AV_CODEC_ID_DSS_SP, .priv_data_size = sizeof(DssSpContext), .init = dss_sp_decode_init, - .decode = dss_sp_decode_frame, + FF_CODEC_DECODE_CB(dss_sp_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dstdec.c b/libavcodec/dstdec.c index e1d06a9c36..93642e34b9 100644 --- a/libavcodec/dstdec.c +++ b/libavcodec/dstdec.c @@ -386,7 +386,7 @@ const FFCodec ff_dst_decoder = { .p.id = AV_CODEC_ID_DST, .priv_data_size = sizeof(DSTContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/dvaudiodec.c b/libavcodec/dvaudiodec.c index 97851981c5..56d9c3573b 100644 --- a/libavcodec/dvaudiodec.c +++ b/libavcodec/dvaudiodec.c @@ -124,7 +124,7 @@ const FFCodec ff_dvaudio_decoder = { .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_DVAUDIO, .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(DVAudioContext), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index c5391ea5ad..58e18cfece 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -1746,7 +1746,7 @@ const FFCodec ff_dvbsub_decoder = { .priv_data_size = sizeof(DVBSubContext), .init = dvbsub_init_decoder, .close = dvbsub_close_decoder, - .decode_sub = dvbsub_decode, + FF_CODEC_DECODE_SUB_CB(dvbsub_decode), .p.priv_class = &dvbsubdec_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dvbsubenc.c b/libavcodec/dvbsubenc.c index 5444dbfa99..06087b058d 100644 --- a/libavcodec/dvbsubenc.c +++ b/libavcodec/dvbsubenc.c @@ -512,5 +512,5 @@ const FFCodec ff_dvbsub_encoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_DVB_SUBTITLE, .priv_data_size = sizeof(DVBSubtitleContext), - .encode_sub = dvbsub_encode, + FF_CODEC_ENCODE_SUB_CB(dvbsub_encode), }; diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index 5a1de7a409..a0bae6f57e 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -688,7 +688,7 @@ const FFCodec ff_dvvideo_decoder = { .p.id = AV_CODEC_ID_DVVIDEO, .priv_data_size = sizeof(DVVideoContext), .init = dvvideo_decode_init, - .decode = dvvideo_decode_frame, + FF_CODEC_DECODE_CB(dvvideo_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, .p.max_lowres = 3, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index 713170cdc2..2951e74736 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -760,7 +760,7 @@ const FFCodec ff_dvdsub_decoder = { .p.id = AV_CODEC_ID_DVD_SUBTITLE, .priv_data_size = sizeof(DVDSubContext), .init = dvdsub_init, - .decode_sub = dvdsub_decode, + FF_CODEC_DECODE_SUB_CB(dvdsub_decode), .flush = dvdsub_flush, .p.priv_class = &dvdsub_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/dvdsubenc.c b/libavcodec/dvdsubenc.c index d6960e5f70..fc3b7d1816 100644 --- a/libavcodec/dvdsubenc.c +++ b/libavcodec/dvdsubenc.c @@ -500,7 +500,7 @@ const FFCodec ff_dvdsub_encoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_DVD_SUBTITLE, .init = dvdsub_init, - .encode_sub = dvdsub_encode, + FF_CODEC_ENCODE_SUB_CB(dvdsub_encode), .p.priv_class = &dvdsubenc_class, .priv_data_size = sizeof(DVDSubtitleContext), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c index 2a760465e5..2922829dc5 100644 --- a/libavcodec/dvenc.c +++ b/libavcodec/dvenc.c @@ -1215,7 +1215,7 @@ const FFCodec ff_dvvideo_encoder = { AV_CODEC_CAP_SLICE_THREADS, .priv_data_size = sizeof(DVVideoContext), .init = dvvideo_encode_init, - .encode2 = dvvideo_encode_frame, + FF_CODEC_ENCODE_CB(dvvideo_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c index 1a383f182e..93a1724743 100644 --- a/libavcodec/dxa.c +++ b/libavcodec/dxa.c @@ -369,7 +369,7 @@ const FFCodec ff_dxa_decoder = { .priv_data_size = sizeof(DxaDecContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/dxtory.c b/libavcodec/dxtory.c index e7aaee7cb6..b7dfff4755 100644 --- a/libavcodec/dxtory.c +++ b/libavcodec/dxtory.c @@ -875,6 +875,6 @@ const FFCodec ff_dxtory_decoder = { .p.long_name = NULL_IF_CONFIG_SMALL("Dxtory"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DXTORY, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, }; diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c index 63fec7a14e..d75f8b0402 100644 --- a/libavcodec/dxv.c +++ b/libavcodec/dxv.c @@ -1266,7 +1266,7 @@ const FFCodec ff_dxv_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_DXV, .init = dxv_init, - .decode = dxv_decode, + FF_CODEC_DECODE_CB(dxv_decode), .close = dxv_close, .priv_data_size = sizeof(DXVContext), .p.capabilities = AV_CODEC_CAP_DR1 | diff --git a/libavcodec/eac3enc.c b/libavcodec/eac3enc.c index 5c19d70266..79611cee0c 100644 --- a/libavcodec/eac3enc.c +++ b/libavcodec/eac3enc.c @@ -258,7 +258,7 @@ const FFCodec ff_eac3_encoder = { .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(AC3EncodeContext), .init = ff_ac3_float_encode_init, - .encode2 = ff_ac3_float_encode_frame, + FF_CODEC_ENCODE_CB(ff_ac3_float_encode_frame), .close = ff_ac3_encode_close, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c index bd332a9106..0a13a74bb8 100644 --- a/libavcodec/eacmv.c +++ b/libavcodec/eacmv.c @@ -237,7 +237,7 @@ const FFCodec ff_eacmv_decoder = { .priv_data_size = sizeof(CmvContext), .init = cmv_decode_init, .close = cmv_decode_end, - .decode = cmv_decode_frame, + FF_CODEC_DECODE_CB(cmv_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c index e6e90d6bd7..337a9c144a 100644 --- a/libavcodec/eamad.c +++ b/libavcodec/eamad.c @@ -348,7 +348,7 @@ const FFCodec ff_eamad_decoder = { .priv_data_size = sizeof(MadContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c index ea5f4386bc..2e9d2fe13c 100644 --- a/libavcodec/eatgq.c +++ b/libavcodec/eatgq.c @@ -253,7 +253,7 @@ const FFCodec ff_eatgq_decoder = { .p.id = AV_CODEC_ID_TGQ, .priv_data_size = sizeof(TgqContext), .init = tgq_decode_init, - .decode = tgq_decode_frame, + FF_CODEC_DECODE_CB(tgq_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c index 525c80a570..23cf7300c6 100644 --- a/libavcodec/eatgv.c +++ b/libavcodec/eatgv.c @@ -366,7 +366,7 @@ const FFCodec ff_eatgv_decoder = { .priv_data_size = sizeof(TgvContext), .init = tgv_decode_init, .close = tgv_decode_end, - .decode = tgv_decode_frame, + FF_CODEC_DECODE_CB(tgv_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c index dad742996c..305ea4ba2c 100644 --- a/libavcodec/eatqi.c +++ b/libavcodec/eatqi.c @@ -189,7 +189,7 @@ const FFCodec ff_eatqi_decoder = { .priv_data_size = sizeof(TqiContext), .init = tqi_decode_init, .close = tqi_decode_end, - .decode = tqi_decode_frame, + FF_CODEC_DECODE_CB(tqi_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/encode.c b/libavcodec/encode.c index 70bd8da81f..3891ebcc91 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c @@ -152,7 +152,7 @@ int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size, return -1; } - ret = ffcodec(avctx->codec)->encode_sub(avctx, buf, buf_size, sub); + ret = ffcodec(avctx->codec)->cb.encode_sub(avctx, buf, buf_size, sub); avctx->frame_number++; return ret; } @@ -202,7 +202,7 @@ static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt) got_packet = 0; - av_assert0(codec->encode2); + av_assert0(codec->cb_type == FF_CODEC_CB_TYPE_ENCODE); if (CONFIG_FRAME_THREAD_ENCODER && avci->frame_thread_encoder && (avctx->active_thread_type & FF_THREAD_FRAME)) @@ -212,7 +212,7 @@ static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt) * no sense to use the properties of the current frame anyway). */ ret = ff_thread_video_encode_frame(avctx, avpkt, frame, &got_packet); else { - ret = codec->encode2(avctx, avpkt, frame, &got_packet); + ret = codec->cb.encode(avctx, avpkt, frame, &got_packet); if (avctx->codec->type == AVMEDIA_TYPE_VIDEO && !ret && got_packet && !(avctx->codec->capabilities & AV_CODEC_CAP_DELAY)) avpkt->pts = avpkt->dts = frame->pts; @@ -292,8 +292,8 @@ static int encode_receive_packet_internal(AVCodecContext *avctx, AVPacket *avpkt return AVERROR(EINVAL); } - if (ffcodec(avctx->codec)->receive_packet) { - ret = ffcodec(avctx->codec)->receive_packet(avctx, avpkt); + if (ffcodec(avctx->codec)->cb_type == FF_CODEC_CB_TYPE_RECEIVE_PACKET) { + ret = ffcodec(avctx->codec)->cb.receive_packet(avctx, avpkt); if (ret < 0) av_packet_unref(avpkt); else diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c index f52573107c..2fdffff13a 100644 --- a/libavcodec/escape124.c +++ b/libavcodec/escape124.c @@ -383,7 +383,7 @@ const FFCodec ff_escape124_decoder = { .priv_data_size = sizeof(Escape124Context), .init = escape124_decode_init, .close = escape124_decode_close, - .decode = escape124_decode_frame, + FF_CODEC_DECODE_CB(escape124_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/escape130.c b/libavcodec/escape130.c index ffa2274ea9..cd6dd7690b 100644 --- a/libavcodec/escape130.c +++ b/libavcodec/escape130.c @@ -353,7 +353,7 @@ const FFCodec ff_escape130_decoder = { .priv_data_size = sizeof(Escape130Context), .init = escape130_decode_init, .close = escape130_decode_close, - .decode = escape130_decode_frame, + FF_CODEC_DECODE_CB(escape130_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/evrcdec.c b/libavcodec/evrcdec.c index d3703977ba..a6475199cd 100644 --- a/libavcodec/evrcdec.c +++ b/libavcodec/evrcdec.c @@ -935,7 +935,7 @@ const FFCodec ff_evrc_decoder = { .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_EVRC, .init = evrc_decode_init, - .decode = evrc_decode_frame, + FF_CODEC_DECODE_CB(evrc_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .priv_data_size = sizeof(EVRCContext), .p.priv_class = &evrcdec_class, diff --git a/libavcodec/exr.c b/libavcodec/exr.c index 88e7c01488..4af0f4f771 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -2348,7 +2348,7 @@ const FFCodec ff_exr_decoder = { .priv_data_size = sizeof(EXRContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/exrenc.c b/libavcodec/exrenc.c index baf29f5912..459afebb82 100644 --- a/libavcodec/exrenc.c +++ b/libavcodec/exrenc.c @@ -543,7 +543,7 @@ const FFCodec ff_exr_encoder = { .p.id = AV_CODEC_ID_EXR, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .close = encode_close, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRPF32, diff --git a/libavcodec/fastaudio.c b/libavcodec/fastaudio.c index fc525e58d1..46fffaf8b8 100644 --- a/libavcodec/fastaudio.c +++ b/libavcodec/fastaudio.c @@ -194,7 +194,7 @@ const FFCodec ff_fastaudio_decoder = { .p.id = AV_CODEC_ID_FASTAUDIO, .priv_data_size = sizeof(FastAudioContext), .init = fastaudio_init, - .decode = fastaudio_decode, + FF_CODEC_DECODE_CB(fastaudio_decode), .close = fastaudio_close, .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index 81fa249885..365f8b77a7 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -1060,7 +1060,7 @@ const FFCodec ff_ffv1_decoder = { .priv_data_size = sizeof(FFV1Context), .init = decode_init, .close = ff_ffv1_close, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), .p.capabilities = AV_CODEC_CAP_DR1 /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/ | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c index 13af2547a0..cee2627eed 100644 --- a/libavcodec/ffv1enc.c +++ b/libavcodec/ffv1enc.c @@ -1284,7 +1284,7 @@ const FFCodec ff_ffv1_encoder = { .p.id = AV_CODEC_ID_FFV1, .priv_data_size = sizeof(FFV1Context), .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .close = encode_close, .p.capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_DELAY, .p.pix_fmts = (const enum AVPixelFormat[]) { diff --git a/libavcodec/ffwavesynth.c b/libavcodec/ffwavesynth.c index 0426386058..67e867b444 100644 --- a/libavcodec/ffwavesynth.c +++ b/libavcodec/ffwavesynth.c @@ -467,7 +467,7 @@ const FFCodec ff_ffwavesynth_decoder = { .priv_data_size = sizeof(struct wavesynth_context), .init = wavesynth_init, .close = wavesynth_close, - .decode = wavesynth_decode, + FF_CODEC_DECODE_CB(wavesynth_decode), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/fic.c b/libavcodec/fic.c index 86a5012587..e56a1a323c 100644 --- a/libavcodec/fic.c +++ b/libavcodec/fic.c @@ -491,7 +491,7 @@ const FFCodec ff_fic_decoder = { .p.id = AV_CODEC_ID_FIC, .priv_data_size = sizeof(FICContext), .init = fic_decode_init, - .decode = fic_decode_frame, + FF_CODEC_DECODE_CB(fic_decode_frame), .close = fic_decode_close, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, .p.priv_class = &fic_decoder_class, diff --git a/libavcodec/fitsdec.c b/libavcodec/fitsdec.c index 25857a1799..b60c2bd441 100644 --- a/libavcodec/fitsdec.c +++ b/libavcodec/fitsdec.c @@ -329,5 +329,5 @@ const FFCodec ff_fits_decoder = { .p.long_name = NULL_IF_CONFIG_SMALL("Flexible Image Transport System"), .p.priv_class = &fits_decoder_class, .priv_data_size = sizeof(FITSContext), - .decode = fits_decode_frame, + FF_CODEC_DECODE_CB(fits_decode_frame), }; diff --git a/libavcodec/fitsenc.c b/libavcodec/fitsenc.c index eebabfb621..5e9100be85 100644 --- a/libavcodec/fitsenc.c +++ b/libavcodec/fitsenc.c @@ -116,7 +116,7 @@ const FFCodec ff_fits_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_FITS, .p.capabilities = AV_CODEC_CAP_DR1, - .encode2 = fits_encode_frame, + FF_CODEC_ENCODE_CB(fits_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRAP16BE, AV_PIX_FMT_GBRP16BE, AV_PIX_FMT_GBRP, diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index 11a62daab5..a23d7e2cf1 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -665,7 +665,7 @@ const FFCodec ff_flac_decoder = { .priv_data_size = sizeof(FLACContext), .init = flac_decode_init, .close = flac_decode_close, - .decode = flac_decode_frame, + FF_CODEC_DECODE_CB(flac_decode_frame), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index 6b46664dd9..e9edd8476d 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -1467,7 +1467,7 @@ const FFCodec ff_flac_encoder = { AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(FlacEncodeContext), .init = flac_encode_init, - .encode2 = flac_encode_frame, + FF_CODEC_ENCODE_CB(flac_encode_frame), .close = flac_encode_close, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c index 3cf01336c8..0982161d49 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -502,7 +502,7 @@ const FFCodec ff_flashsv_decoder = { .priv_data_size = sizeof(FlashSVContext), .init = flashsv_decode_init, .close = flashsv_decode_end, - .decode = flashsv_decode_frame, + FF_CODEC_DECODE_CB(flashsv_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, @@ -569,7 +569,7 @@ const FFCodec ff_flashsv2_decoder = { .priv_data_size = sizeof(FlashSVContext), .init = flashsv2_decode_init, .close = flashsv2_decode_end, - .decode = flashsv_decode_frame, + FF_CODEC_DECODE_CB(flashsv_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, diff --git a/libavcodec/flashsv2enc.c b/libavcodec/flashsv2enc.c index 42ae77810c..07fa9945ff 100644 --- a/libavcodec/flashsv2enc.c +++ b/libavcodec/flashsv2enc.c @@ -917,7 +917,7 @@ const FFCodec ff_flashsv2_encoder = { .p.id = AV_CODEC_ID_FLASHSV2, .priv_data_size = sizeof(FlashSV2Context), .init = flashsv2_encode_init, - .encode2 = flashsv2_encode_frame, + FF_CODEC_ENCODE_CB(flashsv2_encode_frame), .close = flashsv2_encode_end, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/flashsvenc.c b/libavcodec/flashsvenc.c index 0059ea5a46..592bb061cb 100644 --- a/libavcodec/flashsvenc.c +++ b/libavcodec/flashsvenc.c @@ -264,7 +264,7 @@ const FFCodec ff_flashsv_encoder = { .p.id = AV_CODEC_ID_FLASHSV, .priv_data_size = sizeof(FlashSVContext), .init = flashsv_encode_init, - .encode2 = flashsv_encode_frame, + FF_CODEC_ENCODE_CB(flashsv_encode_frame), .close = flashsv_encode_end, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c index 79e50aa71d..b841050a81 100644 --- a/libavcodec/flicvideo.c +++ b/libavcodec/flicvideo.c @@ -1112,7 +1112,7 @@ const FFCodec ff_flic_decoder = { .priv_data_size = sizeof(FlicDecodeContext), .init = flic_decode_init, .close = flic_decode_end, - .decode = flic_decode_frame, + FF_CODEC_DECODE_CB(flic_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/flvdec.c b/libavcodec/flvdec.c index 096f82fa88..cc016d129d 100644 --- a/libavcodec/flvdec.c +++ b/libavcodec/flvdec.c @@ -121,7 +121,7 @@ const FFCodec ff_flv_decoder = { .priv_data_size = sizeof(MpegEncContext), .init = ff_h263_decode_init, .close = ff_h263_decode_end, - .decode = ff_h263_decode_frame, + FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, diff --git a/libavcodec/flvenc.c b/libavcodec/flvenc.c index 1796c8a698..74ed321e27 100644 --- a/libavcodec/flvenc.c +++ b/libavcodec/flvenc.c @@ -100,7 +100,7 @@ const FFCodec ff_flv_encoder = { .p.priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, - .encode2 = ff_mpv_encode_picture, + FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, diff --git a/libavcodec/fmvc.c b/libavcodec/fmvc.c index 0dc918bc8c..4abf6d7048 100644 --- a/libavcodec/fmvc.c +++ b/libavcodec/fmvc.c @@ -634,7 +634,7 @@ const FFCodec ff_fmvc_decoder = { .priv_data_size = sizeof(FMVCContext), .init = decode_init, .close = decode_close, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c index c6528dd804..07d310a986 100644 --- a/libavcodec/frame_thread_encoder.c +++ b/libavcodec/frame_thread_encoder.c @@ -104,7 +104,7 @@ static void * attribute_align_arg worker(void *v){ frame = task->indata; pkt = task->outdata; - ret = ffcodec(avctx->codec)->encode2(avctx, pkt, frame, &got_packet); + ret = ffcodec(avctx->codec)->cb.encode(avctx, pkt, frame, &got_packet); if(got_packet) { int ret2 = av_packet_make_refcounted(pkt); if (ret >= 0 && ret2 < 0) diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c index 82851e74de..7f695305f1 100644 --- a/libavcodec/fraps.c +++ b/libavcodec/fraps.c @@ -347,7 +347,7 @@ const FFCodec ff_fraps_decoder = { .priv_data_size = sizeof(FrapsContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/frwu.c b/libavcodec/frwu.c index 6ec88808df..766fda7455 100644 --- a/libavcodec/frwu.c +++ b/libavcodec/frwu.c @@ -122,7 +122,7 @@ const FFCodec ff_frwu_decoder = { .p.id = AV_CODEC_ID_FRWU, .priv_data_size = sizeof(FRWUContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .p.priv_class = &frwu_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c index 72368d9f4f..00964369c5 100644 --- a/libavcodec/g2meet.c +++ b/libavcodec/g2meet.c @@ -1630,7 +1630,7 @@ const FFCodec ff_g2m_decoder = { .priv_data_size = sizeof(G2MContext), .init = g2m_decode_init, .close = g2m_decode_end, - .decode = g2m_decode_frame, + FF_CODEC_DECODE_CB(g2m_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/g722dec.c b/libavcodec/g722dec.c index e7e846b264..8a02ec5230 100644 --- a/libavcodec/g722dec.c +++ b/libavcodec/g722dec.c @@ -146,7 +146,7 @@ const FFCodec ff_adpcm_g722_decoder = { .p.id = AV_CODEC_ID_ADPCM_G722, .priv_data_size = sizeof(G722Context), .init = g722_decode_init, - .decode = g722_decode_frame, + FF_CODEC_DECODE_CB(g722_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.priv_class = &g722_decoder_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/g722enc.c b/libavcodec/g722enc.c index ca6bd46532..325c3927d1 100644 --- a/libavcodec/g722enc.c +++ b/libavcodec/g722enc.c @@ -380,7 +380,7 @@ const FFCodec ff_adpcm_g722_encoder = { .priv_data_size = sizeof(G722Context), .init = g722_encode_init, .close = g722_encode_close, - .encode2 = g722_encode_frame, + FF_CODEC_ENCODE_CB(g722_encode_frame), .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, #if FF_API_OLD_CHANNEL_LAYOUT .p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, 0 }, diff --git a/libavcodec/g723_1dec.c b/libavcodec/g723_1dec.c index b025cb2b8e..d095f09fe5 100644 --- a/libavcodec/g723_1dec.c +++ b/libavcodec/g723_1dec.c @@ -1118,7 +1118,7 @@ const FFCodec ff_g723_1_decoder = { .p.id = AV_CODEC_ID_G723_1, .priv_data_size = sizeof(G723_1_Context), .init = g723_1_decode_init, - .decode = g723_1_decode_frame, + FF_CODEC_DECODE_CB(g723_1_decode_frame), .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, .p.priv_class = &g723_1dec_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/g723_1enc.c b/libavcodec/g723_1enc.c index 60066ec305..e8fb8429c1 100644 --- a/libavcodec/g723_1enc.c +++ b/libavcodec/g723_1enc.c @@ -1246,7 +1246,7 @@ const FFCodec ff_g723_1_encoder = { .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(G723_1_Context), .init = g723_1_encode_init, - .encode2 = g723_1_encode_frame, + FF_CODEC_ENCODE_CB(g723_1_encode_frame), .defaults = defaults, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE diff --git a/libavcodec/g726.c b/libavcodec/g726.c index 0e19a2a8fc..3bf0da3949 100644 --- a/libavcodec/g726.c +++ b/libavcodec/g726.c @@ -408,7 +408,7 @@ const FFCodec ff_adpcm_g726_encoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(G726Context), .init = g726_encode_init, - .encode2 = g726_encode_frame, + FF_CODEC_ENCODE_CB(g726_encode_frame), .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.priv_class = &g726_class, @@ -426,7 +426,7 @@ const FFCodec ff_adpcm_g726le_encoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(G726Context), .init = g726_encode_init, - .encode2 = g726_encode_frame, + FF_CODEC_ENCODE_CB(g726_encode_frame), .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.priv_class = &g726_class, @@ -509,7 +509,7 @@ const FFCodec ff_adpcm_g726_decoder = { .p.id = AV_CODEC_ID_ADPCM_G726, .priv_data_size = sizeof(G726Context), .init = g726_decode_init, - .decode = g726_decode_frame, + FF_CODEC_DECODE_CB(g726_decode_frame), .flush = g726_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, @@ -523,7 +523,7 @@ const FFCodec ff_adpcm_g726le_decoder = { .p.id = AV_CODEC_ID_ADPCM_G726LE, .priv_data_size = sizeof(G726Context), .init = g726_decode_init, - .decode = g726_decode_frame, + FF_CODEC_DECODE_CB(g726_decode_frame), .flush = g726_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM little-endian"), diff --git a/libavcodec/g729dec.c b/libavcodec/g729dec.c index 0d54f555bd..a306456f0a 100644 --- a/libavcodec/g729dec.c +++ b/libavcodec/g729dec.c @@ -759,7 +759,7 @@ const FFCodec ff_g729_decoder = { .p.id = AV_CODEC_ID_G729, .priv_data_size = sizeof(G729Context), .init = decoder_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .close = decode_close, .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, @@ -772,7 +772,7 @@ const FFCodec ff_acelp_kelvin_decoder = { .p.id = AV_CODEC_ID_ACELP_KELVIN, .priv_data_size = sizeof(G729Context), .init = decoder_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .close = decode_close, .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/gdv.c b/libavcodec/gdv.c index d4c763cffb..70c2ad4bd1 100644 --- a/libavcodec/gdv.c +++ b/libavcodec/gdv.c @@ -568,7 +568,7 @@ const FFCodec ff_gdv_decoder = { .priv_data_size = sizeof(GDVContext), .init = gdv_decode_init, .close = gdv_decode_close, - .decode = gdv_decode_frame, + FF_CODEC_DECODE_CB(gdv_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/gemdec.c b/libavcodec/gemdec.c index 0844f8cfb3..0d6acd5303 100644 --- a/libavcodec/gemdec.c +++ b/libavcodec/gemdec.c @@ -356,6 +356,6 @@ const FFCodec ff_gem_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_GEM, .p.capabilities = AV_CODEC_CAP_DR1, - .decode = gem_decode_frame, + FF_CODEC_DECODE_CB(gem_decode_frame), .close = gem_close, }; diff --git a/libavcodec/gif.c b/libavcodec/gif.c index a22cae1f0b..8c52c865a4 100644 --- a/libavcodec/gif.c +++ b/libavcodec/gif.c @@ -559,7 +559,7 @@ const FFCodec ff_gif_encoder = { .p.id = AV_CODEC_ID_GIF, .priv_data_size = sizeof(GIFContext), .init = gif_encode_init, - .encode2 = gif_encode_frame, + FF_CODEC_ENCODE_CB(gif_encode_frame), .close = gif_encode_close, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c index adb8d0cec3..3936de1cd2 100644 --- a/libavcodec/gifdec.c +++ b/libavcodec/gifdec.c @@ -564,7 +564,7 @@ const FFCodec ff_gif_decoder = { .priv_data_size = sizeof(GifState), .init = gif_decode_init, .close = gif_decode_close, - .decode = gif_decode_frame, + FF_CODEC_DECODE_CB(gif_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/gsmdec.c b/libavcodec/gsmdec.c index 84852c8b11..e5b8d6f41f 100644 --- a/libavcodec/gsmdec.c +++ b/libavcodec/gsmdec.c @@ -120,7 +120,7 @@ const FFCodec ff_gsm_decoder = { .p.id = AV_CODEC_ID_GSM, .priv_data_size = sizeof(GSMContext), .init = gsm_init, - .decode = gsm_decode_frame, + FF_CODEC_DECODE_CB(gsm_decode_frame), .flush = gsm_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, @@ -134,7 +134,7 @@ const FFCodec ff_gsm_ms_decoder = { .p.id = AV_CODEC_ID_GSM_MS, .priv_data_size = sizeof(GSMContext), .init = gsm_init, - .decode = gsm_decode_frame, + FF_CODEC_DECODE_CB(gsm_decode_frame), .flush = gsm_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index a826c1ca1c..1699172767 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -688,7 +688,7 @@ const FFCodec ff_h261_decoder = { .priv_data_size = sizeof(H261DecContext), .init = h261_decode_init, .close = h261_decode_end, - .decode = h261_decode_frame, + FF_CODEC_DECODE_CB(h261_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .p.max_lowres = 3, diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c index f18f58b107..007bb4aa30 100644 --- a/libavcodec/h261enc.c +++ b/libavcodec/h261enc.c @@ -408,7 +408,7 @@ const FFCodec ff_h261_encoder = { .p.priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(H261EncContext), .init = ff_mpv_encode_init, - .encode2 = ff_mpv_encode_picture, + FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 731f442b01..1f9f3e5e95 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -762,7 +762,7 @@ const FFCodec ff_h263_decoder = { .priv_data_size = sizeof(MpegEncContext), .init = ff_h263_decode_init, .close = ff_h263_decode_end, - .decode = ff_h263_decode_frame, + FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | #if FF_API_FLAG_TRUNCATED AV_CODEC_CAP_TRUNCATED | @@ -784,7 +784,7 @@ const FFCodec ff_h263p_decoder = { .priv_data_size = sizeof(MpegEncContext), .init = ff_h263_decode_init, .close = ff_h263_decode_end, - .decode = ff_h263_decode_frame, + FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | #if FF_API_FLAG_TRUNCATED AV_CODEC_CAP_TRUNCATED | diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index 1dbf136934..d80bc6b17f 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -1070,7 +1070,7 @@ const FFCodec ff_h264_decoder = { .priv_data_size = sizeof(H264Context), .init = h264_decode_init, .close = h264_decode_end, - .decode = h264_decode_frame, + FF_CODEC_DECODE_CB(h264_decode_frame), .p.capabilities = /*AV_CODEC_CAP_DRAW_HORIZ_BAND |*/ AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, diff --git a/libavcodec/hapdec.c b/libavcodec/hapdec.c index 1a0472d432..7db3f5fd76 100644 --- a/libavcodec/hapdec.c +++ b/libavcodec/hapdec.c @@ -478,7 +478,7 @@ const FFCodec ff_hap_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HAP, .init = hap_init, - .decode = hap_decode, + FF_CODEC_DECODE_CB(hap_decode), .close = hap_close, .priv_data_size = sizeof(HapContext), .p.capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS | diff --git a/libavcodec/hapenc.c b/libavcodec/hapenc.c index ee03fef449..f3964896d5 100644 --- a/libavcodec/hapenc.c +++ b/libavcodec/hapenc.c @@ -357,7 +357,7 @@ const FFCodec ff_hap_encoder = { .priv_data_size = sizeof(HapContext), .p.priv_class = &hapenc_class, .init = hap_init, - .encode2 = hap_encode, + FF_CODEC_ENCODE_CB(hap_encode), .close = hap_close, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE, diff --git a/libavcodec/hcadec.c b/libavcodec/hcadec.c index 8539c772d8..4e84942bb9 100644 --- a/libavcodec/hcadec.c +++ b/libavcodec/hcadec.c @@ -452,7 +452,7 @@ const FFCodec ff_hca_decoder = { .p.id = AV_CODEC_ID_HCA, .priv_data_size = sizeof(HCAContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .close = decode_close, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/hcom.c b/libavcodec/hcom.c index 4d55360294..74a13e0044 100644 --- a/libavcodec/hcom.c +++ b/libavcodec/hcom.c @@ -142,7 +142,7 @@ const FFCodec ff_hcom_decoder = { .priv_data_size = sizeof(HCOMContext), .init = hcom_init, .close = hcom_close, - .decode = hcom_decode, + FF_CODEC_DECODE_CB(hcom_decode), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 9c2958b643..f782ea6394 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -3884,7 +3884,7 @@ const FFCodec ff_hevc_decoder = { .p.priv_class = &hevc_decoder_class, .init = hevc_decode_init, .close = hevc_decode_free, - .decode = hevc_decode_frame, + FF_CODEC_DECODE_CB(hevc_decode_frame), .flush = hevc_decode_flush, .update_thread_context = ONLY_IF_THREADS_ENABLED(hevc_update_thread_context), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | diff --git a/libavcodec/hnm4video.c b/libavcodec/hnm4video.c index deba534766..9eb9f3a694 100644 --- a/libavcodec/hnm4video.c +++ b/libavcodec/hnm4video.c @@ -505,7 +505,7 @@ const FFCodec ff_hnm4_video_decoder = { .priv_data_size = sizeof(Hnm4VideoContext), .init = hnm_decode_init, .close = hnm_decode_end, - .decode = hnm_decode_frame, + FF_CODEC_DECODE_CB(hnm_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/hq_hqa.c b/libavcodec/hq_hqa.c index a53b4641a0..cea2475bb8 100644 --- a/libavcodec/hq_hqa.c +++ b/libavcodec/hq_hqa.c @@ -388,7 +388,7 @@ const FFCodec ff_hq_hqa_decoder = { .p.id = AV_CODEC_ID_HQ_HQA, .priv_data_size = sizeof(HQContext), .init = hq_hqa_decode_init, - .decode = hq_hqa_decode_frame, + FF_CODEC_DECODE_CB(hq_hqa_decode_frame), .close = hq_hqa_decode_close, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c index 8c7fc9b1ec..c41fe61387 100644 --- a/libavcodec/hqx.c +++ b/libavcodec/hqx.c @@ -541,7 +541,7 @@ const FFCodec ff_hqx_decoder = { .p.id = AV_CODEC_ID_HQX, .priv_data_size = sizeof(HQXContext), .init = hqx_decode_init, - .decode = hqx_decode_frame, + FF_CODEC_DECODE_CB(hqx_decode_frame), .close = hqx_decode_close, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c index d98156e26d..07fa11e37a 100644 --- a/libavcodec/huffyuvdec.c +++ b/libavcodec/huffyuvdec.c @@ -1270,7 +1270,7 @@ const FFCodec ff_huffyuv_decoder = { .priv_data_size = sizeof(HYuvContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, @@ -1285,7 +1285,7 @@ const FFCodec ff_ffvhuff_decoder = { .priv_data_size = sizeof(HYuvContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, @@ -1301,7 +1301,7 @@ const FFCodec ff_hymt_decoder = { .priv_data_size = sizeof(HYuvContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index a19cf7efdc..195d45c911 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -1056,7 +1056,7 @@ const FFCodec ff_huffyuv_encoder = { .p.id = AV_CODEC_ID_HUFFYUV, .priv_data_size = sizeof(HYuvContext), .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .close = encode_end, .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.priv_class = &normal_class, @@ -1076,7 +1076,7 @@ const FFCodec ff_ffvhuff_encoder = { .p.id = AV_CODEC_ID_FFVHUFF, .priv_data_size = sizeof(HYuvContext), .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .close = encode_end, .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.priv_class = &ff_class, diff --git a/libavcodec/idcinvideo.c b/libavcodec/idcinvideo.c index 1a3792be0e..ecd4ab2fee 100644 --- a/libavcodec/idcinvideo.c +++ b/libavcodec/idcinvideo.c @@ -248,7 +248,7 @@ const FFCodec ff_idcin_decoder = { .p.id = AV_CODEC_ID_IDCIN, .priv_data_size = sizeof(IdcinContext), .init = idcin_decode_init, - .decode = idcin_decode_frame, + FF_CODEC_DECODE_CB(idcin_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .defaults = idcin_defaults, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/iff.c b/libavcodec/iff.c index 184e3b865e..36c9535d54 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -1917,7 +1917,7 @@ const FFCodec ff_iff_ilbm_decoder = { .priv_data_size = sizeof(IffContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/ilbcdec.c b/libavcodec/ilbcdec.c index 182a014d11..62a9ad19bf 100644 --- a/libavcodec/ilbcdec.c +++ b/libavcodec/ilbcdec.c @@ -1484,7 +1484,7 @@ const FFCodec ff_ilbc_decoder = { .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ILBC, .init = ilbc_decode_init, - .decode = ilbc_decode_frame, + FF_CODEC_DECODE_CB(ilbc_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .priv_data_size = sizeof(ILBCContext), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/imc.c b/libavcodec/imc.c index 7b0e9d3b55..ee12cd913f 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -1092,7 +1092,7 @@ const FFCodec ff_imc_decoder = { .priv_data_size = sizeof(IMCContext), .init = imc_decode_init, .close = imc_decode_close, - .decode = imc_decode_frame, + FF_CODEC_DECODE_CB(imc_decode_frame), .flush = flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, @@ -1109,7 +1109,7 @@ const FFCodec ff_iac_decoder = { .priv_data_size = sizeof(IMCContext), .init = imc_decode_init, .close = imc_decode_close, - .decode = imc_decode_frame, + FF_CODEC_DECODE_CB(imc_decode_frame), .flush = flush, .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, diff --git a/libavcodec/imm4.c b/libavcodec/imm4.c index d531bbdc3d..d826818864 100644 --- a/libavcodec/imm4.c +++ b/libavcodec/imm4.c @@ -540,7 +540,7 @@ const FFCodec ff_imm4_decoder = { .priv_data_size = sizeof(IMM4Context), .init = decode_init, .close = decode_close, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .flush = decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | diff --git a/libavcodec/imm5.c b/libavcodec/imm5.c index eb30cc5509..9b7ac17aa5 100644 --- a/libavcodec/imm5.c +++ b/libavcodec/imm5.c @@ -183,7 +183,7 @@ const FFCodec ff_imm5_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_IMM5, .init = imm5_init, - .decode = imm5_decode_frame, + FF_CODEC_DECODE_CB(imm5_decode_frame), .close = imm5_close, .flush = imm5_flush, .priv_data_size = sizeof(IMM5Context), diff --git a/libavcodec/imx.c b/libavcodec/imx.c index 0d8924bf45..4ee6006860 100644 --- a/libavcodec/imx.c +++ b/libavcodec/imx.c @@ -187,7 +187,7 @@ const FFCodec ff_simbiosis_imx_decoder = { .p.id = AV_CODEC_ID_SIMBIOSIS_IMX, .priv_data_size = sizeof(SimbiosisIMXContext), .init = imx_decode_init, - .decode = imx_decode_frame, + FF_CODEC_DECODE_CB(imx_decode_frame), .close = imx_decode_close, .flush = imx_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c index 8b47b59f79..79028975e5 100644 --- a/libavcodec/indeo2.c +++ b/libavcodec/indeo2.c @@ -267,7 +267,7 @@ const FFCodec ff_indeo2_decoder = { .priv_data_size = sizeof(Ir2Context), .init = ir2_decode_init, .close = ir2_decode_end, - .decode = ir2_decode_frame, + FF_CODEC_DECODE_CB(ir2_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index 753f1b2560..43669f46b5 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -1141,7 +1141,7 @@ const FFCodec ff_indeo3_decoder = { .priv_data_size = sizeof(Indeo3DecodeContext), .init = decode_init, .close = decode_close, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c index 833be98514..f0cdff0e2f 100644 --- a/libavcodec/indeo4.c +++ b/libavcodec/indeo4.c @@ -711,7 +711,7 @@ const FFCodec ff_indeo4_decoder = { .priv_data_size = sizeof(IVI45DecContext), .init = decode_init, .close = ff_ivi_decode_close, - .decode = ff_ivi_decode_frame, + FF_CODEC_DECODE_CB(ff_ivi_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/indeo5.c b/libavcodec/indeo5.c index 9a77cb9fba..aff1102211 100644 --- a/libavcodec/indeo5.c +++ b/libavcodec/indeo5.c @@ -691,7 +691,7 @@ const FFCodec ff_indeo5_decoder = { .priv_data_size = sizeof(IVI45DecContext), .init = decode_init, .close = ff_ivi_decode_close, - .decode = ff_ivi_decode_frame, + FF_CODEC_DECODE_CB(ff_ivi_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/intelh263dec.c b/libavcodec/intelh263dec.c index ddac619b8f..e7e821d3b3 100644 --- a/libavcodec/intelh263dec.c +++ b/libavcodec/intelh263dec.c @@ -137,7 +137,7 @@ const FFCodec ff_h263i_decoder = { .priv_data_size = sizeof(MpegEncContext), .init = ff_h263_decode_init, .close = ff_h263_decode_end, - .decode = ff_h263_decode_frame, + FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, diff --git a/libavcodec/interplayacm.c b/libavcodec/interplayacm.c index f669d6cd31..3c482e4c88 100644 --- a/libavcodec/interplayacm.c +++ b/libavcodec/interplayacm.c @@ -639,7 +639,7 @@ const FFCodec ff_interplay_acm_decoder = { .p.id = AV_CODEC_ID_INTERPLAY_ACM, .init = decode_init, .close = decode_close, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(InterplayACMContext), diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c index ff0efc127c..fe2a9e1e6b 100644 --- a/libavcodec/interplayvideo.c +++ b/libavcodec/interplayvideo.c @@ -1364,7 +1364,7 @@ const FFCodec ff_interplay_video_decoder = { .priv_data_size = sizeof(IpvideoContext), .init = ipvideo_decode_init, .close = ipvideo_decode_end, - .decode = ipvideo_decode_frame, + FF_CODEC_DECODE_CB(ipvideo_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_PARAM_CHANGE, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c index db7cdf1fcb..e99ebfe076 100644 --- a/libavcodec/ituh263enc.c +++ b/libavcodec/ituh263enc.c @@ -911,7 +911,7 @@ const FFCodec ff_h263_encoder = { .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, - .encode2 = ff_mpv_encode_picture, + FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, }; @@ -947,6 +947,6 @@ const FFCodec ff_h263p_encoder = { .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, - .encode2 = ff_mpv_encode_picture, + FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, }; diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c index 0658b056cb..0b761d0b00 100644 --- a/libavcodec/j2kenc.c +++ b/libavcodec/j2kenc.c @@ -1839,7 +1839,7 @@ const FFCodec ff_jpeg2000_encoder = { .p.id = AV_CODEC_ID_JPEG2000, .priv_data_size = sizeof(Jpeg2000EncoderContext), .init = j2kenc_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .close = j2kenc_destroy, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_YUV444P, AV_PIX_FMT_GRAY8, diff --git a/libavcodec/jacosubdec.c b/libavcodec/jacosubdec.c index 0d8e601b28..245ae22221 100644 --- a/libavcodec/jacosubdec.c +++ b/libavcodec/jacosubdec.c @@ -199,7 +199,7 @@ const FFCodec ff_jacosub_decoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_JACOSUB, .init = ff_ass_subtitle_header_default, - .decode_sub = jacosub_decode_frame, + FF_CODEC_DECODE_SUB_CB(jacosub_decode_frame), .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index 23f4cb768b..92966b11f5 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -2578,7 +2578,7 @@ const FFCodec ff_jpeg2000_decoder = { .p.capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_DR1, .priv_data_size = sizeof(Jpeg2000DecoderContext), .init = jpeg2000_decode_init, - .decode = jpeg2000_decode_frame, + FF_CODEC_DECODE_CB(jpeg2000_decode_frame), .p.priv_class = &jpeg2000_class, .p.max_lowres = 5, .p.profiles = NULL_IF_CONFIG_SMALL(ff_jpeg2000_profiles), diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c index 4c747b3919..399837cf2f 100644 --- a/libavcodec/jpeglsdec.c +++ b/libavcodec/jpeglsdec.c @@ -558,7 +558,7 @@ const FFCodec ff_jpegls_decoder = { .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, - .receive_frame = ff_mjpeg_receive_frame, + FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_SETS_PKT_DTS, diff --git a/libavcodec/jpeglsenc.c b/libavcodec/jpeglsenc.c index dbd7941df2..577e8a19db 100644 --- a/libavcodec/jpeglsenc.c +++ b/libavcodec/jpeglsenc.c @@ -482,7 +482,7 @@ const FFCodec ff_jpegls_encoder = { .priv_data_size = sizeof(JPEGLSContext), .p.priv_class = &jpegls_class, .init = encode_jpegls_init, - .encode2 = encode_picture_ls, + FF_CODEC_ENCODE_CB(encode_picture_ls), .close = encode_jpegls_close, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB24, diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c index 805ff9dda5..06015ba59d 100644 --- a/libavcodec/jvdec.c +++ b/libavcodec/jvdec.c @@ -242,7 +242,7 @@ const FFCodec ff_jv_decoder = { .priv_data_size = sizeof(JvContext), .init = decode_init, .close = decode_close, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c index 83dbc8291f..08e92c7107 100644 --- a/libavcodec/kgv1dec.c +++ b/libavcodec/kgv1dec.c @@ -184,7 +184,7 @@ const FFCodec ff_kgv1_decoder = { .priv_data_size = sizeof(KgvContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .flush = decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c index f031d37b7f..a009ba0ce2 100644 --- a/libavcodec/kmvc.c +++ b/libavcodec/kmvc.c @@ -411,7 +411,7 @@ const FFCodec ff_kmvc_decoder = { .p.id = AV_CODEC_ID_KMVC, .priv_data_size = sizeof(KmvcContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c index 2276616bb8..3aeb1c8a99 100644 --- a/libavcodec/lagarith.c +++ b/libavcodec/lagarith.c @@ -732,7 +732,7 @@ const FFCodec ff_lagarith_decoder = { .p.id = AV_CODEC_ID_LAGARITH, .priv_data_size = sizeof(LagarithContext), .init = lag_decode_init, - .decode = lag_decode_frame, + FF_CODEC_DECODE_CB(lag_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c index 6285e71d6e..ffa2fe5a6d 100644 --- a/libavcodec/lcldec.c +++ b/libavcodec/lcldec.c @@ -639,7 +639,7 @@ const FFCodec ff_mszh_decoder = { .priv_data_size = sizeof(LclDecContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; #endif @@ -654,7 +654,7 @@ const FFCodec ff_zlib_decoder = { .priv_data_size = sizeof(LclDecContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; #endif diff --git a/libavcodec/lclenc.c b/libavcodec/lclenc.c index 4389dcebf3..bd42c155aa 100644 --- a/libavcodec/lclenc.c +++ b/libavcodec/lclenc.c @@ -158,7 +158,7 @@ const FFCodec ff_zlib_encoder = { .p.id = AV_CODEC_ID_ZLIB, .priv_data_size = sizeof(LclEncContext), .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .close = encode_end, .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c index a083487c33..52a8bf19e2 100644 --- a/libavcodec/libaomdec.c +++ b/libavcodec/libaomdec.c @@ -256,7 +256,7 @@ const FFCodec ff_libaom_av1_decoder = { .priv_data_size = sizeof(AV1DecodeContext), .init = av1_init, .close = aom_free, - .decode = aom_decode, + FF_CODEC_DECODE_CB(aom_decode), .p.capabilities = AV_CODEC_CAP_OTHER_THREADS | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, .p.profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles), diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index 7dbb6f6f39..054903e6e2 100644 --- a/libavcodec/libaomenc.c +++ b/libavcodec/libaomenc.c @@ -1353,7 +1353,7 @@ FFCodec ff_libaom_av1_encoder = { .p.wrapper_name = "libaom", .priv_data_size = sizeof(AOMContext), .init = av1_init, - .encode2 = aom_encode, + FF_CODEC_ENCODE_CB(aom_encode), .close = aom_free, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, .defaults = defaults, diff --git a/libavcodec/libaribb24.c b/libavcodec/libaribb24.c index ab7e0e02d5..e1a26e5659 100644 --- a/libavcodec/libaribb24.c +++ b/libavcodec/libaribb24.c @@ -391,6 +391,6 @@ const FFCodec ff_libaribb24_decoder = { .priv_data_size = sizeof(Libaribb24Context), .init = libaribb24_init, .close = libaribb24_close, - .decode_sub = libaribb24_decode, + FF_CODEC_DECODE_SUB_CB(libaribb24_decode), .flush = libaribb24_flush, }; diff --git a/libavcodec/libcelt_dec.c b/libavcodec/libcelt_dec.c index b5fc391731..d659d80ed2 100644 --- a/libavcodec/libcelt_dec.c +++ b/libavcodec/libcelt_dec.c @@ -137,5 +137,5 @@ const FFCodec ff_libcelt_decoder = { .priv_data_size = sizeof(struct libcelt_context), .init = libcelt_dec_init, .close = libcelt_dec_close, - .decode = libcelt_dec_decode, + FF_CODEC_DECODE_CB(libcelt_dec_decode), }; diff --git a/libavcodec/libcodec2.c b/libavcodec/libcodec2.c index 2cfa1542e4..9064b823ee 100644 --- a/libavcodec/libcodec2.c +++ b/libavcodec/libcodec2.c @@ -188,7 +188,7 @@ const FFCodec ff_libcodec2_decoder = { .priv_data_size = sizeof(LibCodec2Context), .init = libcodec2_init_decoder, .close = libcodec2_close, - .decode = libcodec2_decode, + FF_CODEC_DECODE_CB(libcodec2_decode), #if FF_API_OLD_CHANNEL_LAYOUT .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, #endif @@ -207,7 +207,7 @@ const FFCodec ff_libcodec2_encoder = { .priv_data_size = sizeof(LibCodec2Context), .init = libcodec2_init_encoder, .close = libcodec2_close, - .encode2 = libcodec2_encode, + FF_CODEC_ENCODE_CB(libcodec2_encode), #if FF_API_OLD_CHANNEL_LAYOUT .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, #endif diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c index fb3ccf169e..64014123ce 100644 --- a/libavcodec/libdav1d.c +++ b/libavcodec/libdav1d.c @@ -582,7 +582,7 @@ const FFCodec ff_libdav1d_decoder = { .init = libdav1d_init, .close = libdav1d_close, .flush = libdav1d_flush, - .receive_frame = libdav1d_receive_frame, + FF_CODEC_RECEIVE_FRAME_CB(libdav1d_receive_frame), .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SETS_PKT_DTS | FF_CODEC_CAP_AUTO_THREADS, diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c index 564f9fb7c5..a47027d300 100644 --- a/libavcodec/libdavs2.c +++ b/libavcodec/libdavs2.c @@ -220,7 +220,7 @@ const FFCodec ff_libdavs2_decoder = { .priv_data_size = sizeof(DAVS2Context), .init = davs2_init, .close = davs2_end, - .decode = davs2_decode_frame, + FF_CODEC_DECODE_CB(davs2_decode_frame), .flush = davs2_flush, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c index c90324a3c8..11eee51a98 100644 --- a/libavcodec/libfdk-aacdec.c +++ b/libavcodec/libfdk-aacdec.c @@ -483,7 +483,7 @@ const FFCodec ff_libfdk_aac_decoder = { .p.id = AV_CODEC_ID_AAC, .priv_data_size = sizeof(FDKAACDecContext), .init = fdk_aac_decode_init, - .decode = fdk_aac_decode_frame, + FF_CODEC_DECODE_CB(fdk_aac_decode_frame), .close = fdk_aac_decode_close, .flush = fdk_aac_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c index d004ae00c3..a5697bde51 100644 --- a/libavcodec/libfdk-aacenc.c +++ b/libavcodec/libfdk-aacenc.c @@ -482,7 +482,7 @@ const FFCodec ff_libfdk_aac_encoder = { .p.id = AV_CODEC_ID_AAC, .priv_data_size = sizeof(AACContext), .init = aac_encode_init, - .encode2 = aac_encode_frame, + FF_CODEC_ENCODE_CB(aac_encode_frame), .close = aac_encode_close, .p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, diff --git a/libavcodec/libgsmdec.c b/libavcodec/libgsmdec.c index 88f0a0b3d6..9c2304f7a2 100644 --- a/libavcodec/libgsmdec.c +++ b/libavcodec/libgsmdec.c @@ -135,7 +135,7 @@ const FFCodec ff_libgsm_decoder = { .priv_data_size = sizeof(LibGSMDecodeContext), .init = libgsm_decode_init, .close = libgsm_decode_close, - .decode = libgsm_decode_frame, + FF_CODEC_DECODE_CB(libgsm_decode_frame), .flush = libgsm_flush, }; #endif @@ -150,7 +150,7 @@ const FFCodec ff_libgsm_ms_decoder = { .priv_data_size = sizeof(LibGSMDecodeContext), .init = libgsm_decode_init, .close = libgsm_decode_close, - .decode = libgsm_decode_frame, + FF_CODEC_DECODE_CB(libgsm_decode_frame), .flush = libgsm_flush, }; #endif diff --git a/libavcodec/libgsmenc.c b/libavcodec/libgsmenc.c index 7d24501b2f..a45b77be95 100644 --- a/libavcodec/libgsmenc.c +++ b/libavcodec/libgsmenc.c @@ -124,7 +124,7 @@ const FFCodec ff_libgsm_encoder = { .p.id = AV_CODEC_ID_GSM, .p.capabilities = AV_CODEC_CAP_DR1, .init = libgsm_encode_init, - .encode2 = libgsm_encode_frame, + FF_CODEC_ENCODE_CB(libgsm_encode_frame), .close = libgsm_encode_close, .defaults = libgsm_defaults, #if FF_API_OLD_CHANNEL_LAYOUT @@ -144,7 +144,7 @@ const FFCodec ff_libgsm_ms_encoder = { .p.id = AV_CODEC_ID_GSM_MS, .p.capabilities = AV_CODEC_CAP_DR1, .init = libgsm_encode_init, - .encode2 = libgsm_encode_frame, + FF_CODEC_ENCODE_CB(libgsm_encode_frame), .close = libgsm_encode_close, .defaults = libgsm_defaults, #if FF_API_OLD_CHANNEL_LAYOUT diff --git a/libavcodec/libilbc.c b/libavcodec/libilbc.c index 0fecbd4bba..a7b1eaf28c 100644 --- a/libavcodec/libilbc.c +++ b/libavcodec/libilbc.c @@ -124,7 +124,7 @@ const FFCodec ff_libilbc_decoder = { .p.id = AV_CODEC_ID_ILBC, .priv_data_size = sizeof(ILBCDecContext), .init = ilbc_decode_init, - .decode = ilbc_decode_frame, + FF_CODEC_DECODE_CB(ilbc_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.priv_class = &ilbc_dec_class, }; @@ -206,7 +206,7 @@ const FFCodec ff_libilbc_encoder = { .p.id = AV_CODEC_ID_ILBC, .priv_data_size = sizeof(ILBCEncContext), .init = ilbc_encode_init, - .encode2 = ilbc_encode_frame, + FF_CODEC_ENCODE_CB(ilbc_encode_frame), .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .defaults = ilbc_encode_defaults, diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c index d6de24845d..7fd0e95233 100644 --- a/libavcodec/libkvazaar.c +++ b/libavcodec/libkvazaar.c @@ -332,7 +332,7 @@ const FFCodec ff_libkvazaar_encoder = { .defaults = defaults, .init = libkvazaar_init, - .encode2 = libkvazaar_encode, + FF_CODEC_ENCODE_CB(libkvazaar_encode), .close = libkvazaar_close, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index 14f9872dd6..02a256c766 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -337,7 +337,7 @@ const FFCodec ff_libmp3lame_encoder = { AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(LAMEContext), .init = mp3lame_encode_init, - .encode2 = mp3lame_encode_frame, + FF_CODEC_ENCODE_CB(mp3lame_encode_frame), .close = mp3lame_encode_close, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_FLTP, diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c index 8650296113..539f0ded3c 100644 --- a/libavcodec/libopencore-amr.c +++ b/libavcodec/libopencore-amr.c @@ -141,7 +141,7 @@ const FFCodec ff_libopencore_amrnb_decoder = { .priv_data_size = sizeof(AMRContext), .init = amr_nb_decode_init, .close = amr_nb_decode_close, - .decode = amr_nb_decode_frame, + FF_CODEC_DECODE_CB(amr_nb_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, }; #endif /* CONFIG_LIBOPENCORE_AMRNB_DECODER */ @@ -295,7 +295,7 @@ const FFCodec ff_libopencore_amrnb_encoder = { .p.id = AV_CODEC_ID_AMR_NB, .priv_data_size = sizeof(AMRContext), .init = amr_nb_encode_init, - .encode2 = amr_nb_encode_frame, + FF_CODEC_ENCODE_CB(amr_nb_encode_frame), .close = amr_nb_encode_close, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, @@ -382,7 +382,7 @@ const FFCodec ff_libopencore_amrwb_decoder = { .priv_data_size = sizeof(AMRWBContext), .init = amr_wb_decode_init, .close = amr_wb_decode_close, - .decode = amr_wb_decode_frame, + FF_CODEC_DECODE_CB(amr_wb_decode_frame), }; #endif /* CONFIG_LIBOPENCORE_AMRWB_DECODER */ diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c index a88974cc62..b3e522c31f 100644 --- a/libavcodec/libopenh264dec.c +++ b/libavcodec/libopenh264dec.c @@ -163,7 +163,7 @@ const FFCodec ff_libopenh264_decoder = { .p.id = AV_CODEC_ID_H264, .priv_data_size = sizeof(SVCContext), .init = svc_decode_init, - .decode = svc_decode_frame, + FF_CODEC_DECODE_CB(svc_decode_frame), .close = svc_decode_close, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS | FF_CODEC_CAP_INIT_THREADSAFE | diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c index 7b25eba5d2..f31ed2d4ca 100644 --- a/libavcodec/libopenh264enc.c +++ b/libavcodec/libopenh264enc.c @@ -459,7 +459,7 @@ const FFCodec ff_libopenh264_encoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_OTHER_THREADS, .priv_data_size = sizeof(SVCContext), .init = svc_encode_init, - .encode2 = svc_encode_frame, + FF_CODEC_ENCODE_CB(svc_encode_frame), .close = svc_encode_close, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS, diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c index 1458ea3fdf..58715b43ee 100644 --- a/libavcodec/libopenjpegdec.c +++ b/libavcodec/libopenjpegdec.c @@ -511,5 +511,5 @@ const FFCodec ff_libopenjpeg_decoder = { .p.wrapper_name = "libopenjpeg", .priv_data_size = sizeof(LibOpenJPEGContext), .init = libopenjpeg_decode_init, - .decode = libopenjpeg_decode_frame, + FF_CODEC_DECODE_CB(libopenjpeg_decode_frame), }; diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c index a07fde9a09..06338e882c 100644 --- a/libavcodec/libopenjpegenc.c +++ b/libavcodec/libopenjpegenc.c @@ -761,7 +761,7 @@ const FFCodec ff_libopenjpeg_encoder = { .p.id = AV_CODEC_ID_JPEG2000, .priv_data_size = sizeof(LibOpenJPEGContext), .init = libopenjpeg_encode_init, - .encode2 = libopenjpeg_encode_frame, + FF_CODEC_ENCODE_CB(libopenjpeg_encode_frame), .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48, diff --git a/libavcodec/libopusdec.c b/libavcodec/libopusdec.c index dcc1599d63..316ab0f2a7 100644 --- a/libavcodec/libopusdec.c +++ b/libavcodec/libopusdec.c @@ -238,7 +238,7 @@ const FFCodec ff_libopus_decoder = { .priv_data_size = sizeof(struct libopus_context), .init = libopus_decode_init, .close = libopus_decode_close, - .decode = libopus_decode, + FF_CODEC_DECODE_CB(libopus_decode), .flush = libopus_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c index 0573d59736..c884075ffe 100644 --- a/libavcodec/libopusenc.c +++ b/libavcodec/libopusenc.c @@ -590,7 +590,7 @@ const FFCodec ff_libopus_encoder = { .p.id = AV_CODEC_ID_OPUS, .priv_data_size = sizeof(LibopusEncContext), .init = libopus_encode_init, - .encode2 = libopus_encode, + FF_CODEC_ENCODE_CB(libopus_encode), .close = libopus_encode_close, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, diff --git a/libavcodec/librav1e.c b/libavcodec/librav1e.c index aa8c0c8860..9d811ba81c 100644 --- a/libavcodec/librav1e.c +++ b/libavcodec/librav1e.c @@ -620,7 +620,7 @@ const FFCodec ff_librav1e_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AV1, .init = librav1e_encode_init, - .receive_packet = librav1e_receive_packet, + FF_CODEC_RECEIVE_PACKET_CB(librav1e_receive_packet), .close = librav1e_encode_close, .priv_data_size = sizeof(librav1eContext), .p.priv_class = &class, diff --git a/libavcodec/librsvgdec.c b/libavcodec/librsvgdec.c index c37fbbb0c9..6e949fe3d5 100644 --- a/libavcodec/librsvgdec.c +++ b/libavcodec/librsvgdec.c @@ -126,6 +126,6 @@ const FFCodec ff_librsvg_decoder = { .p.id = AV_CODEC_ID_SVG, .p.capabilities = AV_CODEC_CAP_DR1, .p.wrapper_name = "librsvg", - .decode = librsvg_decode_frame, + FF_CODEC_DECODE_CB(librsvg_decode_frame), .priv_data_size = sizeof(LibRSVGContext), }; diff --git a/libavcodec/libshine.c b/libavcodec/libshine.c index 2274c1aa32..9bc545689a 100644 --- a/libavcodec/libshine.c +++ b/libavcodec/libshine.c @@ -139,7 +139,7 @@ const FFCodec ff_libshine_encoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .priv_data_size = sizeof(SHINEContext), .init = libshine_encode_init, - .encode2 = libshine_encode_frame, + FF_CODEC_ENCODE_CB(libshine_encode_frame), .close = libshine_encode_close, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/libspeexdec.c b/libavcodec/libspeexdec.c index da47b271e0..8c9e05e51d 100644 --- a/libavcodec/libspeexdec.c +++ b/libavcodec/libspeexdec.c @@ -200,6 +200,6 @@ const FFCodec ff_libspeex_decoder = { .priv_data_size = sizeof(LibSpeexContext), .init = libspeex_decode_init, .close = libspeex_decode_close, - .decode = libspeex_decode_frame, + FF_CODEC_DECODE_CB(libspeex_decode_frame), .flush = libspeex_decode_flush, }; diff --git a/libavcodec/libspeexenc.c b/libavcodec/libspeexenc.c index 2c4f4caac9..ec4b3c6a8f 100644 --- a/libavcodec/libspeexenc.c +++ b/libavcodec/libspeexenc.c @@ -355,7 +355,7 @@ const FFCodec ff_libspeex_encoder = { .p.id = AV_CODEC_ID_SPEEX, .priv_data_size = sizeof(LibSpeexEncContext), .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .close = encode_close, .p.capabilities = AV_CODEC_CAP_DELAY, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c index 6cf280377e..7db789be5e 100644 --- a/libavcodec/libsvtav1.c +++ b/libavcodec/libsvtav1.c @@ -614,7 +614,7 @@ const FFCodec ff_libsvtav1_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AV1, .init = eb_enc_init, - .receive_packet = eb_receive_packet, + FF_CODEC_RECEIVE_PACKET_CB(eb_receive_packet), .close = eb_enc_close, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, .caps_internal = FF_CODEC_CAP_AUTO_THREADS | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c index af07575482..162d170b0f 100644 --- a/libavcodec/libtheoraenc.c +++ b/libavcodec/libtheoraenc.c @@ -377,7 +377,7 @@ const FFCodec ff_libtheora_encoder = { .priv_data_size = sizeof(TheoraContext), .init = encode_init, .close = encode_close, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, diff --git a/libavcodec/libtwolame.c b/libavcodec/libtwolame.c index 4320aa1b8c..1e53cf2257 100644 --- a/libavcodec/libtwolame.c +++ b/libavcodec/libtwolame.c @@ -216,7 +216,7 @@ const FFCodec ff_libtwolame_encoder = { .p.id = AV_CODEC_ID_MP2, .priv_data_size = sizeof(TWOLAMEContext), .init = twolame_encode_init, - .encode2 = twolame_encode_frame, + FF_CODEC_ENCODE_CB(twolame_encode_frame), .close = twolame_encode_close, .p.capabilities = AV_CODEC_CAP_DELAY, .defaults = twolame_defaults, diff --git a/libavcodec/libuavs3d.c b/libavcodec/libuavs3d.c index b5e861bd1f..48333f17d1 100644 --- a/libavcodec/libuavs3d.c +++ b/libavcodec/libuavs3d.c @@ -255,7 +255,7 @@ const FFCodec ff_libuavs3d_decoder = { .priv_data_size = sizeof(uavs3d_context), .init = libuavs3d_init, .close = libuavs3d_end, - .decode = libuavs3d_decode_frame, + FF_CODEC_DECODE_CB(libuavs3d_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, .flush = libuavs3d_flush, diff --git a/libavcodec/libvo-amrwbenc.c b/libavcodec/libvo-amrwbenc.c index a52edbfaac..12ef6d7fe6 100644 --- a/libavcodec/libvo-amrwbenc.c +++ b/libavcodec/libvo-amrwbenc.c @@ -150,7 +150,7 @@ const FFCodec ff_libvo_amrwbenc_encoder = { .p.wrapper_name = "libvo_amrwbenc", .priv_data_size = sizeof(AMRWBContext), .init = amr_wb_encode_init, - .encode2 = amr_wb_encode_frame, + FF_CODEC_ENCODE_CB(amr_wb_encode_frame), .close = amr_wb_encode_close, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/libvorbisdec.c b/libavcodec/libvorbisdec.c index 26bd0c994e..81c4ac1c02 100644 --- a/libavcodec/libvorbisdec.c +++ b/libavcodec/libvorbisdec.c @@ -218,6 +218,6 @@ const FFCodec ff_libvorbis_decoder = { .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_CHANNEL_CONF, .priv_data_size = sizeof(OggVorbisDecContext), .init = oggvorbis_decode_init, - .decode = oggvorbis_decode_frame, + FF_CODEC_DECODE_CB(oggvorbis_decode_frame), .close = oggvorbis_decode_close, }; diff --git a/libavcodec/libvorbisenc.c b/libavcodec/libvorbisenc.c index 5266da8dc0..9460d3267c 100644 --- a/libavcodec/libvorbisenc.c +++ b/libavcodec/libvorbisenc.c @@ -384,7 +384,7 @@ const FFCodec ff_libvorbis_encoder = { AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(LibvorbisEncContext), .init = libvorbis_encode_init, - .encode2 = libvorbis_encode_frame, + FF_CODEC_ENCODE_CB(libvorbis_encode_frame), .close = libvorbis_encode_close, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c index 51bdd13832..ef690a7093 100644 --- a/libavcodec/libvpxdec.c +++ b/libavcodec/libvpxdec.c @@ -365,7 +365,7 @@ const FFCodec ff_libvpx_vp8_decoder = { .priv_data_size = sizeof(VPxContext), .init = vp8_init, .close = vpx_free, - .decode = vpx_decode, + FF_CODEC_DECODE_CB(vpx_decode), .caps_internal = FF_CODEC_CAP_AUTO_THREADS, }; #endif /* CONFIG_LIBVPX_VP8_DECODER */ @@ -388,7 +388,7 @@ FFCodec ff_libvpx_vp9_decoder = { .priv_data_size = sizeof(VPxContext), .init = vp9_init, .close = vpx_free, - .decode = vpx_decode, + FF_CODEC_DECODE_CB(vpx_decode), .caps_internal = FF_CODEC_CAP_AUTO_THREADS, .init_static_data = ff_vp9_init_static, }; diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index dff1d06b0e..21a02d0b99 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -1934,7 +1934,7 @@ const FFCodec ff_libvpx_vp8_encoder = { AV_CODEC_CAP_OTHER_THREADS, .priv_data_size = sizeof(VPxContext), .init = vp8_init, - .encode2 = vpx_encode, + FF_CODEC_ENCODE_CB(vpx_encode), .close = vpx_free, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NONE }, @@ -1969,7 +1969,7 @@ FFCodec ff_libvpx_vp9_encoder = { .p.wrapper_name = "libvpx", .priv_data_size = sizeof(VPxContext), .init = vp9_init, - .encode2 = vpx_encode, + FF_CODEC_ENCODE_CB(vpx_encode), .close = vpx_free, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, .defaults = defaults, diff --git a/libavcodec/libwebpenc.c b/libavcodec/libwebpenc.c index 12f15bbf65..c5dc1b160a 100644 --- a/libavcodec/libwebpenc.c +++ b/libavcodec/libwebpenc.c @@ -99,6 +99,6 @@ const FFCodec ff_libwebp_encoder = { .priv_data_size = sizeof(LibWebPContext), .defaults = ff_libwebp_defaults, .init = libwebp_encode_init, - .encode2 = libwebp_encode_frame, + FF_CODEC_ENCODE_CB(libwebp_encode_frame), .close = libwebp_encode_close, }; diff --git a/libavcodec/libwebpenc_animencoder.c b/libavcodec/libwebpenc_animencoder.c index 0f5b524335..c50c2a6a96 100644 --- a/libavcodec/libwebpenc_animencoder.c +++ b/libavcodec/libwebpenc_animencoder.c @@ -137,6 +137,6 @@ const FFCodec ff_libwebp_anim_encoder = { .priv_data_size = sizeof(LibWebPAnimContext), .defaults = ff_libwebp_defaults, .init = libwebp_anim_encode_init, - .encode2 = libwebp_anim_encode_frame, + FF_CODEC_ENCODE_CB(libwebp_anim_encode_frame), .close = libwebp_anim_encode_close, }; diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 989370ef70..4ce3791ae8 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -1228,7 +1228,7 @@ FFCodec ff_libx264_encoder = { .p.wrapper_name = "libx264", .priv_data_size = sizeof(X264Context), .init = X264_init, - .encode2 = X264_frame, + FF_CODEC_ENCODE_CB(X264_frame), .close = X264_close, .defaults = x264_defaults, #if X264_BUILD < 153 @@ -1265,7 +1265,7 @@ const FFCodec ff_libx264rgb_encoder = { .p.wrapper_name = "libx264", .priv_data_size = sizeof(X264Context), .init = X264_init, - .encode2 = X264_frame, + FF_CODEC_ENCODE_CB(X264_frame), .close = X264_close, .defaults = x264_defaults, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS @@ -1297,7 +1297,7 @@ const FFCodec ff_libx262_encoder = { .p.wrapper_name = "libx264", .priv_data_size = sizeof(X264Context), .init = X264_init, - .encode2 = X264_frame, + FF_CODEC_ENCODE_CB(X264_frame), .close = X264_close, .defaults = x264_defaults, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS, diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c index abe64d69ef..4dcdcd7a77 100644 --- a/libavcodec/libx265.c +++ b/libavcodec/libx265.c @@ -752,7 +752,7 @@ FFCodec ff_libx265_encoder = { .p.wrapper_name = "libx265", .init = libx265_encode_init, .init_static_data = libx265_encode_init_csp, - .encode2 = libx265_encode_frame, + FF_CODEC_ENCODE_CB(libx265_encode_frame), .close = libx265_encode_close, .priv_data_size = sizeof(libx265Context), .defaults = x265_defaults, diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c index 609487202d..a3efbcb4a1 100644 --- a/libavcodec/libxavs.c +++ b/libavcodec/libxavs.c @@ -430,7 +430,7 @@ const FFCodec ff_libxavs_encoder = { AV_CODEC_CAP_OTHER_THREADS, .priv_data_size = sizeof(XavsContext), .init = XAVS_init, - .encode2 = XAVS_frame, + FF_CODEC_ENCODE_CB(XAVS_frame), .close = XAVS_close, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c index f189aaeed2..f77078e3fb 100644 --- a/libavcodec/libxavs2.c +++ b/libavcodec/libxavs2.c @@ -295,7 +295,7 @@ const FFCodec ff_libxavs2_encoder = { AV_CODEC_CAP_OTHER_THREADS, .priv_data_size = sizeof(XAVS2EContext), .init = xavs2_init, - .encode2 = xavs2_encode_frame, + FF_CODEC_ENCODE_CB(xavs2_encode_frame), .close = xavs2_close, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index ece7aaaebd..4b3dd71bc5 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -904,7 +904,7 @@ const FFCodec ff_libxvid_encoder = { .p.id = AV_CODEC_ID_MPEG4, .priv_data_size = sizeof(struct xvid_context), .init = xvid_encode_init, - .encode2 = xvid_encode_frame, + FF_CODEC_ENCODE_CB(xvid_encode_frame), .close = xvid_encode_close, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .p.priv_class = &xvid_class, diff --git a/libavcodec/libzvbi-teletextdec.c b/libavcodec/libzvbi-teletextdec.c index 4920c61e0f..79a1237431 100644 --- a/libavcodec/libzvbi-teletextdec.c +++ b/libavcodec/libzvbi-teletextdec.c @@ -822,6 +822,6 @@ const FFCodec ff_libzvbi_teletext_decoder = { .priv_data_size = sizeof(TeletextContext), .init = teletext_init_decoder, .close = teletext_close_decoder, - .decode_sub = teletext_decode_frame, + FF_CODEC_DECODE_SUB_CB(teletext_decode_frame), .flush = teletext_flush, }; diff --git a/libavcodec/ljpegenc.c b/libavcodec/ljpegenc.c index fad19cbb76..e0fc417d1f 100644 --- a/libavcodec/ljpegenc.c +++ b/libavcodec/ljpegenc.c @@ -329,7 +329,7 @@ const FFCodec ff_ljpeg_encoder = { .priv_data_size = sizeof(LJpegEncContext), .p.priv_class = &ljpeg_class, .init = ljpeg_encode_init, - .encode2 = ljpeg_encode_frame, + FF_CODEC_ENCODE_CB(ljpeg_encode_frame), .close = ljpeg_encode_close, .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]){ diff --git a/libavcodec/loco.c b/libavcodec/loco.c index c21214a626..9cadc9d006 100644 --- a/libavcodec/loco.c +++ b/libavcodec/loco.c @@ -343,7 +343,7 @@ const FFCodec ff_loco_decoder = { .p.id = AV_CODEC_ID_LOCO, .priv_data_size = sizeof(LOCOContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/lscrdec.c b/libavcodec/lscrdec.c index dc2c7a51c2..9e7010c288 100644 --- a/libavcodec/lscrdec.c +++ b/libavcodec/lscrdec.c @@ -253,7 +253,7 @@ const FFCodec ff_lscr_decoder = { .priv_data_size = sizeof(LSCRContext), .init = lscr_decode_init, .close = lscr_decode_close, - .decode = decode_frame_lscr, + FF_CODEC_DECODE_CB(decode_frame_lscr), .flush = lscr_decode_flush, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/m101.c b/libavcodec/m101.c index a635b153f7..fce31956c7 100644 --- a/libavcodec/m101.c +++ b/libavcodec/m101.c @@ -111,7 +111,7 @@ const FFCodec ff_m101_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_M101, .init = m101_decode_init, - .decode = m101_decode_frame, + FF_CODEC_DECODE_CB(m101_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mace.c b/libavcodec/mace.c index b32890c578..35af4a6aae 100644 --- a/libavcodec/mace.c +++ b/libavcodec/mace.c @@ -292,7 +292,7 @@ const FFCodec ff_mace3_decoder = { .p.id = AV_CODEC_ID_MACE3, .priv_data_size = sizeof(MACEContext), .init = mace_decode_init, - .decode = mace_decode_frame, + FF_CODEC_DECODE_CB(mace_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, @@ -306,7 +306,7 @@ const FFCodec ff_mace6_decoder = { .p.id = AV_CODEC_ID_MACE6, .priv_data_size = sizeof(MACEContext), .init = mace_decode_init, - .decode = mace_decode_frame, + FF_CODEC_DECODE_CB(mace_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c index b99905f4ad..634d45ca48 100644 --- a/libavcodec/magicyuv.c +++ b/libavcodec/magicyuv.c @@ -701,7 +701,7 @@ const FFCodec ff_magicyuv_decoder = { .priv_data_size = sizeof(MagicYUVContext), .init = magy_decode_init, .close = magy_decode_end, - .decode = magy_decode_frame, + FF_CODEC_DECODE_CB(magy_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, diff --git a/libavcodec/magicyuvenc.c b/libavcodec/magicyuvenc.c index b365739443..ce492368ef 100644 --- a/libavcodec/magicyuvenc.c +++ b/libavcodec/magicyuvenc.c @@ -572,7 +572,7 @@ const FFCodec ff_magicyuv_encoder = { .p.priv_class = &magicyuv_class, .init = magy_encode_init, .close = magy_encode_close, - .encode2 = magy_encode_frame, + FF_CODEC_ENCODE_CB(magy_encode_frame), .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_YUV422P, diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index 24c0fc1adc..deabebda62 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -257,7 +257,7 @@ const FFCodec ff_mdec_decoder = { .priv_data_size = sizeof(MDECContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c index c8c9f1df08..6b4c39b4e0 100644 --- a/libavcodec/mediacodecdec.c +++ b/libavcodec/mediacodecdec.c @@ -540,7 +540,7 @@ const FFCodec ff_ ## short_name ## _mediacodec_decoder = { .p.priv_class = &ff_##short_name##_mediacodec_dec_class, \ .priv_data_size = sizeof(MediaCodecH264DecContext), \ .init = mediacodec_decode_init, \ - .receive_frame = mediacodec_receive_frame, \ + FF_CODEC_RECEIVE_FRAME_CB(mediacodec_receive_frame), \ .flush = mediacodec_decode_flush, \ .close = mediacodec_decode_close, \ .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \ diff --git a/libavcodec/metasound.c b/libavcodec/metasound.c index 3897d42911..9c5d0369c4 100644 --- a/libavcodec/metasound.c +++ b/libavcodec/metasound.c @@ -381,7 +381,7 @@ const FFCodec ff_metasound_decoder = { .priv_data_size = sizeof(TwinVQContext), .init = metasound_decode_init, .close = ff_twinvq_decode_close, - .decode = ff_twinvq_decode_frame, + FF_CODEC_DECODE_CB(ff_twinvq_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/mfenc.c b/libavcodec/mfenc.c index f30068985e..280941cf2e 100644 --- a/libavcodec/mfenc.c +++ b/libavcodec/mfenc.c @@ -1160,7 +1160,7 @@ static int mf_close(AVCodecContext *avctx) .priv_data_size = sizeof(MFContext), \ .init = mf_init, \ .close = mf_close, \ - .receive_packet = mf_receive_packet, \ + FF_CODEC_RECEIVE_PACKET_CB(mf_receive_packet), \ EXTRA \ .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID | \ AV_CODEC_CAP_DR1, \ diff --git a/libavcodec/microdvddec.c b/libavcodec/microdvddec.c index 1cd5d1d5f5..154fd3271b 100644 --- a/libavcodec/microdvddec.c +++ b/libavcodec/microdvddec.c @@ -374,7 +374,7 @@ const FFCodec ff_microdvd_decoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_MICRODVD, .init = microdvd_init, - .decode_sub = microdvd_decode_frame, + FF_CODEC_DECODE_SUB_CB(microdvd_decode_frame), .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/midivid.c b/libavcodec/midivid.c index 55fca27085..a21303ab60 100644 --- a/libavcodec/midivid.c +++ b/libavcodec/midivid.c @@ -285,7 +285,7 @@ const FFCodec ff_mvdv_decoder = { .p.id = AV_CODEC_ID_MVDV, .priv_data_size = sizeof(MidiVidContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .flush = decode_flush, .close = decode_close, .p.capabilities = AV_CODEC_CAP_DR1, diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index 05c193989b..74dd947f88 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -445,7 +445,7 @@ const FFCodec ff_mimic_decoder = { .priv_data_size = sizeof(MimicContext), .init = mimic_decode_init, .close = mimic_decode_end, - .decode = mimic_decode_frame, + FF_CODEC_DECODE_CB(mimic_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .update_thread_context = ONLY_IF_THREADS_ENABLED(mimic_decode_update_thread_context), .caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS | diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c index b04d61c0e0..8c1809e5fb 100644 --- a/libavcodec/mjpegbdec.c +++ b/libavcodec/mjpegbdec.c @@ -164,7 +164,7 @@ const FFCodec ff_mjpegb_decoder = { .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, - .decode = mjpegb_decode_frame, + FF_CODEC_DECODE_CB(mjpegb_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .p.max_lowres = 3, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 13b56e0b2f..32874a5a19 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -3020,7 +3020,7 @@ const FFCodec ff_mjpeg_decoder = { .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, - .receive_frame = ff_mjpeg_receive_frame, + FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame), .flush = decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, .p.max_lowres = 3, @@ -3048,7 +3048,7 @@ const FFCodec ff_thp_decoder = { .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, - .receive_frame = ff_mjpeg_receive_frame, + FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame), .flush = decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, .p.max_lowres = 3, @@ -3066,7 +3066,7 @@ const FFCodec ff_smvjpeg_decoder = { .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, - .receive_frame = ff_mjpeg_receive_frame, + FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame), .flush = decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_EXPORTS_CROPPING | diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index a39b990eea..31d794965f 100644 --- a/libavcodec/mjpegenc.c +++ b/libavcodec/mjpegenc.c @@ -658,7 +658,7 @@ const FFCodec ff_mjpeg_encoder = { .p.id = AV_CODEC_ID_MJPEG, .priv_data_size = sizeof(MJPEGEncContext), .init = ff_mpv_encode_init, - .encode2 = ff_mpv_encode_picture, + FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = mjpeg_encode_close, .p.capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, @@ -687,7 +687,7 @@ const FFCodec ff_amv_encoder = { .p.id = AV_CODEC_ID_AMV, .priv_data_size = sizeof(MJPEGEncContext), .init = ff_mpv_encode_init, - .encode2 = amv_encode_picture, + FF_CODEC_ENCODE_CB(amv_encode_picture), .close = mjpeg_encode_close, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]) { diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index a3c1850d33..c5d8f5bde8 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -1424,7 +1424,7 @@ const FFCodec ff_mlp_decoder = { .priv_data_size = sizeof(MLPDecodeContext), .p.priv_class = &mlp_decoder_class, .init = mlp_decode_init, - .decode = read_access_unit, + FF_CODEC_DECODE_CB(read_access_unit), .flush = mlp_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, @@ -1439,7 +1439,7 @@ const FFCodec ff_truehd_decoder = { .priv_data_size = sizeof(MLPDecodeContext), .p.priv_class = &truehd_decoder_class, .init = mlp_decode_init, - .decode = read_access_unit, + FF_CODEC_DECODE_CB(read_access_unit), .flush = mlp_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c index bcb479f2a6..da36818169 100644 --- a/libavcodec/mlpenc.c +++ b/libavcodec/mlpenc.c @@ -2213,7 +2213,7 @@ const FFCodec ff_mlp_encoder = { .p.id = AV_CODEC_ID_MLP, .priv_data_size = sizeof(MLPEncodeContext), .init = mlp_encode_init, - .encode2 = mlp_encode_frame, + FF_CODEC_ENCODE_CB(mlp_encode_frame), .close = mlp_encode_close, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_EXPERIMENTAL, .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE}, @@ -2233,7 +2233,7 @@ const FFCodec ff_truehd_encoder = { .p.id = AV_CODEC_ID_TRUEHD, .priv_data_size = sizeof(MLPEncodeContext), .init = mlp_encode_init, - .encode2 = mlp_encode_frame, + FF_CODEC_ENCODE_CB(mlp_encode_frame), .close = mlp_encode_close, .p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_EXPERIMENTAL, .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE}, diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c index 2a56bcae01..7fd24ad3b7 100644 --- a/libavcodec/mmaldec.c +++ b/libavcodec/mmaldec.c @@ -837,7 +837,7 @@ static const AVClass ffmmal_dec_class = { .priv_data_size = sizeof(MMALDecodeContext), \ .init = ffmmal_init_decoder, \ .close = ffmmal_close_decoder, \ - .receive_frame = ffmmal_receive_frame, \ + FF_CODEC_RECEIVE_FRAME_CB(ffmmal_receive_frame), \ .flush = ffmmal_flush, \ .p.priv_class = &ffmmal_dec_class, \ .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE, \ diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c index 54ed5fad14..fc80ec4764 100644 --- a/libavcodec/mmvideo.c +++ b/libavcodec/mmvideo.c @@ -246,7 +246,7 @@ const FFCodec ff_mmvideo_decoder = { .priv_data_size = sizeof(MmContext), .init = mm_decode_init, .close = mm_decode_end, - .decode = mm_decode_frame, + FF_CODEC_DECODE_CB(mm_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c index 0b7230f326..2d09bc1f72 100644 --- a/libavcodec/mobiclip.c +++ b/libavcodec/mobiclip.c @@ -1347,7 +1347,7 @@ const FFCodec ff_mobiclip_decoder = { .p.id = AV_CODEC_ID_MOBICLIP, .priv_data_size = sizeof(MobiClipContext), .init = mobiclip_init, - .decode = mobiclip_decode, + FF_CODEC_DECODE_CB(mobiclip_decode), .flush = mobiclip_flush, .close = mobiclip_close, .p.capabilities = AV_CODEC_CAP_DR1, diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index aeea4e6865..29454fd242 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -353,7 +353,7 @@ const FFCodec ff_motionpixels_decoder = { .priv_data_size = sizeof(MotionPixelsContext), .init = mp_decode_init, .close = mp_decode_end, - .decode = mp_decode_frame, + FF_CODEC_DECODE_CB(mp_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c index c3e0a75e57..6a71537291 100644 --- a/libavcodec/movtextdec.c +++ b/libavcodec/movtextdec.c @@ -599,7 +599,7 @@ const FFCodec ff_movtext_decoder = { .priv_data_size = sizeof(MovTextContext), .p.priv_class = &mov_text_decoder_class, .init = mov_text_init, - .decode_sub = mov_text_decode_frame, + FF_CODEC_DECODE_SUB_CB(mov_text_decode_frame), .close = mov_text_decode_close, .flush = mov_text_flush, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c index 333a23be82..728338f2cc 100644 --- a/libavcodec/movtextenc.c +++ b/libavcodec/movtextenc.c @@ -707,7 +707,7 @@ const FFCodec ff_movtext_encoder = { .priv_data_size = sizeof(MovTextContext), .p.priv_class = &mov_text_encoder_class, .init = mov_text_encode_init, - .encode_sub = mov_text_encode_frame, + FF_CODEC_ENCODE_SUB_CB(mov_text_encode_frame), .close = mov_text_encode_close, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index 5d8280ee2e..1b722714f0 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.c @@ -317,7 +317,7 @@ const FFCodec ff_mpc7_decoder = { .priv_data_size = sizeof(MPCContext), .init = mpc7_decode_init, .close = mpc7_decode_close, - .decode = mpc7_decode_frame, + FF_CODEC_DECODE_CB(mpc7_decode_frame), .flush = mpc7_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index e876de4813..7903e5df8a 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -390,7 +390,7 @@ const FFCodec ff_mpc8_decoder = { .p.id = AV_CODEC_ID_MUSEPACK8, .priv_data_size = sizeof(MPCContext), .init = mpc8_decode_init, - .decode = mpc8_decode_frame, + FF_CODEC_DECODE_CB(mpc8_decode_frame), .flush = mpc8_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 599ee8dcb1..e9bde48f7a 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -2870,7 +2870,7 @@ const FFCodec ff_mpeg1video_decoder = { .priv_data_size = sizeof(Mpeg1Context), .init = mpeg_decode_init, .close = mpeg_decode_end, - .decode = mpeg_decode_frame, + FF_CODEC_DECODE_CB(mpeg_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | #if FF_API_FLAG_TRUNCATED AV_CODEC_CAP_TRUNCATED | @@ -2903,7 +2903,7 @@ const FFCodec ff_mpeg2video_decoder = { .priv_data_size = sizeof(Mpeg1Context), .init = mpeg_decode_init, .close = mpeg_decode_end, - .decode = mpeg_decode_frame, + FF_CODEC_DECODE_CB(mpeg_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | #if FF_API_FLAG_TRUNCATED AV_CODEC_CAP_TRUNCATED | @@ -2949,7 +2949,7 @@ const FFCodec ff_mpegvideo_decoder = { .priv_data_size = sizeof(Mpeg1Context), .init = mpeg_decode_init, .close = mpeg_decode_end, - .decode = mpeg_decode_frame, + FF_CODEC_DECODE_CB(mpeg_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | #if FF_API_FLAG_TRUNCATED AV_CODEC_CAP_TRUNCATED | @@ -3113,7 +3113,7 @@ const FFCodec ff_ipu_decoder = { .p.id = AV_CODEC_ID_IPU, .priv_data_size = sizeof(IPUContext), .init = ipu_decode_init, - .decode = ipu_decode_frame, + FF_CODEC_DECODE_CB(ipu_decode_frame), .close = ipu_decode_end, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 77cbb60ea1..5ba2828e2f 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -1232,7 +1232,7 @@ const FFCodec ff_mpeg1video_encoder = { .p.id = AV_CODEC_ID_MPEG1VIDEO, .priv_data_size = sizeof(MPEG12EncContext), .init = encode_init, - .encode2 = ff_mpv_encode_picture, + FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, .p.supported_framerates = ff_mpeg12_frame_rate_tab + 1, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, @@ -1249,7 +1249,7 @@ const FFCodec ff_mpeg2video_encoder = { .p.id = AV_CODEC_ID_MPEG2VIDEO, .priv_data_size = sizeof(MPEG12EncContext), .init = encode_init, - .encode2 = ff_mpv_encode_picture, + FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, .p.supported_framerates = ff_mpeg2_frame_rate_tab, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 5c55de3eb8..e2bde73639 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -3670,7 +3670,7 @@ const FFCodec ff_mpeg4_decoder = { .priv_data_size = sizeof(Mpeg4DecContext), .init = decode_init, .close = ff_h263_decode_end, - .decode = ff_h263_decode_frame, + FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | #if FF_API_FLAG_TRUNCATED AV_CODEC_CAP_TRUNCATED | diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c index 1140c33a70..89e7ce1260 100644 --- a/libavcodec/mpeg4videoenc.c +++ b/libavcodec/mpeg4videoenc.c @@ -1401,7 +1401,7 @@ const FFCodec ff_mpeg4_encoder = { .p.id = AV_CODEC_ID_MPEG4, .priv_data_size = sizeof(MpegEncContext), .init = encode_init, - .encode2 = ff_mpv_encode_picture, + FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS, diff --git a/libavcodec/mpegaudiodec_fixed.c b/libavcodec/mpegaudiodec_fixed.c index 8809fac976..8a5721d383 100644 --- a/libavcodec/mpegaudiodec_fixed.c +++ b/libavcodec/mpegaudiodec_fixed.c @@ -68,7 +68,7 @@ const FFCodec ff_mp1_decoder = { .p.id = AV_CODEC_ID_MP1, .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush, @@ -86,7 +86,7 @@ const FFCodec ff_mp2_decoder = { .p.id = AV_CODEC_ID_MP2, .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush, @@ -104,7 +104,7 @@ const FFCodec ff_mp3_decoder = { .p.id = AV_CODEC_ID_MP3, .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush, @@ -122,7 +122,7 @@ const FFCodec ff_mp3adu_decoder = { .p.id = AV_CODEC_ID_MP3ADU, .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, - .decode = decode_frame_adu, + FF_CODEC_DECODE_CB(decode_frame_adu), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush, @@ -141,7 +141,7 @@ const FFCodec ff_mp3on4_decoder = { .priv_data_size = sizeof(MP3On4DecodeContext), .init = decode_init_mp3on4, .close = decode_close_mp3on4, - .decode = decode_frame_mp3on4, + FF_CODEC_DECODE_CB(decode_frame_mp3on4), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush_mp3on4, diff --git a/libavcodec/mpegaudiodec_float.c b/libavcodec/mpegaudiodec_float.c index c4fd64a85f..bcd55069a0 100644 --- a/libavcodec/mpegaudiodec_float.c +++ b/libavcodec/mpegaudiodec_float.c @@ -81,7 +81,7 @@ const FFCodec ff_mp1float_decoder = { .p.id = AV_CODEC_ID_MP1, .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush, @@ -99,7 +99,7 @@ const FFCodec ff_mp2float_decoder = { .p.id = AV_CODEC_ID_MP2, .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush, @@ -117,7 +117,7 @@ const FFCodec ff_mp3float_decoder = { .p.id = AV_CODEC_ID_MP3, .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush, @@ -135,7 +135,7 @@ const FFCodec ff_mp3adufloat_decoder = { .p.id = AV_CODEC_ID_MP3ADU, .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, - .decode = decode_frame_adu, + FF_CODEC_DECODE_CB(decode_frame_adu), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush, @@ -154,7 +154,7 @@ const FFCodec ff_mp3on4float_decoder = { .priv_data_size = sizeof(MP3On4DecodeContext), .init = decode_init_mp3on4, .close = decode_close_mp3on4, - .decode = decode_frame_mp3on4, + FF_CODEC_DECODE_CB(decode_frame_mp3on4), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush_mp3on4, diff --git a/libavcodec/mpegaudioenc_fixed.c b/libavcodec/mpegaudioenc_fixed.c index 2eaa933195..74cb4b8d57 100644 --- a/libavcodec/mpegaudioenc_fixed.c +++ b/libavcodec/mpegaudioenc_fixed.c @@ -30,7 +30,7 @@ const FFCodec ff_mp2fixed_encoder = { .p.id = AV_CODEC_ID_MP2, .priv_data_size = sizeof(MpegAudioContext), .init = MPA_encode_init, - .encode2 = MPA_encode_frame, + FF_CODEC_ENCODE_CB(MPA_encode_frame), .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.supported_samplerates = (const int[]){ diff --git a/libavcodec/mpegaudioenc_float.c b/libavcodec/mpegaudioenc_float.c index 9b9c7a442a..0a597b7e07 100644 --- a/libavcodec/mpegaudioenc_float.c +++ b/libavcodec/mpegaudioenc_float.c @@ -31,7 +31,7 @@ const FFCodec ff_mp2_encoder = { .p.id = AV_CODEC_ID_MP2, .priv_data_size = sizeof(MpegAudioContext), .init = MPA_encode_init, - .encode2 = MPA_encode_frame, + FF_CODEC_ENCODE_CB(MPA_encode_frame), .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.supported_samplerates = (const int[]){ diff --git a/libavcodec/mpl2dec.c b/libavcodec/mpl2dec.c index 490a3e6d45..7104670f4d 100644 --- a/libavcodec/mpl2dec.c +++ b/libavcodec/mpl2dec.c @@ -86,7 +86,7 @@ const FFCodec ff_mpl2_decoder = { .p.long_name = NULL_IF_CONFIG_SMALL("MPL2 subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_MPL2, - .decode_sub = mpl2_decode_frame, + FF_CODEC_DECODE_SUB_CB(mpl2_decode_frame), .init = ff_ass_subtitle_header_default, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), diff --git a/libavcodec/mscc.c b/libavcodec/mscc.c index e7f6015554..ac67ec9c47 100644 --- a/libavcodec/mscc.c +++ b/libavcodec/mscc.c @@ -252,7 +252,7 @@ const FFCodec ff_mscc_decoder = { .priv_data_size = sizeof(MSCCContext), .init = decode_init, .close = decode_close, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; @@ -265,7 +265,7 @@ const FFCodec ff_srgc_decoder = { .priv_data_size = sizeof(MSCCContext), .init = decode_init, .close = decode_close, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c index f0cb11eceb..a03e43f88c 100644 --- a/libavcodec/msmpeg4dec.c +++ b/libavcodec/msmpeg4dec.c @@ -872,7 +872,7 @@ const FFCodec ff_msmpeg4v1_decoder = { .priv_data_size = sizeof(MpegEncContext), .init = ff_msmpeg4_decode_init, .close = ff_h263_decode_end, - .decode = ff_h263_decode_frame, + FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, @@ -891,7 +891,7 @@ const FFCodec ff_msmpeg4v2_decoder = { .priv_data_size = sizeof(MpegEncContext), .init = ff_msmpeg4_decode_init, .close = ff_h263_decode_end, - .decode = ff_h263_decode_frame, + FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, @@ -910,7 +910,7 @@ const FFCodec ff_msmpeg4v3_decoder = { .priv_data_size = sizeof(MpegEncContext), .init = ff_msmpeg4_decode_init, .close = ff_h263_decode_end, - .decode = ff_h263_decode_frame, + FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, @@ -929,7 +929,7 @@ const FFCodec ff_wmv1_decoder = { .priv_data_size = sizeof(MpegEncContext), .init = ff_msmpeg4_decode_init, .close = ff_h263_decode_end, - .decode = ff_h263_decode_frame, + FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, diff --git a/libavcodec/msmpeg4enc.c b/libavcodec/msmpeg4enc.c index dd75cd5746..e597dbbb4e 100644 --- a/libavcodec/msmpeg4enc.c +++ b/libavcodec/msmpeg4enc.c @@ -686,7 +686,7 @@ const FFCodec ff_msmpeg4v2_encoder = { .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(MSMPEG4EncContext), .init = ff_mpv_encode_init, - .encode2 = ff_mpv_encode_picture, + FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, }; @@ -700,7 +700,7 @@ const FFCodec ff_msmpeg4v3_encoder = { .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(MSMPEG4EncContext), .init = ff_mpv_encode_init, - .encode2 = ff_mpv_encode_picture, + FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, }; @@ -714,6 +714,6 @@ const FFCodec ff_wmv1_encoder = { .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(MSMPEG4EncContext), .init = ff_mpv_encode_init, - .encode2 = ff_mpv_encode_picture, + FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, }; diff --git a/libavcodec/msp2dec.c b/libavcodec/msp2dec.c index 99dcf7e9f9..5374c4be81 100644 --- a/libavcodec/msp2dec.c +++ b/libavcodec/msp2dec.c @@ -98,5 +98,5 @@ const FFCodec ff_msp2_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MSP2, .p.capabilities = AV_CODEC_CAP_DR1, - .decode = msp2_decode_frame, + FF_CODEC_DECODE_CB(msp2_decode_frame), }; diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c index 49fd3c86e2..041d0c9493 100644 --- a/libavcodec/msrle.c +++ b/libavcodec/msrle.c @@ -167,7 +167,7 @@ const FFCodec ff_msrle_decoder = { .priv_data_size = sizeof(MsrleContext), .init = msrle_decode_init, .close = msrle_decode_end, - .decode = msrle_decode_frame, + FF_CODEC_DECODE_CB(msrle_decode_frame), .flush = msrle_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/mss1.c b/libavcodec/mss1.c index 844a6bde9c..bc00a11abb 100644 --- a/libavcodec/mss1.c +++ b/libavcodec/mss1.c @@ -227,7 +227,7 @@ const FFCodec ff_mss1_decoder = { .priv_data_size = sizeof(MSS1Context), .init = mss1_decode_init, .close = mss1_decode_end, - .decode = mss1_decode_frame, + FF_CODEC_DECODE_CB(mss1_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c index 235149b906..ab42d12217 100644 --- a/libavcodec/mss2.c +++ b/libavcodec/mss2.c @@ -854,7 +854,7 @@ const FFCodec ff_mss2_decoder = { .priv_data_size = sizeof(MSS2Context), .init = mss2_decode_init, .close = mss2_decode_end, - .decode = mss2_decode_frame, + FF_CODEC_DECODE_CB(mss2_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mss3.c b/libavcodec/mss3.c index 3e12ea0399..55d2d10bd6 100644 --- a/libavcodec/mss3.c +++ b/libavcodec/mss3.c @@ -868,7 +868,7 @@ const FFCodec ff_msa1_decoder = { .priv_data_size = sizeof(MSS3Context), .init = mss3_decode_init, .close = mss3_decode_end, - .decode = mss3_decode_frame, + FF_CODEC_DECODE_CB(mss3_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c index c29d885077..be73e52a91 100644 --- a/libavcodec/mss4.c +++ b/libavcodec/mss4.c @@ -613,7 +613,7 @@ const FFCodec ff_mts2_decoder = { .priv_data_size = sizeof(MSS4Context), .init = mss4_decode_init, .close = mss4_decode_end, - .decode = mss4_decode_frame, + FF_CODEC_DECODE_CB(mss4_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/msvideo1.c b/libavcodec/msvideo1.c index fa08e2cdfd..a39f684b52 100644 --- a/libavcodec/msvideo1.c +++ b/libavcodec/msvideo1.c @@ -349,7 +349,7 @@ const FFCodec ff_msvideo1_decoder = { .priv_data_size = sizeof(Msvideo1Context), .init = msvideo1_decode_init, .close = msvideo1_decode_end, - .decode = msvideo1_decode_frame, + FF_CODEC_DECODE_CB(msvideo1_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/msvideo1enc.c b/libavcodec/msvideo1enc.c index 917b7ea907..53f4a4b365 100644 --- a/libavcodec/msvideo1enc.c +++ b/libavcodec/msvideo1enc.c @@ -309,7 +309,7 @@ const FFCodec ff_msvideo1_encoder = { .p.id = AV_CODEC_ID_MSVIDEO1, .priv_data_size = sizeof(Msvideo1EncContext), .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .close = encode_end, .p.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_RGB555, AV_PIX_FMT_NONE}, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/mv30.c b/libavcodec/mv30.c index 75ed23d493..a32fab2b92 100644 --- a/libavcodec/mv30.c +++ b/libavcodec/mv30.c @@ -710,7 +710,7 @@ const FFCodec ff_mv30_decoder = { .priv_data_size = sizeof(MV30Context), .init = decode_init, .close = decode_close, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .flush = decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | diff --git a/libavcodec/mvcdec.c b/libavcodec/mvcdec.c index 2bef903bfa..4ee8d10ca9 100644 --- a/libavcodec/mvcdec.c +++ b/libavcodec/mvcdec.c @@ -262,7 +262,7 @@ const FFCodec ff_mvc1_decoder = { .p.id = AV_CODEC_ID_MVC1, .priv_data_size = sizeof(MvcContext), .init = mvc_decode_init, - .decode = mvc_decode_frame, + FF_CODEC_DECODE_CB(mvc_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; @@ -276,7 +276,7 @@ const FFCodec ff_mvc2_decoder = { .p.id = AV_CODEC_ID_MVC2, .priv_data_size = sizeof(MvcContext), .init = mvc_decode_init, - .decode = mvc_decode_frame, + FF_CODEC_DECODE_CB(mvc_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mvha.c b/libavcodec/mvha.c index 7c312d8562..8a65c42583 100644 --- a/libavcodec/mvha.c +++ b/libavcodec/mvha.c @@ -306,7 +306,7 @@ const FFCodec ff_mvha_decoder = { .priv_data_size = sizeof(MVHAContext), .init = decode_init, .close = decode_close, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/mwsc.c b/libavcodec/mwsc.c index 82d149a295..d89fbde4e2 100644 --- a/libavcodec/mwsc.c +++ b/libavcodec/mwsc.c @@ -176,7 +176,7 @@ const FFCodec ff_mwsc_decoder = { .priv_data_size = sizeof(MWSCContext), .init = decode_init, .close = decode_close, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/mxpegdec.c b/libavcodec/mxpegdec.c index 19a4bfcd8b..e5cdd44fd2 100644 --- a/libavcodec/mxpegdec.c +++ b/libavcodec/mxpegdec.c @@ -350,7 +350,7 @@ const FFCodec ff_mxpeg_decoder = { .priv_data_size = sizeof(MXpegDecodeContext), .init = mxpeg_decode_init, .close = mxpeg_decode_end, - .decode = mxpeg_decode_frame, + FF_CODEC_DECODE_CB(mxpeg_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .p.max_lowres = 3, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c index 1d51b989a5..63b60f202c 100644 --- a/libavcodec/nellymoserdec.c +++ b/libavcodec/nellymoserdec.c @@ -194,7 +194,7 @@ const FFCodec ff_nellymoser_decoder = { .priv_data_size = sizeof(NellyMoserDecodeContext), .init = decode_init, .close = decode_end, - .decode = decode_tag, + FF_CODEC_DECODE_CB(decode_tag), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_PARAM_CHANGE | AV_CODEC_CAP_CHANNEL_CONF, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c index 35a30b9942..c11dfe504c 100644 --- a/libavcodec/nellymoserenc.c +++ b/libavcodec/nellymoserenc.c @@ -422,7 +422,7 @@ const FFCodec ff_nellymoser_encoder = { AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(NellyMoserEncodeContext), .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .close = encode_end, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/notchlc.c b/libavcodec/notchlc.c index 36967a6f63..f6d62b8a4b 100644 --- a/libavcodec/notchlc.c +++ b/libavcodec/notchlc.c @@ -543,7 +543,7 @@ const FFCodec ff_notchlc_decoder = { .priv_data_size = sizeof(NotchLCContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index 2fdb023751..71420a62f6 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -370,7 +370,7 @@ const FFCodec ff_nuv_decoder = { .priv_data_size = sizeof(NuvContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/nvenc_h264.c b/libavcodec/nvenc_h264.c index 101f8ddb4c..1860c60a29 100644 --- a/libavcodec/nvenc_h264.c +++ b/libavcodec/nvenc_h264.c @@ -225,7 +225,7 @@ const FFCodec ff_h264_nvenc_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H264, .init = ff_nvenc_encode_init, - .receive_packet = ff_nvenc_receive_packet, + FF_CODEC_RECEIVE_PACKET_CB(ff_nvenc_receive_packet), .close = ff_nvenc_encode_close, .flush = ff_nvenc_encode_flush, .priv_data_size = sizeof(NvencContext), diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c index 6443e3e145..2c64cce598 100644 --- a/libavcodec/nvenc_hevc.c +++ b/libavcodec/nvenc_hevc.c @@ -206,7 +206,7 @@ const FFCodec ff_hevc_nvenc_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HEVC, .init = ff_nvenc_encode_init, - .receive_packet = ff_nvenc_receive_packet, + FF_CODEC_RECEIVE_PACKET_CB(ff_nvenc_receive_packet), .close = ff_nvenc_encode_close, .flush = ff_nvenc_encode_flush, .priv_data_size = sizeof(NvencContext), diff --git a/libavcodec/omx.c b/libavcodec/omx.c index 4bf3b4ffdd..d481c0678b 100644 --- a/libavcodec/omx.c +++ b/libavcodec/omx.c @@ -943,7 +943,7 @@ const FFCodec ff_mpeg4_omx_encoder = { .p.id = AV_CODEC_ID_MPEG4, .priv_data_size = sizeof(OMXCodecContext), .init = omx_encode_init, - .encode2 = omx_encode_frame, + FF_CODEC_ENCODE_CB(omx_encode_frame), .close = omx_encode_end, .p.pix_fmts = omx_encoder_pix_fmts, .p.capabilities = AV_CODEC_CAP_DELAY, @@ -964,7 +964,7 @@ const FFCodec ff_h264_omx_encoder = { .p.id = AV_CODEC_ID_H264, .priv_data_size = sizeof(OMXCodecContext), .init = omx_encode_init, - .encode2 = omx_encode_frame, + FF_CODEC_ENCODE_CB(omx_encode_frame), .close = omx_encode_end, .p.pix_fmts = omx_encoder_pix_fmts, .p.capabilities = AV_CODEC_CAP_DELAY, diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c index 9ba4d764a0..5477f6f87b 100644 --- a/libavcodec/on2avc.c +++ b/libavcodec/on2avc.c @@ -1011,7 +1011,7 @@ const FFCodec ff_on2avc_decoder = { .p.id = AV_CODEC_ID_ON2AVC, .priv_data_size = sizeof(On2AVCContext), .init = on2avc_decode_init, - .decode = on2avc_decode_frame, + FF_CODEC_DECODE_CB(on2avc_decode_frame), .close = on2avc_decode_close, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c index ff7dd6c631..8ca99369c6 100644 --- a/libavcodec/opusdec.c +++ b/libavcodec/opusdec.c @@ -713,7 +713,7 @@ const FFCodec ff_opus_decoder = { .priv_data_size = sizeof(OpusContext), .init = opus_decode_init, .close = opus_decode_close, - .decode = opus_decode_packet, + FF_CODEC_DECODE_CB(opus_decode_packet), .flush = opus_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/opusenc.c b/libavcodec/opusenc.c index 44aa9cbd44..b4b7c472a0 100644 --- a/libavcodec/opusenc.c +++ b/libavcodec/opusenc.c @@ -734,7 +734,7 @@ const FFCodec ff_opus_encoder = { .p.priv_class = &opusenc_class, .priv_data_size = sizeof(OpusEncContext), .init = opus_encode_init, - .encode2 = opus_encode_frame, + FF_CODEC_ENCODE_CB(opus_encode_frame), .close = opus_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .p.capabilities = AV_CODEC_CAP_EXPERIMENTAL | AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY, diff --git a/libavcodec/pafaudio.c b/libavcodec/pafaudio.c index 6e8da3d3c4..9f694d2dc8 100644 --- a/libavcodec/pafaudio.c +++ b/libavcodec/pafaudio.c @@ -79,7 +79,7 @@ const FFCodec ff_paf_audio_decoder = { .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_PAF_AUDIO, .init = paf_audio_init, - .decode = paf_audio_decode, + FF_CODEC_DECODE_CB(paf_audio_decode), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/pafvideo.c b/libavcodec/pafvideo.c index 3199e7f44c..a0bd22e8fd 100644 --- a/libavcodec/pafvideo.c +++ b/libavcodec/pafvideo.c @@ -416,7 +416,7 @@ const FFCodec ff_paf_video_decoder = { .priv_data_size = sizeof(PAFVideoDecContext), .init = paf_video_init, .close = paf_video_close, - .decode = paf_video_decode, + FF_CODEC_DECODE_CB(paf_video_decode), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/pamenc.c b/libavcodec/pamenc.c index 8ded835d25..8a94f8a537 100644 --- a/libavcodec/pamenc.c +++ b/libavcodec/pamenc.c @@ -133,7 +133,7 @@ const FFCodec ff_pam_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PAM, .p.capabilities = AV_CODEC_CAP_DR1, - .encode2 = pam_encode_frame, + FF_CODEC_ENCODE_CB(pam_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64BE, diff --git a/libavcodec/pcm-bluray.c b/libavcodec/pcm-bluray.c index fb9d06a36f..54338e679f 100644 --- a/libavcodec/pcm-bluray.c +++ b/libavcodec/pcm-bluray.c @@ -304,7 +304,7 @@ const FFCodec ff_pcm_bluray_decoder = { .p.long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for Blu-ray media"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_PCM_BLURAY, - .decode = pcm_bluray_decode_frame, + FF_CODEC_DECODE_CB(pcm_bluray_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE diff --git a/libavcodec/pcm-blurayenc.c b/libavcodec/pcm-blurayenc.c index 37b4709df8..99886e8c37 100644 --- a/libavcodec/pcm-blurayenc.c +++ b/libavcodec/pcm-blurayenc.c @@ -277,7 +277,7 @@ const FFCodec ff_pcm_bluray_encoder = { .p.id = AV_CODEC_ID_PCM_BLURAY, .priv_data_size = sizeof(BlurayPCMEncContext), .init = pcm_bluray_encode_init, - .encode2 = pcm_bluray_encode_frame, + FF_CODEC_ENCODE_CB(pcm_bluray_encode_frame), .p.supported_samplerates = (const int[]) { 48000, 96000, 192000, 0 }, #if FF_API_OLD_CHANNEL_LAYOUT .p.channel_layouts = (const uint64_t[]) { diff --git a/libavcodec/pcm-dvd.c b/libavcodec/pcm-dvd.c index f7a5ba6600..57d0ff81d0 100644 --- a/libavcodec/pcm-dvd.c +++ b/libavcodec/pcm-dvd.c @@ -302,7 +302,7 @@ const FFCodec ff_pcm_dvd_decoder = { .p.id = AV_CODEC_ID_PCM_DVD, .priv_data_size = sizeof(PCMDVDContext), .init = pcm_dvd_decode_init, - .decode = pcm_dvd_decode_frame, + FF_CODEC_DECODE_CB(pcm_dvd_decode_frame), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { diff --git a/libavcodec/pcm-dvdenc.c b/libavcodec/pcm-dvdenc.c index d0c328beb0..f18855cfa7 100644 --- a/libavcodec/pcm-dvdenc.c +++ b/libavcodec/pcm-dvdenc.c @@ -180,7 +180,7 @@ const FFCodec ff_pcm_dvd_encoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(PCMDVDContext), .init = pcm_dvd_encode_init, - .encode2 = pcm_dvd_encode_frame, + FF_CODEC_ENCODE_CB(pcm_dvd_encode_frame), .p.supported_samplerates = (const int[]) { 48000, 96000, 0}, #if FF_API_OLD_CHANNEL_LAYOUT .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c index dfb10095c2..471075ad71 100644 --- a/libavcodec/pcm.c +++ b/libavcodec/pcm.c @@ -561,7 +561,7 @@ const FFCodec ff_ ## name_ ## _encoder = { \ .p.id = AV_CODEC_ID_ ## id_, \ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_VARIABLE_FRAME_SIZE, \ .init = pcm_encode_init, \ - .encode2 = pcm_encode_frame, \ + FF_CODEC_ENCODE_CB(pcm_encode_frame), \ .p.sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \ AV_SAMPLE_FMT_NONE }, \ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \ @@ -583,7 +583,7 @@ const FFCodec ff_ ## name_ ## _decoder = { \ .p.id = AV_CODEC_ID_ ## id_, \ .priv_data_size = sizeof(PCMDecode), \ .init = pcm_decode_init, \ - .decode = pcm_decode_frame, \ + FF_CODEC_DECODE_CB(pcm_decode_frame), \ .p.capabilities = AV_CODEC_CAP_DR1, \ .p.sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \ AV_SAMPLE_FMT_NONE }, \ diff --git a/libavcodec/pcx.c b/libavcodec/pcx.c index 2831f1bc3b..b21bdce5ce 100644 --- a/libavcodec/pcx.c +++ b/libavcodec/pcx.c @@ -254,6 +254,6 @@ const FFCodec ff_pcx_decoder = { .p.long_name = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PCX, - .decode = pcx_decode_frame, + FF_CODEC_DECODE_CB(pcx_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/pcxenc.c b/libavcodec/pcxenc.c index 1ccd7db92f..e6eb387f0d 100644 --- a/libavcodec/pcxenc.c +++ b/libavcodec/pcxenc.c @@ -197,7 +197,7 @@ const FFCodec ff_pcx_encoder = { .p.long_name = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PCX, - .encode2 = pcx_encode_frame, + FF_CODEC_ENCODE_CB(pcx_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c index 8b5eb5f816..8441b88d27 100644 --- a/libavcodec/pgssubdec.c +++ b/libavcodec/pgssubdec.c @@ -698,7 +698,7 @@ const FFCodec ff_pgssub_decoder = { .priv_data_size = sizeof(PGSSubContext), .init = init_decoder, .close = close_decoder, - .decode_sub = decode, + FF_CODEC_DECODE_SUB_CB(decode), .p.priv_class = &pgsdec_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/pgxdec.c b/libavcodec/pgxdec.c index 01cd484da2..899e7a9994 100644 --- a/libavcodec/pgxdec.c +++ b/libavcodec/pgxdec.c @@ -164,5 +164,5 @@ const FFCodec ff_pgx_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PGX, .p.capabilities = AV_CODEC_CAP_DR1, - .decode = pgx_decode_frame, + FF_CODEC_DECODE_CB(pgx_decode_frame), }; diff --git a/libavcodec/photocd.c b/libavcodec/photocd.c index 48dc1b88c4..0f3001f2e1 100644 --- a/libavcodec/photocd.c +++ b/libavcodec/photocd.c @@ -464,7 +464,7 @@ const FFCodec ff_photocd_decoder = { .p.priv_class = &photocd_class, .init = photocd_decode_init, .close = photocd_decode_close, - .decode = photocd_decode_frame, + FF_CODEC_DECODE_CB(photocd_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .p.long_name = NULL_IF_CONFIG_SMALL("Kodak Photo CD"), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c index 3c32cbc4e6..ed0292c797 100644 --- a/libavcodec/pictordec.c +++ b/libavcodec/pictordec.c @@ -286,5 +286,5 @@ const FFCodec ff_pictor_decoder = { .p.id = AV_CODEC_ID_PICTOR, .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PicContext), - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), }; diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c index 12857919fe..18a6587257 100644 --- a/libavcodec/pixlet.c +++ b/libavcodec/pixlet.c @@ -699,7 +699,7 @@ const FFCodec ff_pixlet_decoder = { .p.id = AV_CODEC_ID_PIXLET, .init = pixlet_init, .close = pixlet_close, - .decode = pixlet_decode_frame, + FF_CODEC_DECODE_CB(pixlet_decode_frame), .priv_data_size = sizeof(PixletContext), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 59302c898a..6b44af59f2 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -1723,7 +1723,7 @@ const FFCodec ff_apng_decoder = { .priv_data_size = sizeof(PNGDecContext), .init = png_dec_init, .close = png_dec_end, - .decode = decode_frame_apng, + FF_CODEC_DECODE_CB(decode_frame_apng), .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | @@ -1740,7 +1740,7 @@ const FFCodec ff_png_decoder = { .priv_data_size = sizeof(PNGDecContext), .init = png_dec_init, .close = png_dec_end, - .decode = decode_frame_png, + FF_CODEC_DECODE_CB(decode_frame_png), .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/, .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM | FF_CODEC_CAP_INIT_THREADSAFE | diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index f67f90cd14..aaa6453218 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -1119,7 +1119,7 @@ const FFCodec ff_png_encoder = { .priv_data_size = sizeof(PNGEncContext), .init = png_enc_init, .close = png_enc_close, - .encode2 = encode_png, + FF_CODEC_ENCODE_CB(encode_png), .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, @@ -1142,7 +1142,7 @@ const FFCodec ff_apng_encoder = { .priv_data_size = sizeof(PNGEncContext), .init = png_enc_init, .close = png_enc_close, - .encode2 = encode_apng, + FF_CODEC_ENCODE_CB(encode_apng), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64BE, diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c index a6f5d7c55d..f2d9b7e4b6 100644 --- a/libavcodec/pnmdec.c +++ b/libavcodec/pnmdec.c @@ -338,7 +338,7 @@ const FFCodec ff_pgm_decoder = { .p.id = AV_CODEC_ID_PGM, .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), - .decode = pnm_decode_frame, + FF_CODEC_DECODE_CB(pnm_decode_frame), }; #endif @@ -350,7 +350,7 @@ const FFCodec ff_pgmyuv_decoder = { .p.id = AV_CODEC_ID_PGMYUV, .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), - .decode = pnm_decode_frame, + FF_CODEC_DECODE_CB(pnm_decode_frame), }; #endif @@ -362,7 +362,7 @@ const FFCodec ff_ppm_decoder = { .p.id = AV_CODEC_ID_PPM, .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), - .decode = pnm_decode_frame, + FF_CODEC_DECODE_CB(pnm_decode_frame), }; #endif @@ -374,7 +374,7 @@ const FFCodec ff_pbm_decoder = { .p.id = AV_CODEC_ID_PBM, .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), - .decode = pnm_decode_frame, + FF_CODEC_DECODE_CB(pnm_decode_frame), }; #endif @@ -386,7 +386,7 @@ const FFCodec ff_pam_decoder = { .p.id = AV_CODEC_ID_PAM, .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), - .decode = pnm_decode_frame, + FF_CODEC_DECODE_CB(pnm_decode_frame), }; #endif @@ -398,6 +398,6 @@ const FFCodec ff_pfm_decoder = { .p.id = AV_CODEC_ID_PFM, .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), - .decode = pnm_decode_frame, + FF_CODEC_DECODE_CB(pnm_decode_frame), }; #endif diff --git a/libavcodec/pnmenc.c b/libavcodec/pnmenc.c index 020dbd218c..feb26b8bfa 100644 --- a/libavcodec/pnmenc.c +++ b/libavcodec/pnmenc.c @@ -157,7 +157,7 @@ const FFCodec ff_pgm_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PGM, .p.capabilities = AV_CODEC_CAP_DR1, - .encode2 = pnm_encode_frame, + FF_CODEC_ENCODE_CB(pnm_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_NONE }, @@ -172,7 +172,7 @@ const FFCodec ff_pgmyuv_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PGMYUV, .p.capabilities = AV_CODEC_CAP_DR1, - .encode2 = pnm_encode_frame, + FF_CODEC_ENCODE_CB(pnm_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_NONE }, @@ -187,7 +187,7 @@ const FFCodec ff_ppm_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PPM, .p.capabilities = AV_CODEC_CAP_DR1, - .encode2 = pnm_encode_frame, + FF_CODEC_ENCODE_CB(pnm_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_NONE }, @@ -202,7 +202,7 @@ const FFCodec ff_pbm_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PBM, .p.capabilities = AV_CODEC_CAP_DR1, - .encode2 = pnm_encode_frame, + FF_CODEC_ENCODE_CB(pnm_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, @@ -216,7 +216,7 @@ const FFCodec ff_pfm_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PFM, .p.capabilities = AV_CODEC_CAP_DR1, - .encode2 = pnm_encode_frame, + FF_CODEC_ENCODE_CB(pnm_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_GBRPF32, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c index 46ca26150b..dba64a2489 100644 --- a/libavcodec/proresdec2.c +++ b/libavcodec/proresdec2.c @@ -878,7 +878,7 @@ const FFCodec ff_prores_decoder = { .priv_data_size = sizeof(ProresContext), .init = decode_init, .close = decode_close, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, .p.profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 2f6bd89efd..914c3fb2c2 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -949,7 +949,7 @@ const FFCodec ff_prores_aw_encoder = { .priv_data_size = sizeof(ProresContext), .init = prores_encode_init, .close = prores_encode_close, - .encode2 = prores_encode_frame, + FF_CODEC_ENCODE_CB(prores_encode_frame), .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.priv_class = &prores_enc_class, .p.profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), @@ -965,7 +965,7 @@ const FFCodec ff_prores_encoder = { .priv_data_size = sizeof(ProresContext), .init = prores_encode_init, .close = prores_encode_close, - .encode2 = prores_encode_frame, + FF_CODEC_ENCODE_CB(prores_encode_frame), .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.priv_class = &prores_enc_class, .p.profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index 429b623678..1062ca1443 100644 --- a/libavcodec/proresenc_kostya.c +++ b/libavcodec/proresenc_kostya.c @@ -1401,7 +1401,7 @@ const FFCodec ff_prores_ks_encoder = { .priv_data_size = sizeof(ProresContext), .init = encode_init, .close = encode_close, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .p.capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, diff --git a/libavcodec/prosumer.c b/libavcodec/prosumer.c index db17cd5083..8a91d5e110 100644 --- a/libavcodec/prosumer.c +++ b/libavcodec/prosumer.c @@ -372,7 +372,7 @@ const FFCodec ff_prosumer_decoder = { .p.id = AV_CODEC_ID_PROSUMER, .priv_data_size = sizeof(ProSumerContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .close = decode_close, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | diff --git a/libavcodec/psd.c b/libavcodec/psd.c index da802a5585..1d92163408 100644 --- a/libavcodec/psd.c +++ b/libavcodec/psd.c @@ -551,5 +551,5 @@ const FFCodec ff_psd_decoder = { .p.id = AV_CODEC_ID_PSD, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .priv_data_size = sizeof(PSDContext), - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), }; diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c index aa971bd74d..10b84e57b0 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -218,7 +218,7 @@ FF_ENABLE_DEPRECATION_WARNINGS av_frame_unref(p->frame); p->got_frame = 0; - p->result = codec->decode(avctx, p->frame, &p->got_frame, p->avpkt); + p->result = codec->cb.decode(avctx, p->frame, &p->got_frame, p->avpkt); if ((p->result < 0 || !p->got_frame) && p->frame->buf[0]) ff_thread_release_buffer(avctx, p->frame); diff --git a/libavcodec/ptx.c b/libavcodec/ptx.c index b782bf1db3..1102049347 100644 --- a/libavcodec/ptx.c +++ b/libavcodec/ptx.c @@ -92,5 +92,5 @@ const FFCodec ff_ptx_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_PTX, .p.capabilities = AV_CODEC_CAP_DR1, - .decode = ptx_decode_frame, + FF_CODEC_DECODE_CB(ptx_decode_frame), }; diff --git a/libavcodec/qcelpdec.c b/libavcodec/qcelpdec.c index 16ece70e63..1a4d308ac1 100644 --- a/libavcodec/qcelpdec.c +++ b/libavcodec/qcelpdec.c @@ -796,7 +796,7 @@ const FFCodec ff_qcelp_decoder = { .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_QCELP, .init = qcelp_decode_init, - .decode = qcelp_decode_frame, + FF_CODEC_DECODE_CB(qcelp_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .priv_data_size = sizeof(QCELPContext), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index 9d0b541964..427e8e8449 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -1877,7 +1877,7 @@ const FFCodec ff_qdm2_decoder = { .priv_data_size = sizeof(QDM2Context), .init = qdm2_decode_init, .close = qdm2_decode_close, - .decode = qdm2_decode_frame, + FF_CODEC_DECODE_CB(qdm2_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/qdmc.c b/libavcodec/qdmc.c index 4ef4be19f5..7c069a8012 100644 --- a/libavcodec/qdmc.c +++ b/libavcodec/qdmc.c @@ -736,7 +736,7 @@ const FFCodec ff_qdmc_decoder = { .priv_data_size = sizeof(QDMCContext), .init = qdmc_decode_init, .close = qdmc_decode_close, - .decode = qdmc_decode_frame, + FF_CODEC_DECODE_CB(qdmc_decode_frame), .flush = qdmc_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c index bf67f8523d..849d4a5cad 100644 --- a/libavcodec/qdrw.c +++ b/libavcodec/qdrw.c @@ -519,5 +519,5 @@ const FFCodec ff_qdraw_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_QDRAW, .p.capabilities = AV_CODEC_CAP_DR1, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), }; diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c index 0f33e87de1..9e787cb434 100644 --- a/libavcodec/qpeg.c +++ b/libavcodec/qpeg.c @@ -359,7 +359,7 @@ const FFCodec ff_qpeg_decoder = { .priv_data_size = sizeof(QpegContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .flush = decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index 08eda5bc26..de4af1754d 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -984,7 +984,7 @@ const FFCodec ff_##x##_qsv_decoder = { \ .p.type = AVMEDIA_TYPE_VIDEO, \ .p.id = AV_CODEC_ID_##X, \ .init = qsv_decode_init, \ - .decode = qsv_decode_frame, \ + FF_CODEC_DECODE_CB(qsv_decode_frame), \ .flush = qsv_decode_flush, \ .close = qsv_decode_close, \ .bsfs = bsf_name, \ diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c index 3778fe66c2..b4cf9ea456 100644 --- a/libavcodec/qsvenc_h264.c +++ b/libavcodec/qsvenc_h264.c @@ -184,7 +184,7 @@ const FFCodec ff_h264_qsv_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_H264, .init = qsv_enc_init, - .encode2 = qsv_enc_frame, + FF_CODEC_ENCODE_CB(qsv_enc_frame), .close = qsv_enc_close, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c index 5c1571f62f..36c2d484ad 100644 --- a/libavcodec/qsvenc_hevc.c +++ b/libavcodec/qsvenc_hevc.c @@ -298,7 +298,7 @@ const FFCodec ff_hevc_qsv_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_HEVC, .init = qsv_enc_init, - .encode2 = qsv_enc_frame, + FF_CODEC_ENCODE_CB(qsv_enc_frame), .close = qsv_enc_close, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, diff --git a/libavcodec/qsvenc_jpeg.c b/libavcodec/qsvenc_jpeg.c index 6bae0a0be9..825eb8dc06 100644 --- a/libavcodec/qsvenc_jpeg.c +++ b/libavcodec/qsvenc_jpeg.c @@ -86,7 +86,7 @@ const FFCodec ff_mjpeg_qsv_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MJPEG, .init = qsv_enc_init, - .encode2 = qsv_enc_frame, + FF_CODEC_ENCODE_CB(qsv_enc_frame), .close = qsv_enc_close, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, diff --git a/libavcodec/qsvenc_mpeg2.c b/libavcodec/qsvenc_mpeg2.c index 0ab1412abb..3f79b48cb8 100644 --- a/libavcodec/qsvenc_mpeg2.c +++ b/libavcodec/qsvenc_mpeg2.c @@ -99,7 +99,7 @@ const FFCodec ff_mpeg2_qsv_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_MPEG2VIDEO, .init = qsv_enc_init, - .encode2 = qsv_enc_frame, + FF_CODEC_ENCODE_CB(qsv_enc_frame), .close = qsv_enc_close, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, diff --git a/libavcodec/qsvenc_vp9.c b/libavcodec/qsvenc_vp9.c index 6afbef195d..4b2a6ce77f 100644 --- a/libavcodec/qsvenc_vp9.c +++ b/libavcodec/qsvenc_vp9.c @@ -109,7 +109,7 @@ const FFCodec ff_vp9_qsv_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VP9, .init = qsv_enc_init, - .encode2 = qsv_enc_frame, + FF_CODEC_ENCODE_CB(qsv_enc_frame), .close = qsv_enc_close, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c index b7f114bdec..5e2139cce9 100644 --- a/libavcodec/qtrle.c +++ b/libavcodec/qtrle.c @@ -589,7 +589,7 @@ const FFCodec ff_qtrle_decoder = { .priv_data_size = sizeof(QtrleContext), .init = qtrle_decode_init, .close = qtrle_decode_end, - .decode = qtrle_decode_frame, + FF_CODEC_DECODE_CB(qtrle_decode_frame), .flush = qtrle_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/qtrleenc.c b/libavcodec/qtrleenc.c index 04e98185e5..21c19eda23 100644 --- a/libavcodec/qtrleenc.c +++ b/libavcodec/qtrleenc.c @@ -406,7 +406,7 @@ const FFCodec ff_qtrle_encoder = { .p.id = AV_CODEC_ID_QTRLE, .priv_data_size = sizeof(QtrleEncContext), .init = qtrle_encode_init, - .encode2 = qtrle_encode_frame, + FF_CODEC_ENCODE_CB(qtrle_encode_frame), .close = qtrle_encode_end, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB555BE, AV_PIX_FMT_ARGB, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE diff --git a/libavcodec/r210dec.c b/libavcodec/r210dec.c index da20ffe067..b95f663aa5 100644 --- a/libavcodec/r210dec.c +++ b/libavcodec/r210dec.c @@ -109,7 +109,7 @@ const FFCodec ff_r210_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_R210, .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; @@ -121,7 +121,7 @@ const FFCodec ff_r10k_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_R10K, .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; @@ -133,7 +133,7 @@ const FFCodec ff_avrp_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AVRP, .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/r210enc.c b/libavcodec/r210enc.c index 88bbd4677d..cfff21cb23 100644 --- a/libavcodec/r210enc.c +++ b/libavcodec/r210enc.c @@ -98,7 +98,7 @@ const FFCodec ff_r210_encoder = { .p.id = AV_CODEC_ID_R210, .p.capabilities = AV_CODEC_CAP_DR1, .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = pix_fmt, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; @@ -111,7 +111,7 @@ const FFCodec ff_r10k_encoder = { .p.id = AV_CODEC_ID_R10K, .p.capabilities = AV_CODEC_CAP_DR1, .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = pix_fmt, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; @@ -124,7 +124,7 @@ const FFCodec ff_avrp_encoder = { .p.id = AV_CODEC_ID_AVRP, .p.capabilities = AV_CODEC_CAP_DR1, .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = pix_fmt, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/ra144dec.c b/libavcodec/ra144dec.c index b795e327a2..bef6389bcf 100644 --- a/libavcodec/ra144dec.c +++ b/libavcodec/ra144dec.c @@ -133,7 +133,7 @@ const FFCodec ff_ra_144_decoder = { .p.id = AV_CODEC_ID_RA_144, .priv_data_size = sizeof(RA144Context), .init = ra144_decode_init, - .decode = ra144_decode_frame, + FF_CODEC_DECODE_CB(ra144_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/ra144enc.c b/libavcodec/ra144enc.c index ec65621060..66ac381e60 100644 --- a/libavcodec/ra144enc.c +++ b/libavcodec/ra144enc.c @@ -544,7 +544,7 @@ const FFCodec ff_ra_144_encoder = { AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(RA144Context), .init = ra144_encode_init, - .encode2 = ra144_encode_frame, + FF_CODEC_ENCODE_CB(ra144_encode_frame), .close = ra144_encode_close, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c index f904d471a3..24d976fd92 100644 --- a/libavcodec/ra288.c +++ b/libavcodec/ra288.c @@ -244,7 +244,7 @@ const FFCodec ff_ra_288_decoder = { .p.id = AV_CODEC_ID_RA_288, .priv_data_size = sizeof(RA288Context), .init = ra288_decode_init, - .decode = ra288_decode_frame, + FF_CODEC_DECODE_CB(ra288_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/ralf.c b/libavcodec/ralf.c index 3887c29ee9..16cb524a4e 100644 --- a/libavcodec/ralf.c +++ b/libavcodec/ralf.c @@ -521,7 +521,7 @@ const FFCodec ff_ralf_decoder = { .priv_data_size = sizeof(RALFContext), .init = decode_init, .close = decode_close, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .flush = decode_flush, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, diff --git a/libavcodec/rasc.c b/libavcodec/rasc.c index 6966ada2d0..bcb619f11c 100644 --- a/libavcodec/rasc.c +++ b/libavcodec/rasc.c @@ -805,7 +805,7 @@ const FFCodec ff_rasc_decoder = { .priv_data_size = sizeof(RASCContext), .init = decode_init, .close = decode_close, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .flush = decode_flush, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index 7ed7492337..c10b20d4f9 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -488,7 +488,7 @@ const FFCodec ff_rawvideo_decoder = { .priv_data_size = sizeof(RawVideoContext), .init = raw_init_decoder, .close = raw_close_decoder, - .decode = raw_decode, + FF_CODEC_DECODE_CB(raw_decode), .p.priv_class = &rawdec_class, .p.capabilities = AV_CODEC_CAP_PARAM_CHANGE, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c index 1aa88d9db0..34d7a1bef4 100644 --- a/libavcodec/rawenc.c +++ b/libavcodec/rawenc.c @@ -88,6 +88,6 @@ const FFCodec ff_rawvideo_encoder = { .p.id = AV_CODEC_ID_RAWVIDEO, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .init = raw_encode_init, - .encode2 = raw_encode, + FF_CODEC_ENCODE_CB(raw_encode), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/realtextdec.c b/libavcodec/realtextdec.c index 1612554461..e058b7494d 100644 --- a/libavcodec/realtextdec.c +++ b/libavcodec/realtextdec.c @@ -79,7 +79,7 @@ const FFCodec ff_realtext_decoder = { .p.long_name = NULL_IF_CONFIG_SMALL("RealText subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_REALTEXT, - .decode_sub = realtext_decode_frame, + FF_CODEC_DECODE_SUB_CB(realtext_decode_frame), .init = ff_ass_subtitle_header_default, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), diff --git a/libavcodec/rkmppdec.c b/libavcodec/rkmppdec.c index d5eab14c09..d4f09f456d 100644 --- a/libavcodec/rkmppdec.c +++ b/libavcodec/rkmppdec.c @@ -569,7 +569,7 @@ static const AVCodecHWConfigInternal *const rkmpp_hw_configs[] = { .priv_data_size = sizeof(RKMPPDecodeContext), \ .init = rkmpp_init_decoder, \ .close = rkmpp_close_decoder, \ - .receive_frame = rkmpp_receive_frame, \ + FF_CODEC_RECEIVE_FRAME_CB(rkmpp_receive_frame), \ .flush = rkmpp_flush, \ .p.priv_class = &rkmpp_##NAME##_dec_class, \ .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \ diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c index 37c9bf5d82..e76b068970 100644 --- a/libavcodec/rl2.c +++ b/libavcodec/rl2.c @@ -225,7 +225,7 @@ const FFCodec ff_rl2_decoder = { .priv_data_size = sizeof(Rl2Context), .init = rl2_decode_init, .close = rl2_decode_end, - .decode = rl2_decode_frame, + FF_CODEC_DECODE_CB(rl2_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/roqaudioenc.c b/libavcodec/roqaudioenc.c index c444c2e635..18a5f23df0 100644 --- a/libavcodec/roqaudioenc.c +++ b/libavcodec/roqaudioenc.c @@ -195,7 +195,7 @@ const FFCodec ff_roq_dpcm_encoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .priv_data_size = sizeof(ROQDPCMContext), .init = roq_dpcm_encode_init, - .encode2 = roq_dpcm_encode_frame, + FF_CODEC_ENCODE_CB(roq_dpcm_encode_frame), .close = roq_dpcm_encode_close, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c index 99aa1ce24c..3e796b18bc 100644 --- a/libavcodec/roqvideodec.c +++ b/libavcodec/roqvideodec.c @@ -241,7 +241,7 @@ const FFCodec ff_roq_decoder = { .priv_data_size = sizeof(RoqContext), .init = roq_decode_init, .close = roq_decode_end, - .decode = roq_decode_frame, + FF_CODEC_DECODE_CB(roq_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c index ef7861088d..8cdc9f389c 100644 --- a/libavcodec/roqvideoenc.c +++ b/libavcodec/roqvideoenc.c @@ -1125,7 +1125,7 @@ const FFCodec ff_roq_encoder = { .p.id = AV_CODEC_ID_ROQ, .priv_data_size = sizeof(RoqEncContext), .init = roq_encode_init, - .encode2 = roq_encode_frame, + FF_CODEC_ENCODE_CB(roq_encode_frame), .close = roq_encode_end, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_NONE }, diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c index 4482dfc8c8..703f05e7b8 100644 --- a/libavcodec/rpza.c +++ b/libavcodec/rpza.c @@ -294,7 +294,7 @@ const FFCodec ff_rpza_decoder = { .priv_data_size = sizeof(RpzaContext), .init = rpza_decode_init, .close = rpza_decode_end, - .decode = rpza_decode_frame, + FF_CODEC_DECODE_CB(rpza_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/rpzaenc.c b/libavcodec/rpzaenc.c index c4c3843f1c..50b68bb8b3 100644 --- a/libavcodec/rpzaenc.c +++ b/libavcodec/rpzaenc.c @@ -851,7 +851,7 @@ const FFCodec ff_rpza_encoder = { .priv_data_size = sizeof(RpzaContext), .p.priv_class = &rpza_class, .init = rpza_encode_init, - .encode2 = rpza_encode_frame, + FF_CODEC_ENCODE_CB(rpza_encode_frame), .close = rpza_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB555, diff --git a/libavcodec/rscc.c b/libavcodec/rscc.c index 3891cf24e4..f4fa786718 100644 --- a/libavcodec/rscc.c +++ b/libavcodec/rscc.c @@ -368,7 +368,7 @@ const FFCodec ff_rscc_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_RSCC, .init = rscc_init, - .decode = rscc_decode_frame, + FF_CODEC_DECODE_CB(rscc_decode_frame), .close = rscc_close, .priv_data_size = sizeof(RsccContext), .p.capabilities = AV_CODEC_CAP_DR1, diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 8c2188bc05..8f8a755ac3 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -689,7 +689,7 @@ const FFCodec ff_rv10_decoder = { .priv_data_size = sizeof(RVDecContext), .init = rv10_decode_init, .close = rv10_decode_end, - .decode = rv10_decode_frame, + FF_CODEC_DECODE_CB(rv10_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .p.max_lowres = 3, @@ -707,7 +707,7 @@ const FFCodec ff_rv20_decoder = { .priv_data_size = sizeof(RVDecContext), .init = rv10_decode_init, .close = rv10_decode_end, - .decode = rv10_decode_frame, + FF_CODEC_DECODE_CB(rv10_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .flush = ff_mpeg_flush, diff --git a/libavcodec/rv10enc.c b/libavcodec/rv10enc.c index 8df8f0a060..7560e6026a 100644 --- a/libavcodec/rv10enc.c +++ b/libavcodec/rv10enc.c @@ -73,7 +73,7 @@ const FFCodec ff_rv10_encoder = { .p.priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, - .encode2 = ff_mpv_encode_picture, + FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, diff --git a/libavcodec/rv20enc.c b/libavcodec/rv20enc.c index 916f505ecc..422188e21a 100644 --- a/libavcodec/rv20enc.c +++ b/libavcodec/rv20enc.c @@ -70,7 +70,7 @@ const FFCodec ff_rv20_encoder = { .p.priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, - .encode2 = ff_mpv_encode_picture, + FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, diff --git a/libavcodec/rv30.c b/libavcodec/rv30.c index 7d5e1acc97..8fd8498d9a 100644 --- a/libavcodec/rv30.c +++ b/libavcodec/rv30.c @@ -299,7 +299,7 @@ const FFCodec ff_rv30_decoder = { .priv_data_size = sizeof(RV34DecContext), .init = rv30_decode_init, .close = ff_rv34_decode_end, - .decode = ff_rv34_decode_frame, + FF_CODEC_DECODE_CB(ff_rv34_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_FRAME_THREADS, .flush = ff_mpeg_flush, diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c index b95f0d7919..b15f3cddfc 100644 --- a/libavcodec/rv40.c +++ b/libavcodec/rv40.c @@ -582,7 +582,7 @@ const FFCodec ff_rv40_decoder = { .priv_data_size = sizeof(RV34DecContext), .init = rv40_decode_init, .close = ff_rv34_decode_end, - .decode = ff_rv34_decode_frame, + FF_CODEC_DECODE_CB(ff_rv34_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_FRAME_THREADS, .flush = ff_mpeg_flush, diff --git a/libavcodec/s302m.c b/libavcodec/s302m.c index 68533be6c6..fb7b6e240b 100644 --- a/libavcodec/s302m.c +++ b/libavcodec/s302m.c @@ -234,7 +234,7 @@ const FFCodec ff_s302m_decoder = { .p.id = AV_CODEC_ID_S302M, .p.priv_class = &s302m_class, .priv_data_size = sizeof(S302Context), - .decode = s302m_decode_frame, + FF_CODEC_DECODE_CB(s302m_decode_frame), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/s302menc.c b/libavcodec/s302menc.c index 737fc94697..b6f9501bf2 100644 --- a/libavcodec/s302menc.c +++ b/libavcodec/s302menc.c @@ -179,7 +179,7 @@ const FFCodec ff_s302m_encoder = { AV_CODEC_CAP_VARIABLE_FRAME_SIZE, .priv_data_size = sizeof(S302MEncContext), .init = s302m_encode_init, - .encode2 = s302m_encode2_frame, + FF_CODEC_ENCODE_CB(s302m_encode2_frame), .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/samidec.c b/libavcodec/samidec.c index f2cf5783af..b9f6128a3e 100644 --- a/libavcodec/samidec.c +++ b/libavcodec/samidec.c @@ -188,7 +188,7 @@ const FFCodec ff_sami_decoder = { .priv_data_size = sizeof(SAMIContext), .init = sami_init, .close = sami_close, - .decode_sub = sami_decode_frame, + FF_CODEC_DECODE_SUB_CB(sami_decode_frame), .flush = sami_flush, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index b5e12fccc1..7f094c8bbf 100644 --- a/libavcodec/sanm.c +++ b/libavcodec/sanm.c @@ -1524,7 +1524,7 @@ const FFCodec ff_sanm_decoder = { .priv_data_size = sizeof(SANMVideoContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/sbcdec.c b/libavcodec/sbcdec.c index 6b79136fac..99af7e1652 100644 --- a/libavcodec/sbcdec.c +++ b/libavcodec/sbcdec.c @@ -372,7 +372,7 @@ const FFCodec ff_sbc_decoder = { .p.id = AV_CODEC_ID_SBC, .priv_data_size = sizeof(SBCDecContext), .init = sbc_decode_init, - .decode = sbc_decode_frame, + FF_CODEC_DECODE_CB(sbc_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, #if FF_API_OLD_CHANNEL_LAYOUT diff --git a/libavcodec/sbcenc.c b/libavcodec/sbcenc.c index db1370f1c7..18ac4fb9bd 100644 --- a/libavcodec/sbcenc.c +++ b/libavcodec/sbcenc.c @@ -351,7 +351,7 @@ const FFCodec ff_sbc_encoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(SBCEncContext), .init = sbc_encode_init, - .encode2 = sbc_encode_frame, + FF_CODEC_ENCODE_CB(sbc_encode_frame), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, #if FF_API_OLD_CHANNEL_LAYOUT .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c index c744db2539..0623b73c84 100644 --- a/libavcodec/scpr.c +++ b/libavcodec/scpr.c @@ -675,7 +675,7 @@ const FFCodec ff_scpr_decoder = { .priv_data_size = sizeof(SCPRContext), .init = decode_init, .close = decode_close, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/screenpresso.c b/libavcodec/screenpresso.c index b2b71a00b3..8a4a8cde9e 100644 --- a/libavcodec/screenpresso.c +++ b/libavcodec/screenpresso.c @@ -189,7 +189,7 @@ const FFCodec ff_screenpresso_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SCREENPRESSO, .init = screenpresso_init, - .decode = screenpresso_decode_frame, + FF_CODEC_DECODE_CB(screenpresso_decode_frame), .close = screenpresso_close, .priv_data_size = sizeof(ScreenpressoContext), .p.capabilities = AV_CODEC_CAP_DR1, diff --git a/libavcodec/sga.c b/libavcodec/sga.c index cb6d8db3f4..cdd37feb70 100644 --- a/libavcodec/sga.c +++ b/libavcodec/sga.c @@ -526,7 +526,7 @@ const FFCodec ff_sga_decoder = { .p.id = AV_CODEC_ID_SGA_VIDEO, .priv_data_size = sizeof(SGAVideoContext), .init = sga_decode_init, - .decode = sga_decode_frame, + FF_CODEC_DECODE_CB(sga_decode_frame), .close = sga_decode_end, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c index a0669590ed..b23e205c3b 100644 --- a/libavcodec/sgidec.c +++ b/libavcodec/sgidec.c @@ -292,7 +292,7 @@ const FFCodec ff_sgi_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SGI, .priv_data_size = sizeof(SgiState), - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .init = sgi_decode_init, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/sgienc.c b/libavcodec/sgienc.c index 8a3c1ddde1..93cb95f07f 100644 --- a/libavcodec/sgienc.c +++ b/libavcodec/sgienc.c @@ -278,7 +278,7 @@ const FFCodec ff_sgi_encoder = { .priv_data_size = sizeof(SgiContext), .p.priv_class = &sgi_class, .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48LE, AV_PIX_FMT_RGB48BE, diff --git a/libavcodec/sgirledec.c b/libavcodec/sgirledec.c index 8e00fdf183..e04b9b1cad 100644 --- a/libavcodec/sgirledec.c +++ b/libavcodec/sgirledec.c @@ -137,7 +137,7 @@ const FFCodec ff_sgirle_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SGIRLE, .init = sgirle_decode_init, - .decode = sgirle_decode_frame, + FF_CODEC_DECODE_CB(sgirle_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/sheervideo.c b/libavcodec/sheervideo.c index ecde9e1637..327bf85eda 100644 --- a/libavcodec/sheervideo.c +++ b/libavcodec/sheervideo.c @@ -2006,5 +2006,5 @@ const FFCodec ff_sheervideo_decoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .priv_data_size = sizeof(SheerVideoContext), .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), }; diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index 96dec88191..27074e930d 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -811,7 +811,7 @@ const FFCodec ff_shorten_decoder = { .priv_data_size = sizeof(ShortenContext), .init = shorten_decode_init, .close = shorten_decode_close, - .decode = shorten_decode_frame, + FF_CODEC_DECODE_CB(shorten_decode_frame), .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | diff --git a/libavcodec/sipr.c b/libavcodec/sipr.c index dde39f154a..9d11f2c5c6 100644 --- a/libavcodec/sipr.c +++ b/libavcodec/sipr.c @@ -569,7 +569,7 @@ const FFCodec ff_sipr_decoder = { .p.id = AV_CODEC_ID_SIPR, .priv_data_size = sizeof(SiprContext), .init = sipr_decoder_init, - .decode = sipr_decode_frame, + FF_CODEC_DECODE_CB(sipr_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/siren.c b/libavcodec/siren.c index 70e8267dad..b613ee113d 100644 --- a/libavcodec/siren.c +++ b/libavcodec/siren.c @@ -849,7 +849,7 @@ const FFCodec ff_siren_decoder = { .p.id = AV_CODEC_ID_SIREN, .init = siren_init, .close = siren_close, - .decode = siren_decode, + FF_CODEC_DECODE_CB(siren_decode), .flush = siren_flush, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, @@ -865,7 +865,7 @@ const FFCodec ff_msnsiren_decoder = { .p.id = AV_CODEC_ID_MSNSIREN, .init = siren_init, .close = siren_close, - .decode = siren_decode, + FF_CODEC_DECODE_CB(siren_decode), .flush = siren_flush, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index 1ef2161dbb..179c70f1ee 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -730,7 +730,7 @@ const FFCodec ff_smacker_decoder = { .priv_data_size = sizeof(SmackVContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; @@ -741,7 +741,7 @@ const FFCodec ff_smackaud_decoder = { .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_SMACKAUDIO, .init = smka_decode_init, - .decode = smka_decode_frame, + FF_CODEC_DECODE_CB(smka_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/smc.c b/libavcodec/smc.c index 2f87937c49..313d8edba6 100644 --- a/libavcodec/smc.c +++ b/libavcodec/smc.c @@ -476,7 +476,7 @@ const FFCodec ff_smc_decoder = { .priv_data_size = sizeof(SmcContext), .init = smc_decode_init, .close = smc_decode_end, - .decode = smc_decode_frame, + FF_CODEC_DECODE_CB(smc_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/smcenc.c b/libavcodec/smcenc.c index a9f6c483a7..e1137098d0 100644 --- a/libavcodec/smcenc.c +++ b/libavcodec/smcenc.c @@ -555,7 +555,7 @@ const FFCodec ff_smc_encoder = { .p.id = AV_CODEC_ID_SMC, .priv_data_size = sizeof(SMCContext), .init = smc_encode_init, - .encode2 = smc_encode_frame, + FF_CODEC_ENCODE_CB(smc_encode_frame), .close = smc_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_PAL8, diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c index 4208707da0..92ff87731c 100644 --- a/libavcodec/snowdec.c +++ b/libavcodec/snowdec.c @@ -661,7 +661,7 @@ const FFCodec ff_snow_decoder = { .priv_data_size = sizeof(SnowContext), .init = ff_snow_common_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index b5a5e57a91..410aa0f0e5 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -1919,7 +1919,7 @@ const FFCodec ff_snow_encoder = { .p.id = AV_CODEC_ID_SNOW, .priv_data_size = sizeof(SnowContext), .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .close = encode_end, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV444P, diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index f20365485d..dfb055d80e 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -1084,7 +1084,7 @@ const FFCodec ff_sonic_decoder = { .priv_data_size = sizeof(SonicContext), .init = sonic_decode_init, .close = sonic_decode_close, - .decode = sonic_decode_frame, + FF_CODEC_DECODE_CB(sonic_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; @@ -1098,7 +1098,7 @@ const FFCodec ff_sonic_encoder = { .p.id = AV_CODEC_ID_SONIC, .priv_data_size = sizeof(SonicContext), .init = sonic_encode_init, - .encode2 = sonic_encode_frame, + FF_CODEC_ENCODE_CB(sonic_encode_frame), .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.capabilities = AV_CODEC_CAP_EXPERIMENTAL, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, @@ -1114,7 +1114,7 @@ const FFCodec ff_sonic_ls_encoder = { .p.id = AV_CODEC_ID_SONIC_LS, .priv_data_size = sizeof(SonicContext), .init = sonic_encode_init, - .encode2 = sonic_encode_frame, + FF_CODEC_ENCODE_CB(sonic_encode_frame), .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.capabilities = AV_CODEC_CAP_EXPERIMENTAL, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/sp5xdec.c b/libavcodec/sp5xdec.c index 99647efa52..aa4d3d771b 100644 --- a/libavcodec/sp5xdec.c +++ b/libavcodec/sp5xdec.c @@ -100,7 +100,7 @@ const FFCodec ff_sp5x_decoder = { .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, - .receive_frame = ff_mjpeg_receive_frame, + FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame), .p.capabilities = AV_CODEC_CAP_DR1, .p.max_lowres = 3, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | @@ -116,7 +116,7 @@ const FFCodec ff_amv_decoder = { .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, - .receive_frame = ff_mjpeg_receive_frame, + FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame), .p.max_lowres = 3, .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c index fbe2d584d0..4cfd4ce73d 100644 --- a/libavcodec/speedhq.c +++ b/libavcodec/speedhq.c @@ -731,7 +731,7 @@ const FFCodec ff_speedhq_decoder = { .p.id = AV_CODEC_ID_SPEEDHQ, .priv_data_size = sizeof(SHQContext), .init = speedhq_decode_init, - .decode = speedhq_decode_frame, + FF_CODEC_DECODE_CB(speedhq_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c index 22213b823d..55b378abce 100644 --- a/libavcodec/speedhqenc.c +++ b/libavcodec/speedhqenc.c @@ -278,7 +278,7 @@ const FFCodec ff_speedhq_encoder = { .p.priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, - .encode2 = ff_mpv_encode_picture, + FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]) { diff --git a/libavcodec/speexdec.c b/libavcodec/speexdec.c index 28a6b67a66..3251eda820 100644 --- a/libavcodec/speexdec.c +++ b/libavcodec/speexdec.c @@ -1582,7 +1582,7 @@ const FFCodec ff_speex_decoder = { .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_SPEEX, .init = speex_decode_init, - .decode = speex_decode_frame, + FF_CODEC_DECODE_CB(speex_decode_frame), .close = speex_decode_close, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .priv_data_size = sizeof(SpeexContext), diff --git a/libavcodec/srtdec.c b/libavcodec/srtdec.c index aa975d16c7..705df007d6 100644 --- a/libavcodec/srtdec.c +++ b/libavcodec/srtdec.c @@ -96,7 +96,7 @@ const FFCodec ff_srt_decoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_SUBRIP, .init = ff_ass_subtitle_header_default, - .decode_sub = srt_decode_frame, + FF_CODEC_DECODE_SUB_CB(srt_decode_frame), .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, @@ -110,7 +110,7 @@ const FFCodec ff_subrip_decoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_SUBRIP, .init = ff_ass_subtitle_header_default, - .decode_sub = srt_decode_frame, + FF_CODEC_DECODE_SUB_CB(srt_decode_frame), .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/srtenc.c b/libavcodec/srtenc.c index 8ff799b684..51456c8b9d 100644 --- a/libavcodec/srtenc.c +++ b/libavcodec/srtenc.c @@ -300,7 +300,7 @@ const FFCodec ff_srt_encoder = { .p.id = AV_CODEC_ID_SUBRIP, .priv_data_size = sizeof(SRTContext), .init = srt_encode_init, - .encode_sub = srt_encode_frame, + FF_CODEC_ENCODE_SUB_CB(srt_encode_frame), .close = srt_encode_close, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; @@ -314,7 +314,7 @@ const FFCodec ff_subrip_encoder = { .p.id = AV_CODEC_ID_SUBRIP, .priv_data_size = sizeof(SRTContext), .init = srt_encode_init, - .encode_sub = srt_encode_frame, + FF_CODEC_ENCODE_SUB_CB(srt_encode_frame), .close = srt_encode_close, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; @@ -328,7 +328,7 @@ const FFCodec ff_text_encoder = { .p.id = AV_CODEC_ID_TEXT, .priv_data_size = sizeof(SRTContext), .init = srt_encode_init, - .encode_sub = text_encode_frame, + FF_CODEC_ENCODE_SUB_CB(text_encode_frame), .close = srt_encode_close, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/subviewerdec.c b/libavcodec/subviewerdec.c index 9001dd3d45..b6acea93f5 100644 --- a/libavcodec/subviewerdec.c +++ b/libavcodec/subviewerdec.c @@ -70,7 +70,7 @@ const FFCodec ff_subviewer_decoder = { .p.long_name = NULL_IF_CONFIG_SMALL("SubViewer subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_SUBVIEWER, - .decode_sub = subviewer_decode_frame, + FF_CODEC_DECODE_SUB_CB(subviewer_decode_frame), .init = ff_ass_subtitle_header_default, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), diff --git a/libavcodec/sunrast.c b/libavcodec/sunrast.c index 65b4f359b2..e543757a39 100644 --- a/libavcodec/sunrast.c +++ b/libavcodec/sunrast.c @@ -211,5 +211,5 @@ const FFCodec ff_sunrast_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_SUNRAST, .p.capabilities = AV_CODEC_CAP_DR1, - .decode = sunrast_decode_frame, + FF_CODEC_DECODE_CB(sunrast_decode_frame), }; diff --git a/libavcodec/sunrastenc.c b/libavcodec/sunrastenc.c index acc609c3b6..6245e592c7 100644 --- a/libavcodec/sunrastenc.c +++ b/libavcodec/sunrastenc.c @@ -215,7 +215,7 @@ const FFCodec ff_sunrast_encoder = { .p.id = AV_CODEC_ID_SUNRAST, .priv_data_size = sizeof(SUNRASTContext), .init = sunrast_encode_init, - .encode2 = sunrast_encode_frame, + FF_CODEC_ENCODE_CB(sunrast_encode_frame), .p.priv_class = &sunrast_class, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_PAL8, diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c index e0a599bb36..7cd623ff18 100644 --- a/libavcodec/svq1dec.c +++ b/libavcodec/svq1dec.c @@ -851,7 +851,7 @@ const FFCodec ff_svq1_decoder = { .priv_data_size = sizeof(SVQ1Context), .init = svq1_decode_init, .close = svq1_decode_end, - .decode = svq1_decode_frame, + FF_CODEC_DECODE_CB(svq1_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .flush = svq1_flush, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV410P, diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c index 706bc2e42e..a0205e8bb7 100644 --- a/libavcodec/svq1enc.c +++ b/libavcodec/svq1enc.c @@ -684,7 +684,7 @@ const FFCodec ff_svq1_encoder = { .priv_data_size = sizeof(SVQ1EncContext), .p.priv_class = &svq1enc_class, .init = svq1_encode_init, - .encode2 = svq1_encode_frame, + FF_CODEC_ENCODE_CB(svq1_encode_frame), .close = svq1_encode_end, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV410P, AV_PIX_FMT_NONE }, diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 69949b7e63..f038466922 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -1596,7 +1596,7 @@ const FFCodec ff_svq3_decoder = { .priv_data_size = sizeof(SVQ3Context), .init = svq3_decode_init, .close = svq3_decode_end, - .decode = svq3_decode_frame, + FF_CODEC_DECODE_CB(svq3_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c index 0ef42adc81..47978fcd4b 100644 --- a/libavcodec/takdec.c +++ b/libavcodec/takdec.c @@ -949,7 +949,7 @@ const FFCodec ff_tak_decoder = { .priv_data_size = sizeof(TAKDecContext), .init = tak_decode_init, .close = tak_decode_close, - .decode = tak_decode_frame, + FF_CODEC_DECODE_CB(tak_decode_frame), .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, diff --git a/libavcodec/targa.c b/libavcodec/targa.c index d6c46f8dce..833576c6b3 100644 --- a/libavcodec/targa.c +++ b/libavcodec/targa.c @@ -312,5 +312,5 @@ const FFCodec ff_targa_decoder = { .p.id = AV_CODEC_ID_TARGA, .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(TargaContext), - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), }; diff --git a/libavcodec/targa_y216dec.c b/libavcodec/targa_y216dec.c index c6339ab92a..bf33dc8a68 100644 --- a/libavcodec/targa_y216dec.c +++ b/libavcodec/targa_y216dec.c @@ -79,7 +79,7 @@ const FFCodec ff_targa_y216_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TARGA_Y216, .init = y216_decode_init, - .decode = y216_decode_frame, + FF_CODEC_DECODE_CB(y216_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/targaenc.c b/libavcodec/targaenc.c index 9170eff956..84e2086869 100644 --- a/libavcodec/targaenc.c +++ b/libavcodec/targaenc.c @@ -210,7 +210,7 @@ const FFCodec ff_targa_encoder = { .priv_data_size = sizeof(TargaContext), .p.priv_class = &targa_class, .init = targa_encode_init, - .encode2 = targa_encode_frame, + FF_CODEC_ENCODE_CB(targa_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_BGRA, AV_PIX_FMT_RGB555LE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE diff --git a/libavcodec/tdsc.c b/libavcodec/tdsc.c index 701cd8b9ad..0cf17d75dd 100644 --- a/libavcodec/tdsc.c +++ b/libavcodec/tdsc.c @@ -627,7 +627,7 @@ const FFCodec ff_tdsc_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TDSC, .init = tdsc_init, - .decode = tdsc_decode_frame, + FF_CODEC_DECODE_CB(tdsc_decode_frame), .close = tdsc_close, .priv_data_size = sizeof(TDSCContext), .p.capabilities = AV_CODEC_CAP_DR1, diff --git a/libavcodec/tests/avcodec.c b/libavcodec/tests/avcodec.c index f77d7aebe9..08b5fbede1 100644 --- a/libavcodec/tests/avcodec.c +++ b/libavcodec/tests/avcodec.c @@ -64,7 +64,7 @@ int main(void){ while (codec = av_codec_iterate(&iter)) { const FFCodec *const codec2 = ffcodec(codec); const AVCodecDescriptor *desc; - int is_decoder, is_encoder; + int is_decoder = 0, is_encoder = 0; if (!codec->name) { AV_LOG("Codec for format %s has no name\n", @@ -102,17 +102,38 @@ int main(void){ AV_CODEC_CAP_OTHER_THREADS))) ERR("Codec %s has private-only threading support\n"); - is_decoder = av_codec_is_decoder(codec); - is_encoder = av_codec_is_encoder(codec); - if (!!is_decoder + !!is_encoder != 1) { - ERR("Codec %s is decoder and encoder or neither.\n"); + switch (codec2->cb_type) { + case FF_CODEC_CB_TYPE_DECODE: + case FF_CODEC_CB_TYPE_DECODE_SUB: + case FF_CODEC_CB_TYPE_RECEIVE_FRAME: + is_decoder = 1; + break; + case FF_CODEC_CB_TYPE_ENCODE: + case FF_CODEC_CB_TYPE_ENCODE_SUB: + case FF_CODEC_CB_TYPE_RECEIVE_PACKET: + is_encoder = 1; + break; + default: + ERR("Codec %s has unknown cb_type\n"); continue; } + if (is_decoder != av_codec_is_decoder(codec) || + is_encoder != av_codec_is_encoder(codec)) { + ERR("Codec %s cb_type and av_codec_is_(de|en)coder inconsistent.\n"); + continue; + } +#define CHECK(TYPE, type) (codec2->cb_type == FF_CODEC_CB_TYPE_ ## TYPE && !codec2->cb.type) + if (CHECK(DECODE, decode) || CHECK(DECODE_SUB, decode_sub) || + CHECK(RECEIVE_PACKET, receive_packet) || + CHECK(ENCODE, encode) || CHECK(ENCODE_SUB, encode_sub) || + CHECK(RECEIVE_FRAME, receive_frame)) { + ERR_EXT("Codec %s does not implement its %s callback.\n", + is_decoder ? "decoding" : "encoding"); + } +#undef CHECK if (is_encoder) { - if (codec->type == AVMEDIA_TYPE_SUBTITLE ^ !!codec2->encode_sub) + if ((codec->type == AVMEDIA_TYPE_SUBTITLE) != (codec2->cb_type == FF_CODEC_CB_TYPE_ENCODE_SUB)) ERR("Encoder %s is both subtitle encoder and not subtitle encoder."); - if (!!codec2->encode_sub + !!codec2->encode2 + !!codec2->receive_packet != 1) - ERR("Encoder %s does not implement exactly one encode API.\n"); if (codec2->update_thread_context || codec2->update_thread_context_for_user || codec2->bsfs) ERR("Encoder %s has decoder-only thread functions or bsf.\n"); if (codec->type == AVMEDIA_TYPE_AUDIO) { @@ -135,14 +156,11 @@ int main(void){ codec->capabilities & AV_CODEC_CAP_ENCODER_FLUSH) ERR("Frame-threaded encoder %s claims to support flushing\n"); } else { - if (codec->type == AVMEDIA_TYPE_SUBTITLE && !codec2->decode_sub) + if ((codec->type == AVMEDIA_TYPE_SUBTITLE) != (codec2->cb_type == FF_CODEC_CB_TYPE_DECODE_SUB)) ERR("Subtitle decoder %s does not implement decode_sub callback\n"); if (codec->type == AVMEDIA_TYPE_SUBTITLE && codec2->bsfs) ERR("Automatic bitstream filtering unsupported for subtitles; " "yet decoder %s has it set\n"); - if (codec->type != AVMEDIA_TYPE_SUBTITLE != - !!codec2->decode + !!codec2->receive_frame) - ERR("Decoder %s does not implement exactly one decode API.\n"); if (codec->capabilities & (AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_VARIABLE_FRAME_SIZE | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE | diff --git a/libavcodec/textdec.c b/libavcodec/textdec.c index 48e7e14602..09de0ad8fd 100644 --- a/libavcodec/textdec.c +++ b/libavcodec/textdec.c @@ -86,7 +86,7 @@ const FFCodec ff_text_decoder = { .priv_data_size = sizeof(TextContext), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_TEXT, - .decode_sub = text_decode_frame, + FF_CODEC_DECODE_SUB_CB(text_decode_frame), .init = ff_ass_subtitle_header_default, .p.priv_class = &textsub_decoder_class, .flush = text_flush, @@ -110,7 +110,7 @@ const FFCodec ff_vplayer_decoder = { .priv_data_size = sizeof(TextContext), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_VPLAYER, - .decode_sub = text_decode_frame, + FF_CODEC_DECODE_SUB_CB(text_decode_frame), .init = linebreak_init, .p.priv_class = &textsub_decoder_class, .flush = text_flush, @@ -125,7 +125,7 @@ const FFCodec ff_stl_decoder = { .priv_data_size = sizeof(TextContext), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_STL, - .decode_sub = text_decode_frame, + FF_CODEC_DECODE_SUB_CB(text_decode_frame), .init = linebreak_init, .p.priv_class = &textsub_decoder_class, .flush = text_flush, @@ -140,7 +140,7 @@ const FFCodec ff_pjs_decoder = { .priv_data_size = sizeof(TextContext), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_PJS, - .decode_sub = text_decode_frame, + FF_CODEC_DECODE_SUB_CB(text_decode_frame), .init = linebreak_init, .p.priv_class = &textsub_decoder_class, .flush = text_flush, @@ -155,7 +155,7 @@ const FFCodec ff_subviewer1_decoder = { .priv_data_size = sizeof(TextContext), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_SUBVIEWER1, - .decode_sub = text_decode_frame, + FF_CODEC_DECODE_SUB_CB(text_decode_frame), .init = linebreak_init, .p.priv_class = &textsub_decoder_class, .flush = text_flush, diff --git a/libavcodec/tiertexseqv.c b/libavcodec/tiertexseqv.c index 06d9c39880..618275a57c 100644 --- a/libavcodec/tiertexseqv.c +++ b/libavcodec/tiertexseqv.c @@ -269,7 +269,7 @@ const FFCodec ff_tiertexseqvideo_decoder = { .priv_data_size = sizeof(SeqVideoContext), .init = seqvideo_decode_init, .close = seqvideo_decode_end, - .decode = seqvideo_decode_frame, + FF_CODEC_DECODE_CB(seqvideo_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 3d5b3c28ac..e4a5d3c537 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -2185,7 +2185,7 @@ const FFCodec ff_tiff_decoder = { .priv_data_size = sizeof(TiffContext), .init = tiff_init, .close = tiff_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .p.priv_class = &tiff_decoder_class, diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 17ff542354..2f2742e566 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -578,7 +578,7 @@ const FFCodec ff_tiff_encoder = { .init = encode_init, .close = encode_close, .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48LE, AV_PIX_FMT_PAL8, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGBA64LE, diff --git a/libavcodec/tmv.c b/libavcodec/tmv.c index 263a63aa55..d1685a0ae7 100644 --- a/libavcodec/tmv.c +++ b/libavcodec/tmv.c @@ -92,7 +92,7 @@ const FFCodec ff_tmv_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TMV, .init = tmv_decode_init, - .decode = tmv_decode_frame, + FF_CODEC_DECODE_CB(tmv_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c index 7ef025b43e..64d9b8fed1 100644 --- a/libavcodec/truemotion1.c +++ b/libavcodec/truemotion1.c @@ -918,7 +918,7 @@ const FFCodec ff_truemotion1_decoder = { .priv_data_size = sizeof(TrueMotion1Context), .init = truemotion1_decode_init, .close = truemotion1_decode_end, - .decode = truemotion1_decode_frame, + FF_CODEC_DECODE_CB(truemotion1_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c index a89f999ce5..3fd956ee1e 100644 --- a/libavcodec/truemotion2.c +++ b/libavcodec/truemotion2.c @@ -1016,7 +1016,7 @@ const FFCodec ff_truemotion2_decoder = { .priv_data_size = sizeof(TM2Context), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/truemotion2rt.c b/libavcodec/truemotion2rt.c index 0383cb090f..a3686fc1ac 100644 --- a/libavcodec/truemotion2rt.c +++ b/libavcodec/truemotion2rt.c @@ -226,7 +226,7 @@ const FFCodec ff_truemotion2rt_decoder = { .p.id = AV_CODEC_ID_TRUEMOTION2RT, .priv_data_size = sizeof(TrueMotion2RTContext), .init = truemotion2rt_decode_init, - .decode = truemotion2rt_decode_frame, + FF_CODEC_DECODE_CB(truemotion2rt_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c index a8bf43d2a4..e472cb8241 100644 --- a/libavcodec/truespeech.c +++ b/libavcodec/truespeech.c @@ -363,7 +363,7 @@ const FFCodec ff_truespeech_decoder = { .p.id = AV_CODEC_ID_TRUESPEECH, .priv_data_size = sizeof(TSContext), .init = truespeech_decode_init, - .decode = truespeech_decode_frame, + FF_CODEC_DECODE_CB(truespeech_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c index a841fd2c9d..7343d7aace 100644 --- a/libavcodec/tscc.c +++ b/libavcodec/tscc.c @@ -178,7 +178,7 @@ const FFCodec ff_tscc_decoder = { .priv_data_size = sizeof(CamtasiaContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c index 6879f42cd9..136f1f76d9 100644 --- a/libavcodec/tscc2.c +++ b/libavcodec/tscc2.c @@ -364,7 +364,7 @@ const FFCodec ff_tscc2_decoder = { .priv_data_size = sizeof(TSCC2Context), .init = tscc2_decode_init, .close = tscc2_decode_end, - .decode = tscc2_decode_frame, + FF_CODEC_DECODE_CB(tscc2_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/tta.c b/libavcodec/tta.c index 506a61b881..74be140d51 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -428,7 +428,7 @@ const FFCodec ff_tta_decoder = { .priv_data_size = sizeof(TTAContext), .init = tta_decode_init, .close = tta_decode_close, - .decode = tta_decode_frame, + FF_CODEC_DECODE_CB(tta_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF, .p.priv_class = &tta_decoder_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/ttaenc.c b/libavcodec/ttaenc.c index b52cb21d2c..b7d4aafdc3 100644 --- a/libavcodec/ttaenc.c +++ b/libavcodec/ttaenc.c @@ -210,7 +210,7 @@ const FFCodec ff_tta_encoder = { .priv_data_size = sizeof(TTAEncContext), .init = tta_encode_init, .close = tta_encode_close, - .encode2 = tta_encode_frame, + FF_CODEC_ENCODE_CB(tta_encode_frame), .p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S16, diff --git a/libavcodec/ttmlenc.c b/libavcodec/ttmlenc.c index 98a36caf5c..be1d8fb2e8 100644 --- a/libavcodec/ttmlenc.c +++ b/libavcodec/ttmlenc.c @@ -390,7 +390,7 @@ const FFCodec ff_ttml_encoder = { .p.id = AV_CODEC_ID_TTML, .priv_data_size = sizeof(TTMLContext), .init = ttml_encode_init, - .encode_sub = ttml_encode_frame, + FF_CODEC_ENCODE_SUB_CB(ttml_encode_frame), .close = ttml_encode_close, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/twinvqdec.c b/libavcodec/twinvqdec.c index 7f0eeb0bfb..6dfa57f007 100644 --- a/libavcodec/twinvqdec.c +++ b/libavcodec/twinvqdec.c @@ -422,7 +422,7 @@ const FFCodec ff_twinvq_decoder = { .priv_data_size = sizeof(TwinVQContext), .init = twinvq_decode_init, .close = ff_twinvq_decode_close, - .decode = ff_twinvq_decode_frame, + FF_CODEC_DECODE_CB(ff_twinvq_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/txd.c b/libavcodec/txd.c index 854ef1522d..8b1da773a3 100644 --- a/libavcodec/txd.c +++ b/libavcodec/txd.c @@ -170,5 +170,5 @@ const FFCodec ff_txd_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TXD, .p.capabilities = AV_CODEC_CAP_DR1, - .decode = txd_decode_frame, + FF_CODEC_DECODE_CB(txd_decode_frame), }; diff --git a/libavcodec/ulti.c b/libavcodec/ulti.c index c5be1dffda..a8bec9cce2 100644 --- a/libavcodec/ulti.c +++ b/libavcodec/ulti.c @@ -426,7 +426,7 @@ const FFCodec ff_ulti_decoder = { .priv_data_size = sizeof(UltimotionDecodeContext), .init = ulti_decode_init, .close = ulti_decode_end, - .decode = ulti_decode_frame, + FF_CODEC_DECODE_CB(ulti_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 34d97022b7..eb7e505a62 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -74,13 +74,17 @@ void av_fast_padded_mallocz(void *ptr, unsigned int *size, size_t min_size) int av_codec_is_encoder(const AVCodec *avcodec) { const FFCodec *const codec = ffcodec(avcodec); - return codec && (codec->encode_sub || codec->encode2 || codec->receive_packet); + return codec && (codec->cb_type == FF_CODEC_CB_TYPE_ENCODE || + codec->cb_type == FF_CODEC_CB_TYPE_ENCODE_SUB || + codec->cb_type == FF_CODEC_CB_TYPE_RECEIVE_PACKET); } int av_codec_is_decoder(const AVCodec *avcodec) { const FFCodec *const codec = ffcodec(avcodec); - return codec && (codec->decode || codec->decode_sub || codec->receive_frame); + return codec && (codec->cb_type == FF_CODEC_CB_TYPE_DECODE || + codec->cb_type == FF_CODEC_CB_TYPE_DECODE_SUB || + codec->cb_type == FF_CODEC_CB_TYPE_RECEIVE_FRAME); } int ff_set_dimensions(AVCodecContext *s, int width, int height) diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c index 051f90c9db..03ee8f0b10 100644 --- a/libavcodec/utvideodec.c +++ b/libavcodec/utvideodec.c @@ -1058,7 +1058,7 @@ const FFCodec ff_utvideo_decoder = { .priv_data_size = sizeof(UtvideoContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c index e1f7086152..15a53a6094 100644 --- a/libavcodec/utvideoenc.c +++ b/libavcodec/utvideoenc.c @@ -651,7 +651,7 @@ const FFCodec ff_utvideo_encoder = { .priv_data_size = sizeof(UtvideoContext), .p.priv_class = &utvideo_class, .init = utvideo_encode_init, - .encode2 = utvideo_encode_frame, + FF_CODEC_ENCODE_CB(utvideo_encode_frame), .close = utvideo_encode_close, .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .p.pix_fmts = (const enum AVPixelFormat[]) { diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c index f208a0786f..b5e1d728a7 100644 --- a/libavcodec/v210dec.c +++ b/libavcodec/v210dec.c @@ -218,7 +218,7 @@ const FFCodec ff_v210_decoder = { .p.id = AV_CODEC_ID_V210, .priv_data_size = sizeof(V210DecContext), .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c index 2582571823..9ac923571c 100644 --- a/libavcodec/v210enc.c +++ b/libavcodec/v210enc.c @@ -160,7 +160,7 @@ const FFCodec ff_v210_encoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .priv_data_size = sizeof(V210EncContext), .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/v210x.c b/libavcodec/v210x.c index 34eb54e447..18d3e637be 100644 --- a/libavcodec/v210x.c +++ b/libavcodec/v210x.c @@ -125,7 +125,7 @@ const FFCodec ff_v210x_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_V210X, .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/v308dec.c b/libavcodec/v308dec.c index 6c85bc585d..5f8cbc634b 100644 --- a/libavcodec/v308dec.c +++ b/libavcodec/v308dec.c @@ -78,7 +78,7 @@ const FFCodec ff_v308_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_V308, .init = v308_decode_init, - .decode = v308_decode_frame, + FF_CODEC_DECODE_CB(v308_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/v308enc.c b/libavcodec/v308enc.c index 08e6ddaecb..c4f07a123d 100644 --- a/libavcodec/v308enc.c +++ b/libavcodec/v308enc.c @@ -77,7 +77,7 @@ const FFCodec ff_v308_encoder = { .p.id = AV_CODEC_ID_V308, .p.capabilities = AV_CODEC_CAP_DR1, .init = v308_encode_init, - .encode2 = v308_encode_frame, + FF_CODEC_ENCODE_CB(v308_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/v408dec.c b/libavcodec/v408dec.c index 32ea98b724..02024959c7 100644 --- a/libavcodec/v408dec.c +++ b/libavcodec/v408dec.c @@ -88,7 +88,7 @@ const FFCodec ff_ayuv_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_AYUV, .init = v408_decode_init, - .decode = v408_decode_frame, + FF_CODEC_DECODE_CB(v408_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; @@ -100,7 +100,7 @@ const FFCodec ff_v408_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_V408, .init = v408_decode_init, - .decode = v408_decode_frame, + FF_CODEC_DECODE_CB(v408_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/v408enc.c b/libavcodec/v408enc.c index 52d5e19802..157ed85104 100644 --- a/libavcodec/v408enc.c +++ b/libavcodec/v408enc.c @@ -87,7 +87,7 @@ const FFCodec ff_ayuv_encoder = { .p.id = AV_CODEC_ID_AYUV, .p.capabilities = AV_CODEC_CAP_DR1, .init = v408_encode_init, - .encode2 = v408_encode_frame, + FF_CODEC_ENCODE_CB(v408_encode_frame), .p.pix_fmts = pix_fmt, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; @@ -100,7 +100,7 @@ const FFCodec ff_v408_encoder = { .p.id = AV_CODEC_ID_V408, .p.capabilities = AV_CODEC_CAP_DR1, .init = v408_encode_init, - .encode2 = v408_encode_frame, + FF_CODEC_ENCODE_CB(v408_encode_frame), .p.pix_fmts = pix_fmt, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/v410dec.c b/libavcodec/v410dec.c index bb1dd5d0c6..f6d675c508 100644 --- a/libavcodec/v410dec.c +++ b/libavcodec/v410dec.c @@ -120,7 +120,7 @@ const FFCodec ff_v410_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_V410, .init = v410_decode_init, - .decode = v410_decode_frame, + FF_CODEC_DECODE_CB(v410_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/v410enc.c b/libavcodec/v410enc.c index 32966d9176..88a2ce346b 100644 --- a/libavcodec/v410enc.c +++ b/libavcodec/v410enc.c @@ -81,7 +81,7 @@ const FFCodec ff_v410_encoder = { .p.id = AV_CODEC_ID_V410, .p.capabilities = AV_CODEC_CAP_DR1, .init = v410_encode_init, - .encode2 = v410_encode_frame, + FF_CODEC_ENCODE_CB(v410_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P10, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c index 4c521eba34..8a51dec3fa 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -248,7 +248,7 @@ static const AVOption options[] = { .priv_data_size = sizeof(V4L2m2mPriv), \ .p.priv_class = &v4l2_m2m_ ## NAME ## _dec_class, \ .init = v4l2_decode_init, \ - .receive_frame = v4l2_receive_frame, \ + FF_CODEC_RECEIVE_FRAME_CB(v4l2_receive_frame), \ .close = v4l2_decode_close, \ .bsfs = bsf_name, \ .p.capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, \ diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c index 1d90de2b9d..20f81df750 100644 --- a/libavcodec/v4l2_m2m_enc.c +++ b/libavcodec/v4l2_m2m_enc.c @@ -429,7 +429,7 @@ static const FFCodecDefault v4l2_m2m_defaults[] = { .priv_data_size = sizeof(V4L2m2mPriv), \ .p.priv_class = &v4l2_m2m_ ## NAME ##_enc_class, \ .init = v4l2_encode_init, \ - .receive_packet = v4l2_receive_packet, \ + FF_CODEC_RECEIVE_PACKET_CB(v4l2_receive_packet), \ .close = v4l2_encode_close, \ .defaults = v4l2_m2m_defaults, \ .p.capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY, \ diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index 69d5abfe55..7a6b54ab6f 100644 --- a/libavcodec/vaapi_encode_h264.c +++ b/libavcodec/vaapi_encode_h264.c @@ -1332,7 +1332,7 @@ const FFCodec ff_h264_vaapi_encoder = { .p.id = AV_CODEC_ID_H264, .priv_data_size = sizeof(VAAPIEncodeH264Context), .init = &vaapi_encode_h264_init, - .receive_packet = &ff_vaapi_encode_receive_packet, + FF_CODEC_RECEIVE_PACKET_CB(&ff_vaapi_encode_receive_packet), .close = &vaapi_encode_h264_close, .p.priv_class = &vaapi_encode_h264_class, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c index a77cb21c82..0be32588c0 100644 --- a/libavcodec/vaapi_encode_h265.c +++ b/libavcodec/vaapi_encode_h265.c @@ -1309,7 +1309,7 @@ const FFCodec ff_hevc_vaapi_encoder = { .p.id = AV_CODEC_ID_HEVC, .priv_data_size = sizeof(VAAPIEncodeH265Context), .init = &vaapi_encode_h265_init, - .receive_packet = &ff_vaapi_encode_receive_packet, + FF_CODEC_RECEIVE_PACKET_CB(&ff_vaapi_encode_receive_packet), .close = &vaapi_encode_h265_close, .p.priv_class = &vaapi_encode_h265_class, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | diff --git a/libavcodec/vaapi_encode_mjpeg.c b/libavcodec/vaapi_encode_mjpeg.c index d42c1d7b1e..ddc1d0fc8d 100644 --- a/libavcodec/vaapi_encode_mjpeg.c +++ b/libavcodec/vaapi_encode_mjpeg.c @@ -559,7 +559,7 @@ const FFCodec ff_mjpeg_vaapi_encoder = { .p.id = AV_CODEC_ID_MJPEG, .priv_data_size = sizeof(VAAPIEncodeMJPEGContext), .init = &vaapi_encode_mjpeg_init, - .receive_packet = &ff_vaapi_encode_receive_packet, + FF_CODEC_RECEIVE_PACKET_CB(&ff_vaapi_encode_receive_packet), .close = &vaapi_encode_mjpeg_close, .p.priv_class = &vaapi_encode_mjpeg_class, .p.capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DR1, diff --git a/libavcodec/vaapi_encode_mpeg2.c b/libavcodec/vaapi_encode_mpeg2.c index ef24dcbbb9..0e30efe119 100644 --- a/libavcodec/vaapi_encode_mpeg2.c +++ b/libavcodec/vaapi_encode_mpeg2.c @@ -697,7 +697,7 @@ const FFCodec ff_mpeg2_vaapi_encoder = { .p.id = AV_CODEC_ID_MPEG2VIDEO, .priv_data_size = sizeof(VAAPIEncodeMPEG2Context), .init = &vaapi_encode_mpeg2_init, - .receive_packet = &ff_vaapi_encode_receive_packet, + FF_CODEC_RECEIVE_PACKET_CB(&ff_vaapi_encode_receive_packet), .close = &vaapi_encode_mpeg2_close, .p.priv_class = &vaapi_encode_mpeg2_class, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | diff --git a/libavcodec/vaapi_encode_vp8.c b/libavcodec/vaapi_encode_vp8.c index 9824fff052..0e384d5a58 100644 --- a/libavcodec/vaapi_encode_vp8.c +++ b/libavcodec/vaapi_encode_vp8.c @@ -252,7 +252,7 @@ const FFCodec ff_vp8_vaapi_encoder = { .p.id = AV_CODEC_ID_VP8, .priv_data_size = sizeof(VAAPIEncodeVP8Context), .init = &vaapi_encode_vp8_init, - .receive_packet = &ff_vaapi_encode_receive_packet, + FF_CODEC_RECEIVE_PACKET_CB(&ff_vaapi_encode_receive_packet), .close = &ff_vaapi_encode_close, .p.priv_class = &vaapi_encode_vp8_class, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | diff --git a/libavcodec/vaapi_encode_vp9.c b/libavcodec/vaapi_encode_vp9.c index dd87825c28..9ca4e451a3 100644 --- a/libavcodec/vaapi_encode_vp9.c +++ b/libavcodec/vaapi_encode_vp9.c @@ -294,7 +294,7 @@ const FFCodec ff_vp9_vaapi_encoder = { .p.id = AV_CODEC_ID_VP9, .priv_data_size = sizeof(VAAPIEncodeVP9Context), .init = &vaapi_encode_vp9_init, - .receive_packet = &ff_vaapi_encode_receive_packet, + FF_CODEC_RECEIVE_PACKET_CB(&ff_vaapi_encode_receive_packet), .close = &ff_vaapi_encode_close, .p.priv_class = &vaapi_encode_vp9_class, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | diff --git a/libavcodec/vb.c b/libavcodec/vb.c index 1a05bd949f..82b4ea85ca 100644 --- a/libavcodec/vb.c +++ b/libavcodec/vb.c @@ -286,7 +286,7 @@ const FFCodec ff_vb_decoder = { .priv_data_size = sizeof(VBDecContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/vble.c b/libavcodec/vble.c index 85b1fec855..f7ab17d621 100644 --- a/libavcodec/vble.c +++ b/libavcodec/vble.c @@ -209,7 +209,7 @@ const FFCodec ff_vble_decoder = { .priv_data_size = sizeof(VBLEContext), .init = vble_decode_init, .close = vble_decode_close, - .decode = vble_decode_frame, + FF_CODEC_DECODE_CB(vble_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 0f5a07ff33..3e746e64cb 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -1209,7 +1209,7 @@ const FFCodec ff_vc1_decoder = { .priv_data_size = sizeof(VC1Context), .init = vc1_decode_init, .close = ff_vc1_decode_end, - .decode = vc1_decode_frame, + FF_CODEC_DECODE_CB(vc1_decode_frame), .flush = ff_mpeg_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, @@ -1247,7 +1247,7 @@ const FFCodec ff_wmv3_decoder = { .priv_data_size = sizeof(VC1Context), .init = vc1_decode_init, .close = ff_vc1_decode_end, - .decode = vc1_decode_frame, + FF_CODEC_DECODE_CB(vc1_decode_frame), .flush = ff_mpeg_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, @@ -1286,7 +1286,7 @@ const FFCodec ff_wmv3image_decoder = { .priv_data_size = sizeof(VC1Context), .init = vc1_decode_init, .close = ff_vc1_decode_end, - .decode = vc1_decode_frame, + FF_CODEC_DECODE_CB(vc1_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .flush = vc1_sprite_flush, @@ -1306,7 +1306,7 @@ const FFCodec ff_vc1image_decoder = { .priv_data_size = sizeof(VC1Context), .init = vc1_decode_init, .close = ff_vc1_decode_end, - .decode = vc1_decode_frame, + FF_CODEC_DECODE_CB(vc1_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .flush = vc1_sprite_flush, diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c index e1b8b7ffae..1e3127f080 100644 --- a/libavcodec/vc2enc.c +++ b/libavcodec/vc2enc.c @@ -1234,7 +1234,7 @@ const FFCodec ff_vc2_encoder = { .priv_data_size = sizeof(VC2EncContext), .init = vc2_encode_init, .close = vc2_encode_end, - .encode2 = vc2_encode_frame, + FF_CODEC_ENCODE_CB(vc2_encode_frame), .p.priv_class = &vc2enc_class, .defaults = vc2enc_defaults, .p.pix_fmts = allowed_pix_fmts diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c index d062700259..4aed1eeafb 100644 --- a/libavcodec/vcr1.c +++ b/libavcodec/vcr1.c @@ -128,7 +128,7 @@ const FFCodec ff_vcr1_decoder = { .p.id = AV_CODEC_ID_VCR1, .priv_data_size = sizeof(VCR1Context), .init = vcr1_decode_init, - .decode = vcr1_decode_frame, + FF_CODEC_DECODE_CB(vcr1_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c index 61c24f9110..270496b7a7 100644 --- a/libavcodec/videotoolboxenc.c +++ b/libavcodec/videotoolboxenc.c @@ -2732,7 +2732,7 @@ const FFCodec ff_h264_videotoolbox_encoder = { .priv_data_size = sizeof(VTEncContext), .p.pix_fmts = avc_pix_fmts, .init = vtenc_init, - .encode2 = vtenc_frame, + FF_CODEC_ENCODE_CB(vtenc_frame), .close = vtenc_close, .p.priv_class = &h264_videotoolbox_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | @@ -2767,7 +2767,7 @@ const FFCodec ff_hevc_videotoolbox_encoder = { .priv_data_size = sizeof(VTEncContext), .p.pix_fmts = hevc_pix_fmts, .init = vtenc_init, - .encode2 = vtenc_frame, + FF_CODEC_ENCODE_CB(vtenc_frame), .close = vtenc_close, .p.priv_class = &hevc_videotoolbox_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | @@ -2806,7 +2806,7 @@ const FFCodec ff_prores_videotoolbox_encoder = { .priv_data_size = sizeof(VTEncContext), .p.pix_fmts = prores_pix_fmts, .init = vtenc_init, - .encode2 = vtenc_frame, + FF_CODEC_ENCODE_CB(vtenc_frame), .close = vtenc_close, .p.priv_class = &prores_videotoolbox_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | diff --git a/libavcodec/vima.c b/libavcodec/vima.c index e429855245..73276056c2 100644 --- a/libavcodec/vima.c +++ b/libavcodec/vima.c @@ -213,7 +213,7 @@ const FFCodec ff_adpcm_vima_decoder = { .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_ADPCM_VIMA, .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/vmdaudio.c b/libavcodec/vmdaudio.c index b81e5b0ced..2e6e358b64 100644 --- a/libavcodec/vmdaudio.c +++ b/libavcodec/vmdaudio.c @@ -235,7 +235,7 @@ const FFCodec ff_vmdaudio_decoder = { .p.id = AV_CODEC_ID_VMDAUDIO, .priv_data_size = sizeof(VmdAudioContext), .init = vmdaudio_decode_init, - .decode = vmdaudio_decode_frame, + FF_CODEC_DECODE_CB(vmdaudio_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/vmdvideo.c b/libavcodec/vmdvideo.c index fd48dc3255..947f09b73b 100644 --- a/libavcodec/vmdvideo.c +++ b/libavcodec/vmdvideo.c @@ -472,7 +472,7 @@ const FFCodec ff_vmdvideo_decoder = { .priv_data_size = sizeof(VmdVideoContext), .init = vmdvideo_decode_init, .close = vmdvideo_decode_end, - .decode = vmdvideo_decode_frame, + FF_CODEC_DECODE_CB(vmdvideo_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/vmnc.c b/libavcodec/vmnc.c index e7db38e85c..cc790984ad 100644 --- a/libavcodec/vmnc.c +++ b/libavcodec/vmnc.c @@ -581,7 +581,7 @@ const FFCodec ff_vmnc_decoder = { .priv_data_size = sizeof(VmncContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index 433fbfc6f9..6ba0e1d811 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -1892,7 +1892,7 @@ const FFCodec ff_vorbis_decoder = { .priv_data_size = sizeof(vorbis_context), .init = vorbis_decode_init, .close = vorbis_decode_close, - .decode = vorbis_decode_frame, + FF_CODEC_DECODE_CB(vorbis_decode_frame), .flush = vorbis_decode_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/vorbisenc.c b/libavcodec/vorbisenc.c index a6c5cfa8c7..0db8aeb2b5 100644 --- a/libavcodec/vorbisenc.c +++ b/libavcodec/vorbisenc.c @@ -1302,7 +1302,7 @@ const FFCodec ff_vorbis_encoder = { .p.id = AV_CODEC_ID_VORBIS, .priv_data_size = sizeof(vorbis_enc_context), .init = vorbis_encode_init, - .encode2 = vorbis_encode_frame, + FF_CODEC_ENCODE_CB(vorbis_encode_frame), .close = vorbis_encode_close, .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_EXPERIMENTAL, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 528029203d..1a745331f4 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -3176,7 +3176,7 @@ const FFCodec ff_theora_decoder = { .priv_data_size = sizeof(Vp3DecodeContext), .init = theora_decode_init, .close = vp3_decode_end, - .decode = vp3_decode_frame, + FF_CODEC_DECODE_CB(vp3_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_FRAME_THREADS, .flush = vp3_decode_flush, @@ -3194,7 +3194,7 @@ const FFCodec ff_vp3_decoder = { .priv_data_size = sizeof(Vp3DecodeContext), .init = vp3_decode_init, .close = vp3_decode_end, - .decode = vp3_decode_frame, + FF_CODEC_DECODE_CB(vp3_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_FRAME_THREADS, .flush = vp3_decode_flush, @@ -3212,7 +3212,7 @@ const FFCodec ff_vp4_decoder = { .priv_data_size = sizeof(Vp3DecodeContext), .init = vp3_decode_init, .close = vp3_decode_end, - .decode = vp3_decode_frame, + FF_CODEC_DECODE_CB(vp3_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_FRAME_THREADS, .flush = vp3_decode_flush, diff --git a/libavcodec/vp5.c b/libavcodec/vp5.c index 167fda4bfc..7ec381b5e5 100644 --- a/libavcodec/vp5.c +++ b/libavcodec/vp5.c @@ -311,7 +311,7 @@ const FFCodec ff_vp5_decoder = { .priv_data_size = sizeof(VP56Context), .init = vp5_decode_init, .close = vp56_free, - .decode = ff_vp56_decode_frame, + FF_CODEC_DECODE_CB(ff_vp56_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index 313b499623..19dc754fee 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/vp6.c @@ -720,7 +720,7 @@ const FFCodec ff_vp6_decoder = { .priv_data_size = sizeof(VP56Context), .init = vp6_decode_init, .close = vp6_decode_free, - .decode = ff_vp56_decode_frame, + FF_CODEC_DECODE_CB(ff_vp56_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; @@ -734,7 +734,7 @@ const FFCodec ff_vp6f_decoder = { .priv_data_size = sizeof(VP56Context), .init = vp6_decode_init, .close = vp6_decode_free, - .decode = ff_vp56_decode_frame, + FF_CODEC_DECODE_CB(ff_vp56_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; @@ -748,7 +748,7 @@ const FFCodec ff_vp6a_decoder = { .priv_data_size = 2 /* Main context + alpha context */ * sizeof(VP56Context), .init = vp6_decode_init, .close = vp6_decode_free, - .decode = ff_vp56_decode_frame, + FF_CODEC_DECODE_CB(ff_vp56_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index acb61ceede..f521f2c9de 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -2947,7 +2947,7 @@ const FFCodec ff_vp7_decoder = { .priv_data_size = sizeof(VP8Context), .init = vp7_decode_init, .close = ff_vp8_decode_free, - .decode = vp7_decode_frame, + FF_CODEC_DECODE_CB(vp7_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .flush = vp8_decode_flush, @@ -2963,7 +2963,7 @@ const FFCodec ff_vp8_decoder = { .priv_data_size = sizeof(VP8Context), .init = ff_vp8_decode_init, .close = ff_vp8_decode_free, - .decode = ff_vp8_decode_frame, + FF_CODEC_DECODE_CB(ff_vp8_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index 8f2c52da87..fee79fb45b 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -1874,7 +1874,7 @@ const FFCodec ff_vp9_decoder = { .priv_data_size = sizeof(VP9Context), .init = vp9_decode_init, .close = vp9_decode_free, - .decode = vp9_decode_frame, + FF_CODEC_DECODE_CB(vp9_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_SLICE_THREAD_HAS_MF | diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c index e8555e2570..62f930ed94 100644 --- a/libavcodec/vqavideo.c +++ b/libavcodec/vqavideo.c @@ -854,7 +854,7 @@ const FFCodec ff_vqa_decoder = { .priv_data_size = sizeof(VqaContext), .init = vqa_decode_init, .close = vqa_decode_end, - .decode = vqa_decode_frame, + FF_CODEC_DECODE_CB(vqa_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .defaults = vqa_defaults, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 8bb03e5b4f..efd9e0fdd0 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1710,7 +1710,7 @@ const FFCodec ff_wavpack_decoder = { .priv_data_size = sizeof(WavpackContext), .init = wavpack_decode_init, .close = wavpack_decode_end, - .decode = wavpack_decode_frame, + FF_CODEC_DECODE_CB(wavpack_decode_frame), .flush = wavpack_decode_flush, .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c index ac14d0c4f3..1f95768c09 100644 --- a/libavcodec/wavpackenc.c +++ b/libavcodec/wavpackenc.c @@ -2969,7 +2969,7 @@ const FFCodec ff_wavpack_encoder = { .priv_data_size = sizeof(WavPackEncodeContext), .p.priv_class = &wavpack_encoder_class, .init = wavpack_encode_init, - .encode2 = wavpack_encode_frame, + FF_CODEC_ENCODE_CB(wavpack_encode_frame), .close = wavpack_encode_close, .p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_U8P, diff --git a/libavcodec/wcmv.c b/libavcodec/wcmv.c index 8dfc1363a5..ac135f6859 100644 --- a/libavcodec/wcmv.c +++ b/libavcodec/wcmv.c @@ -248,7 +248,7 @@ const FFCodec ff_wcmv_decoder = { .priv_data_size = sizeof(WCMVContext), .init = decode_init, .close = decode_close, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/webp.c b/libavcodec/webp.c index a0b51ac1e7..1b5e943a6e 100644 --- a/libavcodec/webp.c +++ b/libavcodec/webp.c @@ -1562,7 +1562,7 @@ const FFCodec ff_webp_decoder = { .p.id = AV_CODEC_ID_WEBP, .priv_data_size = sizeof(WebPContext), .init = webp_decode_init, - .decode = webp_decode_frame, + FF_CODEC_DECODE_CB(webp_decode_frame), .close = webp_decode_close, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/webvttdec.c b/libavcodec/webvttdec.c index 8cb7fea070..0179fc26d2 100644 --- a/libavcodec/webvttdec.c +++ b/libavcodec/webvttdec.c @@ -103,7 +103,7 @@ const FFCodec ff_webvtt_decoder = { .p.long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"), .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_WEBVTT, - .decode_sub = webvtt_decode_frame, + FF_CODEC_DECODE_SUB_CB(webvtt_decode_frame), .init = ff_ass_subtitle_header_default, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), diff --git a/libavcodec/webvttenc.c b/libavcodec/webvttenc.c index 7f514ed940..e433bb4579 100644 --- a/libavcodec/webvttenc.c +++ b/libavcodec/webvttenc.c @@ -218,7 +218,7 @@ const FFCodec ff_webvtt_encoder = { .p.id = AV_CODEC_ID_WEBVTT, .priv_data_size = sizeof(WebVTTContext), .init = webvtt_encode_init, - .encode_sub = webvtt_encode_frame, + FF_CODEC_ENCODE_SUB_CB(webvtt_encode_frame), .close = webvtt_encode_close, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index 945fd8c843..825bd6cdbb 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -1007,7 +1007,7 @@ const FFCodec ff_wmav1_decoder = { .priv_data_size = sizeof(WMACodecContext), .init = wma_decode_init, .close = ff_wma_end, - .decode = wma_decode_superframe, + FF_CODEC_DECODE_CB(wma_decode_superframe), .flush = flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, @@ -1024,7 +1024,7 @@ const FFCodec ff_wmav2_decoder = { .priv_data_size = sizeof(WMACodecContext), .init = wma_decode_init, .close = ff_wma_end, - .decode = wma_decode_superframe, + FF_CODEC_DECODE_CB(wma_decode_superframe), .flush = flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c index fd1fb8ad97..28a7546eb5 100644 --- a/libavcodec/wmaenc.c +++ b/libavcodec/wmaenc.c @@ -440,7 +440,7 @@ const FFCodec ff_wmav1_encoder = { .p.id = AV_CODEC_ID_WMAV1, .priv_data_size = sizeof(WMACodecContext), .init = encode_init, - .encode2 = encode_superframe, + FF_CODEC_ENCODE_CB(encode_superframe), .close = ff_wma_end, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, @@ -455,7 +455,7 @@ const FFCodec ff_wmav2_encoder = { .p.id = AV_CODEC_ID_WMAV2, .priv_data_size = sizeof(WMACodecContext), .init = encode_init, - .encode2 = encode_superframe, + FF_CODEC_ENCODE_CB(encode_superframe), .close = ff_wma_end, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c index daa775314d..9a8d6cc276 100644 --- a/libavcodec/wmalosslessdec.c +++ b/libavcodec/wmalosslessdec.c @@ -1336,7 +1336,7 @@ const FFCodec ff_wmalossless_decoder = { .priv_data_size = sizeof(WmallDecodeCtx), .init = decode_init, .close = decode_close, - .decode = decode_packet, + FF_CODEC_DECODE_CB(decode_packet), .flush = flush, .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 245241aa50..9cf763acd4 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -2088,7 +2088,7 @@ const FFCodec ff_wmapro_decoder = { .priv_data_size = sizeof(WMAProDecodeCtx), .init = wmapro_decode_init, .close = wmapro_decode_end, - .decode = wmapro_decode_packet, + FF_CODEC_DECODE_CB(wmapro_decode_packet), .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, .flush = wmapro_flush, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, @@ -2104,7 +2104,7 @@ const FFCodec ff_xma1_decoder = { .priv_data_size = sizeof(XMADecodeCtx), .init = xma_decode_init, .close = xma_decode_end, - .decode = xma_decode_packet, + FF_CODEC_DECODE_CB(xma_decode_packet), .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, @@ -2119,7 +2119,7 @@ const FFCodec ff_xma2_decoder = { .priv_data_size = sizeof(XMADecodeCtx), .init = xma_decode_init, .close = xma_decode_end, - .decode = xma_decode_packet, + FF_CODEC_DECODE_CB(xma_decode_packet), .flush = xma_flush, .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c index 571dd5803b..c52ab876b2 100644 --- a/libavcodec/wmavoice.c +++ b/libavcodec/wmavoice.c @@ -2006,7 +2006,7 @@ const FFCodec ff_wmavoice_decoder = { .priv_data_size = sizeof(WMAVoiceContext), .init = wmavoice_decode_init, .close = wmavoice_decode_end, - .decode = wmavoice_decode_packet, + FF_CODEC_DECODE_CB(wmavoice_decode_packet), .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .flush = wmavoice_flush, diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c index 249200bf23..bf0e609c0b 100644 --- a/libavcodec/wmv2dec.c +++ b/libavcodec/wmv2dec.c @@ -599,7 +599,7 @@ const FFCodec ff_wmv2_decoder = { .priv_data_size = sizeof(WMV2DecContext), .init = wmv2_decode_init, .close = wmv2_decode_end, - .decode = ff_h263_decode_frame, + FF_CODEC_DECODE_CB(ff_h263_decode_frame), .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c index a4d15e1d55..88211ac179 100644 --- a/libavcodec/wmv2enc.c +++ b/libavcodec/wmv2enc.c @@ -241,7 +241,7 @@ const FFCodec ff_wmv2_encoder = { .p.priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(WMV2EncContext), .init = wmv2_encode_init, - .encode2 = ff_mpv_encode_picture, + FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), .close = ff_mpv_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index 913b42a78f..0cf2181a48 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -138,7 +138,7 @@ const FFCodec ff_wnv1_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_WNV1, .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/wrapped_avframe.c b/libavcodec/wrapped_avframe.c index 6794dd2045..3af007d478 100644 --- a/libavcodec/wrapped_avframe.c +++ b/libavcodec/wrapped_avframe.c @@ -113,7 +113,7 @@ const FFCodec ff_wrapped_avframe_encoder = { .p.long_name = NULL_IF_CONFIG_SMALL("AVFrame to AVPacket passthrough"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_WRAPPED_AVFRAME, - .encode2 = wrapped_avframe_encode, + FF_CODEC_ENCODE_CB(wrapped_avframe_encode), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; @@ -122,6 +122,6 @@ const FFCodec ff_wrapped_avframe_decoder = { .p.long_name = NULL_IF_CONFIG_SMALL("AVPacket to AVFrame passthrough"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_WRAPPED_AVFRAME, - .decode = wrapped_avframe_decode, + FF_CODEC_DECODE_CB(wrapped_avframe_decode), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/ws-snd1.c b/libavcodec/ws-snd1.c index 00e4d91d4f..8d072297ee 100644 --- a/libavcodec/ws-snd1.c +++ b/libavcodec/ws-snd1.c @@ -176,7 +176,7 @@ const FFCodec ff_ws_snd1_decoder = { .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_WESTWOOD_SND1, .init = ws_snd_decode_init, - .decode = ws_snd_decode_frame, + FF_CODEC_DECODE_CB(ws_snd_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/xan.c b/libavcodec/xan.c index e9f6c334a1..3386a702b1 100644 --- a/libavcodec/xan.c +++ b/libavcodec/xan.c @@ -642,7 +642,7 @@ const FFCodec ff_xan_wc3_decoder = { .priv_data_size = sizeof(XanContext), .init = xan_decode_init, .close = xan_decode_end, - .decode = xan_decode_frame, + FF_CODEC_DECODE_CB(xan_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/xbmdec.c b/libavcodec/xbmdec.c index bf9446195f..62ce46f3a7 100644 --- a/libavcodec/xbmdec.c +++ b/libavcodec/xbmdec.c @@ -143,5 +143,5 @@ const FFCodec ff_xbm_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_XBM, .p.capabilities = AV_CODEC_CAP_DR1, - .decode = xbm_decode_frame, + FF_CODEC_DECODE_CB(xbm_decode_frame), }; diff --git a/libavcodec/xbmenc.c b/libavcodec/xbmenc.c index 95db87dba6..60fb169457 100644 --- a/libavcodec/xbmenc.c +++ b/libavcodec/xbmenc.c @@ -81,7 +81,7 @@ const FFCodec ff_xbm_encoder = { .p.long_name = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"), .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_XBM, - .encode2 = xbm_encode_frame, + FF_CODEC_ENCODE_CB(xbm_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE }, }; diff --git a/libavcodec/xfacedec.c b/libavcodec/xfacedec.c index 0542a36a5d..b103b5beda 100644 --- a/libavcodec/xfacedec.c +++ b/libavcodec/xfacedec.c @@ -182,7 +182,7 @@ const FFCodec ff_xface_decoder = { .p.id = AV_CODEC_ID_XFACE, .priv_data_size = sizeof(XFaceContext), .init = xface_decode_init, - .decode = xface_decode_frame, + FF_CODEC_DECODE_CB(xface_decode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/xfaceenc.c b/libavcodec/xfaceenc.c index c1beb002cf..a46b7133e7 100644 --- a/libavcodec/xfaceenc.c +++ b/libavcodec/xfaceenc.c @@ -219,5 +219,5 @@ const FFCodec ff_xface_encoder = { .p.capabilities = AV_CODEC_CAP_DR1, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE }, .priv_data_size = sizeof(XFaceContext), - .encode2 = xface_encode_frame, + FF_CODEC_ENCODE_CB(xface_encode_frame), }; diff --git a/libavcodec/xl.c b/libavcodec/xl.c index d414bcf95d..d2037b9f09 100644 --- a/libavcodec/xl.c +++ b/libavcodec/xl.c @@ -132,7 +132,7 @@ const FFCodec ff_xl_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_VIXL, .init = decode_init, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/xpmdec.c b/libavcodec/xpmdec.c index 468175fc4b..26d076d2e8 100644 --- a/libavcodec/xpmdec.c +++ b/libavcodec/xpmdec.c @@ -444,5 +444,5 @@ const FFCodec ff_xpm_decoder = { .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(XPMDecContext), .close = xpm_decode_close, - .decode = xpm_decode_frame, + FF_CODEC_DECODE_CB(xpm_decode_frame), }; diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c index c2c1b920cc..f22c5cf3b3 100644 --- a/libavcodec/xsubdec.c +++ b/libavcodec/xsubdec.c @@ -160,6 +160,6 @@ const FFCodec ff_xsub_decoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_XSUB, .init = decode_init, - .decode_sub = decode_frame, + FF_CODEC_DECODE_SUB_CB(decode_frame), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/xsubenc.c b/libavcodec/xsubenc.c index 9069a96437..8ca411e5af 100644 --- a/libavcodec/xsubenc.c +++ b/libavcodec/xsubenc.c @@ -217,6 +217,6 @@ const FFCodec ff_xsub_encoder = { .p.type = AVMEDIA_TYPE_SUBTITLE, .p.id = AV_CODEC_ID_XSUB, .init = xsub_encoder_init, - .encode_sub = xsub_encode, + FF_CODEC_ENCODE_SUB_CB(xsub_encode), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/xwddec.c b/libavcodec/xwddec.c index 650a0bf774..f8afab598d 100644 --- a/libavcodec/xwddec.c +++ b/libavcodec/xwddec.c @@ -253,5 +253,5 @@ const FFCodec ff_xwd_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_XWD, .p.capabilities = AV_CODEC_CAP_DR1, - .decode = xwd_decode_frame, + FF_CODEC_DECODE_CB(xwd_decode_frame), }; diff --git a/libavcodec/xwdenc.c b/libavcodec/xwdenc.c index 0bfe5a2970..0c6dfc6569 100644 --- a/libavcodec/xwdenc.c +++ b/libavcodec/xwdenc.c @@ -220,7 +220,7 @@ const FFCodec ff_xwd_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_XWD, .p.capabilities = AV_CODEC_CAP_DR1, - .encode2 = xwd_encode_frame, + FF_CODEC_ENCODE_CB(xwd_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGRA, AV_PIX_FMT_RGBA, AV_PIX_FMT_ARGB, diff --git a/libavcodec/xxan.c b/libavcodec/xxan.c index 9a79e58d8a..d73bd46284 100644 --- a/libavcodec/xxan.c +++ b/libavcodec/xxan.c @@ -441,7 +441,7 @@ const FFCodec ff_xan_wc4_decoder = { .priv_data_size = sizeof(XanContext), .init = xan_decode_init, .close = xan_decode_end, - .decode = xan_decode_frame, + FF_CODEC_DECODE_CB(xan_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/y41pdec.c b/libavcodec/y41pdec.c index 663a1cc910..ca81dda0e8 100644 --- a/libavcodec/y41pdec.c +++ b/libavcodec/y41pdec.c @@ -87,7 +87,7 @@ const FFCodec ff_y41p_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_Y41P, .init = y41p_decode_init, - .decode = y41p_decode_frame, + FF_CODEC_DECODE_CB(y41p_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/y41penc.c b/libavcodec/y41penc.c index 0522de6613..390bd10ba1 100644 --- a/libavcodec/y41penc.c +++ b/libavcodec/y41penc.c @@ -84,7 +84,7 @@ const FFCodec ff_y41p_encoder = { .p.id = AV_CODEC_ID_Y41P, .p.capabilities = AV_CODEC_CAP_DR1, .init = y41p_encode_init, - .encode2 = y41p_encode_frame, + FF_CODEC_ENCODE_CB(y41p_encode_frame), .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/ylc.c b/libavcodec/ylc.c index 9b19405b24..94d0388f31 100644 --- a/libavcodec/ylc.c +++ b/libavcodec/ylc.c @@ -457,7 +457,7 @@ const FFCodec ff_ylc_decoder = { .priv_data_size = sizeof(YLCContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/yop.c b/libavcodec/yop.c index 3079af061f..5befbb072e 100644 --- a/libavcodec/yop.c +++ b/libavcodec/yop.c @@ -274,6 +274,6 @@ const FFCodec ff_yop_decoder = { .priv_data_size = sizeof(YopDecContext), .init = yop_decode_init, .close = yop_decode_close, - .decode = yop_decode_frame, + FF_CODEC_DECODE_CB(yop_decode_frame), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/yuv4dec.c b/libavcodec/yuv4dec.c index 3c6d6eda6e..bbd213e698 100644 --- a/libavcodec/yuv4dec.c +++ b/libavcodec/yuv4dec.c @@ -79,7 +79,7 @@ const FFCodec ff_yuv4_decoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_YUV4, .init = yuv4_decode_init, - .decode = yuv4_decode_frame, + FF_CODEC_DECODE_CB(yuv4_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/yuv4enc.c b/libavcodec/yuv4enc.c index 3a4d36f40c..8d72382197 100644 --- a/libavcodec/yuv4enc.c +++ b/libavcodec/yuv4enc.c @@ -66,5 +66,5 @@ const FFCodec ff_yuv4_encoder = { .p.id = AV_CODEC_ID_YUV4, .p.capabilities = AV_CODEC_CAP_DR1, .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .encode2 = yuv4_encode_frame, + FF_CODEC_ENCODE_CB(yuv4_encode_frame), }; diff --git a/libavcodec/zerocodec.c b/libavcodec/zerocodec.c index b4d189cd7a..08511ca152 100644 --- a/libavcodec/zerocodec.c +++ b/libavcodec/zerocodec.c @@ -140,7 +140,7 @@ const FFCodec ff_zerocodec_decoder = { .p.id = AV_CODEC_ID_ZEROCODEC, .priv_data_size = sizeof(ZeroCodecContext), .init = zerocodec_decode_init, - .decode = zerocodec_decode_frame, + FF_CODEC_DECODE_CB(zerocodec_decode_frame), .flush = zerocodec_decode_flush, .close = zerocodec_decode_close, .p.capabilities = AV_CODEC_CAP_DR1, diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c index 4a845a333d..37c18e3a14 100644 --- a/libavcodec/zmbv.c +++ b/libavcodec/zmbv.c @@ -653,7 +653,7 @@ const FFCodec ff_zmbv_decoder = { .priv_data_size = sizeof(ZmbvContext), .init = decode_init, .close = decode_end, - .decode = decode_frame, + FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c index 89814de800..ef21a189a6 100644 --- a/libavcodec/zmbvenc.c +++ b/libavcodec/zmbvenc.c @@ -418,7 +418,7 @@ const FFCodec ff_zmbv_encoder = { .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(ZmbvEncContext), .init = encode_init, - .encode2 = encode_frame, + FF_CODEC_ENCODE_CB(encode_frame), .close = encode_end, .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_PAL8, AV_PIX_FMT_RGB555LE, From patchwork Wed Mar 30 22:49:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 35098 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c05:b0:7a:e998:b410 with SMTP id bw5csp1066593pzb; Wed, 30 Mar 2022 15:50:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWxBhiM3MmfBOUQHAW5cR+eAgYblPYdufS47P7+SochYAJleokCCXHqq0qLBgidNd8bOgs X-Received: by 2002:a17:907:c24:b0:6e1:4943:9950 with SMTP id ga36-20020a1709070c2400b006e149439950mr2096787ejc.559.1648680645979; Wed, 30 Mar 2022 15:50:45 -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 f1-20020a05640214c100b00418e6e7fea2si21329011edx.241.2022.03.30.15.50.45; Wed, 30 Mar 2022 15:50:45 -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=j5FaSDqK; 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 8AABA68B266; Thu, 31 Mar 2022 01:50:30 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2075.outbound.protection.outlook.com [40.92.89.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9BB766801DD for ; Thu, 31 Mar 2022 01:50:24 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iCtMLE8gsF9riEqc/TS3zOkIqS7Y3+GTA/EKXVRoDv2A5b++7BzO8YzgMw7a3clT7E6I6U95QK8y/cYBgcSj1Aq+1PwQgmLCg6OAMlzzAl3P17/YvFZGhaYoJf/A6r7aFmQKLDP4F687Uscf8aZSXr+a/v2+fc2jygY+iNqu6RBwoqAfjj2JZ6crgK8WdwID0KQ3vvXtWXWgvwbpqKqWYrTjx7HcebRbgqr6OLuo63l1J2WrsGnIAvgV3dsQVto50quyjCLaJY57rZ6juao48AC/4EVMZlPclT80Q1CAbYyl/vIfjtl7j9s0yuhqGI3NphSio/21L8Zn+HxERpmUNQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yGTMqyoKYJYYv50xPb516cHjAW+6S14fjSXAAILlty0=; b=EGAMgr9tWmTzPtvUdV3dNl/K3BRNtBTKpJoWDMuXP347N3ahVagAF1vnHSGmcHGQtMBDWjZuDj6sx4H64gI/8BubYY3IwS30maasKxUcKVgud+O2IgOm0PKCu58OpFg70M05QAA8eVEOYf6NVzc69rz+JFQqmMkJeR0Ht2VFA7szMcwTCksNr7v56s16txdsmxBLWjE7X1SzWQO9sIQSB3Gu/QUTNLWismNR6sRKeDQBpgwxyR4HdMOJ4FvRYEksdaC3it0JZNK6CwaWl+DjDkXypOsCAzitgOMuqFkSRiY1ozFA24jbQvDui4ucePQzorrNpyQHZJLtBL0aXa228g== 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=yGTMqyoKYJYYv50xPb516cHjAW+6S14fjSXAAILlty0=; b=j5FaSDqKdK55m2vztSzK5f0/OaLefPQZLmbfiWFFokMjcfrFc9PMPK0IPzPD6o+OmFrzE2FjeQdHfyAbvlGgZZcPCq+SXtO+hZqwQLKHnApX905y2hDbDaKgmJgQcj0xngQybBL+bcudtfC3WoC7lVdS6rzE1IWCiefC5r5KK+8q5nykM4a2JxP9TjXZT0CMDr0QoOJVbD5sWvg1gOdIAr04UhBi6ILG7IBK1M3E6DDhWhsCLU0e9cp6V6WK3gAojWV2xsomfHctAPVsfDjLT2ms8laLP//vbnQzp8L7u75cV0OwqHa2DXuXw/KPlPdssWgtErBPWnyIZZDxxTtzeA== Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) by AM5PR0102MB2579.eurprd01.prod.exchangelabs.com (2603:10a6:206:d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17; Wed, 30 Mar 2022 22:50:23 +0000 Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8]) by AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8%3]) with mapi id 15.20.5102.022; Wed, 30 Mar 2022 22:50:23 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 31 Mar 2022 00:49:56 +0200 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [pdOwiDNQrch/RuxT95+zH5IJYOFEDWV7] X-ClientProxiedBy: ZRAP278CA0002.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:10::12) To AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) X-Microsoft-Original-Message-ID: <20220330224958.538843-4-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bfb5e87d-daad-48b8-6438-08da129facb3 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiQvrz79k5T5N22eDaDjTtMWPLHDN2AA+sp3BkM2m2Zvlf7ingFM45xnYjP03phbFzr8x20IBl5G+1r0B3P/on/bwSh6YAqeiht5dAwEdbv4lHAVZ5Lq9FHTsjIPf+X6mQ/IWzSFveZZXkqXeBYyl7+5r9D2+wCsOm3b3S9Gzgn8nmjLf6ZSGmgUdQqc8hGEy87wtNTj8rQNC+9NRr3MRhRMolFzXfMmbKE9RFoUR241M+S4Ss3KdzpPZ0FZX+KDw6PkityDicmUXeupV6Mtkw1UwcvtGn+qc6WNUFMADaLkHjrgNAPe5iLPWCFErhWNH72REMJdmy0wfSg+GpIGxcHFm5RgbacjUhvACDLUUL4Ztwr05QPVhaWR6n89j+i2Nw79hxUaP4Emu7g4E/ms7BAGLiB5NtZ4l7YkeJqiBfcNd+qZoQdW4p+E1qFpYskoSjIT72+6W2aahIZvBeDEZfn5h13BRTEPMauMfdTJslASMrqT/7RdOvP9yLirdKCwhDLPV5CSmPWZIPRDJeZ/r2BT5ZAJuKI8GH5iZMiFs+M0GV3wJ+YouL+tzEFnVemHyFSw7DrjT63ioTUJ1m/4+QmIcPFOZ9NPIUQFz0adyfWcfENALJlyR4Sug278Szxofh7jEV8nRUsFmbxekwVnzFPEI9w3PJT3MP+JjNMZSqd6GuLRnlz2og3gevC612QoyKoiAJmSaGsELX9Ww6287dBJ+EERw9uS+9v6GMuxO+G7ABai174ruOLyeoHHMOJTU7Y= X-MS-TrafficTypeDiagnostic: AM5PR0102MB2579:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QrCIGrUvf4T7vwvEudIpy+Ko2gdiRY3eTBl/foz37ghk9cZ9IlRofrLh3w4glMRyLobkPxr8bmcXOGGIfqNNzzlWHHSpzSi0V7IAThL5M0myx+0nXC6yvDvS40P8jpogTUV93i+FOnu6Bsf7RoGnjXqwJqYM/KM4eG1ZOUd9vVIXVt+dpup6JpD+HwKI/3OGOIwg23bXqDXMXeJ8wLC3z/ti9IAZc0Oh/IMOWye4RWB+DFPZ4EdMlma2nQEQkbKues9G4kk/7niRrTPWXLdFY7msUSYVySBMs8NCHxG64s2aJ5bxN7+15ap2zpycEWgTLnFwqZ91AgpsG1s9CJ0vHpW7W3fXgdU6DLBEHCowtfP9WQaSixIMoWh+2XCA7RwMawnqIYrxfl/4yMlZGJxT01Ok6C47gMNy8w2uOzFIOT93lED3INQ+Yil+3FypB2DqvZCzqa4rAS0Fv1B8xCAxm47YZK2UOK9o5V97QFeQEWoO4Tu2qd2rMtnxbZZ7hwaCgGInFW4/NDVngoZqqcFB2pj3m7cu+6efBAKo8+vVDT9TofWkMlRMY6syHcwQ6OODO/MgqQdb++9e51H1OYRXjQ== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9bvdbko3iXEu0BhIKpHi8MlE7a3ZEqmqWWwUDczZlAWfWWIlNUDtGopkLg46HuzKKrWT6f5/Uq9874TDnB/k+g4ebYfioQFbvKLBt/kiNTQmRsunR0ePqnKM5Vq9dQh+IjZxVSjMmXx1dbPTII2tWE8x9lTvhKjkaBlsQ0YFciPD9vftM2YCaZBmLq3LFbUVhUbFLp3vRjbJmyJ3T+0AnL64uxRNhdAcvQt13ce7BycE7rB9WOWdjsSvDK6LW2ZZa9DB5DEu0qUZ3mCduFXsq9BZT5Pno3plcA/SXNwGSYWAOkw+Ks1gFqkkPtzHxlzJB3HLUqxDEZovES+Wvhr5vGC08MGmK5y9nJMflRrNOmBPfeawjOl7L3Kiod/f/ydQPqQpLgTvNCcyfTVg4YIE3Pz90C+4B9E8fz/Dw69eOAqQ/wuzZovdTgWukKj2WKTFybGBdLBWs9c/I755AoS//Y5f43a1IPad050frNmpY3OG808TvDT4nLcsrJDgNx+meECXGGZnfdzyGiikwZtyl7oHKaA93hKaokIv8Popn0m4x5ArTewcdeWFfQlGd338y2moKvR56QQZ5bCHaKOdnrXwM1+SqK72llWgx1dB6/uvJ0hiTXa7Hgog/MBzfwI+k85fWlOyqkOY8NKywgcQ5sNkm9uSQh62cxvWEcW/cP5SAGQSnKNgJlsCC2pb6wzVLr+MTNgjq2AdDyrTTyb6BRhTBpOJc7f/cZE1nFmXpQXC7vf6vJQNObDSNWr7v/okmuUMskR1ZTEp/12U5o501CMqij25D4ncFAkLAB/AXhS8oUbo7hvPFCJ8doSkHPYkcG0FqEBh6Jt4Xhj5NsmrY3QPE8B4+e5XNXk6q89UtnlorSAsaXf5nayWgQA0j70MqhWRLdIx9PdlCEbZ56R7Tjxr1zkCo3C2vmfRFr8XnJ3fffVXnyqAwLRfdyOrFAhFB71gO4yiJE7uLavTuoHDwKixyWhO7wHhM46duba8NWQfgbZkU0xq1UDtyOga6YnPyo8r6uDqCoBR+OsHVop7BayF2tIagJjxtz6ONl1cDM+/jPDqF6Wjr+qeoiFoTJ+PsMdyd81y9kaa+/PCRkLZMue3u0bHXeMLhwWBgGek7t7Ko8uzSp7qyrsO2wvnaublZMZGmhASC0j1ISJoIw73Y976aK2VqfyrYOsmgG7Zh3VJJ9L0hItEnRyX5sUCrCt6g1gxx6XPgsB2tDIJDXyEN81+UweSvDaJQrxvSUgNs+PokawP3st76NWphzTYP4ID33S1U9lDeFoYvrtzNo8m09jiLZUwxY+kYdbH0STuOQJWOfAA1IdDg7IyJddHKWc0yXNuKTotNtQCPwvTnpHMX7EOdmyFzheRKFWkROEAaUtudGc4/DfaL6iXBsJUJ+eECSlk0HktsiY6JwPO683xx9hIyZyyQrUyGGfxc4uMmXLoItb4HQYJP5ILy1/ooDLe X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bfb5e87d-daad-48b8-6438-08da129facb3 X-MS-Exchange-CrossTenant-AuthSource: AS1PR01MB9564.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2022 22:50:23.5384 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0102MB2579 Subject: [FFmpeg-devel] [PATCH 5/7] avcodec/codec_internal: Constify AVPacket in decode_sub cb 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: uoOxzBAkx2uv No subtitle decoder ever modifies the AVPacket given to it. Signed-off-by: Andreas Rheinhardt --- libavcodec/assdec.c | 2 +- libavcodec/ccaption_dec.c | 2 +- libavcodec/codec_internal.h | 2 +- libavcodec/dvbsubdec.c | 2 +- libavcodec/dvdsubdec.c | 2 +- libavcodec/jacosubdec.c | 2 +- libavcodec/libaribb24.c | 2 +- libavcodec/libzvbi-teletextdec.c | 2 +- libavcodec/microdvddec.c | 2 +- libavcodec/movtextdec.c | 2 +- libavcodec/mpl2dec.c | 2 +- libavcodec/pgssubdec.c | 2 +- libavcodec/realtextdec.c | 2 +- libavcodec/samidec.c | 2 +- libavcodec/srtdec.c | 2 +- libavcodec/subviewerdec.c | 2 +- libavcodec/textdec.c | 2 +- libavcodec/webvttdec.c | 2 +- libavcodec/xsubdec.c | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/libavcodec/assdec.c b/libavcodec/assdec.c index b94629ea1d..f43b500aa7 100644 --- a/libavcodec/assdec.c +++ b/libavcodec/assdec.c @@ -41,7 +41,7 @@ static av_cold int ass_decode_init(AVCodecContext *avctx) } static int ass_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, AVPacket *avpkt) + int *got_sub_ptr, const AVPacket *avpkt) { if (avpkt->size <= 0) return avpkt->size; diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c index e33fb36824..34f0513b1a 100644 --- a/libavcodec/ccaption_dec.c +++ b/libavcodec/ccaption_dec.c @@ -839,7 +839,7 @@ static int process_cc608(CCaptionSubContext *ctx, uint8_t hi, uint8_t lo) } static int decode(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub, AVPacket *avpkt) + int *got_sub, const AVPacket *avpkt) { CCaptionSubContext *ctx = avctx->priv_data; int64_t in_time = sub->pts; diff --git a/libavcodec/codec_internal.h b/libavcodec/codec_internal.h index a14f6592fe..5df286ce52 100644 --- a/libavcodec/codec_internal.h +++ b/libavcodec/codec_internal.h @@ -184,7 +184,7 @@ typedef struct FFCodec { * Apart from that this is like the decode callback. */ int (*decode_sub)(struct AVCodecContext *avctx, struct AVSubtitle *sub, - int *got_frame_ptr, struct AVPacket *avpkt); + int *got_frame_ptr, const struct AVPacket *avpkt); /** * Decode API with decoupled packet/frame dataflow. * cb is in this state if cb_type is FF_CODEC_CB_TYPE_RECEIVE_FRAME. diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index 58e18cfece..6e510d12c7 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -1608,7 +1608,7 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf, } static int dvbsub_decode(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, AVPacket *avpkt) + int *got_sub_ptr, const AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index 2951e74736..2aa6983490 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -549,7 +549,7 @@ static int append_to_cached_buf(AVCodecContext *avctx, } static int dvdsub_decode(AVCodecContext *avctx, AVSubtitle *sub, - int *data_size, AVPacket *avpkt) + int *data_size, const AVPacket *avpkt) { DVDSubContext *ctx = avctx->priv_data; const uint8_t *buf = avpkt->data; diff --git a/libavcodec/jacosubdec.c b/libavcodec/jacosubdec.c index 245ae22221..e3bf9f4226 100644 --- a/libavcodec/jacosubdec.c +++ b/libavcodec/jacosubdec.c @@ -163,7 +163,7 @@ static void jacosub_to_ass(AVCodecContext *avctx, AVBPrint *dst, const char *src } static int jacosub_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, AVPacket *avpkt) + int *got_sub_ptr, const AVPacket *avpkt) { int ret; const char *ptr = avpkt->data; diff --git a/libavcodec/libaribb24.c b/libavcodec/libaribb24.c index e1a26e5659..9658e1d5ac 100644 --- a/libavcodec/libaribb24.c +++ b/libavcodec/libaribb24.c @@ -284,7 +284,7 @@ next_region: } static int libaribb24_decode(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, AVPacket *pkt) + int *got_sub_ptr, const AVPacket *pkt) { Libaribb24Context *b24 = avctx->priv_data; size_t parsed_data_size = 0; diff --git a/libavcodec/libzvbi-teletextdec.c b/libavcodec/libzvbi-teletextdec.c index 79a1237431..92466cc11e 100644 --- a/libavcodec/libzvbi-teletextdec.c +++ b/libavcodec/libzvbi-teletextdec.c @@ -638,7 +638,7 @@ static int slice_to_vbi_lines(TeletextContext *ctx, uint8_t* buf, int size) } static int teletext_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, AVPacket *pkt) + int *got_sub_ptr, const AVPacket *pkt) { TeletextContext *ctx = avctx->priv_data; int ret = 0; diff --git a/libavcodec/microdvddec.c b/libavcodec/microdvddec.c index 154fd3271b..f36ad51468 100644 --- a/libavcodec/microdvddec.c +++ b/libavcodec/microdvddec.c @@ -275,7 +275,7 @@ static void microdvd_close_no_persistent_tags(AVBPrint *new_line, } static int microdvd_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, AVPacket *avpkt) + int *got_sub_ptr, const AVPacket *avpkt) { AVBPrint new_line; char *line = avpkt->data; diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c index 6a71537291..70162b4888 100644 --- a/libavcodec/movtextdec.c +++ b/libavcodec/movtextdec.c @@ -473,7 +473,7 @@ static int mov_text_init(AVCodecContext *avctx) { } static int mov_text_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, AVPacket *avpkt) + int *got_sub_ptr, const AVPacket *avpkt) { MovTextContext *m = avctx->priv_data; int ret; diff --git a/libavcodec/mpl2dec.c b/libavcodec/mpl2dec.c index 7104670f4d..56f008b65c 100644 --- a/libavcodec/mpl2dec.c +++ b/libavcodec/mpl2dec.c @@ -64,7 +64,7 @@ static int mpl2_event_to_ass(AVBPrint *buf, const char *p) } static int mpl2_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, AVPacket *avpkt) + int *got_sub_ptr, const AVPacket *avpkt) { int ret = 0; AVBPrint buf; diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c index 8441b88d27..e50c6766c5 100644 --- a/libavcodec/pgssubdec.c +++ b/libavcodec/pgssubdec.c @@ -590,7 +590,7 @@ static int display_end_segment(AVCodecContext *avctx, AVSubtitle *sub, } static int decode(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, AVPacket *avpkt) + int *got_sub_ptr, const AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; diff --git a/libavcodec/realtextdec.c b/libavcodec/realtextdec.c index e058b7494d..c3e138a7ba 100644 --- a/libavcodec/realtextdec.c +++ b/libavcodec/realtextdec.c @@ -57,7 +57,7 @@ static int rt_event_to_ass(AVBPrint *buf, const char *p) } static int realtext_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, AVPacket *avpkt) + int *got_sub_ptr, const AVPacket *avpkt) { int ret = 0; const char *ptr = avpkt->data; diff --git a/libavcodec/samidec.c b/libavcodec/samidec.c index b9f6128a3e..cf5dec955b 100644 --- a/libavcodec/samidec.c +++ b/libavcodec/samidec.c @@ -133,7 +133,7 @@ end: } static int sami_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, AVPacket *avpkt) + int *got_sub_ptr, const AVPacket *avpkt) { const char *ptr = avpkt->data; SAMIContext *sami = avctx->priv_data; diff --git a/libavcodec/srtdec.c b/libavcodec/srtdec.c index 705df007d6..b2df34474e 100644 --- a/libavcodec/srtdec.c +++ b/libavcodec/srtdec.c @@ -56,7 +56,7 @@ static int srt_to_ass(AVCodecContext *avctx, AVBPrint *dst, } static int srt_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, AVPacket *avpkt) + int *got_sub_ptr, const AVPacket *avpkt) { AVBPrint buffer; int x1 = -1, y1 = -1, x2 = -1, y2 = -1; diff --git a/libavcodec/subviewerdec.c b/libavcodec/subviewerdec.c index b6acea93f5..2bda5fa5c1 100644 --- a/libavcodec/subviewerdec.c +++ b/libavcodec/subviewerdec.c @@ -48,7 +48,7 @@ static int subviewer_event_to_ass(AVBPrint *buf, const char *p) } static int subviewer_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, AVPacket *avpkt) + int *got_sub_ptr, const AVPacket *avpkt) { int ret = 0; const char *ptr = avpkt->data; diff --git a/libavcodec/textdec.c b/libavcodec/textdec.c index 09de0ad8fd..d509452391 100644 --- a/libavcodec/textdec.c +++ b/libavcodec/textdec.c @@ -46,7 +46,7 @@ static const AVOption options[] = { }; static int text_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, AVPacket *avpkt) + int *got_sub_ptr, const AVPacket *avpkt) { int ret = 0; AVBPrint buf; diff --git a/libavcodec/webvttdec.c b/libavcodec/webvttdec.c index 0179fc26d2..fcf1062d86 100644 --- a/libavcodec/webvttdec.c +++ b/libavcodec/webvttdec.c @@ -81,7 +81,7 @@ static int webvtt_event_to_ass(AVBPrint *buf, const char *p) } static int webvtt_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, AVPacket *avpkt) + int *got_sub_ptr, const AVPacket *avpkt) { int ret = 0; const char *ptr = avpkt->data; diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c index f22c5cf3b3..d62fa164a5 100644 --- a/libavcodec/xsubdec.c +++ b/libavcodec/xsubdec.c @@ -48,7 +48,7 @@ static int64_t parse_timecode(const uint8_t *buf, int64_t packet_time) { } static int decode_frame(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, AVPacket *avpkt) + int *got_sub_ptr, const AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; From patchwork Wed Mar 30 22:49:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 35099 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c05:b0:7a:e998:b410 with SMTP id bw5csp1066652pzb; Wed, 30 Mar 2022 15:50:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtqIlcGVeSbEnROWcSrsWDyyIOLq86YRl/ukbRdtkxmX4rEXR3RbAEgJhJaPlfTnhsDS46 X-Received: by 2002:a17:906:4443:b0:6cf:6a7d:5f9b with SMTP id i3-20020a170906444300b006cf6a7d5f9bmr2104559ejp.12.1648680655637; Wed, 30 Mar 2022 15:50:55 -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 l2-20020a1709061c4200b006e11da49d4fsi10054208ejg.189.2022.03.30.15.50.55; Wed, 30 Mar 2022 15:50:55 -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=oOhBm49z; 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 61DF168B27E; Thu, 31 Mar 2022 01:50:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2075.outbound.protection.outlook.com [40.92.89.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CB26B6801DD for ; Thu, 31 Mar 2022 01:50:29 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fGG/6MJ9cIUqJkSj7Ff15+rVUjvT4fyUhzq1wGM8rh/FpUnI5R8isyYZKyUWr05bx7O2veHXuDFxSmOl/WXhRz1urVjcDBi6mRUlQ7q+oCH6oe2BwAH4ASnr/N/obwnBEkYsRZ7zUWmmnkFfGQj2kYxZ/SDY8owkPpIlIWl4eQnFxsCKJRYpgjicHrDkN1D3DJYvQJQ5tl5ZAY7RN8G/d+Pmda5B4havTDaWWQ3wBun6kJKD3IWalaLISUgNehsVS4zBm6Ve/LM1tOl085dDI0UEBv4ytqG68absWSGzp/+DZk+M9v5X3hCApJFGV4Rn0cn0c2E1R0l7hpgopNQzkw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=br7imklcuuIz4mKaaTOMFPUQ7YOYAfuIJxT5Ed3M79E=; b=EDL/Z2BL5exJ0qBiGnDl65OpMp/wplT8B4mn0pSSRLrw86JclkR4b/zBvALFmhMfP/jFoICdOXcdGeuV7ebvQ/XVMnAGCJW9nwSC/9El0N3tABYqG0R5JTgX3j38gNfVCcioWhGXr6v72NJsQA9t4YXXsfcJoPsD8vuDDL9cODn4Y9/2AJcaywDX5zl9HBMLAhDW+FKopNwgn72wWjz72eqk2WcljYu8mb1QGVQkQ783zWxF/0hwQ3EMniOP+QjnjwkdsV7l6285oPgfJU5f0dIRYdw41Ptw6UBkPFLVTAZJ1x9beJUNrB/Vgu/58HzLJpYbnrdj/GvGJAxI7hqf1g== 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=br7imklcuuIz4mKaaTOMFPUQ7YOYAfuIJxT5Ed3M79E=; b=oOhBm49zj5F2mMO4QgKtq+Dqi9jBkPDFC+VaiI03IA8RmfCuuHl+s0hgUaPtUlBLCg3WAkGrDd87jqGk1uN8NLN45zc3wP9ewwS4+SfJy5qWWtx75ccWSHOAu8sD3BBRUT+wj9nemfnFlg6UkQDaZEw6IRDlqhcBJo0jsmxYuhu+OzAL3PCqFEFfkBuk3BYAwE3x8uFdizq0OGSixvv7uaCSw6OwbegyjM18kSo6n9VfE6jRhGRZa28RoUpBNU5jQ6oD8f9aL+UubscPdNJ/Mfp//XVelfHfHpRk8pqP+TlSEUeZ3dYTD8CaCz7MbH1e1sVejkps/e0kAPXZr/OlVA== Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) by AM5PR0102MB2579.eurprd01.prod.exchangelabs.com (2603:10a6:206:d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17; Wed, 30 Mar 2022 22:50:28 +0000 Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8]) by AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8%3]) with mapi id 15.20.5102.022; Wed, 30 Mar 2022 22:50:28 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 31 Mar 2022 00:49:57 +0200 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [51uzQ2VJ6Y3a8Ow33EIYx1zx2CgvTr82] X-ClientProxiedBy: ZRAP278CA0002.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:10::12) To AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) X-Microsoft-Original-Message-ID: <20220330224958.538843-5-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4a497a13-f514-4852-c613-08da129faf5f X-MS-TrafficTypeDiagnostic: AM5PR0102MB2579:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Cj6IbLPTSFxIOzyPmKJoxfJ3vhhR7LzlAvoh7UfCtdMXmc6sNIQhdY9E7wDPwgy7SZGXR/m0HNfBIbiN9ImnQKB3l9blDO3L09yT8rM+TkO03Fj8+qTon71Bm4hbt7ozR74sEo6K6g5/oB4y/oBLPuNgbpYCoLwGacKEGrBbRGytRfUXRp9N8jY2S9qitFjgz/4px1g7FU7cG5QwD/PczI835UMmPO4LDg794/6ucxqPgMQiJIWJ/mypsE3mVcOHJDKmUEx0zdWMgwE+GE0mOg4OFDDkVTPm1wo+eQjQFuBh2hjlA1YU7VEtyNne9oNroMjzbuScc96LwW/4pFoXssiaZXzp1TZSCq8rWUERWRNonsGj7i7cReyOY2KmOLLm8pHcA25tbh2GJQ/1oDLOEfhVcp5G8frRvzwWWTeayhsOuEUaLGX8y8SADwRKR2JED9/XRbeTDQ5kRzKX0PF7+bdWWY8mWndzkHVhvoEqDD5pYDElvVkfHQLJhTEZzHa3WCmYRCZohC1Sv0ih5w0gwpq4z4Ib7H41ZpsOTpS3lhIWHemA/sxtp9gxDlwSkCfMnPZikWE6r/nzkwfwqDbYUg== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xUBJ/yUGcicmGqjXidrWb+wNM5fnAuUxxLXYM/e3F/hHAvxzc5oodKsLnDn8QYz+Y/CfE8D7Ln5mBgq1mmEEMbk8fB+WNh4TwrIsIToR4FhbTGLCdMCW15n64VQMuo8sI+4aXFo5MvPdTorKlChdXkoayC8Wmig6ofNw05wSGPuD+vAVDihl2UUpA7o9hP7UGOzggfYXxxOY+jf2VLzWzhxQnEPvP/1mpTBrrdx59G3ZG5gikdeYrOkjiHZusdIq+UoCjfP+WJ9gAAo2nl9teUcv1A6DyGJEqtLUg3rzGo2o9xzneUwkFCe+yjq0jXBAPp1fcp8+e8+AeSv9OQ1m+c9dzOxCx8W1bgkIiPQEdQbDtCShgV4nXQ/9ta40/OZlqI0zANv9XSJUqgdWOKgY5GJlZ9sI1LBlSId1Ojt7bjYzyLMomKBbBYbLdAh8nu4b0mvC61agGGRaNi7B5J+xLGYEBnJ2DJXom4hy4lZPkXTKQL3hs4bgfZoHxz3qiRbbiyhKFprHsV+W/09o4Yi+ztGBav8+mhND32fIJ2m+G4I0PGhruJC5YpGnsyaH3s9+G69iztkTBAWlvNU3YdXsDZXWND2uvQ6v7zjX1NERsWSjzU57F2c4ZXhyVAoguHJ7mL4jJK+dCE84RaGAG/kXH/dQgR18QOBa6f63dtBzAK0xmMCRNq413nZVSum/JUVA2xPrPtbsDJdkqyJ411W7a6roxnvjQnCByQmUy0qR0KW2/JQZBtIkWA4of722ynBloLz2y1Rdm9C8cHBQYqSm9LJm7cZL6CPC5NVEvQK1/2BVl7CKxUexW0Xf+Pk93L+oHOr6l0XkY4RMVXErjIBILQ/opThMhPJC9u/9lT/gnCUu/DCvEVRhSIKQOwefq8FQFSaEz/yZ5cDmYPOwwWZhoUKjzTejEQn4ja/3kUsJQGVL/NlT+fVXKJSC2l83KeRAchLkDShleSvu8KvxvdhRy+ivStEjWureOm7iGfvRTmUo/J60bc2hYG5amdYftLosXhH3/osET50cHMcFKxrDnCN4/D0Jv/ln4jyMOH3ObSxJUlZzVRbPMi3s/JqmuMday269bUMZ00FJAsoNLKVQCeJZ8SoIscVbALJmlgH/38xzFrmHbw75ShUJqjpf1m+vR5g9jovjO7YiuYawmZXSjfMynYTR1CHfIski2K9lQaOCGV3KoEARtoscNbPlrCihJWplypPYwLLqCRzS+RVULcA+p9CjhkvUDVFsBj7lgcjwzNqPxd+1qImPnxBeH/at9Ifd9ywyTheQ+ururZDFpsPRFJNqhj/tj3ZoPErAIQ8DwF2EqSLkP3sbo1AxWJq99XqSxGskm1e7NEuiqJQPNjZrcdulK1bVJWnje2zPA1jQzqJmKBssdd3miA8zcpJBIiA0GY74rfeAXZ19z7omBejQomYMcZEmuLdsHPDmLpZNRBp3AtjmicYndi+dIE10 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4a497a13-f514-4852-c613-08da129faf5f X-MS-Exchange-CrossTenant-AuthSource: AS1PR01MB9564.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2022 22:50:27.9766 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0102MB2579 Subject: [FFmpeg-devel] [PATCH 6/7] avcodec: Make avcodec_decoder_subtitles2 accept a const AVPacket* 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: pIUl6dvPruql From: Andreas Rheinhardt Signed-off-by: Andreas Rheinhardt --- doc/APIchanges | 3 +++ fftools/ffmpeg.c | 4 ++-- fftools/ffprobe.c | 2 +- libavcodec/avcodec.h | 3 +-- libavcodec/decode.c | 9 ++++----- libavcodec/version.h | 2 +- tools/target_dec_fuzzer.c | 4 ++-- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 1a9f0a303e..326a3c721c 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -14,6 +14,9 @@ libavutil: 2021-04-27 API changes, most recent first: +2022-03-30 - xxxxxxxxxx - lavc 59.26.100 - avcodec.h + avcodec_decode_subtitle2() now accepts const AVPacket*. + 2022-03-16 - xxxxxxxxxx - all libraries - version_major.h Add lib/version_major.h as new installed headers, which only contain the major version number (and corresponding API deprecation diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 6d62bdc7b0..979e33c9ab 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -2491,8 +2491,8 @@ fail: return err < 0 ? err : ret; } -static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output, - int *decode_failed) +static int transcode_subtitles(InputStream *ist, const AVPacket *pkt, + int *got_output, int *decode_failed) { AVSubtitle subtitle; int free_sub = 1; diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index 05c167eeb5..d2aacb6a0d 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -2629,7 +2629,7 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream, static av_always_inline int process_frame(WriterContext *w, InputFile *ifile, - AVFrame *frame, AVPacket *pkt, + AVFrame *frame, const AVPacket *pkt, int *packet_new) { AVFormatContext *fmt_ctx = ifile->fmt_ctx; diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 4dae23d06e..64804c2a50 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -2544,8 +2544,7 @@ enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos); * @param[in] avpkt The input AVPacket containing the input buffer. */ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, - AVPacket *avpkt); + int *got_sub_ptr, const AVPacket *avpkt); /** * Supply raw packet data as input to a decoder. diff --git a/libavcodec/decode.c b/libavcodec/decode.c index e51a39e70a..8bb6e8c265 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -751,8 +751,8 @@ static void get_subtitle_defaults(AVSubtitle *sub) } #define UTF8_MAX_BYTES 4 /* 5 and 6 bytes sequences should not be used */ -static int recode_subtitle(AVCodecContext *avctx, AVPacket **outpkt, - AVPacket *inpkt, AVPacket *buf_pkt) +static int recode_subtitle(AVCodecContext *avctx, const AVPacket **outpkt, + const AVPacket *inpkt, AVPacket *buf_pkt) { #if CONFIG_ICONV iconv_t cd = (iconv_t)-1; @@ -832,8 +832,7 @@ static int utf8_check(const uint8_t *str) } int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, - AVPacket *avpkt) + int *got_sub_ptr, const AVPacket *avpkt) { int ret = 0; @@ -853,7 +852,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, if ((avctx->codec->capabilities & AV_CODEC_CAP_DELAY) || avpkt->size) { AVCodecInternal *avci = avctx->internal; - AVPacket *pkt; + const AVPacket *pkt; ret = recode_subtitle(avctx, &pkt, avpkt, avci->buffer_pkt); if (ret < 0) diff --git a/libavcodec/version.h b/libavcodec/version.h index a744e7469f..26ee41eb1f 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 25 +#define LIBAVCODEC_VERSION_MINOR 26 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c index 288aa63313..bb9fad613d 100644 --- a/tools/target_dec_fuzzer.c +++ b/tools/target_dec_fuzzer.c @@ -81,8 +81,8 @@ static const FFCodec *AVCodecInitialize(enum AVCodecID codec_id) return ffcodec(res); } -static int subtitle_handler(AVCodecContext *avctx, void *frame, - int *got_sub_ptr, AVPacket *avpkt) +static int subtitle_handler(AVCodecContext *avctx, AVFrame *unused, + int *got_sub_ptr, const AVPacket *avpkt) { AVSubtitle sub; int ret = avcodec_decode_subtitle2(avctx, &sub, got_sub_ptr, avpkt); From patchwork Wed Mar 30 22:49:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 35100 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c05:b0:7a:e998:b410 with SMTP id bw5csp1066696pzb; Wed, 30 Mar 2022 15:51:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyN1nTSBW4Z3mjz+lLOyGNKRuNHqwJVpHZpUvuh55ehT7qNUfOP0K6yrd431kvyMfXI2+an X-Received: by 2002:a05:6402:1e92:b0:419:76:21a6 with SMTP id f18-20020a0564021e9200b00419007621a6mr13467476edf.128.1648680664292; Wed, 30 Mar 2022 15:51:04 -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 e15-20020a50e00f000000b00418c2b5bd97si24112950edl.121.2022.03.30.15.51.03; Wed, 30 Mar 2022 15:51: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; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=QFPHufVG; 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 A063968B29A; Thu, 31 Mar 2022 01:50:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2075.outbound.protection.outlook.com [40.92.89.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EBB8668B28A for ; Thu, 31 Mar 2022 01:50:34 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UWMUizkOz1qYhPZepJKOLUKbAvkd84vBA/ZwB3qAecnrrsmNuzKgWmuuH0Kn+Atkv6v2klk3qgcMyYW79HhOfzW7u+t9EVBX1w1RVHNuH6muwzJ4L9JWfJ2hAeFDBhufe51ITAnHE0GPyiIpazgpFfuavlnjqEy9Unkn+8DTfPPtONLEmFE1NlFw1oSATbhv8xd1c4EL66amchNUBh0SpbSGZ1yE1+rApyRemPEqaNw7pFBp6AOq4UE5AjJ3NCwsXDsZMBfUlTdVxd11IW8D9x+iQSBFCYkYFGCBVGc6ZFUfKvoJM6rt6f8CtBSZNcLJLFZ8w+GxwNgFCh7TlBo6Ug== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aV04TANpq16x3VoUabVGdIUJJ/Iw0AXM5midIRfxDtU=; b=AsYb4jOMVQAx6ncPUyZCmeHzAMc16xxENJPr4YEMN0rNSTZtRV+O8RXwgTjuv85iwOOPWOc7f4N2DSVSEdrYIBHEKSuxMDsh7+d5Yuyclfof4Bj4xoGnGSgFV3zikCFzbAq5VGLjufToGworsylshCqWk3wmi+jDTJSqFszWBZyfNOrzs+H5tE5tpY/AAMcyqUSHmlt0PcPLdeHz6jezKvtG0lHdXcDuoesEL+dJ0/LMSQUFDaSwKvF7s0y/RJ0SMvLiE17JYoJNm2oAuxjT6QhFgDaSjEn0PgA0L8dOosTsJTD2YBzIU/9xZHW9Y/TfOgf0PfgBCYNu6zteGVspFw== 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=aV04TANpq16x3VoUabVGdIUJJ/Iw0AXM5midIRfxDtU=; b=QFPHufVGcvUvP6bcl/G8RnimyV4E5ZwTI3fJCzIPl5h5A+v+EQK8/qouKoEqxVodU03n5R/MCDrCw9mSJ8MT51yQwvL/taaOMedJ3+QEXRI/AluYZ0O6K/Bew6sOYi5OeWZoHT5usZHEOTX5yNmRCgtb4lfyfCiQwlXSI9hK2uW6mBqZdIj+91m1DpXHWzaZa5+3AS0Sz5iB2XVHgd8Md7VVYiCjtMWTXEOV47jxinHsFKtWGRtJckkr/UwbQI7G8YoiPzbF+uj0or5Xrb2Vn3Ou9VLs/RmeHxxSeQYz8VPDRbHrVlK/btX4oTtqIeCVRPLOlTIEiLLKy/xF2lBXVQ== Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) by AM5PR0102MB2579.eurprd01.prod.exchangelabs.com (2603:10a6:206:d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17; Wed, 30 Mar 2022 22:50:29 +0000 Received: from AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8]) by AS1PR01MB9564.eurprd01.prod.exchangelabs.com ([fe80::9070:a5fd:e532:bdf8%3]) with mapi id 15.20.5102.022; Wed, 30 Mar 2022 22:50:29 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 31 Mar 2022 00:49:58 +0200 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [Wwtxn/YNY+rwcLf0PvjIhO18VUJFHdW2] X-ClientProxiedBy: ZRAP278CA0002.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:10::12) To AS1PR01MB9564.eurprd01.prod.exchangelabs.com (2603:10a6:20b:4d1::16) X-Microsoft-Original-Message-ID: <20220330224958.538843-6-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a14c88df-51fa-416a-f54a-08da129fb00d X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiQvrz79k5T5N22eDaDjTtMWw3JvljEAPzyqXaHQk803kAIWxFrGY3HxxSpShKZvsS4JKJGhZtWwVEKuxH64XXVtyZj5XduRiPNT/nqOHRc525niR3AdmVFEA3HkuhzClj9ZHimBRY9TfzwCbxuBon1scG64WUA8VlP5asOvBIRzhilG5Zn0uLsg3bQKuGgNNl2DaI11yh9e+1pgHYln3PXrGGky3DKDvtcd9H5r9k+mxt4etkfL8zH+oPjfNkDPrrHsN+atlawv2lrhzgaI7hhHBDYtlEQouWHdjpo9guktzWExyi1xeLhvl03rjaUSEpKEN+jsgyGfMtwtRAHTZdOhDpW6s+n7QqdSqTf3kWCopUFpXmamVoBsoFoHTsLsbeQLT9OkfTHllctrYkmTPnw/Oxzcz3SFHVRoic+IE6QgSCmqtzss7V8+LqINulX6A2q2HYN0nrEpzG+eNoXOmIRSWAu5DlfqdEsnwycHLERREycfeIrBgh/aOzVL9lBAQaOv1ZuclWacFRA/MUdUve6laCsK8vJfeh0fsS0TTKBhMkQ8tyI1lXeCt6hKgMgcObEVXvb/PSBU6FB7Qz857JaJlVe/hdAgwLVrbR04Ph+Nb9piwLAbNBqywSoMMXnAw5rDmi00ykyC1pUCnEgHiWb5WHJFlBrbBAc4eyYTGoByVx7k7sO1FeIT4ZR2iUdq8oFghdQw1GSy1bDlbr+Vid3C5Xd5mFQwV/ECtsI+sjga2dbXj5aLVv7V21kmJ+B264Y= X-MS-TrafficTypeDiagnostic: AM5PR0102MB2579:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FXjpKE5TT2mVW5E0JqpeAm3oec0PdFZ9PnOUdjXfD5/0U1mpWpFiXRuelmGzm7XpEsturpxvKwGjZq1POzsXS0KiTqXFwnuNXQYH0YZMbljFFAzbEMiP2ZYSOc4VtFxpYkvjgv7jGw7j8O3ZVFDUvC94UZys9w8C9/Lc1gAgr5ijVj2U0T5xWMB6/mVBWXDeljE7Z/B3cLnGd/3mQ7OyQyyKfGYHqaVr/GvIoGF5C4OvmAFCwUzGqvhnqPStwWEKRhS8gX4xtGWHdTkjURf9suxfFJmoZpUF+1qzdQAgWhUFBiLMr0hZPo4htJN1ctDNBhSQIi1h0rxCZo4RpPuhUUPkgLFfAniOA1GUsPhtXLvI4kog1/ZgZISjXn9Mbaoy6czirpDYuPHReuXxNKP6agPFKijDfQ/e/Ym1UqtwZYxYr1MIbC11B6OE5jmdHDla3XMinMmySrBAH09GdLaHg/3cjRFI0HZr+0Vi01CTddNg2MQ38H6soCK8+GpkIuiQuWXtZqmPijYDuBNoo22Oo+vRlZpeLJRfDVYQrI/r0o2dHgT+e8Xl8sPnp1xaYk5pLeRrG/MBnghR621lW4R9QA== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: W+U3MdpaMsShb5gWz9CuN59/DcdcpxRbF+EjQl7uHnDKuTlXE13h9I1XiX0t1xc+rDP3I8KnqujvQj8uc6WbEjin5hZaLIrPvORVK4f1ONchFmkBwK+OPVNhyANA50klj6K9+d1+U1/ZmYei+Nn9XYHINj6PC5DQj8jev4FUeZSeVX1/1Z5ls7nzOdTCGJOSvP8HwvzTfmFn7rxygop2EvsBxsnDN9fO8vx65o30pNN9xfzwGb60AW0YfRbIXCJeYpNIG1hR3DiEFbbAVVkWID2Hrzic2nuh65rhpIQyCuejsxlCB2R/XavVmR/8LK5K5K7x1KRnqxe3djQKIJY/qeyWqC/T1M8bgnNbyBZqhFwk1kNAQXI0CBRYn3IV3kBOEdKunHt4mde7slZqhjmMkptN2z39z6q1qXRgA0T5YULLItTtVPfz/vzgdVYDuZ3FNvFCmfiI2XUx1vrvL+qQOsaEbFI9EcFQ2LUrdiRJZCdTRBUQt2DRS7FjAWKn+9MK9+poyEaEHsuf+G+1E3ZsTsyyTF/7r59xiNxzCrH15Ch7fo4w13dY2oc/nUA9oefkQQtw2Vd+vIbs6BNR1T6M84DINquIev98NUWHT/zJQD1NJJLrgSJ7e0JQ7KBeIUkArRF4xxy6PcM+qGUQGWuTwPJmL1gjfMxpyIf/brvKIVlQn5WHA6sBNdQWYf0IK8A9/t4FiC7JfCZC7bMqMi9WcHgT4dPM1R4E8SCl7yw0q3eut0B8xlJHnrIpZBSA4lhR4j5nXMXzlq2EcI7NfVb08l+Qq1hbUiiw1I44UQHhRUrc/iIi8fXDRkCqtdIvk+MFeGGmjUAE8UhvQyOJeON2N7o70mo+GLIIlAmv63ouI60Sgmx/5jQiPytxjGHRFU/YxTmD0aoX1Y2vrmr2AiRkjpiF7hSg3WJWwxbxgyml0EATxt4+FtiUeyyYy+Lh0VA+ayciJJeqbs3Q6alA9IDU+f4XUkpPORtegLnaCKd90Sfw1GYcvBFFISdvU5P6p9BteUgCCIrdMjsmZWDkQMVw441Og+ZVcYHm5XRqLbLLBiBPUKGUszmklHzM/FO2FYZHHNzAg4fedNxGcjk5u2gKWXmZSKEcVI/d+UB1TCKO16Wz5wNgJUEZDuAK9fk51fj+MOFh53qbGok8l8RFja0eEApEcXeYbKEHVoFmt3aVO1lRAyBvSoKbS16BfMQhaIWPQZSWg3dtaq82yElOocvOvPbyLoRBB/1ZrlyXQOZHVft0jKdRev9v+xml8Ey0ayvW61ADg/4k+fNtdi+ExG1aSOeSmzirqkuUq46i7qeXd9eVO06mLir4hyYqRyMFrX5DuiMVri2EgdQ71Kv5EKW6tWoLtwvDyglFt6lGmRCrtdsladtANOJ3mVdytyJduVAhuBY4TvHvfMHVaC+V25LvGtBoqfGH0aNYWj+cB9Y+LExKWJC7gTMuATAg483A/U7C X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a14c88df-51fa-416a-f54a-08da129fb00d X-MS-Exchange-CrossTenant-AuthSource: AS1PR01MB9564.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2022 22:50:29.1026 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0102MB2579 Subject: [FFmpeg-devel] [PATCH 7/7] avformat/demux: Avoid stack packet when decoding frame 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: 5IQtaB0LShEG Possible now that avcodec_decode_subtitle2() accepts a const AVPacket*. Signed-off-by: Andreas Rheinhardt --- libavformat/demux.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libavformat/demux.c b/libavformat/demux.c index ef189d9d8e..ed5c811a01 100644 --- a/libavformat/demux.c +++ b/libavformat/demux.c @@ -1983,7 +1983,7 @@ static int has_codec_parameters(const AVStream *st, const char **errmsg_ptr) /* returns 1 or 0 if or if not decoded data was returned, or a negative error */ static int try_decode_frame(AVFormatContext *s, AVStream *st, - const AVPacket *avpkt, AVDictionary **options) + const AVPacket *pkt, AVDictionary **options) { FFStream *const sti = ffstream(st); AVCodecContext *const avctx = sti->avctx; @@ -1991,9 +1991,9 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st, int got_picture = 1, ret = 0; AVFrame *frame = av_frame_alloc(); AVSubtitle subtitle; - AVPacket pkt = *avpkt; int do_skip_frame = 0; enum AVDiscard skip_frame; + int pkt_to_send = pkt->size > 0; if (!frame) return AVERROR(ENOMEM); @@ -2042,7 +2042,7 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st, avctx->skip_frame = AVDISCARD_ALL; } - while ((pkt.size > 0 || (!pkt.data && got_picture)) && + while ((pkt_to_send || (!pkt->data && got_picture)) && ret >= 0 && (!has_codec_parameters(st, NULL) || !has_decode_delay_been_guessed(st) || (!sti->codec_info_nb_frames && @@ -2050,11 +2050,11 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st, got_picture = 0; if (avctx->codec_type == AVMEDIA_TYPE_VIDEO || avctx->codec_type == AVMEDIA_TYPE_AUDIO) { - ret = avcodec_send_packet(avctx, &pkt); + ret = avcodec_send_packet(avctx, pkt); if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) break; if (ret >= 0) - pkt.size = 0; + pkt_to_send = 0; ret = avcodec_receive_frame(avctx, frame); if (ret >= 0) got_picture = 1; @@ -2062,11 +2062,11 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st, ret = 0; } else if (avctx->codec_type == AVMEDIA_TYPE_SUBTITLE) { ret = avcodec_decode_subtitle2(avctx, &subtitle, - &got_picture, &pkt); + &got_picture, pkt); if (got_picture) avsubtitle_free(&subtitle); if (ret >= 0) - pkt.size = 0; + pkt_to_send = 0; } if (ret >= 0) { if (got_picture)