diff mbox series

[FFmpeg-devel,1/2] configure: Remove a redundant check for UWP mode

Message ID 20231221212747.278886-1-martin@martin.st
State Accepted
Commit 6d045187880c9209e8d2a4b995acba7284088f83
Headers show
Series [FFmpeg-devel,1/2] configure: Remove a redundant check for UWP mode | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Martin Storsjö Dec. 21, 2023, 9:27 p.m. UTC
The check for UWP mode was duplicated from right above, in
d54127c41a81cf2078a3504f78e0e4232cfe11b7.

Also, instead of several lines with "enabled uwp && ...", make one
"if enabled uwp; then" block.
---
 configure | 30 +++++++++++-------------------
 1 file changed, 11 insertions(+), 19 deletions(-)

Comments

Wu, Tong1 Dec. 22, 2023, 4:51 a.m. UTC | #1
>Subject: [FFmpeg-devel] [PATCH 1/2] configure: Remove a redundant check for
>UWP mode
>
>The check for UWP mode was duplicated from right above, in
>d54127c41a81cf2078a3504f78e0e4232cfe11b7.
>
>Also, instead of several lines with "enabled uwp && ...", make one
>"if enabled uwp; then" block.
>---
> configure | 30 +++++++++++-------------------
> 1 file changed, 11 insertions(+), 19 deletions(-)
>
>diff --git a/configure b/configure
>index af0bebc1ac..69b755f274 100755
>--- a/configure
>+++ b/configure
>@@ -7102,9 +7102,8 @@ fi
>
> check_func_headers "windows.h" CreateDIBSection
>"$gdigrab_indev_extralibs"
>
>-# d3d11va requires linking directly to dxgi and d3d11 if not building for
>-# the desktop api partition
>-test_cpp <<EOF && enable uwp && d3d11va_extralibs="-ldxgi -ld3d11"
>+# check if building for desktop or uwp
>+test_cpp <<EOF && enable uwp
> #ifdef WINAPI_FAMILY
> #include <winapifamily.h>
> #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
>@@ -7117,23 +7116,16 @@ test_cpp <<EOF && enable uwp &&
>d3d11va_extralibs="-ldxgi -ld3d11"
> #endif
> EOF
>
>-# vaapi_win32 requires linking directly to dxgi if not building for
>-# the desktop api partition
>-test_cpp <<EOF && enable uwp && vaapi_win32_extralibs="-ldxgi"
>-#ifdef WINAPI_FAMILY
>-#include <winapifamily.h>
>-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
>-#error desktop, not uwp
>-#else
>-// WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
>-#endif
>-#else
>-#error no family set
>-#endif
>-EOF
>+mediafoundation_extralibs="-lmfuuid -lole32 -lstrmiids"
>
>-# mediafoundation requires linking directly to mfplat if building for uwp target
>-enabled uwp && mediafoundation_extralibs="-lmfplat -lmfuuid -lole32 -
>lstrmiids" || mediafoundation_extralibs="-lmfuuid -lole32 -lstrmiids"
>+if enabled uwp; then
>+    # In UWP mode, we can't use LoadLibrary+GetProcAddress to conditionally
>+    # try to load these APIs at runtime, like we do in regular desktop mode -
>+    # therefore, we need to link directly against these APIs.
>+    d3d11va_extralibs="-ldxgi -ld3d11"
>+    vaapi_win32_extralibs="-ldxgi"
>+    mediafoundation_extralibs="-lmfplat $mediafoundation_extralibs"
>+fi
>
> enabled libdrm &&
>     check_pkg_config libdrm_getfb2 libdrm "xf86drmMode.h"
>drmModeGetFB2
>--
>2.34.1

LGTM, thx.

>
>_______________________________________________
>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".
Martin Storsjö Dec. 22, 2023, 8:41 a.m. UTC | #2
On Fri, 22 Dec 2023, Wu, Tong1 wrote:

>
>> Subject: [FFmpeg-devel] [PATCH 1/2] configure: Remove a redundant check for
>> UWP mode
>>
>> The check for UWP mode was duplicated from right above, in
>> d54127c41a81cf2078a3504f78e0e4232cfe11b7.
>>
>> Also, instead of several lines with "enabled uwp && ...", make one
>> "if enabled uwp; then" block.
>> ---
>> configure | 30 +++++++++++-------------------
>> 1 file changed, 11 insertions(+), 19 deletions(-)
>>
>> diff --git a/configure b/configure
>> index af0bebc1ac..69b755f274 100755
>> --- a/configure
>> +++ b/configure
>> @@ -7102,9 +7102,8 @@ fi
>>
>> check_func_headers "windows.h" CreateDIBSection
>> "$gdigrab_indev_extralibs"
>>
>> -# d3d11va requires linking directly to dxgi and d3d11 if not building for
>> -# the desktop api partition
>> -test_cpp <<EOF && enable uwp && d3d11va_extralibs="-ldxgi -ld3d11"
>> +# check if building for desktop or uwp
>> +test_cpp <<EOF && enable uwp
>> #ifdef WINAPI_FAMILY
>> #include <winapifamily.h>
>> #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
>> @@ -7117,23 +7116,16 @@ test_cpp <<EOF && enable uwp &&
>> d3d11va_extralibs="-ldxgi -ld3d11"
>> #endif
>> EOF
>>
>> -# vaapi_win32 requires linking directly to dxgi if not building for
>> -# the desktop api partition
>> -test_cpp <<EOF && enable uwp && vaapi_win32_extralibs="-ldxgi"
>> -#ifdef WINAPI_FAMILY
>> -#include <winapifamily.h>
>> -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
>> -#error desktop, not uwp
>> -#else
>> -// WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
>> -#endif
>> -#else
>> -#error no family set
>> -#endif
>> -EOF
>> +mediafoundation_extralibs="-lmfuuid -lole32 -lstrmiids"
>>
>> -# mediafoundation requires linking directly to mfplat if building for uwp target
>> -enabled uwp && mediafoundation_extralibs="-lmfplat -lmfuuid -lole32 -
>> lstrmiids" || mediafoundation_extralibs="-lmfuuid -lole32 -lstrmiids"
>> +if enabled uwp; then
>> +    # In UWP mode, we can't use LoadLibrary+GetProcAddress to conditionally
>> +    # try to load these APIs at runtime, like we do in regular desktop mode -
>> +    # therefore, we need to link directly against these APIs.
>> +    d3d11va_extralibs="-ldxgi -ld3d11"
>> +    vaapi_win32_extralibs="-ldxgi"
>> +    mediafoundation_extralibs="-lmfplat $mediafoundation_extralibs"
>> +fi
>>
>> enabled libdrm &&
>>     check_pkg_config libdrm_getfb2 libdrm "xf86drmMode.h"
>> drmModeGetFB2
>> --
>> 2.34.1
>
> LGTM, thx.

Does that cover patch 2/2, which fixes linking errors in the UWP 
configurations, as well?

// Martin
Wu, Tong1 Dec. 22, 2023, 8:52 a.m. UTC | #3
>From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
>Martin Storsjö
>Sent: Friday, December 22, 2023 4:41 PM
>To: FFmpeg development discussions and patches <ffmpeg-
>devel@ffmpeg.org>
>Subject: Re: [FFmpeg-devel] [PATCH 1/2] configure: Remove a redundant check
>for UWP mode
>
>On Fri, 22 Dec 2023, Wu, Tong1 wrote:
>
>>
>>> Subject: [FFmpeg-devel] [PATCH 1/2] configure: Remove a redundant check
>for
>>> UWP mode
>>>
>>> The check for UWP mode was duplicated from right above, in
>>> d54127c41a81cf2078a3504f78e0e4232cfe11b7.
>>>
>>> Also, instead of several lines with "enabled uwp && ...", make one
>>> "if enabled uwp; then" block.
>>> ---
>>> configure | 30 +++++++++++-------------------
>>> 1 file changed, 11 insertions(+), 19 deletions(-)
>>>
>>> diff --git a/configure b/configure
>>> index af0bebc1ac..69b755f274 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -7102,9 +7102,8 @@ fi
>>>
>>> check_func_headers "windows.h" CreateDIBSection
>>> "$gdigrab_indev_extralibs"
>>>
>>> -# d3d11va requires linking directly to dxgi and d3d11 if not building for
>>> -# the desktop api partition
>>> -test_cpp <<EOF && enable uwp && d3d11va_extralibs="-ldxgi -ld3d11"
>>> +# check if building for desktop or uwp
>>> +test_cpp <<EOF && enable uwp
>>> #ifdef WINAPI_FAMILY
>>> #include <winapifamily.h>
>>> #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
>>> @@ -7117,23 +7116,16 @@ test_cpp <<EOF && enable uwp &&
>>> d3d11va_extralibs="-ldxgi -ld3d11"
>>> #endif
>>> EOF
>>>
>>> -# vaapi_win32 requires linking directly to dxgi if not building for
>>> -# the desktop api partition
>>> -test_cpp <<EOF && enable uwp && vaapi_win32_extralibs="-ldxgi"
>>> -#ifdef WINAPI_FAMILY
>>> -#include <winapifamily.h>
>>> -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
>>> -#error desktop, not uwp
>>> -#else
>>> -// WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
>>> -#endif
>>> -#else
>>> -#error no family set
>>> -#endif
>>> -EOF
>>> +mediafoundation_extralibs="-lmfuuid -lole32 -lstrmiids"
>>>
>>> -# mediafoundation requires linking directly to mfplat if building for uwp
>target
>>> -enabled uwp && mediafoundation_extralibs="-lmfplat -lmfuuid -lole32 -
>>> lstrmiids" || mediafoundation_extralibs="-lmfuuid -lole32 -lstrmiids"
>>> +if enabled uwp; then
>>> +    # In UWP mode, we can't use LoadLibrary+GetProcAddress to
>conditionally
>>> +    # try to load these APIs at runtime, like we do in regular desktop mode -
>>> +    # therefore, we need to link directly against these APIs.
>>> +    d3d11va_extralibs="-ldxgi -ld3d11"
>>> +    vaapi_win32_extralibs="-ldxgi"
>>> +    mediafoundation_extralibs="-lmfplat $mediafoundation_extralibs"
>>> +fi
>>>
>>> enabled libdrm &&
>>>     check_pkg_config libdrm_getfb2 libdrm "xf86drmMode.h"
>>> drmModeGetFB2
>>> --
>>> 2.34.1
>>
>> LGTM, thx.
>
>Does that cover patch 2/2, which fixes linking errors in the UWP
>configurations, as well?
>
>// Martin

From the code it looks good to me but I don't have the UWP test environment to try out.

>
>_______________________________________________
>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".
Martin Storsjö Dec. 22, 2023, 9:53 a.m. UTC | #4
On Fri, 22 Dec 2023, Wu, Tong1 wrote:

>> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
>> Martin Storsjö
>> Sent: Friday, December 22, 2023 4:41 PM
>> To: FFmpeg development discussions and patches <ffmpeg-
>> devel@ffmpeg.org>
>> Subject: Re: [FFmpeg-devel] [PATCH 1/2] configure: Remove a redundant check
>> for UWP mode
>>
>> On Fri, 22 Dec 2023, Wu, Tong1 wrote:
>>
>>>
>>>> Subject: [FFmpeg-devel] [PATCH 1/2] configure: Remove a redundant check
>> for
>>>> UWP mode
>>>>
>>>> The check for UWP mode was duplicated from right above, in
>>>> d54127c41a81cf2078a3504f78e0e4232cfe11b7.
>>>>
>>>> Also, instead of several lines with "enabled uwp && ...", make one
>>>> "if enabled uwp; then" block.
>>>> ---
>>>> configure | 30 +++++++++++-------------------
>>>> 1 file changed, 11 insertions(+), 19 deletions(-)
>>>>
>>>> diff --git a/configure b/configure
>>>> index af0bebc1ac..69b755f274 100755
>>>> --- a/configure
>>>> +++ b/configure
>>>> @@ -7102,9 +7102,8 @@ fi
>>>>
>>>> check_func_headers "windows.h" CreateDIBSection
>>>> "$gdigrab_indev_extralibs"
>>>>
>>>> -# d3d11va requires linking directly to dxgi and d3d11 if not building for
>>>> -# the desktop api partition
>>>> -test_cpp <<EOF && enable uwp && d3d11va_extralibs="-ldxgi -ld3d11"
>>>> +# check if building for desktop or uwp
>>>> +test_cpp <<EOF && enable uwp
>>>> #ifdef WINAPI_FAMILY
>>>> #include <winapifamily.h>
>>>> #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
>>>> @@ -7117,23 +7116,16 @@ test_cpp <<EOF && enable uwp &&
>>>> d3d11va_extralibs="-ldxgi -ld3d11"
>>>> #endif
>>>> EOF
>>>>
>>>> -# vaapi_win32 requires linking directly to dxgi if not building for
>>>> -# the desktop api partition
>>>> -test_cpp <<EOF && enable uwp && vaapi_win32_extralibs="-ldxgi"
>>>> -#ifdef WINAPI_FAMILY
>>>> -#include <winapifamily.h>
>>>> -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
>>>> -#error desktop, not uwp
>>>> -#else
>>>> -// WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
>>>> -#endif
>>>> -#else
>>>> -#error no family set
>>>> -#endif
>>>> -EOF
>>>> +mediafoundation_extralibs="-lmfuuid -lole32 -lstrmiids"
>>>>
>>>> -# mediafoundation requires linking directly to mfplat if building for uwp
>> target
>>>> -enabled uwp && mediafoundation_extralibs="-lmfplat -lmfuuid -lole32 -
>>>> lstrmiids" || mediafoundation_extralibs="-lmfuuid -lole32 -lstrmiids"
>>>> +if enabled uwp; then
>>>> +    # In UWP mode, we can't use LoadLibrary+GetProcAddress to
>> conditionally
>>>> +    # try to load these APIs at runtime, like we do in regular desktop mode -
>>>> +    # therefore, we need to link directly against these APIs.
>>>> +    d3d11va_extralibs="-ldxgi -ld3d11"
>>>> +    vaapi_win32_extralibs="-ldxgi"
>>>> +    mediafoundation_extralibs="-lmfplat $mediafoundation_extralibs"
>>>> +fi
>>>>
>>>> enabled libdrm &&
>>>>     check_pkg_config libdrm_getfb2 libdrm "xf86drmMode.h"
>>>> drmModeGetFB2
>>>> --
>>>> 2.34.1
>>>
>>> LGTM, thx.
>>
>> Does that cover patch 2/2, which fixes linking errors in the UWP
>> configurations, as well?
>>
>> // Martin
>
> From the code it looks good to me but I don't have the UWP test 
> environment to try out.

Well it fixes linking at least, so that's better than failing to link, so 
I'll go ahead and push it to unbreak those builds.

// Martin
diff mbox series

Patch

diff --git a/configure b/configure
index af0bebc1ac..69b755f274 100755
--- a/configure
+++ b/configure
@@ -7102,9 +7102,8 @@  fi
 
 check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
 
-# d3d11va requires linking directly to dxgi and d3d11 if not building for
-# the desktop api partition
-test_cpp <<EOF && enable uwp && d3d11va_extralibs="-ldxgi -ld3d11"
+# check if building for desktop or uwp
+test_cpp <<EOF && enable uwp
 #ifdef WINAPI_FAMILY
 #include <winapifamily.h>
 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
@@ -7117,23 +7116,16 @@  test_cpp <<EOF && enable uwp && d3d11va_extralibs="-ldxgi -ld3d11"
 #endif
 EOF
 
-# vaapi_win32 requires linking directly to dxgi if not building for
-# the desktop api partition
-test_cpp <<EOF && enable uwp && vaapi_win32_extralibs="-ldxgi"
-#ifdef WINAPI_FAMILY
-#include <winapifamily.h>
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
-#error desktop, not uwp
-#else
-// WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
-#endif
-#else
-#error no family set
-#endif
-EOF
+mediafoundation_extralibs="-lmfuuid -lole32 -lstrmiids"
 
-# mediafoundation requires linking directly to mfplat if building for uwp target
-enabled uwp && mediafoundation_extralibs="-lmfplat -lmfuuid -lole32 -lstrmiids" || mediafoundation_extralibs="-lmfuuid -lole32 -lstrmiids"
+if enabled uwp; then
+    # In UWP mode, we can't use LoadLibrary+GetProcAddress to conditionally
+    # try to load these APIs at runtime, like we do in regular desktop mode -
+    # therefore, we need to link directly against these APIs.
+    d3d11va_extralibs="-ldxgi -ld3d11"
+    vaapi_win32_extralibs="-ldxgi"
+    mediafoundation_extralibs="-lmfplat $mediafoundation_extralibs"
+fi
 
 enabled libdrm &&
     check_pkg_config libdrm_getfb2 libdrm "xf86drmMode.h" drmModeGetFB2