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

* Re: [FFmpeg-devel] [PATCH] videotoolbox: Add SDK ifdefs for use of kVTVideoDecoderReferenceMissingErr
  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ö
  0 siblings, 1 reply; 5+ messages in thread
From: Zhao Zhili @ 2025-03-25 10:16 UTC (permalink / raw)
  To: ffmpeg-devel


> 在 2025年3月25日,下午6:01,Martin Storsjö <martin@martin.st> 写道:
> 
> 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

I used its numeric value initially, but after checking the doc,

kVTVideoDecoderReferenceMissingErr
iOS 6.0+
iPadOS 6.0+
Mac Catalyst 13.0+
macOS 10.8+
tvOS 10.2+
visionOS 1.0+













I replaced it with the enum.

Now I wondering what does this macOS 10.8 mean.

Anyway, can we use the numeric value here?

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

* Re: [FFmpeg-devel] [PATCH] videotoolbox: Add SDK ifdefs for use of kVTVideoDecoderReferenceMissingErr
  2025-03-25 10:16 ` Zhao Zhili
@ 2025-03-25 10:46   ` Martin Storsjö
  2025-03-25 11:30     ` Zhao Zhili
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Storsjö @ 2025-03-25 10:46 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Tue, 25 Mar 2025, Zhao Zhili wrote:

>
>> 在 2025年3月25日,下午6:01,Martin Storsjö <martin@martin.st> 写道:
>> 
>> 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
>
> I used its numeric value initially, but after checking the doc,
>
> kVTVideoDecoderReferenceMissingErr
> iOS 6.0+
> iPadOS 6.0+
> Mac Catalyst 13.0+
> macOS 10.8+
> tvOS 10.2+
> visionOS 1.0+
>
> I replaced it with the enum.
>
> Now I wondering what does this macOS 10.8 mean.
>
> Anyway, can we use the numeric value here?

Can you link to which docs declare this to be available since macOS 10.8?

Anyway, I'm ok wth just using a numeric value instead, but then we should 
probably add a comment saying what the value refers to, and that it is 
only available since macOS 12 SDKs.

// Martin
_______________________________________________
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

* Re: [FFmpeg-devel] [PATCH] videotoolbox: Add SDK ifdefs for use of kVTVideoDecoderReferenceMissingErr
  2025-03-25 10:46   ` Martin Storsjö
@ 2025-03-25 11:30     ` Zhao Zhili
  2025-03-25 11:33       ` Martin Storsjö
  0 siblings, 1 reply; 5+ messages in thread
From: Zhao Zhili @ 2025-03-25 11:30 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



> On Mar 25, 2025, at 18:46, Martin Storsjö <martin@martin.st> wrote:
> 
> On Tue, 25 Mar 2025, Zhao Zhili wrote:
> 
>> 
>>> 在 2025年3月25日,下午6:01,Martin Storsjö <martin@martin.st> 写道:
>>> 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
>> 
>> I used its numeric value initially, but after checking the doc,
>> 
>> kVTVideoDecoderReferenceMissingErr
>> iOS 6.0+
>> iPadOS 6.0+
>> Mac Catalyst 13.0+
>> macOS 10.8+
>> tvOS 10.2+
>> visionOS 1.0+
>> 
>> I replaced it with the enum.
>> 
>> Now I wondering what does this macOS 10.8 mean.
>> 
>> Anyway, can we use the numeric value here?
> 
> Can you link to which docs declare this to be available since macOS 10.8?

https://developer.apple.com/documentation/videotoolbox/kvtvideodecoderreferencemissingerr?language=objc

> 
> Anyway, I'm ok wth just using a numeric value instead, but then we should probably add a comment saying what the value refers to, and that it is only available since macOS 12 SDKs.
> 
> // Martin
> _______________________________________________
> 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".

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

* Re: [FFmpeg-devel] [PATCH] videotoolbox: Add SDK ifdefs for use of kVTVideoDecoderReferenceMissingErr
  2025-03-25 11:30     ` Zhao Zhili
@ 2025-03-25 11:33       ` Martin Storsjö
  0 siblings, 0 replies; 5+ messages in thread
From: Martin Storsjö @ 2025-03-25 11:33 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Tue, 25 Mar 2025, Zhao Zhili wrote:

>
>
>> On Mar 25, 2025, at 18:46, Martin Storsjö <martin@martin.st> wrote:
>> 
>> On Tue, 25 Mar 2025, Zhao Zhili wrote:
>> 
>>> 
>>>> 在 2025年3月25日,下午6:01,Martin Storsjö <martin@martin.st> 写道:
>>>> 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
>>> 
>>> I used its numeric value initially, but after checking the doc,
>>> 
>>> kVTVideoDecoderReferenceMissingErr
>>> iOS 6.0+
>>> iPadOS 6.0+
>>> Mac Catalyst 13.0+
>>> macOS 10.8+
>>> tvOS 10.2+
>>> visionOS 1.0+
>>> 
>>> I replaced it with the enum.
>>> 
>>> Now I wondering what does this macOS 10.8 mean.
>>> 
>>> Anyway, can we use the numeric value here?
>> 
>> Can you link to which docs declare this to be available since macOS 10.8?
>
> https://developer.apple.com/documentation/videotoolbox/kvtvideodecoderreferencemissingerr?language=objc

Thanks, that's interesting. Apparently they don't really track the 
availability of the individual enum entries very thoroughly here...

// Martin
_______________________________________________
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