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 00A6F400E0 for ; Sun, 19 Dec 2021 17:36:20 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7CC0168AF04; Sun, 19 Dec 2021 19:36:18 +0200 (EET) Received: from mail-vk1-f172.google.com (mail-vk1-f172.google.com [209.85.221.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A702C68AD86 for ; Sun, 19 Dec 2021 19:36:11 +0200 (EET) Received: by mail-vk1-f172.google.com with SMTP id m185so4788328vkm.5 for ; Sun, 19 Dec 2021 09:36:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=HBaefLTktB3P9EUtylh8/p2RsmA5ckadA+j8Nq5eMsk=; b=XQzrNuJ8irWNHAg3sEY/LCxEc7iwpB3pznbImuI27AOLxLGxJ/VIgDaVPBvwqO8peb Upiy7FRGDw11TVqsB73xOXasvNA63hVkxQfkF+j7THrSlTtEh1SvkvQRg7o0YeYq6lBu fmQWCM/zJiuobzJPCcayQMkSJqYlDFdaBts+EnYlD40brpifDAxS6ZWytNyYiR2NFH9w THRYLw9bQQnynR26K45lw+KOaPWlMbWvmbcqdvZuJugexDsj+Roal1BEkX5FhAuGakmv lVxRp9rrIxanqzqBiGTFYRTiCfzd0olc9pTUAMnX3mn6noRJYVcUgM6q24LLfq3E9k+7 DXbg== X-Gm-Message-State: AOAM531kv0gLnsNXJnXC4pXHtjIyXJMNZ0ANpMPRlyp6gTPT5CWw2qXC 19c/nzVkIrffpHb3/O8W6OiRrBRawncz0ovSt4m9MYola5c= X-Google-Smtp-Source: ABdhPJzVx6GZz3lneesagrS4hhF35oWjD2etwKJsJ4wDKYGmgY4Ha6OySeORXFCNhMfD2YHDpBegaoJWyd6FkZmGKF4= X-Received: by 2002:a1f:2bc7:: with SMTP id r190mr4523757vkr.16.1639935370030; Sun, 19 Dec 2021 09:36:10 -0800 (PST) MIME-Version: 1.0 References: <20211217200418.68942-1-ffmpeg@tmm1.net> <20211217200418.68942-3-ffmpeg@tmm1.net> <08de8d98-1b78-07c4-3b07-c4619635c610@gmail.com> In-Reply-To: <08de8d98-1b78-07c4-3b07-c4619635c610@gmail.com> From: Aman Karmani Date: Sun, 19 Dec 2021 09:35:58 -0800 Message-ID: To: FFmpeg development discussions and patches , rcombs@rcombs.me X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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 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. 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".