From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id 3CA644AEDD
	for <ffmpegdev@gitmailbox.com>; Tue, 25 Mar 2025 10:01:44 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D9A96687B92;
	Tue, 25 Mar 2025 12:01:40 +0200 (EET)
Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com
 [209.85.167.47])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AC7FA680CC5
 for <ffmpeg-devel@ffmpeg.org>; Tue, 25 Mar 2025 12:01:34 +0200 (EET)
Received: by mail-lf1-f47.google.com with SMTP id
 2adb3069b0e04-54ac9b3ddf6so5401113e87.1
 for <ffmpeg-devel@ffmpeg.org>; Tue, 25 Mar 2025 03:01:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=martin-st.20230601.gappssmtp.com; s=20230601; t=1742896894; x=1743501694;
 darn=ffmpeg.org; 
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=i0zCsQU9sQoMT2AehXgyxR6XzvY/0xbFDFa6HmmDXTA=;
 b=KGrrpaS4ZOO6384DsawmyPCd7CnrPm0IJHkwr6pnwQD5bcIgKfd+hUa5uaCNWcCukP
 VH30dccwuSCshz7NG1rVq+nI8eKeJvcxlgyjz4n8zgSvIxQm0u6OhLtKiJvV8XWaR3We
 CiNq7mtrVgYCTDCd9TciO/C4PUvtmNjCdhft38S6ZftHcE/1TjQm+AaM4jrmJB19VcF9
 1NFjB+Evr96ym6Er24OGAleXoGgpe8bbQdjU9/TVymt/tqN1nMfiYm3k1qAAlOM3Jgdu
 1ER6rl5J6GR9jlc17ErisgCZYFxlly01wuLTeFoqlVL+K+6vzWOLoiDg4vnQhGKF6HbF
 QRVA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1742896894; x=1743501694;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=i0zCsQU9sQoMT2AehXgyxR6XzvY/0xbFDFa6HmmDXTA=;
 b=TcXWKTnBjA2JwatcQPYEUvH4NU+0vVNFMqt6BetzlR1jtsSfkla940Un8+DmW1zWtK
 uQKE/hxl+ZBbzfwvVpaB2vJm3e9AeR8fQZ+Cr4yKfZTRh0mwNiWM/NbTLb6XMpqL6m/c
 Aid+W2UIXtjl5MkNNs7s22E4m/x5UEat6hZ1tg/rudg91pjwX+selRkAbLCEO8/gEA/2
 rr+tmCH5+qUqw2Lyib5THphbL5Fzqz500hWScowzaF4ZemxNVjkwLQrh22JF5BXQrf1V
 41hAloApL245IIAM39xsmJr5Kgy1ZGcI3ukgrlihD2cK0Bpd4CuMlYH3ujB/yVxbJMM3
 1fWw==
X-Gm-Message-State: AOJu0YxFGke7NrxdKnXKhW8icN5DHkljFHjQiUK7drE9C2KB8VSyTctl
 7tnZYzdj0PfESHJBy7gbDaaXP7e3SCOlXBB4HSLzi9djpdbGfdhAV+ZMpMFfvpi8G2wSRB7waM3
 7t5Mm
X-Gm-Gg: ASbGnctv5SFirC23uXjAawWJ9Z/FALxE8dnpKVOWOc5eDEphurfiLTikBS4phUrQlze
 yUZhqp9D3zaAs0WTS5lU65WxfeFJhk5TpJir91/gzRpnrJzJd4qc4lglfMfQTDfbpa0DM9V5CiA
 uUdNMtOacr9FeoXumzOHvZacAcZKVPABojJ9qDNaDOrRI85DPbRoiCGVdPKzBC5elDVd+8WN+/n
 ADgrRQaiE5RsYcmvUsRp/8t8VW3Wkwh7EkaDq7svWdJizuWJlmIiZorIJ9pF4+1mAVPn+/8rPZF
 uMw9VLCCZBt14cc43wvlPpn3im/o3+ySZnhsnNYYXcJM/OheNZ+WSPmzSb324fDymNdNh3XyDJm
 AJ1rR2+l/GqA=
X-Google-Smtp-Source: AGHT+IGgkWvy1Xr3oehBceYyUB/2Fj7VuHFClbPiajuszhHhLALypYfg3gCea8dIq/mqsrj1J1Ckzw==
X-Received: by 2002:a05:6512:2395:b0:549:6451:7e76 with SMTP id
 2adb3069b0e04-54ad64f5220mr6739138e87.33.1742896893698; 
 Tue, 25 Mar 2025 03:01:33 -0700 (PDT)
Received: from localhost (dsl-tkubng21-50de30-198.dhcp.inet.fi.
 [80.222.48.198]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-54ad65096a3sm1437122e87.196.2025.03.25.03.01.33
 (version=TLS1 cipher=AES128-SHA bits=128/128);
 Tue, 25 Mar 2025 03:01:33 -0700 (PDT)
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
To: ffmpeg-devel@ffmpeg.org
Date: Tue, 25 Mar 2025 12:01:32 +0200
Message-Id: <20250325100132.57710-1-martin@martin.st>
X-Mailer: git-send-email 2.39.5 (Apple Git-154)
MIME-Version: 1.0
Subject: [FFmpeg-devel] [PATCH] videotoolbox: Add SDK ifdefs for use of
 kVTVideoDecoderReferenceMissingErr
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Zhao Zhili <quinkblack@foxmail.com>, Marvin Scholz <epirat07@gmail.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/20250325100132.57710-1-martin@martin.st/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

This error constant was only added in the macOS 12 and iOS 15
SDKs.

If building with an older SDK, assume that the error doesn't
match this constant.

This fixes build errors with older SDKs after
c6214b0d691566c7cb0f2ff5be08a24c3534e5bb.

As this constant is declared unconditionally (without any target
version guards) in the headers, one can't reproduce this issue
while building with a newer SDK and targeting an older version
with -mmacosx-version-min=.

Technically, checking just one of MAC_OS_VERSION_12_0 and
__IPHONE_15_0 is enough; the macOS SDKs and iOS SDKs share these
files, so files from a similar point in time do have the same
defines. Therefore, we don't really need to expand this with
checks for tvOS, watchOS and other OS variants.
---
 libavcodec/videotoolbox.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index aaa6129576..7f7b910b26 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -728,8 +728,13 @@ static void videotoolbox_decoder_callback(void *opaque,
     }
 
     if (!image_buffer) {
+#if defined(MAC_OS_VERSION_12_0) || defined(__IPHONE_15_0)
+        // kVTVideoDecoderReferenceMissingErr was defined in the macOS 12/iOS 15 SDK
         if (status != kVTVideoDecoderReferenceMissingErr)
             vtctx->reconfig_needed = true;
+#else
+        vtctx->reconfig_needed = true;
+#endif
 
         av_log(vtctx->logctx, status ? AV_LOG_WARNING : AV_LOG_DEBUG,
                "vt decoder cb: output image buffer is null: %i, reconfig %d\n",
-- 
2.39.5 (Apple Git-154)

_______________________________________________
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".