From patchwork Thu Dec 16 20:28:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aman Karmani X-Patchwork-Id: 32666 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp832361iog; Thu, 16 Dec 2021 12:29:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwbJBYb6T222M11/VHaERM9wWuEKzaOCdBKx60sSoARZZ6NQUA2d/PgPqcuhlWYccS7SVjF X-Received: by 2002:a17:906:31c2:: with SMTP id f2mr17486707ejf.341.1639686580898; Thu, 16 Dec 2021 12:29:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639686580; cv=none; d=google.com; s=arc-20160816; b=fAUFPuU+iIabGT2paYnBiFM41ZhQ7p+Knd7825MCyXERNVXS5MswpJx+Dgk1RjLvw0 gz2wS4BrjKqyFL7TQdmRK52za1j1v0Fpxo0w9o2D5jjNX34Jp8DOG6xwK2b+LxbW48y6 iKw0S5qgXgKxnUdwFk9emIad4VFw/oyJLN66GO9vxxRchoExgWF0FITfot3wd7LSx0Gh goEeMqu8awSsrgx3FLbL2s79Kl8vtVVAtqCHOVcqEi3mdMFckoe8d+hyHKbLVmpXlkQV Z/wIp9bmSww9O2tqnGv7p9YZ5ScKFv+K+vV8qh648oDElMRCKf0zFBmnuJ7QcJqD/yqX GeuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=eYILe//xkS8hj+kWfduqmg0rGB2DIysTEXeXiZ1vMK0=; b=PN5avAhVBkw9iRB7TUUB7El3jduHyqkOLVXQn/MAYvr+WD/c7gjfn3vaQ3eNb+O81A 5xludceLn/GqvUaqeXKqpz6PR5Nk3Pa0PT1fqbEIbGO4W6ffgHqYHpkqJKT4AzP6qf8+ mv3AJIKtV7lWDMsZhQCN1C3aS/re/AUgXmVWfqQpROiWw4m82TULltMGaBv62VidoL4P 4kOp7qGCpSESnRLg+xhvLhqzh0+FjxqYe3Y9yh0ysVxaoQ6Z279eg+RZHFpii8nJnu2h vNaSqFKHdcOAeupGYXf0scq0BRbfto/7L8MQTcvM6RcaV3KYUhIcTNsR2r8ZMDzzL+s3 SMkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=ej9UzV3b; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id dd13si5074322ejc.841.2021.12.16.12.29.40; Thu, 16 Dec 2021 12:29:40 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=ej9UzV3b; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3694268AF85; Thu, 16 Dec 2021 22:29:16 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2487768AF56 for ; Thu, 16 Dec 2021 22:29:09 +0200 (EET) Received: by mail-pj1-f51.google.com with SMTP id f18-20020a17090aa79200b001ad9cb23022so459978pjq.4 for ; Thu, 16 Dec 2021 12:29:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7J5gE8A6u5+d8rZTnUfnUKTgI4tI5h11RBoCpL4Ov9U=; b=ej9UzV3bmb6wA03ZyQk7PgvAHgigZxM4hHFrRP9ev87h7npcNufXxqd8r8lVuJZm/E IRGiDIlYSjuk5IdpSDaR+I7TQXlfZGeOEq8yQ3LQuayXE5pYEvejsrgpl0KnpmCrlYgi nO07vh3lwNf6Ip76F425cqSzuNX9bjZtHjXUMAXtZiK1WYo46Pi99jp22CGWrt6bUgj3 6qrtd2xhqc/tsvWZGqCoAKlEbXCoQDwc4zhs4FVw728ICLMjMre+wGGF2QblaD93WfLu 7CmbU/JVatHkmK2M9l6uJyrA4Btor6MNy6G1CnDksPKOzSYmGIyk0A2NqJ+p3WrJqgYo Rqhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=7J5gE8A6u5+d8rZTnUfnUKTgI4tI5h11RBoCpL4Ov9U=; b=HRRTIHOzDp8oD/DnLY4wn6QI6HAnrpLE8cWgVVuJOOLGwl7zenGG2TVFVvXZh/zWR9 QokPCmSBXSl/FIeIIdcFiZL+Ex6UHdKF73l3qhe1thGelDRK+uGILV/e+yRIYhcc9mKY yTZwjNlGV4bBPfu8bMrcoPWbtMyXjv36u0vgFRxT4TuY96HFSQfa5QRTK9FrMv+3XymF 5XuJQKIm/+iZgtwWxAnbW8dOojwM6kKufHVWmp8iRsVc2/MPSdpC5HtMA1xu2bC1AkRM owjXEHSjy6AcjNvbyDL109LbffL9KuuRmt1IQQlchB1A5wZm1JNKIY1V5zKSr7Zv7Vzc WINA== X-Gm-Message-State: AOAM5314F5uoNE1+nJiPtSGmVjBwM3j+QBNBwvY1HSl0RVovkq2g+Tuw dEGGZHcyC0BHz+rDUUvYdR7/b50wQiHmQg== X-Received: by 2002:a17:902:e892:b0:148:a77a:d312 with SMTP id w18-20020a170902e89200b00148a77ad312mr10250893plg.95.1639686547133; Thu, 16 Dec 2021 12:29:07 -0800 (PST) Received: from tmm1-imac.lan ([2600:8802:5501:308f:15c6:3324:e59b:bed5]) by smtp.gmail.com with ESMTPSA id k16sm7534732pfu.183.2021.12.16.12.29.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Dec 2021 12:29:06 -0800 (PST) From: Aman Karmani To: ffmpeg-devel@ffmpeg.org Date: Thu, 16 Dec 2021 12:28:56 -0800 Message-Id: <20211216202858.77643-3-ffmpeg@tmm1.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216202858.77643-1-ffmpeg@tmm1.net> References: <20211216202858.77643-1-ffmpeg@tmm1.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 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 Cc: philipl@overt.org, Aman Karmani , kernrj@gmail.com Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 1RN7KPTZokFm From: Aman Karmani 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..3ca1303394 --- /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 + +inline void ff_objc_release(NSObject **obj) +{ + if (*obj) { + [*obj release]; + *obj = nil; + } +} + +#endif /* AVUTIL_OBJC_H */ \ No newline at end of file