Re: [Mingw-w64-public] [PATCH] headers: codecapi add missing enums

2020-04-08 Thread Biswapriyo Nath
Updated.
From: Biswapriyo Nath 
Date: Wed, 8 Apr 2020 19:14:50 +0530
Subject: [PATCH] headers: codecapi add missing enums

Signed-off-by: Biswapriyo Nath 
---
 mingw-w64-headers/include/codecapi.h | 572 +--
 1 file changed, 538 insertions(+), 34 deletions(-)

diff --git a/mingw-w64-headers/include/codecapi.h 
b/mingw-w64-headers/include/codecapi.h
index fd849e9..95c8d6e 100644
--- a/mingw-w64-headers/include/codecapi.h
+++ b/mingw-w64-headers/include/codecapi.h
@@ -30,45 +30,549 @@
 #  endif
 #endif
 
-  enum eAVEncH264VLevel {
-eAVEncH264VLevel1 = 10,
-eAVEncH264VLevel1_b   = 11,
-eAVEncH264VLevel1_1   = 11,
-eAVEncH264VLevel1_2   = 12,
-eAVEncH264VLevel1_3   = 13,
-eAVEncH264VLevel2 = 20,
-eAVEncH264VLevel2_1   = 21,
-eAVEncH264VLevel2_2   = 22,
-eAVEncH264VLevel3 = 30,
-eAVEncH264VLevel3_1   = 31,
-eAVEncH264VLevel3_2   = 32,
-eAVEncH264VLevel4 = 40,
-eAVEncH264VLevel4_1   = 41,
-eAVEncH264VLevel4_2   = 42,
-eAVEncH264VLevel5 = 50,
-eAVEncH264VLevel5_1   = 51 
+  enum eAVEncCommonRateControlMode {
+eAVEncCommonRateControlMode_CBR = 0,
+eAVEncCommonRateControlMode_PeakConstrainedVBR = 1,
+eAVEncCommonRateControlMode_UnconstrainedVBR = 2,
+eAVEncCommonRateControlMode_Quality = 3,
+eAVEncCommonRateControlMode_LowDelayVBR = 4,
+eAVEncCommonRateControlMode_GlobalVBR = 5,
+eAVEncCommonRateControlMode_GlobalLowDelayVBR = 6
+  };
+
+  enum eAVEncCommonStreamEndHandling {
+eAVEncCommonStreamEndHandling_DiscardPartial = 0,
+eAVEncCommonStreamEndHandling_EnsureComplete = 1
+  };
+
+  enum eAVEncVideoOutputFrameRateConversion {
+eAVEncVideoOutputFrameRateConversion_Disable = 0,
+eAVEncVideoOutputFrameRateConversion_Enable = 1,
+eAVEncVideoOutputFrameRateConversion_Alias = 2
+  };
+
+  enum eAVDecVideoSoftwareDeinterlaceMode {
+eAVDecVideoSoftwareDeinterlaceMode_NoDeinterlacing = 0,
+eAVDecVideoSoftwareDeinterlaceMode_ProgressiveDeinterlacing = 1,
+eAVDecVideoSoftwareDeinterlaceMode_BOBDeinterlacing = 2,
+eAVDecVideoSoftwareDeinterlaceMode_SmartBOBDeinterlacing = 3
+  };
+
+  enum eAVFastDecodeMode {
+eVideoDecodeCompliant = 0,
+eVideoDecodeOptimalLF = 1,
+eVideoDecodeDisableLF = 2,
+eVideoDecodeFastest = 32
+  };
+
+  enum eAVDecVideoH264ErrorConcealment {
+eErrorConcealmentTypeDrop = 0,
+eErrorConcealmentTypeBasic = 1,
+eErrorConcealmentTypeAdvanced = 2,
+eErrorConcealmentTypeDXVASetBlack = 3
+  };
+
+  enum eAVDecVideoMPEG2ErrorConcealment {
+eErrorConcealmentOff = 0,
+eErrorConcealmentOn = 1
+  };
+
+  enum eAVDecVideoCodecType {
+eAVDecVideoCodecType_NOTPLAYING = 0,
+eAVDecVideoCodecType_MPEG2 = 1,
+eAVDecVideoCodecType_H264 = 2
+  };
+
+  enum eAVDecVideoDXVAMode {
+eAVDecVideoDXVAMode_NOTPLAYING = 0,
+eAVDecVideoDXVAMode_SW = 1,
+eAVDecVideoDXVAMode_MC = 2,
+eAVDecVideoDXVAMode_IDCT = 3,
+eAVDecVideoDXVAMode_VLD = 4
+  };
+
+  enum eAVDecVideoDXVABusEncryption {
+eAVDecVideoDXVABusEncryption_NONE = 0,
+eAVDecVideoDXVABusEncryption_PRIVATE = 1,
+eAVDecVideoDXVABusEncryption_AES = 2
+  };
+
+  enum eAVEncVideoSourceScanType {
+eAVEncVideoSourceScan_Automatic = 0,
+eAVEncVideoSourceScan_Interlaced = 1,
+eAVEncVideoSourceScan_Progressive = 2
+  };
+
+  enum eAVEncVideoOutputScanType {
+eAVEncVideoOutputScan_Progressive = 0,
+eAVEncVideoOutputScan_Interlaced = 1,
+eAVEncVideoOutputScan_SameAsInput = 2,
+eAVEncVideoOutputScan_Automatic = 3
+  };
+
+  enum eAVEncVideoFilmContent {
+eAVEncVideoFilmContent_VideoOnly = 0,
+eAVEncVideoFilmContent_FilmOnly = 1,
+eAVEncVideoFilmContent_Mixed = 2
+  };
+
+  enum eAVEncVideoChromaResolution {
+eAVEncVideoChromaResolution_SameAsSource = 0,
+eAVEncVideoChromaResolution_444 = 1,
+eAVEncVideoChromaResolution_422 = 2,
+eAVEncVideoChromaResolution_420 = 3,
+eAVEncVideoChromaResolution_411 = 4
+  };
+
+  enum eAVEncVideoChromaSubsampling {
+eAVEncVideoChromaSubsamplingFormat_SameAsSource = 0,
+eAVEncVideoChromaSubsamplingFormat_ProgressiveChroma = 0x8,
+eAVEncVideoChromaSubsamplingFormat_Horizontally_Cosited = 0x4,
+eAVEncVideoChromaSubsamplingFormat_Vertically_Cosited = 0x2,
+eAVEncVideoChromaSubsamplingFormat_Vertically_AlignedChromaPlanes = 0x1
+  };
+
+  enum eAVEncVideoColorPrimaries {
+eAVEncVideoColorPrimaries_SameAsSource = 0,
+eAVEncVideoColorPrimaries_Reserved = 1,
+eAVEncVideoColorPrimaries_BT709 = 2,
+eAVEncVideoColorPrimaries_BT470_2_SysM = 3,
+eAVEncVideoColorPrimaries_BT470_2_SysBG = 4,
+eAVEncVideoColorPrimaries_SMPTE170M = 5,
+eAVEncVideoColorPrimaries_SMPTE240M = 6,
+eAVEncVideoColorPrimaries_EBU3231 = 7,
+eAVEncVideoColorPrimaries_SMPTE_C = 8
+  };
+
+  enum eAVEncVideoColorTransferFunction {
+eAVEncVideoColorTransferFunction_SameAsSource = 0,
+eAVEncVideoColorTransferFunction_10 = 1,
+   

Re: [Mingw-w64-public] Proposal to add a code formatting rule

2020-04-08 Thread NightStrike
On Sat, Apr 4, 2020 at 1:04 AM Biswapriyo Nath  wrote:
>
> The coding style is different in many files in mingw-w64 headers and crt.
> Is it possible to add a rule to enforce a consistent coding style across
> all the source file? For example, using clang-fromat, editorconfig etc.
> lightweight tools?

Most of the code developed specifically for this project (ie,
winpthreads) is supposed to be in GNU format.  Code that is from the
header set is a mixture of inheritance from mingw.org and a result of
the whitebox porting of MS headers that was done.  Other code is
directly imported from other projects, such as Wine.  In many cases,
these self-inconsistencies are intentional to be compatible with these
external projects.  It's not a simple matter of saying "apply this
ruleset" as it might be in a small, self-contained project.


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH 1/6] winpthreads: simplify the USE_VEH_FOR_MSC_SETTHREADNAME check

2020-04-08 Thread LRN
On 08.04.2020 18:13, Steve Lhomme wrote:
> When compiling with other compilers than MSVC, we always use the code
> relying on USE_VEH_FOR_MSC_SETTHREADNAME.
> 
> -#if !defined(_MSC_VER) || defined (USE_VEH_FOR_MSC_SETTHREADNAME)
> +#if !defined(_MSC_VER)
> +#define USE_VEH_FOR_MSC_SETTHREADNAME
> +#endif
> +

I think the idea was to allow this code to be optionally used with MSVC
(nothing prevents it from working with MSVC, other than the fact that there's
an MSVC-specific alternative available).



signature.asc
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 2/6] winpthreads: do not use the XXXExceptionHandler API in winstore builds

2020-04-08 Thread Steve Lhomme
Calling RemoveVectoredExceptionHandler()/AddVectoredExceptionHandler() is
forbidden in non-desktop apps.
https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-addvectoredexceptionhandler
https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-removevectoredexceptionhandler

If USE_VEH_FOR_MSC_SETTHREADNAME is set in winstore builds, RaiseException is
only called if there's a debugger attached. In non-winstore builds it can also
be called if the SetThreadName_VEH_handle was set succesfully.
---
 mingw-w64-libraries/winpthreads/src/thread.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/mingw-w64-libraries/winpthreads/src/thread.c 
b/mingw-w64-libraries/winpthreads/src/thread.c
index 10405116..11c52b19 100644
--- a/mingw-w64-libraries/winpthreads/src/thread.c
+++ b/mingw-w64-libraries/winpthreads/src/thread.c
@@ -21,6 +21,7 @@
 */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -57,6 +58,10 @@ static pthread_t idListNextId = 0;
 #if !defined(_MSC_VER)
 #define USE_VEH_FOR_MSC_SETTHREADNAME
 #endif
+#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+/* forbidden RemoveVectoredExceptionHandler/AddVectoredExceptionHandler APIs */
+#undef USE_VEH_FOR_MSC_SETTHREADNAME
+#endif
 
 #if defined(USE_VEH_FOR_MSC_SETTHREADNAME)
 static void *SetThreadName_VEH_handle = NULL;
@@ -105,7 +110,11 @@ SetThreadName (DWORD dwThreadID, LPCSTR szThreadName)
/* Without a debugger we *must* have an exception handler,
 * otherwise raising an exception will crash the process.
 */
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
if ((!IsDebuggerPresent ()) && (SetThreadName_VEH_handle == NULL))
+#else
+   if (!IsDebuggerPresent ())
+#endif
  return;
 
RaiseException (EXCEPTION_SET_THREAD_NAME, 0, infosize, (ULONG_PTR *) 
);
-- 
2.17.1



___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 1/6] winpthreads: simplify the USE_VEH_FOR_MSC_SETTHREADNAME check

2020-04-08 Thread Steve Lhomme
When compiling with other compilers than MSVC, we always use the code
relying on USE_VEH_FOR_MSC_SETTHREADNAME.

The __try/__except check code is not modified as it relies on internal MSVC
dialect. With MSVC either USE_VEH_FOR_MSC_SETTHREADNAME was set but that code
wasn't use anyway (unchanged) or it wasn't set and we use the code (unchanged).
Without MSVC we always define USE_VEH_FOR_MSC_SETTHREADNAME so the other
variant of the code is used (unchanged).
---
 mingw-w64-libraries/winpthreads/src/thread.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/mingw-w64-libraries/winpthreads/src/thread.c 
b/mingw-w64-libraries/winpthreads/src/thread.c
index 1b12edb4..10405116 100644
--- a/mingw-w64-libraries/winpthreads/src/thread.c
+++ b/mingw-w64-libraries/winpthreads/src/thread.c
@@ -54,7 +54,11 @@ static size_t idListCnt = 0;
 static size_t idListMax = 0;
 static pthread_t idListNextId = 0;
 
-#if !defined(_MSC_VER) || defined (USE_VEH_FOR_MSC_SETTHREADNAME)
+#if !defined(_MSC_VER)
+#define USE_VEH_FOR_MSC_SETTHREADNAME
+#endif
+
+#if defined(USE_VEH_FOR_MSC_SETTHREADNAME)
 static void *SetThreadName_VEH_handle = NULL;
 
 static LONG __stdcall
@@ -419,7 +423,7 @@ __dyn_tls_pthread (HANDLE hDllHandle, DWORD dwReason, 
LPVOID lpreserved)
 
   if (dwReason == DLL_PROCESS_DETACH)
 {
-#if !defined(_MSC_VER) || defined (USE_VEH_FOR_MSC_SETTHREADNAME)
+#if defined(USE_VEH_FOR_MSC_SETTHREADNAME)
   if (lpreserved == NULL && SetThreadName_VEH_handle != NULL)
 {
   RemoveVectoredExceptionHandler (SetThreadName_VEH_handle);
@@ -430,7 +434,7 @@ __dyn_tls_pthread (HANDLE hDllHandle, DWORD dwReason, 
LPVOID lpreserved)
 }
   else if (dwReason == DLL_PROCESS_ATTACH)
 {
-#if !defined(_MSC_VER) || defined (USE_VEH_FOR_MSC_SETTHREADNAME)
+#if defined(USE_VEH_FOR_MSC_SETTHREADNAME)
   SetThreadName_VEH_handle = AddVectoredExceptionHandler (1, 
_VEH);
   /* Can't do anything on error anyway, check for NULL later */
 #endif
-- 
2.17.1



___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 4/6] winpthreads: simplify the handle validity in pthread_check()

2020-04-08 Thread Steve Lhomme
---
 mingw-w64-libraries/winpthreads/src/sched.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/mingw-w64-libraries/winpthreads/src/sched.c 
b/mingw-w64-libraries/winpthreads/src/sched.c
index bdd4301b..df3c60ea 100644
--- a/mingw-w64-libraries/winpthreads/src/sched.c
+++ b/mingw-w64-libraries/winpthreads/src/sched.c
@@ -95,12 +95,7 @@ static int pthread_check(pthread_t t)
   pv = __pth_gpointer_locked (t);
   if (pv->ended == 0)
 return 0;
-  if (!(pv->h) || pv->h == INVALID_HANDLE_VALUE)
-  {
-return ESRCH;
-  }
-  else if (!GetHandleInformation(pv->h, ))
-return ESRCH;
+  CHECK_OBJECT(pv, ESRCH);
   return 0;
 }
 
-- 
2.17.1



___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 5/6] winpthreads: do not call GetHandleInformation in winstore build

2020-04-08 Thread Steve Lhomme
The call is forbidden on non-desktop apps.

The check on INVALID_HANDLE_VALUE should be good enough.
---
 mingw-w64-libraries/winpthreads/src/misc.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/mingw-w64-libraries/winpthreads/src/misc.h 
b/mingw-w64-libraries/winpthreads/src/misc.h
index a86c0253..3a0e5fe8 100644
--- a/mingw-w64-libraries/winpthreads/src/misc.h
+++ b/mingw-w64-libraries/winpthreads/src/misc.h
@@ -24,6 +24,7 @@
 #define WIN_PTHREADS_MISC_H
 
 #include "pthread_compat.h"
+#include 
 
 #ifndef assert
 
@@ -62,6 +63,11 @@ typedef long long LONGBAG;
 typedef long LONGBAG;
 #endif
 
+#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#undef GetHandleInformation
+#define GetHandleInformation(h,f)  (1)
+#endif
+
 #define CHECK_HANDLE(h) { DWORD dwFlags; \
 if (!(h) || ((h) == INVALID_HANDLE_VALUE) || !GetHandleInformation((h), 
)) \
 return EINVAL; }
-- 
2.17.1



___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 6/6] winpthreads: don't call SetThreadContext in winstore builds

2020-04-08 Thread Steve Lhomme
The call is forbidden.

Hopefully the deferred Canceling mechanism below will work and this is not
needed.
---
 mingw-w64-libraries/winpthreads/src/thread.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mingw-w64-libraries/winpthreads/src/thread.c 
b/mingw-w64-libraries/winpthreads/src/thread.c
index 11c52b19..ee7cef04 100644
--- a/mingw-w64-libraries/winpthreads/src/thread.c
+++ b/mingw-w64-libraries/winpthreads/src/thread.c
@@ -1257,7 +1257,9 @@ pthread_cancel (pthread_t t)
 #else
 #error Unsupported architecture
 #endif
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  SetThreadContext (tv->h, );
+#endif
 
  /* Also try deferred Cancelling */
  tv->cancelled = 1;
-- 
2.17.1



___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH 3/6] winpthreads: always return 0 in pthread_check() if the thread ended is 0

2020-04-08 Thread Steve Lhomme
The code does the same but in a cleaner way, making room for the next patch.
---
 mingw-w64-libraries/winpthreads/src/sched.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mingw-w64-libraries/winpthreads/src/sched.c 
b/mingw-w64-libraries/winpthreads/src/sched.c
index 75a579db..bdd4301b 100644
--- a/mingw-w64-libraries/winpthreads/src/sched.c
+++ b/mingw-w64-libraries/winpthreads/src/sched.c
@@ -93,13 +93,13 @@ static int pthread_check(pthread_t t)
   if (!t)
 return ESRCH;
   pv = __pth_gpointer_locked (t);
+  if (pv->ended == 0)
+return 0;
   if (!(pv->h) || pv->h == INVALID_HANDLE_VALUE)
   {
-   if (pv->ended == 0)
- return 0;
 return ESRCH;
   }
-  else if ((!GetHandleInformation(pv->h, ) && pv->ended))
+  else if (!GetHandleInformation(pv->h, ))
 return ESRCH;
   return 0;
 }
-- 
2.17.1



___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] Add the IApplicationData2 storage interface

2020-04-08 Thread Steve Lhomme
It allows getting the LocalCacheFolder
https://docs.microsoft.com/en-us/uwp/api/windows.storage.applicationdata.localcachefolde
---
 mingw-w64-headers/include/windows.storage.h   | 114 ++
 mingw-w64-headers/include/windows.storage.idl |   5 +
 2 files changed, 119 insertions(+)

diff --git a/mingw-w64-headers/include/windows.storage.h 
b/mingw-w64-headers/include/windows.storage.h
index c0c6c48e..7e4c429b 100644
--- a/mingw-w64-headers/include/windows.storage.h
+++ b/mingw-w64-headers/include/windows.storage.h
@@ -42,6 +42,11 @@ typedef interface IApplicationDataContainer 
IApplicationDataContainer;
 typedef interface IApplicationData IApplicationData;
 #endif
 
+#ifndef __IApplicationData2_FWD_DEFINED__
+#define __IApplicationData2_FWD_DEFINED__
+typedef interface IApplicationData2 IApplicationData2;
+#endif
+
 #ifndef __IApplicationDataStatics_FWD_DEFINED__
 #define __IApplicationDataStatics_FWD_DEFINED__
 typedef interface IApplicationDataStatics IApplicationDataStatics;
@@ -107,6 +112,11 @@ typedef interface IStorageFolder IStorageFolder;
 typedef interface IApplicationData IApplicationData;
 #endif
 
+#ifndef __IApplicationData2_FWD_DEFINED__
+#define __IApplicationData2_FWD_DEFINED__
+typedef interface IApplicationData2 IApplicationData2;
+#endif
+
 #ifndef __IApplicationDataStatics_FWD_DEFINED__
 #define __IApplicationDataStatics_FWD_DEFINED__
 typedef interface IApplicationDataStatics IApplicationDataStatics;
@@ -1562,6 +1572,110 @@ void __RPC_STUB 
IApplicationData_RoamingStorageQuota_Stub(
 
 #endif  /* __IApplicationData_INTERFACE_DEFINED__ */
 
+/*
+ * IApplicationData2 interface
+ */
+#ifndef __IApplicationData2_INTERFACE_DEFINED__
+#define __IApplicationData2_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_IApplicationData2, 0x9e65cd69, 0x0ba3, 0x4e32, 0xbe,0x29, 
0xb0,0x2d,0xe6,0x60,0x76,0x38);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+MIDL_INTERFACE("9e65cd69-0ba3-4e32-be29-b02de6607638")
+IApplicationData2 : public IInspectable
+{
+virtual HRESULT STDMETHODCALLTYPE get_LocalCacheFolder(
+IStorageFolder **value) = 0;
+
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(IApplicationData2, 0x9e65cd69, 0x0ba3, 0x4e32, 0xbe,0x29, 
0xb0,0x2d,0xe6,0x60,0x76,0x38)
+#endif
+#else
+typedef struct IApplicationData2Vtbl {
+BEGIN_INTERFACE
+
+/*** IUnknown methods ***/
+HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+IApplicationData2 *This,
+REFIID riid,
+void **ppvObject);
+
+ULONG (STDMETHODCALLTYPE *AddRef)(
+IApplicationData2 *This);
+
+ULONG (STDMETHODCALLTYPE *Release)(
+IApplicationData2 *This);
+
+/*** IInspectable methods ***/
+HRESULT (STDMETHODCALLTYPE *GetIids)(
+IApplicationData2 *This,
+ULONG *iidCount,
+IID **iids);
+
+HRESULT (STDMETHODCALLTYPE *GetRuntimeClassName)(
+IApplicationData2 *This,
+HSTRING *className);
+
+HRESULT (STDMETHODCALLTYPE *GetTrustLevel)(
+IApplicationData2 *This,
+TrustLevel *trustLevel);
+
+/*** IApplicationData2 methods ***/
+HRESULT (STDMETHODCALLTYPE *get_LocalCacheFolder)(
+IApplicationData2 *This,
+IStorageFolder **value);
+
+END_INTERFACE
+} IApplicationData2Vtbl;
+
+interface IApplicationData2 {
+CONST_VTBL IApplicationData2Vtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+#ifndef WIDL_C_INLINE_WRAPPERS
+/*** IUnknown methods ***/
+#define IApplicationData2_QueryInterface(This,riid,ppvObject) 
(This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define IApplicationData2_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define IApplicationData2_Release(This) (This)->lpVtbl->Release(This)
+/*** IInspectable methods ***/
+#define IApplicationData2_GetIids(This,iidCount,iids) 
(This)->lpVtbl->GetIids(This,iidCount,iids)
+#define IApplicationData2_GetRuntimeClassName(This,className) 
(This)->lpVtbl->GetRuntimeClassName(This,className)
+#define IApplicationData2_GetTrustLevel(This,trustLevel) 
(This)->lpVtbl->GetTrustLevel(This,trustLevel)
+/*** IApplicationData2 methods ***/
+#define IApplicationData2_get_LocalCacheFolder(This,value) 
(This)->lpVtbl->get_LocalCacheFolder(This,value)
+#else
+/*** IUnknown methods ***/
+static FORCEINLINE HRESULT IApplicationData2_QueryInterface(IApplicationData2* 
This,REFIID riid,void **ppvObject) {
+return This->lpVtbl->QueryInterface(This,riid,ppvObject);
+}
+static FORCEINLINE ULONG IApplicationData2_AddRef(IApplicationData2* This) {
+return This->lpVtbl->AddRef(This);
+}
+static FORCEINLINE ULONG IApplicationData2_Release(IApplicationData2* This) {
+return This->lpVtbl->Release(This);
+}
+/*** IInspectable methods ***/
+static FORCEINLINE HRESULT IApplicationData2_GetIids(IApplicationData2* 
This,ULONG *iidCount,IID **iids) {
+return This->lpVtbl->GetIids(This,iidCount,iids);
+}
+static FORCEINLINE HRESULT 
IApplicationData2_GetRuntimeClassName(IApplicationData2* 

Re: [Mingw-w64-public] [PATCH] headers: codecapi add missing enums

2020-04-08 Thread Liu Hao
在 2020/4/8 21:49, Biswapriyo Nath 写道:
> ...
> 
> 
> 

> +  enum eAVEncVP9VProfile {
> +eAVEncVP9VProfile_unknown = 0,
> +eAVEncVP9VProfile_420_8 = 1,
> +eAVEncVP9VProfile_420_10 = 2,
> +eAVEncVP9VProfile_420_12 = 3,
---^
Probably this trailing comma should be removed?



> +  enum eAVEncAudioDualMono {
> +eAVEncAudioDualMono_SameAsInput = 0,
> +eAVEncAudioDualMono_Off = 1,
> +eAVEncAudioDualMono_On = 2
> +  }; 
---^
There is a trailing space character, which should be removed as well.





-- 
Best regards,
LH_Mouse



signature.asc
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH 3/3] crt: Convert the arm sincos.c to assembly

2020-04-08 Thread Martin Storsjö

On Wed, 8 Apr 2020, Liu Hao wrote:


在 2020/4/8 2:01, Martin Storsjö 写道:

This avoids optimizing the sincos function to a recursive call to
itself, if built with -ffast-math (unless built with -fno-builtin-sin).

While building with -ffast-math can break certain math routines and
thus can be considered a self-inflicted issue, it's safest to avoid
constructs that potentially can be optimized into an infinite self
recursion.

Signed-off-by: Martin Storsjö 
---
 mingw-w64-crt/Makefile.am  |  5 ++--
 mingw-w64-crt/math/arm-common/sincos.c | 29 --
 mingw-w64-crt/math/arm/sincos.S| 32 
 mingw-w64-crt/math/arm/sincosf.S   | 29 ++
 mingw-w64-crt/math/arm64/sincos.S  | 34 ++
 mingw-w64-crt/math/arm64/sincosf.S | 31 +++
 6 files changed, 129 insertions(+), 31 deletions(-)
 delete mode 100644 mingw-w64-crt/math/arm-common/sincos.c
 create mode 100644 mingw-w64-crt/math/arm/sincos.S
 create mode 100644 mingw-w64-crt/math/arm/sincosf.S
 create mode 100644 mingw-w64-crt/math/arm64/sincos.S
 create mode 100644 mingw-w64-crt/math/arm64/sincosf.S



These patches look good to me.

However I think it's probably bad practice to build the CRT with
`-ffast-math` as it can lead to non-compliant code.


Indeed - if building with that option, the essential rounding operation 
within e.g. the rint function (implemented in C) is optimized out - so the 
user who reported these issues has been advised to not use that option 
that widely.


// Martin

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] headers: codecapi add missing enums

2020-04-08 Thread Biswapriyo Nath
...
From e93b22a07dfd67ab9841951b09c6b0617cefd6e4 Mon Sep 17 00:00:00 2001
From: Biswapriyo Nath 
Date: Wed, 8 Apr 2020 19:14:50 +0530
Subject: [PATCH] headers: codecapi add missing enums

Signed-off-by: Biswapriyo Nath 
---
 mingw-w64-headers/include/codecapi.h | 572 +--
 1 file changed, 538 insertions(+), 34 deletions(-)

diff --git a/mingw-w64-headers/include/codecapi.h 
b/mingw-w64-headers/include/codecapi.h
index fd849e9..95c8d6e 100644
--- a/mingw-w64-headers/include/codecapi.h
+++ b/mingw-w64-headers/include/codecapi.h
@@ -30,45 +30,549 @@
 #  endif
 #endif
 
-  enum eAVEncH264VLevel {
-eAVEncH264VLevel1 = 10,
-eAVEncH264VLevel1_b   = 11,
-eAVEncH264VLevel1_1   = 11,
-eAVEncH264VLevel1_2   = 12,
-eAVEncH264VLevel1_3   = 13,
-eAVEncH264VLevel2 = 20,
-eAVEncH264VLevel2_1   = 21,
-eAVEncH264VLevel2_2   = 22,
-eAVEncH264VLevel3 = 30,
-eAVEncH264VLevel3_1   = 31,
-eAVEncH264VLevel3_2   = 32,
-eAVEncH264VLevel4 = 40,
-eAVEncH264VLevel4_1   = 41,
-eAVEncH264VLevel4_2   = 42,
-eAVEncH264VLevel5 = 50,
-eAVEncH264VLevel5_1   = 51 
+  enum eAVEncCommonRateControlMode {
+eAVEncCommonRateControlMode_CBR = 0,
+eAVEncCommonRateControlMode_PeakConstrainedVBR = 1,
+eAVEncCommonRateControlMode_UnconstrainedVBR = 2,
+eAVEncCommonRateControlMode_Quality = 3,
+eAVEncCommonRateControlMode_LowDelayVBR = 4,
+eAVEncCommonRateControlMode_GlobalVBR = 5,
+eAVEncCommonRateControlMode_GlobalLowDelayVBR = 6
+  };
+
+  enum eAVEncCommonStreamEndHandling {
+eAVEncCommonStreamEndHandling_DiscardPartial = 0,
+eAVEncCommonStreamEndHandling_EnsureComplete = 1
+  };
+
+  enum eAVEncVideoOutputFrameRateConversion {
+eAVEncVideoOutputFrameRateConversion_Disable = 0,
+eAVEncVideoOutputFrameRateConversion_Enable = 1,
+eAVEncVideoOutputFrameRateConversion_Alias = 2
+  };
+
+  enum eAVDecVideoSoftwareDeinterlaceMode {
+eAVDecVideoSoftwareDeinterlaceMode_NoDeinterlacing = 0,
+eAVDecVideoSoftwareDeinterlaceMode_ProgressiveDeinterlacing = 1,
+eAVDecVideoSoftwareDeinterlaceMode_BOBDeinterlacing = 2,
+eAVDecVideoSoftwareDeinterlaceMode_SmartBOBDeinterlacing = 3
+  };
+
+  enum eAVFastDecodeMode {
+eVideoDecodeCompliant = 0,
+eVideoDecodeOptimalLF = 1,
+eVideoDecodeDisableLF = 2,
+eVideoDecodeFastest = 32
+  };
+
+  enum eAVDecVideoH264ErrorConcealment {
+eErrorConcealmentTypeDrop = 0,
+eErrorConcealmentTypeBasic = 1,
+eErrorConcealmentTypeAdvanced = 2,
+eErrorConcealmentTypeDXVASetBlack = 3
+  };
+
+  enum eAVDecVideoMPEG2ErrorConcealment {
+eErrorConcealmentOff = 0,
+eErrorConcealmentOn = 1
+  };
+
+  enum eAVDecVideoCodecType {
+eAVDecVideoCodecType_NOTPLAYING = 0,
+eAVDecVideoCodecType_MPEG2 = 1,
+eAVDecVideoCodecType_H264 = 2
+  };
+
+  enum eAVDecVideoDXVAMode {
+eAVDecVideoDXVAMode_NOTPLAYING = 0,
+eAVDecVideoDXVAMode_SW = 1,
+eAVDecVideoDXVAMode_MC = 2,
+eAVDecVideoDXVAMode_IDCT = 3,
+eAVDecVideoDXVAMode_VLD = 4
+  };
+
+  enum eAVDecVideoDXVABusEncryption {
+eAVDecVideoDXVABusEncryption_NONE = 0,
+eAVDecVideoDXVABusEncryption_PRIVATE = 1,
+eAVDecVideoDXVABusEncryption_AES = 2
+  };
+
+  enum eAVEncVideoSourceScanType {
+eAVEncVideoSourceScan_Automatic = 0,
+eAVEncVideoSourceScan_Interlaced = 1,
+eAVEncVideoSourceScan_Progressive = 2
+  };
+
+  enum eAVEncVideoOutputScanType {
+eAVEncVideoOutputScan_Progressive = 0,
+eAVEncVideoOutputScan_Interlaced = 1,
+eAVEncVideoOutputScan_SameAsInput = 2,
+eAVEncVideoOutputScan_Automatic = 3
+  };
+
+  enum eAVEncVideoFilmContent {
+eAVEncVideoFilmContent_VideoOnly = 0,
+eAVEncVideoFilmContent_FilmOnly = 1,
+eAVEncVideoFilmContent_Mixed = 2
+  };
+
+  enum eAVEncVideoChromaResolution {
+eAVEncVideoChromaResolution_SameAsSource = 0,
+eAVEncVideoChromaResolution_444 = 1,
+eAVEncVideoChromaResolution_422 = 2,
+eAVEncVideoChromaResolution_420 = 3,
+eAVEncVideoChromaResolution_411 = 4
+  };
+
+  enum eAVEncVideoChromaSubsampling {
+eAVEncVideoChromaSubsamplingFormat_SameAsSource = 0,
+eAVEncVideoChromaSubsamplingFormat_ProgressiveChroma = 0x8,
+eAVEncVideoChromaSubsamplingFormat_Horizontally_Cosited = 0x4,
+eAVEncVideoChromaSubsamplingFormat_Vertically_Cosited = 0x2,
+eAVEncVideoChromaSubsamplingFormat_Vertically_AlignedChromaPlanes = 0x1
+  };
+
+  enum eAVEncVideoColorPrimaries {
+eAVEncVideoColorPrimaries_SameAsSource = 0,
+eAVEncVideoColorPrimaries_Reserved = 1,
+eAVEncVideoColorPrimaries_BT709 = 2,
+eAVEncVideoColorPrimaries_BT470_2_SysM = 3,
+eAVEncVideoColorPrimaries_BT470_2_SysBG = 4,
+eAVEncVideoColorPrimaries_SMPTE170M = 5,
+eAVEncVideoColorPrimaries_SMPTE240M = 6,
+eAVEncVideoColorPrimaries_EBU3231 = 7,
+eAVEncVideoColorPrimaries_SMPTE_C = 8
+  };
+
+  enum eAVEncVideoColorTransferFunction {
+