Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] videotoolbox: Add SDK ifdefs for use of kVTVideoDecoderReferenceMissingErr
@ 2025-03-25 10:01 Martin Storsjö
  2025-03-25 10:16 ` Zhao Zhili
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Storsjö @ 2025-03-25 10:01 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Zhao Zhili, Marvin Scholz

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-03-25 11:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-25 10:01 [FFmpeg-devel] [PATCH] videotoolbox: Add SDK ifdefs for use of kVTVideoDecoderReferenceMissingErr Martin Storsjö
2025-03-25 10:16 ` Zhao Zhili
2025-03-25 10:46   ` Martin Storsjö
2025-03-25 11:30     ` Zhao Zhili
2025-03-25 11:33       ` Martin Storsjö

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git