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 86541401B4 for ; Sun, 19 Dec 2021 18:03:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B5A0C68AF04; Sun, 19 Dec 2021 20:03:56 +0200 (EET) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 652B2688384 for ; Sun, 19 Dec 2021 20:03:50 +0200 (EET) Received: by mail-wm1-f49.google.com with SMTP id n14-20020a7bcbce000000b00332f4abf43fso4412574wmi.0 for ; Sun, 19 Dec 2021 10:03:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version; bh=kIQyDXugbt4ZMjLFkychpcyr1IKwLcqR/G0nTJMAoqY=; b=HQkV7TXZ2BD7zCQxMxgCRs7x37/MP6v+f2II405J34da+fPVmKvK+Bmsb5qWrYNz32 r2UlsxRAX0s8bv8UpglDYpEEGZw4HDbOS1ZP5jJX0PM++iDq7LNoXGICpOaFDfpisCuk Zbk+IhTgspJMkWqgVpZXWB9+Y/SbljH/jI7NZQcHkc6t2dTd+DDMMzuzemPe+GJWqVcR f53og8Oydf9VC/mQYjZ/uBmyK8KTzZgusZx01XyMHI+l6wEtHu1iBeVu/xSn3cg1Y8Ns mYUnU8O3Q1Ftf2yDylq7U/gZeftL3s/fWmQr2VjZb95Ed41w4eZu+guhI+83m7zCkFhF cG1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version; bh=kIQyDXugbt4ZMjLFkychpcyr1IKwLcqR/G0nTJMAoqY=; b=0WGtKTBIkbpAjiVmX2WPx/aLyj5Eiy4RqBbrMZtSHV71D1AWhpBeBfoPEtTMRj8j85 vZOmtaHGa3P1MjhKRJkQzhYekgBDH7TDCdTziqL8qVqPOiq/Dd07me9U5nig41Lezj8y EJbH95NuG70KvavjZY+Qet2xRXSoex7M4oLTWKXZF3jSzkyQdx2TOdSKYAsGbC9dUc32 sc60/lgAc5h3Zz8ebf8feBzeb8GwXHL4WH6KBh8pHNV9Fmpoe6S82OXsnJyR99sMQ5np 0zA4HEJ8rVssQFC0nvK9BsdHlpiuT7UuVIHNJMypNQq04F7NvZhGj3OxHWLYGkgdhIoR X/fQ== X-Gm-Message-State: AOAM532L0KVmxB+nlUJu+D2WrCDxJavSFEei82eR5hcnJyiNTyWI2rb9 PEp2crc9xq0uWAM3QDs9RycaP622zOKyzA== X-Google-Smtp-Source: ABdhPJzUV/VqBSYSYiKKlOEMw7bIj+OC30DyfwVVSePykM2AyR6edZsyuGEhk1sNKrit9uWHy7pdpg== X-Received: by 2002:a05:600c:1993:: with SMTP id t19mr18192216wmq.21.1639937029681; Sun, 19 Dec 2021 10:03:49 -0800 (PST) Received: from [10.10.10.172] (84-112-75-55.cable.dynamic.surfer.at. [84.112.75.55]) by smtp.gmail.com with ESMTPSA id f13sm9409110wri.51.2021.12.19.10.03.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Dec 2021 10:03:49 -0800 (PST) From: "Marvin Scholz" To: "FFmpeg development discussions and patches" Date: Sun, 19 Dec 2021 19:03:48 +0100 X-Mailer: MailMate (1.13.2r5673) Message-ID: <3F585874-A24F-4758-AFAD-A3C7FB266068@gmail.com> In-Reply-To: References: <20211217200418.68942-1-ffmpeg@tmm1.net> <20211217200418.68942-3-ffmpeg@tmm1.net> <08de8d98-1b78-07c4-3b07-c4619635c610@gmail.com> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v4 3/5] avutil: add obj-c helpers into header-only include 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 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: On 19 Dec 2021, at 18:35, Aman Karmani wrote: > On Sun, Dec 19, 2021 at 9:09 AM James Almer wrote: > >> On 12/17/2021 5:04 PM, Aman Karmani wrote: >>> From: Aman Karmani >>> >>> Reviewed-by: Ridley Combs >>> Signed-off-by: Aman Karmani >>> --- >>> libavutil/objc.h | 32 ++++++++++++++++++++++++++++++++ >>> 1 file changed, 32 insertions(+) >>> create mode 100644 libavutil/objc.h >>> >>> diff --git a/libavutil/objc.h b/libavutil/objc.h >>> new file mode 100644 >>> index 0000000000..0db993f716 >>> --- /dev/null >>> +++ b/libavutil/objc.h >>> @@ -0,0 +1,32 @@ >>> +/* >>> + * This file is part of FFmpeg. >>> + * >>> + * FFmpeg is free software; you can redistribute it and/or >>> + * modify it under the terms of the GNU Lesser General Public >>> + * License as published by the Free Software Foundation; either >>> + * version 2.1 of the License, or (at your option) any later version. >>> + * >>> + * FFmpeg is distributed in the hope that it will be useful, >>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of >>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >>> + * Lesser General Public License for more details. >>> + * >>> + * You should have received a copy of the GNU Lesser General Public >>> + * License along with FFmpeg; if not, write to the Free Software >>> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA >> 02110-1301 USA >>> + */ >>> + >>> +#ifndef AVUTIL_OBJC_H >>> +#define AVUTIL_OBJC_H >>> + >>> +#include >>> + >>> +static inline void ff_objc_release(NSObject **obj) >>> +{ >>> + if (*obj) { >>> + [*obj release]; >>> + *obj = nil; >>> + } >>> +} >>> + >>> +#endif /* AVUTIL_OBJC_H */ >> >> This breaks checkheaders. It should be added to SKIPHEADERS with the >> corresponding check. >> > > Sorry, will fix. > > >> >> Also, why is this in lavu if it's ultimately only used in lavfi? And >> does it need to be a separate header at all? It's apparently not even C. >> > > It is a generic helper requested by rcombs. I think the plan is to reuse it > in other filters/decoders/encoders written in obj-c. > > One of the reasons is becausing calling `[nil release]` can crash. That's not true, dispatching a message to nil in Objective-C has no effect. I don't really see the benefit of this helper, personally. > > You're right that it is not C, its obj-c and that's why it was simpler to > have it be an include only header. I'm not sure if using a different > extension would have been preferred. > > Aman > > >> _______________________________________________ >> 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". >> > _______________________________________________ > 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". _______________________________________________ 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".