From patchwork Wed May 22 15:22:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 49147 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp447674vqf; Wed, 22 May 2024 08:22:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUWFnvESf92mJ9uEth8nL4XqAA7LlfyT9clZNiw7UxXJh/+cNB09fxVsogaKqoiAHOT+hKXt2afUV9lqP5jm+686ZNrf8NeQYM1wQ== X-Google-Smtp-Source: AGHT+IEbj8kqZejfl/Gl9RU6XVG2LcwuVJZqoseHe0ICYvDz619hymHp9AqPX204LlE87C0WbnBr X-Received: by 2002:ac2:5473:0:b0:515:9ee7:ce45 with SMTP id 2adb3069b0e04-526c0a68de1mr1896583e87.49.1716391365132; Wed, 22 May 2024 08:22: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 4fb4d7f45d1cf-5733beac5a9si15583088a12.86.2024.05.22.08.22.34; Wed, 22 May 2024 08:22: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=sGYk5OVu; 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 52A7968D377; Wed, 22 May 2024 18:22:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02olkn2060.outbound.protection.outlook.com [40.92.49.60]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6BAC968D2A3 for ; Wed, 22 May 2024 18:22:24 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S7rMEBl9ciYRwBD5/eMDsFaciXPUSYnaxBrGo8z46365EakSvqsJBBwhz/C2B71ntib4OsRGODp1QR+RMUMGj854bpEp2FSAdlLzaix21bmrCI84m9lB88mqPdwlSCRQPN1KHmJopn0N5QgU8dCHqP6E2BmjfE69XgTAW/2g1n1tGJyTZqPS2joxLoxFXYJ4XmUfHQXpOotDEpvbJfWMnmtpO9GKOytRf1nE6Pbv46M8DxdBx1OQiAwWqlCritRh5tilbbOsxL3Mla4ADAjR0di3KLB4lDWk7bBPcwB3rCepj64RRnUq2+htGLMZarU1z+0RCKmK8DyFsw0XlVLfqA== 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=s1hHob0R2i5ZfaBnI+5iqJ2JNEn66POf1MX90Nu+ouQ=; b=T3O+sIXBFVgLjircJMC3NjrcICgxlEw2t1pWonDvTMLr8aESEuGKGYJtpQ/QENW5dKiahDSEcSnvwpylWHcGBUHAY6K7SdXl0/HO3IrNVpwWCWhMKFP5vuYSV43/DLJNUhbwbYJTiR4SR8fAhN5ZmY6x/pPEI5LrZTd9vlgyHmFJq3N0L/LKzf+HILG8QRnpmRscA2mWQ76ZNXtNo0EXRD3TzTADqOi3wvqjWL5arH2OqrHxoypRfPtb0BvQ4De9CVm8uXaPU/6BKmxFLf2JBI6cQLrBo20xCs68uiTPmpd8qP+TVUvCznylUGN3qAPYY+XAV/Dwq4KxFt28RPJpfg== 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=s1hHob0R2i5ZfaBnI+5iqJ2JNEn66POf1MX90Nu+ouQ=; b=sGYk5OVuAwriVuyXulqDd/9eFjRiUWKr9fOGRFGIymtx6uL61v3A9uSe5TMXPWwpojuCXvP4obP8SJIRkuvJKK4h1WM0U3miovgZrpLiZbj3ZobPp6ywcapUVJ+vw0zvPyhBhqAKqK4FQT61gKyX0btJl6sIhDsc5t8XUAnRaNqMlOItFVuRhAGPQmqbqB/t3Ngdy99BT730ajBxQY94zG8KC7OTedXQPicSBNovKxuRNKjr1TShAACGbqkkgeKc7Y1mLfM23aDMYkgKmhU9Jr37noGIIAqwfGtA4WzXwghgMrJwT8UMtr5z5rldy2OFGWXS0i3JOXRSlkdvYnCtpg== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by DU2P250MB0301.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:27a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.34; Wed, 22 May 2024 15:22:22 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::d6a1:e3af:a5f1:b614]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::d6a1:e3af:a5f1:b614%3]) with mapi id 15.20.7587.030; Wed, 22 May 2024 15:22:22 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 22 May 2024 17:22:12 +0200 Message-ID: X-Mailer: git-send-email 2.40.1 X-TMN: [w+C/Prqq1WogyqYl3tl1v7TQLNR4xV2k] X-ClientProxiedBy: ZR0P278CA0054.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::23) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20240522152212.3836486-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|DU2P250MB0301:EE_ X-MS-Office365-Filtering-Correlation-Id: b18a411d-9960-4ff0-0448-08dc7a72fa02 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199019|440099019|3412199016|1710799017; X-Microsoft-Antispam-Message-Info: m1bB0xHSsJpg3Yhit9oMixs+ns7wiJTW650PFfhNR4t/GdTsTtWZnHqYHx3e+ropaycHAY7widDn6UP53hS6mQYm6Cfp7QAIkGWvm0YXRhVlNdwcWXCxgjtokDnegVcVGXsTPeDC6Z5GQOjGt3lquSGftasNvVIgk2pYB98vsWy79cqv3ElQPbUkQJFa8L4E80K/o0FWCPbp7/q/SUd83EGgnG73/r4qGjsHnoF32Z6kj28KGjw0OAEUl6v4OVZXbLbL2wCvzCAaXF4/HSMJGa3s3pvN52DPNZpr2deFWqnzb9peYeH0i621bdhb23WSS/bJ1ikmyBxyNWek4PkZLCNH9ayBCJk/PWvM4JPryepmKk99Dv80ZWNYOk3O9m06nIfKRqUDeee5F4eG3yGteGbJHnM2OnYa49cpn3dTRO0JhkzoSat6nCffuPUjDAaGjUzzaEShxoVsYiStKFVN2o9Vyq5GArs4abfxv+Z5IntRZcl+sgCel8dsp13Q4Ash1u9vCgHV4JB384bJi2tn7C7MA1a/HFmYGJW07zYs3TgiU6DCj/GXUv9sS9Zxjn3k6sdPKNMlquNGUpOvR14KrZSN7vk5xt3O+lEpRjUp3h1p3byzmbJ+w91fX5sNnzt/ X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0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NVHTG8Wk5MhDIxEozwqu41ZNtP63aLY3bR4jhhij4aDi0JBBVLuEi9jnUyDr06DlbKdDN/MU1BycH0hpLDVtgoyh/mWjx4oUGp4ysbYBAHgrg64au21C2/etHV/q+75Hu0Xxcq1O7TH0ZesH7hIVVBnnUY+qZAjYbC8o4Eab1qnHdEZ5vvlIGTk78MAeOp9K18/XWODtWVxFjjwF0X2UraiBlWb3Q== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b18a411d-9960-4ff0-0448-08dc7a72fa02 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2024 15:22:22.2146 (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: DU2P250MB0301 Subject: [FFmpeg-devel] [PATCH] avformat/async, cache: Use more unique context names 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: Andrew Sayers , Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: HTJXDGSDcq5s Otherwise Doxygen thinks any text like "Context for foo" is a link to the async protocol's struct called "Context". Reported-by: Andrew Sayers Signed-off-by: Andreas Rheinhardt --- libavformat/async.c | 22 +++++++++++----------- libavformat/cache.c | 18 +++++++++--------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/libavformat/async.c b/libavformat/async.c index e096b0bc6f..e0329e23ec 100644 --- a/libavformat/async.c +++ b/libavformat/async.c @@ -53,7 +53,7 @@ typedef struct RingBuffer int read_pos; } RingBuffer; -typedef struct Context { +typedef struct AsyncContext { AVClass *class; URLContext *inner; @@ -78,7 +78,7 @@ typedef struct Context { int abort_request; AVIOInterruptCB interrupt_callback; -} Context; +} AsyncContext; static int ring_init(RingBuffer *ring, unsigned int capacity, int read_back_capacity) { @@ -132,7 +132,7 @@ static int ring_read(RingBuffer *ring, void *dest, int buf_size) static int wrapped_url_read(void *src, void *dst, size_t *size) { URLContext *h = src; - Context *c = h->priv_data; + AsyncContext *c = h->priv_data; int ret; ret = ffurl_read(c->inner, dst, *size); @@ -170,7 +170,7 @@ static int ring_drain(RingBuffer *ring, int offset) static int async_check_interrupt(void *arg) { URLContext *h = arg; - Context *c = h->priv_data; + AsyncContext *c = h->priv_data; if (c->abort_request) return 1; @@ -184,7 +184,7 @@ static int async_check_interrupt(void *arg) static void *async_buffer_task(void *arg) { URLContext *h = arg; - Context *c = h->priv_data; + AsyncContext *c = h->priv_data; RingBuffer *ring = &c->ring; int ret = 0; int64_t seek_ret; @@ -249,7 +249,7 @@ static void *async_buffer_task(void *arg) static int async_open(URLContext *h, const char *arg, int flags, AVDictionary **options) { - Context *c = h->priv_data; + AsyncContext *c = h->priv_data; int ret; AVIOInterruptCB interrupt_callback = {.callback = async_check_interrupt, .opaque = h}; @@ -316,7 +316,7 @@ fifo_fail: static int async_close(URLContext *h) { - Context *c = h->priv_data; + AsyncContext *c = h->priv_data; int ret; pthread_mutex_lock(&c->mutex); @@ -339,7 +339,7 @@ static int async_close(URLContext *h) static int async_read_internal(URLContext *h, void *dest, int size) { - Context *c = h->priv_data; + AsyncContext *c = h->priv_data; RingBuffer *ring = &c->ring; int read_complete = !dest; int to_read = size; @@ -391,7 +391,7 @@ static int async_read(URLContext *h, unsigned char *buf, int size) static int64_t async_seek(URLContext *h, int64_t pos, int whence) { - Context *c = h->priv_data; + AsyncContext *c = h->priv_data; RingBuffer *ring = &c->ring; int64_t ret; int64_t new_logical_pos; @@ -472,7 +472,7 @@ static int64_t async_seek(URLContext *h, int64_t pos, int whence) return ret; } -#define OFFSET(x) offsetof(Context, x) +#define OFFSET(x) offsetof(AsyncContext, x) #define D AV_OPT_FLAG_DECODING_PARAM static const AVOption options[] = { @@ -495,7 +495,7 @@ const URLProtocol ff_async_protocol = { .url_read = async_read, .url_seek = async_seek, .url_close = async_close, - .priv_data_size = sizeof(Context), + .priv_data_size = sizeof(AsyncContext), .priv_data_class = &async_context_class, }; diff --git a/libavformat/cache.c b/libavformat/cache.c index 5f78adba9d..5d71e56f3d 100644 --- a/libavformat/cache.c +++ b/libavformat/cache.c @@ -52,7 +52,7 @@ typedef struct CacheEntry { int size; } CacheEntry; -typedef struct Context { +typedef struct CacheContext { AVClass *class; int fd; char *filename; @@ -65,7 +65,7 @@ typedef struct Context { URLContext *inner; int64_t cache_hit, cache_miss; int read_ahead_limit; -} Context; +} CacheContext; static int cmp(const void *key, const void *node) { @@ -74,9 +74,9 @@ static int cmp(const void *key, const void *node) static int cache_open(URLContext *h, const char *arg, int flags, AVDictionary **options) { + CacheContext *c = h->priv_data; int ret; char *buffername; - Context *c= h->priv_data; av_strstart(arg, "cache:", &arg); @@ -99,7 +99,7 @@ static int cache_open(URLContext *h, const char *arg, int flags, AVDictionary ** static int add_entry(URLContext *h, const unsigned char *buf, int size) { - Context *c= h->priv_data; + CacheContext *c = h->priv_data; int64_t pos = -1; int ret; CacheEntry *entry = NULL, *next[2] = {NULL, NULL}; @@ -162,7 +162,7 @@ fail: static int cache_read(URLContext *h, unsigned char *buf, int size) { - Context *c= h->priv_data; + CacheContext *c = h->priv_data; CacheEntry *entry, *next[2] = {NULL, NULL}; int64_t r; @@ -227,7 +227,7 @@ static int cache_read(URLContext *h, unsigned char *buf, int size) static int64_t cache_seek(URLContext *h, int64_t pos, int whence) { - Context *c= h->priv_data; + CacheContext *c = h->priv_data; int64_t ret; if (whence == AVSEEK_SIZE) { @@ -298,7 +298,7 @@ static int enu_free(void *opaque, void *elem) static int cache_close(URLContext *h) { - Context *c= h->priv_data; + CacheContext *c = h->priv_data; int ret; av_log(h, AV_LOG_INFO, "Statistics, cache hits:%"PRId64" cache misses:%"PRId64"\n", @@ -318,7 +318,7 @@ static int cache_close(URLContext *h) return 0; } -#define OFFSET(x) offsetof(Context, x) +#define OFFSET(x) offsetof(CacheContext, x) #define D AV_OPT_FLAG_DECODING_PARAM static const AVOption options[] = { @@ -339,6 +339,6 @@ const URLProtocol ff_cache_protocol = { .url_read = cache_read, .url_seek = cache_seek, .url_close = cache_close, - .priv_data_size = sizeof(Context), + .priv_data_size = sizeof(CacheContext), .priv_data_class = &cache_context_class, };