diff mbox series

[FFmpeg-devel] avcodec/videotoolboxenc: #define TARGET_CPU_ARM64 to 0 if not provided by the SDK

Message ID 20210515094534.2950-1-zane@zanevaniperen.com
State Superseded
Headers show
Series [FFmpeg-devel] avcodec/videotoolboxenc: #define TARGET_CPU_ARM64 to 0 if not provided by the SDK | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Zane van Iperen May 15, 2021, 9:45 a.m. UTC
Fixes build failure on older SDKs without it.

Fixes #9242

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
---
 libavcodec/videotoolboxenc.c | 5 +++++
 1 file changed, 5 insertions(+)

NB: This is untested, I do not have a Mac to try it on.

Comments

Timo Rothenpieler May 15, 2021, 12:11 p.m. UTC | #1
On 15.05.2021 11:45, Zane van Iperen wrote:
> Fixes build failure on older SDKs without it.
> 
> Fixes #9242
> 
> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
> ---
>   libavcodec/videotoolboxenc.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> NB: This is untested, I do not have a Mac to try it on.
> 
> diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
> index 58239e0ab9..3d3677362a 100644
> --- a/libavcodec/videotoolboxenc.c
> +++ b/libavcodec/videotoolboxenc.c
> @@ -50,6 +50,11 @@ enum { kCVPixelFormatType_420YpCbCr10BiPlanarFullRange = 'xf20' };
>   enum { kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange = 'x420' };
>   #endif
>   
> +/* Older SDKs don't have this, make sure we can actually compile we're using one. */

Second half of that sentence is missing a word or has too many.

> +#ifndef TARGET_CPU_ARM64
> +#   define TARGET_CPU_ARM64 0
> +#endif
> +
>   typedef OSStatus (*getParameterSetAtIndex)(CMFormatDescriptionRef videoDesc,
>                                              size_t parameterSetIndex,
>                                              const uint8_t **parameterSetPointerOut,
>
Zane van Iperen May 15, 2021, 12:12 p.m. UTC | #2
On 15/5/21 10:11 pm, Timo Rothenpieler wrote:
> On 15.05.2021 11:45, Zane van Iperen wrote:
>> Fixes build failure on older SDKs without it.
>>
>> Fixes #9242
>>
>> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
>> ---
>>   libavcodec/videotoolboxenc.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> NB: This is untested, I do not have a Mac to try it on.
>>
>> diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
>> index 58239e0ab9..3d3677362a 100644
>> --- a/libavcodec/videotoolboxenc.c
>> +++ b/libavcodec/videotoolboxenc.c
>> @@ -50,6 +50,11 @@ enum { kCVPixelFormatType_420YpCbCr10BiPlanarFullRange = 'xf20' };
>>   enum { kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange = 'x420' };
>>   #endif
>> +/* Older SDKs don't have this, make sure we can actually compile we're using one. */
> 
> Second half of that sentence is missing a word or has too many.
> 

Yeah, picked that up shortly after I posted it. It's meant to read:
"Older SDKs don't have this, make sure we can actually compile if we're using one."
Carl Eugen Hoyos May 15, 2021, 2:57 p.m. UTC | #3
> Am 15.05.2021 um 14:12 schrieb Zane van Iperen <zane@zanevaniperen.com>:
> 
> 
> 
>> On 15/5/21 10:11 pm, Timo Rothenpieler wrote:
>>> On 15.05.2021 11:45, Zane van Iperen wrote:
>>> Fixes build failure on older SDKs without it.
>>> 
>>> Fixes #9242
>>> 
>>> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
>>> ---
>>>   libavcodec/videotoolboxenc.c | 5 +++++
>>>   1 file changed, 5 insertions(+)
>>> 
>>> NB: This is untested, I do not have a Mac to try it on.
>>> 
>>> diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
>>> index 58239e0ab9..3d3677362a 100644
>>> --- a/libavcodec/videotoolboxenc.c
>>> +++ b/libavcodec/videotoolboxenc.c
>>> @@ -50,6 +50,11 @@ enum { kCVPixelFormatType_420YpCbCr10BiPlanarFullRange = 'xf20' };
>>>   enum { kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange = 'x420' };
>>>   #endif
>>> +/* Older SDKs don't have this, make sure we can actually compile we're using one. */
>> Second half of that sentence is missing a word or has too many.
> 
> Yeah, picked that up shortly after I posted it. It's meant to read:
> "Older SDKs don't have this, make sure we can actually compile if we're using one."

Make it „Defined in macOS 10.x“ instead or remove the comment.

Carl Eugen
Zane van Iperen May 15, 2021, 9:56 p.m. UTC | #4
On 16/5/21 12:57 am, Carl Eugen Hoyos wrote:

>>>> --- a/libavcodec/videotoolboxenc.c
>>>> +++ b/libavcodec/videotoolboxenc.c
>>>> @@ -50,6 +50,11 @@ enum { kCVPixelFormatType_420YpCbCr10BiPlanarFullRange = 'xf20' };
>>>>    enum { kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange = 'x420' };
>>>>    #endif
>>>> +/* Older SDKs don't have this, make sure we can actually compile we're using one. */
>>> Second half of that sentence is missing a word or has too many.
>>
>> Yeah, picked that up shortly after I posted it. It's meant to read:
>> "Older SDKs don't have this, make sure we can actually compile if we're using one."
> 
> Make it „Defined in macOS 10.x“ instead or remove the comment.
> 

I'll remove it, it's self-explanatory anyway.
diff mbox series

Patch

diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 58239e0ab9..3d3677362a 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -50,6 +50,11 @@  enum { kCVPixelFormatType_420YpCbCr10BiPlanarFullRange = 'xf20' };
 enum { kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange = 'x420' };
 #endif
 
+/* Older SDKs don't have this, make sure we can actually compile we're using one. */
+#ifndef TARGET_CPU_ARM64
+#   define TARGET_CPU_ARM64 0
+#endif
+
 typedef OSStatus (*getParameterSetAtIndex)(CMFormatDescriptionRef videoDesc,
                                            size_t parameterSetIndex,
                                            const uint8_t **parameterSetPointerOut,