From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id AB94B48669 for ; Wed, 14 Feb 2024 17:24:25 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 134D968D213; Wed, 14 Feb 2024 19:24:14 +0200 (EET) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04olkn2100.outbound.protection.outlook.com [40.92.73.100]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A68B468D1D7 for ; Wed, 14 Feb 2024 19:24:07 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ida9aWP7xzeCXbvY+1o/yBzAhBCP21FGRG3VC164QjOcd14Nq6fwiab/UgHZS7SgvADDz0Xfz6IQ7JScNJ9J6E+++bnSPtZotqeNzdoj1xBFEDnxkwSIK3+UYRXfKEHqd+0YNOtJCzsgltDuKDhzLX6ARneX66M6sr83BcRvhj8tLDLBSk/g23hHemgTKulyDKB3lYO4ayuitIAMOh5VqUsWPXvMXjaiDEMBaVMbDtOBct+5guhw+GdfryDZKEs6tYKLWoD8E+Z5iqSGQOqYKxLCxHRHaZyq3hFth8eYgA8qqFdFi/9EsohlxKQ4lK4W/uSXMJWMPEEMDbg6kMqPTg== 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=X0fuaFCdw1JSRNcjfUOwcYgyZTE7TerbKrT9ruT4hhA=; b=IVK800V1Y15l6IKkrhprUqObuZGjxuCM1DeiO7RcC6Vv8JCbcO7Z3TTrUAwE9Y5mivdRmnWbJAxMub+eM4sTvmBjKScGdyC8Y3D8HpwKZmIgSL+fXMimtBAgpNHGL8J79r1TRqQDIvk1iQMPqKNWJQV7Tvr4HX5URbyxTHKLHV074WQcONAHn093/A3cK/v0GHRFf9f+f4aUQez8zTAnOVJ1ON5Rhoi9x4lYY4aNZ+/FlYIUoA4r1UtTvwnaEAgedKRkmpNe/7qYaYogSA91WmvtKtzHocxAtQjEmFBvXlTcrHpJvm1rbK/z5EqhJ1oLVwOHPqGI0kufG4K8d2/7ig== 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=X0fuaFCdw1JSRNcjfUOwcYgyZTE7TerbKrT9ruT4hhA=; b=X9Eg2P5frd38IkTEXt1ZIJ2RAWS2mgu+9XJwYf7DMj9eamWCwe5fpcyURJ7GFZeyEDZbMkugI4cNsntIjxmY/+jt7SDpaGRSzvLSDYslt2AUKsxaV5x3OzSxsQ9JfCo2+MeP20js0rgwf9I5UtV8u0hj84/5faLKCy1IUZ2FUebSLw0fJnkR4jReiBytyRlgs+9xXPcAUUJEg4a16XcCwfWt5N0pJOzdOlv1pFl/DafHFlJr/5Oo8pM9vSjZKgr4Z+em6pwJIOdbB2pzID4pORmuV9OmljyD0QjcJls4iePLzKKwWNMQiwkfZjIpL3dG1k6kmt6lUVTh4+z/FK0S2A== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AM8P250MB0374.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:329::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.39; Wed, 14 Feb 2024 17:23:53 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d%5]) with mapi id 15.20.7270.036; Wed, 14 Feb 2024 17:23:53 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 14 Feb 2024 18:25:34 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [h4ROnnkFsOyShYFo2ePPN0AbwS/THBHhUy0ZfubdOS0=] X-ClientProxiedBy: ZR0P278CA0001.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:16::11) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240214172537.1099404-4-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|AM8P250MB0374:EE_ X-MS-Office365-Filtering-Correlation-Id: 06e34f71-02a5-4b70-c00e-08dc2d81b7b2 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VQyXdkz4Jr8dfbRiGYmnDIhrGbJxvNI0l6A5AE5ITq+an6O0f6SHag3maI/Zq3kUFa7koXEWMv90HrlZ7io1clq1w1c6Tw7walFuFr+cpCNH71J/lVLCMIawnXBJqVBU2M3UTcF/JA3epCzzP/aJ3RunAjVskouRNNVY+DLVdO1lwOSIXAKVOA6zxL3CIYNoU6iIkgEIoBDIPLxhWf33plN//yS6ahdprm2xnBPnnH1oe6UrBw8sO4xLVbgdz9FQ+lQN93fGyZg047G0F5Me2b6WX2APLzXtcT5ubh2InEQs1a4SBZkV16FMHTOnfr5V/J2R+aQOUZ3fkAvmsKpp84hD1OeNFLid/QtDhSE4dVboO3weXnqZHJ+yrC2nSPrUsH6YZfgmcWSTc8amQlHrklJoSg3zTqy3N5w6E4WLjj+ucxr+2E63Msmv5bF+GljT5uA+DjOwG3WYtxsGkWdAI9rzUpp2g4T1R1DKJ7pWLZ1n+SvHkerXwFXk7B3+bLSdLm5Ld/qxRLMNrdiBm4J24Ydu7MwJVAb6ck1ohosJLnngEbZ1O4AKO12QXH15X8emZ8evUuoPfyTSEQGG6gCu14YLD6teuFLmxwHRL62oOzE= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?1XlKZTBaPb862vsaakZntnfxzruh79WKoOvz04wLUonw32tIrZ6a4TAK004w?= =?us-ascii?Q?eoDZEs2sOP5S3SpkbFEUyobHLo68ITsawk7lR23tzc7q6GrRwOLcqiWq4W+/?= =?us-ascii?Q?ZCnlKKbFqTXvPnQto1jet4vw5cVaUDfpedDRlbgcERaGhvENOSNfwo/vRQou?= =?us-ascii?Q?lrBUmCFEzDjivDigXjS1WBKLxqTTBL41dhaN7SMre8IWTlNW0hJ1RYFZ4W6J?= =?us-ascii?Q?uluErmPq5eIp+iO49smgkMhl6aFEpMkKehCeP6JbzICrLr3ewLgCrrVf9pLU?= =?us-ascii?Q?jub3T+NmfmGGE5rnFSRayS8i7STxcEMYjXT70CvZljLGvD5Fwu9s2Vn5iOu9?= =?us-ascii?Q?uSqvLFfToIswYvbgAwj9DELUFcqMf5PnwL9V+bJRnszgy0Dhbu6Gll9WLLtr?= =?us-ascii?Q?wP8bB5+Sh1xP4LTyIQHnWEz6g1A4XLE7aMSk4KTKcXhVylv2dawVXl2Bfuql?= =?us-ascii?Q?xsWDl/ABZGs+eeyZyz+ZnJyqBrChM+xypF7PYPm2n4KKm++s0wMGr3PUYe2k?= =?us-ascii?Q?yPz9r59MkYVmaFa0RBVk0YTOKGX8IuouRBaHOpqYynbZNhJVRdUp7pDVsA6h?= =?us-ascii?Q?IEPCs0DXxUM7h0xo9LKy1zIjsOFgTukufsd6fUWLdVTHigJW1iIPb6PVI1wx?= =?us-ascii?Q?GQ/UMgM7fEFx4JX/qfi4ieQ0C3MrP4q7STHdQDn9sEQaq05bQCkGhvUrL2a+?= =?us-ascii?Q?TezoAsPA9G48ztqzffdtkTsvybX2f0Aw81RJkyVheszOIO/9b3cQeytM5FZT?= =?us-ascii?Q?9wyof2C1ogTNqPWGOQ4qD4tkjV96lNCoID44Tr9VsQwSfYGGYCigYVyUiSnt?= =?us-ascii?Q?6oUJoJNBG3G92ARHgMcOHN4fwrLZwB710pBVNuP19aPx9dAHPZwP3bd7UOyR?= =?us-ascii?Q?R8uYiq3H5uziaZIcY9Zvv+ly/ulgBe1q3fHaGITvtPK3pOePaf5nwsQ1+WQR?= =?us-ascii?Q?X86gEv+S788ZA8gt18zFkrSzqzXUtm/O4LfxmB9hmH6G9jpUDpLaAGlrvbwK?= =?us-ascii?Q?xupQtNUQ6Xm7fHNKpESkDr139uYAomHkPVtUXguBAgsd6+tziizZMV6hxLyz?= =?us-ascii?Q?7LxtvGHVD4UIntNz/Q8Ots6grboIL1jewqSWRv9t3oIcRuVoi5ThXFIZVyLj?= =?us-ascii?Q?EdkUFNhUrNMMHrXWWmneWDjweA03lQ9DF0oE3z1emX/JNvzVkKxEVsq2qhww?= =?us-ascii?Q?LMEQc043J3UJmch1kLtC1XdRXHQGHD9WQ4qyWBh4lF0GzCQ0Tr/T+AHipGfq?= =?us-ascii?Q?ZyLmgroRcVRUfsWwA7MmHVfQYCvyWZJROYepp/QVuQ=3D=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06e34f71-02a5-4b70-c00e-08dc2d81b7b2 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2024 17:23:53.7838 (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: AM8P250MB0374 Subject: [FFmpeg-devel] [PATCH 5/8] avfilter/avfilter: Move AVFilterGraph private fields to FFFilterGraph 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: (These fields were in AVFilterGraph although AVFilterGraphInternal existed for years.) Signed-off-by: Andreas Rheinhardt --- libavfilter/avfilter.h | 12 ------------ libavfilter/avfilter_internal.h | 6 ++++++ libavfilter/avfiltergraph.c | 32 +++++++++++++++++--------------- 3 files changed, 23 insertions(+), 27 deletions(-) diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index b5346f40ab..1d2909e28d 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -899,18 +899,6 @@ typedef struct AVFilterGraph { avfilter_execute_func *execute; char *aresample_swr_opts; ///< swr options to use for the auto-inserted aresample filters, Access ONLY through AVOptions - - /** - * Private fields - * - * The following fields are for internal use only. - * Their type, offset, number and semantic can change without notice. - */ - - AVFilterLink **sink_links; - int sink_links_count; - - unsigned disable_auto_convert; } AVFilterGraph; /** diff --git a/libavfilter/avfilter_internal.h b/libavfilter/avfilter_internal.h index 9ddb82bf26..72712608e7 100644 --- a/libavfilter/avfilter_internal.h +++ b/libavfilter/avfilter_internal.h @@ -41,6 +41,12 @@ typedef struct FFFilterGraph { * The public AVFilterGraph. See avfilter.h for it. */ AVFilterGraph p; + + AVFilterLink **sink_links; + int sink_links_count; + + unsigned disable_auto_convert; + void *thread; avfilter_execute_func *thread_execute; FFFrameQueueGlobal frame_queues; diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index 1e7874adc6..5278cf2010 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -127,7 +127,7 @@ void avfilter_graph_free(AVFilterGraph **graphp) ff_graph_thread_free(graphi); - av_freep(&graph->sink_links); + av_freep(&graphi->sink_links); av_opt_free(graph); @@ -159,7 +159,7 @@ fail: void avfilter_graph_set_auto_convert(AVFilterGraph *graph, unsigned flags) { - graph->disable_auto_convert = flags; + fffiltergraph(graph)->disable_auto_convert = flags; } AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph, @@ -471,7 +471,7 @@ static int query_formats(AVFilterGraph *graph, void *log_ctx) char inst_name[30]; const char *opts; - if (graph->disable_auto_convert) { + if (fffiltergraph(graph)->disable_auto_convert) { av_log(log_ctx, AV_LOG_ERROR, "The filters '%s' and '%s' do not have a common format " "and automatic conversion is disabled.\n", @@ -1317,8 +1317,8 @@ static int graph_config_pointers(AVFilterGraph *graph, void *log_ctx) } } av_assert0(n == sink_links_count); - graph->sink_links = sinks; - graph->sink_links_count = sink_links_count; + fffiltergraph(graph)->sink_links = sinks; + fffiltergraph(graph)->sink_links_count = sink_links_count; return 0; } @@ -1401,7 +1401,7 @@ int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const return 0; } -static void heap_bubble_up(AVFilterGraph *graph, +static void heap_bubble_up(FFFilterGraph *graph, AVFilterLink *link, int index) { AVFilterLink **links = graph->sink_links; @@ -1420,7 +1420,7 @@ static void heap_bubble_up(AVFilterGraph *graph, link->age_index = index; } -static void heap_bubble_down(AVFilterGraph *graph, +static void heap_bubble_down(FFFilterGraph *graph, AVFilterLink *link, int index) { AVFilterLink **links = graph->sink_links; @@ -1446,18 +1446,20 @@ static void heap_bubble_down(AVFilterGraph *graph, void ff_avfilter_graph_update_heap(AVFilterGraph *graph, AVFilterLink *link) { - heap_bubble_up (graph, link, link->age_index); - heap_bubble_down(graph, link, link->age_index); + FFFilterGraph *graphi = fffiltergraph(graph); + heap_bubble_up (graphi, link, link->age_index); + heap_bubble_down(graphi, link, link->age_index); } int avfilter_graph_request_oldest(AVFilterGraph *graph) { - AVFilterLink *oldest = graph->sink_links[0]; + FFFilterGraph *graphi = fffiltergraph(graph); + AVFilterLink *oldest = graphi->sink_links[0]; int64_t frame_count; int r; - while (graph->sink_links_count) { - oldest = graph->sink_links[0]; + while (graphi->sink_links_count) { + oldest = graphi->sink_links[0]; if (oldest->dst->filter->activate) { r = av_buffersink_get_frame_flags(oldest->dst, NULL, AV_BUFFERSINK_FLAG_PEEK); @@ -1472,12 +1474,12 @@ int avfilter_graph_request_oldest(AVFilterGraph *graph) oldest->dst->name, oldest->dstpad->name); /* EOF: remove the link from the heap */ - if (oldest->age_index < --graph->sink_links_count) - heap_bubble_down(graph, graph->sink_links[graph->sink_links_count], + if (oldest->age_index < --graphi->sink_links_count) + heap_bubble_down(graphi, graphi->sink_links[graphi->sink_links_count], oldest->age_index); oldest->age_index = -1; } - if (!graph->sink_links_count) + if (!graphi->sink_links_count) return AVERROR_EOF; av_assert1(!oldest->dst->filter->activate); av_assert1(oldest->age_index >= 0); -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".