Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Martin Storsjö" <martin@martin.st>
To: ffmpeg-devel@ffmpeg.org
Cc: Zhao Zhili <quinkblack@foxmail.com>, Marvin Scholz <epirat07@gmail.com>
Subject: [FFmpeg-devel] [PATCH] videotoolbox: Add SDK ifdefs for use of kVTVideoDecoderReferenceMissingErr
Date: Tue, 25 Mar 2025 12:01:32 +0200
Message-ID: <20250325100132.57710-1-martin@martin.st> (raw)

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

             reply	other threads:[~2025-03-25 10:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-25 10:01 Martin Storsjö [this message]
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ö

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250325100132.57710-1-martin@martin.st \
    --to=martin@martin.st \
    --cc=epirat07@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=quinkblack@foxmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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