[vlc-commits] [Git][videolan/vlc][master] 19 commits: dxgi_fmt: init enum values explicitly

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Jan 17 11:52:13 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
b2bab86e by Steve Lhomme at 2023-01-17T11:33:05+00:00
dxgi_fmt: init enum values explicitly

- - - - -
1aa12246 by Steve Lhomme at 2023-01-17T11:33:05+00:00
sapi: use __uuidof() for known GUIDs

No need to redefine them manually.

CLSID_SpObjectTokenCategory is not exported in the official SDK, despite being
used. So we need to define it no matter what.

- - - - -
e8e09fc2 by Steve Lhomme at 2023-01-17T11:33:05+00:00
sapi: use IID_PPV_ARGS with CoCreateInstance()

This is less error prone.

- - - - -
0dfe6339 by Steve Lhomme at 2023-01-17T11:33:05+00:00
win32: define NOMINMAX to avoid having min & max macros

This is confusing a lot of code. It is automatically done when including
windows.h, but not all code includes it.

- - - - -
3ee67973 by Steve Lhomme at 2023-01-17T11:33:05+00:00
win32: define _USE_MATH_DEFINES

So that M_PI is defined when including math.h.

- - - - -
96736807 by Steve Lhomme at 2023-01-17T11:33:05+00:00
vlc_list: Don't initialize return value with a compound literal in C++

This isn't standard C++ and fails to build with MSVC

Similar to 7180df7a4407c30f2e102ce8e0ba63f5b098fec6

- - - - -
9e3bfc6d by Steve Lhomme at 2023-01-17T11:33:05+00:00
bdagraph: clean pointer printing

- - - - -
b1bbe755 by Steve Lhomme at 2023-01-17T11:33:05+00:00
bdagraph: use IID_PPV_ARGS with QueryInterface()

This is less error prone.

- - - - -
854724e0 by Steve Lhomme at 2023-01-17T11:33:05+00:00
bdagraph: use IID_PPV_ARGS with CoCreateInstance()

This is less error prone.

- - - - -
5bf05141 by Steve Lhomme at 2023-01-17T11:33:05+00:00
audio_filter: fix negative constant size

warning C4146: unary minus operator applied to unsigned type, result still unsigned

- - - - -
355a5996 by Steve Lhomme at 2023-01-17T11:33:05+00:00
audio_filter: remove unneeded structure cast on initialization

- - - - -
b4964a79 by Steve Lhomme at 2023-01-17T11:33:05+00:00
rtp: undefine errno values before forcing new values

They are usually defines.

- - - - -
c426f882 by Steve Lhomme at 2023-01-17T11:33:05+00:00
win32: fix WINAPI_FAMILY forcing

WINAPI_PARTITION_DESKTOP is to check a partition. The proper family is
WINAPI_FAMILY_DESKTOP_APP. As already done in other places.

- - - - -
ebb62929 by Steve Lhomme at 2023-01-17T11:33:05+00:00
acccess/wasapi: fix GUIDs not available for C code in Windows SDK

These GUIDs are not available from the headers or from libraries, only via C++.

- - - - -
9c863ef1 by Steve Lhomme at 2023-01-17T11:33:05+00:00
vlc_fixups: add some fixups for the official Windows SDK

Only used with clan-cl for now.

dirent.h support is disabled. In the end it's never used by code compiled
for Windows.

- - - - -
233b54fc by Steve Lhomme at 2023-01-17T11:33:05+00:00
vlc_common: set VLC_USED/VLC_MALLOC/VLC_DEPRECATED for MSVC

The proper values don't work everywhere as they are not always put in the right
place.

- - - - -
180b2c65 by Steve Lhomme at 2023-01-17T11:33:05+00:00
access/dtv: use BOOL instead of unofficial WINBOOL

- - - - -
dced9c92 by Steve Lhomme at 2023-01-17T11:33:05+00:00
access/dtv: don't define CLSID_NetworkProvider

We never use it.

- - - - -
f59a9f18 by Steve Lhomme at 2023-01-17T11:33:05+00:00
vlc_spawn: use unistd.h to get pid_t

It should be in both headers, but with the Windows SDK it's only possible
to have it inside unistd.h.

- - - - -


13 changed files:

- include/vlc_common.h
- include/vlc_fixups.h
- include/vlc_list.h
- include/vlc_spawn.h
- modules/access/dtv/bdadefs.h
- modules/access/dtv/bdagraph.cpp
- modules/access/wasapi.c
- modules/audio_filter/converter/format.c
- modules/codec/avcodec/directx_va.c
- modules/stream_out/rtp.c
- modules/text_renderer/sapi.cpp
- modules/video_chroma/d3d11_fmt.c
- modules/video_chroma/dxgi_fmt.c


Changes:

=====================================
include/vlc_common.h
=====================================
@@ -170,7 +170,13 @@
  */
 #  define VLC_USED
 # endif
-#else // !GCC
+#elif defined(_MSC_VER)
+# define VLC_USED _Check_return_
+// # define VLC_MALLOC __declspec(allocator)
+# define VLC_MALLOC
+// # define VLC_DEPRECATED __declspec(deprecated)
+# define VLC_DEPRECATED
+#else // !GCC && !MSVC
 # define VLC_USED
 # define VLC_MALLOC
 # define VLC_DEPRECATED


=====================================
include/vlc_fixups.h
=====================================
@@ -26,6 +26,36 @@
 #ifndef LIBVLC_FIXUPS_H
 # define LIBVLC_FIXUPS_H 1
 
+#if defined(_MSC_VER)
+// disable common warnings when compiling POSIX code
+#define _CRT_NONSTDC_NO_WARNINGS    1
+#define _CRT_SECURE_NO_WARNINGS     1
+
+// sys/stat.h values
+#define S_IWUSR     _S_IWRITE
+#define S_IRUSR     _S_IREAD
+#define S_IFIFO     _S_IFIFO
+#define S_ISDIR(m)  (((m) & S_IFMT) == S_IFDIR)
+#define S_ISREG(m)  (((m) & S_IFMT) == S_IFREG)
+#define S_ISBLK(m)  (0)
+
+// same type as statXXX structures st_mode field
+typedef unsigned short mode_t;
+
+// no compat, but there's an MSVC equivalent
+#define strncasecmp _strnicmp
+#define snwprintf   _snwprintf
+
+#endif // _MSC_VER
+
+#ifdef _WIN32
+// avoid collision between numeric_limits::max() and max define
+#define NOMINMAX
+// enable M_PI definition
+#define _USE_MATH_DEFINES           1
+#endif
+
+
 /* needed to detect uClibc */
 #ifdef HAVE_FEATURES_H
 #include <features.h>


=====================================
include/vlc_list.h
=====================================
@@ -222,7 +222,8 @@ struct vlc_list_it vlc_list_it_reverse_start(const struct vlc_list *head)
 {
     struct vlc_list *first = head->prev;
 
-    return (struct vlc_list_it){ head, first, first->prev };
+    struct vlc_list_it it = { head, first, first->prev };
+    return it;
 }
 
 static inline bool vlc_list_it_continue(const struct vlc_list_it *restrict it)


=====================================
include/vlc_spawn.h
=====================================
@@ -21,7 +21,7 @@
 #ifndef VLC_SPAWN_H
 #define VLC_SPAWN_H 1
 
-#include <sys/types.h>
+#include <unistd.h>
 
 /**
  * \defgroup spawn Process management


=====================================
modules/access/dtv/bdadefs.h
=====================================
@@ -154,7 +154,7 @@ MIDL_INTERFACE("6b652fff-11fe-4fce-92ad-0266b5d7c78f")
 ISampleGrabber : public IUnknown
 {
     virtual HRESULT STDMETHODCALLTYPE SetOneShot(
-        WINBOOL OneShot) = 0;
+        BOOL OneShot) = 0;
 
     virtual HRESULT STDMETHODCALLTYPE SetMediaType(
         const AM_MEDIA_TYPE *pType) = 0;
@@ -163,7 +163,7 @@ ISampleGrabber : public IUnknown
         AM_MEDIA_TYPE *pType) = 0;
 
     virtual HRESULT STDMETHODCALLTYPE SetBufferSamples(
-        WINBOOL BufferThem) = 0;
+        BOOL BufferThem) = 0;
 
     virtual HRESULT STDMETHODCALLTYPE GetCurrentBuffer(
         LONG *pBufferSize,
@@ -199,7 +199,7 @@ typedef struct ISampleGrabberVtbl {
     /*** ISampleGrabber methods ***/
     HRESULT (STDMETHODCALLTYPE *SetOneShot)(
         ISampleGrabber *This,
-        WINBOOL OneShot);
+        BOOL OneShot);
 
     HRESULT (STDMETHODCALLTYPE *SetMediaType)(
         ISampleGrabber *This,
@@ -211,7 +211,7 @@ typedef struct ISampleGrabberVtbl {
 
     HRESULT (STDMETHODCALLTYPE *SetBufferSamples)(
         ISampleGrabber *This,
-        WINBOOL BufferThem);
+        BOOL BufferThem);
 
     HRESULT (STDMETHODCALLTYPE *GetCurrentBuffer)(
         ISampleGrabber *This,
@@ -260,7 +260,7 @@ static FORCEINLINE ULONG ISampleGrabber_Release(ISampleGrabber* This) {
     return This->lpVtbl->Release(This);
 }
 /*** ISampleGrabber methods ***/
-static FORCEINLINE HRESULT ISampleGrabber_SetOneShot(ISampleGrabber* This,WINBOOL OneShot) {
+static FORCEINLINE HRESULT ISampleGrabber_SetOneShot(ISampleGrabber* This,BOOL OneShot) {
     return This->lpVtbl->SetOneShot(This,OneShot);
 }
 static FORCEINLINE HRESULT ISampleGrabber_SetMediaType(ISampleGrabber* This,const AM_MEDIA_TYPE *pType) {
@@ -269,7 +269,7 @@ static FORCEINLINE HRESULT ISampleGrabber_SetMediaType(ISampleGrabber* This,cons
 static FORCEINLINE HRESULT ISampleGrabber_GetConnectedMediaType(ISampleGrabber* This,AM_MEDIA_TYPE *pType) {
     return This->lpVtbl->GetConnectedMediaType(This,pType);
 }
-static FORCEINLINE HRESULT ISampleGrabber_SetBufferSamples(ISampleGrabber* This,WINBOOL BufferThem) {
+static FORCEINLINE HRESULT ISampleGrabber_SetBufferSamples(ISampleGrabber* This,BOOL BufferThem) {
     return This->lpVtbl->SetBufferSamples(This,BufferThem);
 }
 static FORCEINLINE HRESULT ISampleGrabber_GetCurrentBuffer(ISampleGrabber* This,LONG *pBufferSize,LONG *pBuffer) {
@@ -560,11 +560,6 @@ public:
 };
 
 extern "C" {
-/* Following GUIDs are for the new windows 7 interfaces  */
-/* windows 7 universal provider applies to all networks */
-DEFINE_GUID(CLSID_NetworkProvider,
-    0xB2F3A67C,0x29DA,0x4C78,0x88,0x31,0x09,0x1E,0xD5,0x09,0xA4,0x75);
-
 DEFINE_GUID(CLSID_DigitalCableNetworkType,
     0x143827AB,0xF77B,0x498d,0x81,0xCA,0x5A,0x00,0x7A,0xEC,0x28,0xBF);
 


=====================================
modules/access/dtv/bdagraph.cpp
=====================================
@@ -603,8 +603,7 @@ int BDAGraph::SetCQAM(long l_frequency)
         return VLC_EGENERIC;
     }
 
-    hr = l.p_tune_request->QueryInterface( IID_IDigitalCableTuneRequest,
-        reinterpret_cast<void**>( &l.p_cqam_tune_request ) );
+    hr = l.p_tune_request->QueryInterface( IID_PPV_ARGS( &l.p_cqam_tune_request ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "SetCQAM: "\
@@ -612,8 +611,8 @@ int BDAGraph::SetCQAM(long l_frequency)
         return VLC_EGENERIC;
     }
 
-    hr = ::CoCreateInstance( CLSID_DigitalCableLocator, 0, CLSCTX_INPROC,
-        IID_IDigitalCableLocator, reinterpret_cast<void**>( &l.p_cqam_locator ) );
+    hr = ::CoCreateInstance( __uuidof(DigitalCableLocator), 0, CLSCTX_INPROC,
+        IID_PPV_ARGS( &l.p_cqam_locator ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "SetCQAM: "\
@@ -718,8 +717,7 @@ int BDAGraph::SetATSC(long l_frequency)
         return VLC_EGENERIC;
     }
 
-    hr = l.p_tune_request->QueryInterface( IID_IATSCChannelTuneRequest,
-        reinterpret_cast<void**>( &l.p_atsc_tune_request ) );
+    hr = l.p_tune_request->QueryInterface( IID_PPV_ARGS( &l.p_atsc_tune_request ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "SetATSC: "\
@@ -727,8 +725,8 @@ int BDAGraph::SetATSC(long l_frequency)
         return VLC_EGENERIC;
     }
 
-    hr = ::CoCreateInstance( CLSID_ATSCLocator, 0, CLSCTX_INPROC,
-        IID_IATSCLocator, reinterpret_cast<void**>( &l.p_atsc_locator ) );
+    hr = ::CoCreateInstance( __uuidof(ATSCLocator), 0, CLSCTX_INPROC,
+        IID_PPV_ARGS( &l.p_atsc_locator ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "SetATSC: "\
@@ -850,8 +848,7 @@ int BDAGraph::SetDVBT(long l_frequency, uint32_t fec_hp, uint32_t fec_lp,
     }
 
     msg_Dbg( p_access, "SetDVBT: Creating DVB tune request" );
-    hr = l.p_tune_request->QueryInterface( IID_IDVBTuneRequest,
-        reinterpret_cast<void**>( &l.p_dvb_tune_request ) );
+    hr = l.p_tune_request->QueryInterface( IID_PPV_ARGS( &l.p_dvb_tune_request ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "SetDVBT: "\
@@ -873,8 +870,7 @@ int BDAGraph::SetDVBT(long l_frequency, uint32_t fec_hp, uint32_t fec_lp,
     }
 
     msg_Dbg( p_access, "SetDVBT: QI to DVBT TS" );
-    hr = p_tuning_space->QueryInterface( IID_IDVBTuningSpace2,
-        reinterpret_cast<void**>( &l.p_dvb_tuning_space ) );
+    hr = p_tuning_space->QueryInterface( IID_PPV_ARGS( &l.p_dvb_tuning_space ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "SetDVBT: "\
@@ -883,8 +879,8 @@ int BDAGraph::SetDVBT(long l_frequency, uint32_t fec_hp, uint32_t fec_lp,
     }
 
     msg_Dbg( p_access, "SetDVBT: Creating local locator" );
-    hr = ::CoCreateInstance( CLSID_DVBTLocator, 0, CLSCTX_INPROC,
-        IID_IDVBTLocator, reinterpret_cast<void**>( &l.p_dvbt_locator ) );
+    hr = ::CoCreateInstance( __uuidof(DVBTLocator), 0, CLSCTX_INPROC,
+        IID_PPV_ARGS( &l.p_dvbt_locator ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "SetDVBT: "\
@@ -1016,8 +1012,7 @@ int BDAGraph::SetDVBT2(long l_frequency, uint32_t fec,
     }
 
     msg_Dbg( p_access, "SetDVBT: Creating DVB tune request" );
-    hr = l.p_tune_request->QueryInterface( IID_IDVBTuneRequest,
-        reinterpret_cast<void**>( &l.p_dvb_tune_request ) );
+    hr = l.p_tune_request->QueryInterface( IID_PPV_ARGS( &l.p_dvb_tune_request ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "SetDVBT: "\
@@ -1039,8 +1034,7 @@ int BDAGraph::SetDVBT2(long l_frequency, uint32_t fec,
     }
 
     msg_Dbg( p_access, "SetDVBT: QI to DVBT TS" );
-    hr = p_tuning_space->QueryInterface( IID_IDVBTuningSpace2,
-        reinterpret_cast<void**>( &l.p_dvb_tuning_space ) );
+    hr = p_tuning_space->QueryInterface( IID_PPV_ARGS( &l.p_dvb_tuning_space ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "SetDVBT: "\
@@ -1050,8 +1044,8 @@ int BDAGraph::SetDVBT2(long l_frequency, uint32_t fec,
 
     msg_Dbg( p_access, "SetDVBT: Creating local locator2" );
 
-    hr = ::CoCreateInstance( CLSID_DVBTLocator2, 0, CLSCTX_INPROC,
-        IID_IDVBTLocator2, reinterpret_cast<void**>( &l.p_dvbt_locator ) );
+    hr = ::CoCreateInstance(__uuidof(DVBTLocator2), 0, CLSCTX_INPROC,
+        IID_PPV_ARGS( &l.p_dvbt_locator ) );
 
 
     if( FAILED( hr ) )
@@ -1213,8 +1207,7 @@ int BDAGraph::SetDVBC(long l_frequency, const char *mod, long l_symbolrate)
     }
 
     msg_Dbg( p_access, "SetDVBC: QI for dvb tune request" );
-    hr = l.p_tune_request->QueryInterface( IID_IDVBTuneRequest,
-        reinterpret_cast<void**>( &l.p_dvb_tune_request ) );
+    hr = l.p_tune_request->QueryInterface( IID_PPV_ARGS( &l.p_dvb_tune_request ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "SetDVBC: "\
@@ -1227,8 +1220,8 @@ int BDAGraph::SetDVBC(long l_frequency, const char *mod, long l_symbolrate)
     l.p_dvb_tune_request->put_TSID( -1 );
 
     msg_Dbg( p_access, "SetDVBC: create dvbc locator" );
-    hr = ::CoCreateInstance( CLSID_DVBCLocator, 0, CLSCTX_INPROC,
-        IID_IDVBCLocator, reinterpret_cast<void**>( &l.p_dvbc_locator ) );
+    hr = ::CoCreateInstance( __uuidof(DVBCLocator), 0, CLSCTX_INPROC,
+        IID_PPV_ARGS( &l.p_dvbc_locator ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "SetDVBC: "\
@@ -1247,8 +1240,7 @@ int BDAGraph::SetDVBC(long l_frequency, const char *mod, long l_symbolrate)
     }
 
     msg_Dbg( p_access, "SetDVBC: QI for dvb tuning space" );
-    hr = p_tuning_space->QueryInterface( IID_IDVBTuningSpace2,
-        reinterpret_cast<void**>( &l.p_dvb_tuning_space ) );
+    hr = p_tuning_space->QueryInterface( IID_PPV_ARGS( &l.p_dvb_tuning_space ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "SetDVBC: "\
@@ -1353,8 +1345,7 @@ int BDAGraph::SetInversion(int inversion)
         return VLC_EGENERIC;
     }
 
-    hr = p_tuning_space->QueryInterface( IID_IDVBSTuningSpace,
-        reinterpret_cast<void**>( &l.p_dvbs_tuning_space ) );
+    hr = p_tuning_space->QueryInterface( IID_PPV_ARGS( &l.p_dvbs_tuning_space ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "SetInversion: "\
@@ -1475,8 +1466,7 @@ int BDAGraph::SetDVBS(long l_frequency, long l_symbolrate, uint32_t fec,
         return VLC_EGENERIC;
     }
 
-    hr = l.p_tune_request->QueryInterface( IID_IDVBTuneRequest,
-        reinterpret_cast<void**>( &l.p_dvb_tune_request ) );
+    hr = l.p_tune_request->QueryInterface( IID_PPV_ARGS( &l.p_dvb_tune_request ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "SetDVBS: "\
@@ -1488,8 +1478,8 @@ int BDAGraph::SetDVBS(long l_frequency, long l_symbolrate, uint32_t fec,
     l.p_dvb_tune_request->put_SID( -1 );
     l.p_dvb_tune_request->put_TSID( -1 );
 
-    hr = ::CoCreateInstance( CLSID_DVBSLocator, 0, CLSCTX_INPROC,
-        IID_IDVBSLocator, reinterpret_cast<void**>( &l.p_dvbs_locator ) );
+    hr = ::CoCreateInstance( __uuidof(DVBSLocator), 0, CLSCTX_INPROC,
+        IID_PPV_ARGS( &l.p_dvbs_locator ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "SetDVBS: "\
@@ -1506,8 +1496,7 @@ int BDAGraph::SetDVBS(long l_frequency, long l_symbolrate, uint32_t fec,
         return VLC_EGENERIC;
     }
 
-    hr = p_tuning_space->QueryInterface( IID_IDVBSTuningSpace,
-        reinterpret_cast<void**>( &l.p_dvbs_tuning_space ) );
+    hr = p_tuning_space->QueryInterface( IID_PPV_ARGS( &l.p_dvbs_tuning_space ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "SetDVBS: "\
@@ -2011,7 +2000,7 @@ HRESULT BDAGraph::Check( REFCLSID clsid_this_network_type )
         Destroy();
     p_filter_graph = NULL;
     hr = ::CoCreateInstance( CLSID_FilterGraph, NULL, CLSCTX_INPROC,
-        IID_IGraphBuilder, reinterpret_cast<void**>( &p_filter_graph ) );
+        IID_PPV_ARGS( &p_filter_graph ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "Check: "\
@@ -2025,7 +2014,7 @@ HRESULT BDAGraph::Check( REFCLSID clsid_this_network_type )
         p_network_provider->Release();
     p_network_provider = NULL;
     hr = ::CoCreateInstance( clsid_this_network_type, NULL, CLSCTX_INPROC_SERVER,
-        IID_IBaseFilter, reinterpret_cast<void**>( &p_network_provider ) );
+        IID_PPV_ARGS( &p_network_provider ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "Check: "\
@@ -2063,8 +2052,7 @@ HRESULT BDAGraph::Check( REFCLSID clsid_this_network_type )
     if( p_scanning_tuner )
         p_scanning_tuner->Release();
     p_scanning_tuner = NULL;
-    hr = p_network_provider->QueryInterface( IID_IScanningTuner,
-        reinterpret_cast<void**>( &p_scanning_tuner ) );
+    hr = p_network_provider->QueryInterface( IID_PPV_ARGS( &p_scanning_tuner ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "Check: "\
@@ -2196,7 +2184,7 @@ HRESULT BDAGraph::Build()
     p_sample_grabber = NULL;
     /* Insert the Sample Grabber to tap into the Transport Stream. */
     hr = ::CoCreateInstance( CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER,
-        IID_IBaseFilter, reinterpret_cast<void**>( &p_sample_grabber ) );
+        IID_PPV_ARGS( &p_sample_grabber ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "Build: "\
@@ -2216,8 +2204,7 @@ HRESULT BDAGraph::Build()
     if( p_grabber )
         p_grabber->Release();
     p_grabber = NULL;
-    hr = p_sample_grabber->QueryInterface( IID_ISampleGrabber,
-        reinterpret_cast<void**>( &p_grabber ) );
+    hr = p_sample_grabber->QueryInterface( IID_PPV_ARGS( &p_grabber ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "Build: "\
@@ -2270,8 +2257,7 @@ HRESULT BDAGraph::Build()
         p_mpeg_demux->Release();
     p_mpeg_demux = NULL;
     hr = ::CoCreateInstance( CLSID_MPEG2Demultiplexer, NULL,
-        CLSCTX_INPROC_SERVER, IID_IBaseFilter,
-        reinterpret_cast<void**>( &p_mpeg_demux ) );
+        CLSCTX_INPROC_SERVER, IID_PPV_ARGS( &p_mpeg_demux ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "Build: "\
@@ -2425,7 +2411,7 @@ HRESULT BDAGraph::ListFilters( REFCLSID this_clsid )
         l.p_local_system_dev_enum->Release();
     l.p_local_system_dev_enum = NULL;
     hr = ::CoCreateInstance( CLSID_SystemDeviceEnum, 0, CLSCTX_INPROC,
-        IID_ICreateDevEnum, reinterpret_cast<void**>( &l.p_local_system_dev_enum ) );
+        IID_PPV_ARGS( &l.p_local_system_dev_enum ) );
     if( FAILED( hr ) )
     {
         msg_Warn( p_access, "ListFilters: "\
@@ -2601,7 +2587,7 @@ HRESULT BDAGraph::FindFilter( REFCLSID this_clsid, long* i_moniker_used,
     {
         msg_Dbg( p_access, "FindFilter: Create p_system_dev_enum");
         hr = ::CoCreateInstance( CLSID_SystemDeviceEnum, 0, CLSCTX_INPROC,
-            IID_ICreateDevEnum, reinterpret_cast<void**>( &p_system_dev_enum ) );
+            IID_PPV_ARGS( &p_system_dev_enum ) );
         if( FAILED( hr ) )
         {
             msg_Warn( p_access, "FindFilter: "\
@@ -3275,8 +3261,8 @@ HRESULT BDAGraph::Register()
     }
 
     size_t len = sizeof(pwsz_graph_name) / sizeof(pwsz_graph_name[0]);
-    _snwprintf( pwsz_graph_name, len - 1, L"VLC BDA Graph %08x Pid %08x",
-        (DWORD_PTR) p_filter_graph, ::GetCurrentProcessId() );
+    _snwprintf( pwsz_graph_name, len - 1, L"VLC BDA Graph %08p Pid %08x",
+        p_filter_graph, ::GetCurrentProcessId() );
     pwsz_graph_name[len-1] = 0;
     hr = CreateItemMoniker( L"!", pwsz_graph_name, &l.p_moniker );
     if( FAILED( hr ) )


=====================================
modules/access/wasapi.c
=====================================
@@ -24,7 +24,7 @@
 # include "config.h"
 #endif
 
-#define INITGUID
+#include <initguid.h>
 #define COBJMACROS
 #define CONST_VTABLE
 
@@ -39,6 +39,15 @@
 #include <mmdeviceapi.h>
 #include <audioclient.h>
 
+#ifdef _MSC_VER
+// these GUIDs are not available from the headers or from libraries, only via C++
+DEFINE_GUID(CLSID_MMDeviceEnumerator, 0xbcde0395, 0xe52f, 0x467c, 0x8e, 0x3d, 0xc4, 0x57, 0x92, 0x91, 0x69, 0x2e);
+DEFINE_GUID(IID_IMMEndpoint, 0x1be09788, 0x6894, 0x4089, 0x85, 0x86, 0x9a, 0x2a, 0x6c, 0x26, 0x5a, 0xc5);
+DEFINE_GUID(IID_IMMDeviceEnumerator, 0xa95664d2, 0x9614, 0x4f35, 0xa7, 0x46, 0xde, 0x8d, 0xb6, 0x36, 0x17, 0xe6);
+DEFINE_GUID(IID_IAudioClient, 0x1cb9ad4c, 0xdbfa, 0x4c32, 0xb1, 0x78, 0xc2, 0xf5, 0x68, 0xa7, 0x03, 0xb2);
+DEFINE_GUID(IID_IAudioCaptureClient, 0xc8adbd64, 0xe71e, 0x48a0, 0xa4, 0xde, 0x18, 0x5c, 0x39, 0x5c, 0xd3, 0x17);
+#endif
+
 static LARGE_INTEGER freq; /* performance counters frequency */
 
 static msftime_t GetQPC(void)


=====================================
modules/audio_filter/converter/format.c
=====================================
@@ -284,12 +284,12 @@ static block_t *Fl32toS32(filter_t *filter, block_t *b)
     int32_t *dst = (int32_t *)src;
     for (size_t i = b->i_buffer / 4; i--;)
     {
-        float s = *(src++) * 2147483648.f;
-        if (s >= 2147483647.f)
-            *(dst++) = 2147483647;
+        float s = *(src++) * -((float)INT32_MIN);
+        if (s >= ((float)INT32_MAX))
+            *(dst++) = INT32_MAX;
         else
-        if (s <= -2147483648.f)
-            *(dst++) = -2147483648;
+        if (s <= ((float)INT32_MIN))
+            *(dst++) = INT32_MIN;
         else
             *(dst++) = lroundf(s);
     }
@@ -346,7 +346,7 @@ static block_t *S32toFl32(filter_t *filter, block_t *b)
     int32_t *src = (int32_t*)b->p_buffer;
     float   *dst = (float *)src;
     for (int i = b->i_buffer / 4; i--;)
-        *dst++ = (float)(*src++) / 2147483648.f;
+        *dst++ = (float)(*src++) / -((float)INT32_MIN);
     return b;
 }
 
@@ -360,7 +360,7 @@ static block_t *S32toFl64(filter_t *filter, block_t *bsrc)
     int32_t *src = (int32_t*)bsrc->p_buffer;
     double  *dst = (double *)bdst->p_buffer;
     for (size_t i = bsrc->i_buffer / 4; i--;)
-        *dst++ = (double)(*src++) / 2147483648.;
+        *dst++ = (double)(*src++) / -(double)INT32_MIN;
 out:
     VLC_UNUSED(filter);
     block_Release(bsrc);
@@ -426,12 +426,12 @@ static block_t *Fl64toS32(filter_t *filter, block_t *b)
     int32_t *dst = (int32_t *)src;
     for (size_t i = b->i_buffer / 8; i--;)
     {
-        float s = *(src++) * 2147483648.;
-        if (s >= 2147483647.f)
-            *(dst++) = 2147483647;
+        float s = *(src++) * -((double)INT32_MIN);
+        if (s >= ((float)INT32_MAX))
+            *(dst++) = INT32_MAX;
         else
-        if (s <= -2147483648.f)
-            *(dst++) = -2147483648;
+        if (s <= ((float)INT32_MIN))
+            *(dst++) = INT32_MIN;
         else
             *(dst++) = lround(s);
     }
@@ -448,32 +448,32 @@ static const struct {
     vlc_fourcc_t dst;
     struct vlc_filter_operations convert;
 } cvt_directs[] = {
-    { VLC_CODEC_U8,   VLC_CODEC_S16N, (struct vlc_filter_operations) { .filter_audio = U8toS16 }    },
-    { VLC_CODEC_U8,   VLC_CODEC_FL32, (struct vlc_filter_operations) { .filter_audio = U8toFl32 }   },
-    { VLC_CODEC_U8,   VLC_CODEC_S32N, (struct vlc_filter_operations) { .filter_audio = U8toS32 }    },
-    { VLC_CODEC_U8,   VLC_CODEC_FL64, (struct vlc_filter_operations) { .filter_audio = U8toFl64 }   },
-
-    { VLC_CODEC_S16N, VLC_CODEC_U8,   (struct vlc_filter_operations) { .filter_audio = S16toU8 }    },
-    { VLC_CODEC_S16N, VLC_CODEC_FL32, (struct vlc_filter_operations) { .filter_audio = S16toFl32 }  },
-    { VLC_CODEC_S16N, VLC_CODEC_S32N, (struct vlc_filter_operations) { .filter_audio = S16toS32 }   },
-    { VLC_CODEC_S16N, VLC_CODEC_FL64, (struct vlc_filter_operations) { .filter_audio = S16toFl64 }  },
-
-    { VLC_CODEC_FL32, VLC_CODEC_U8,   (struct vlc_filter_operations) { .filter_audio = Fl32toU8 }   },
-    { VLC_CODEC_FL32, VLC_CODEC_S16N, (struct vlc_filter_operations) { .filter_audio = Fl32toS16 }  },
-    { VLC_CODEC_FL32, VLC_CODEC_S32N, (struct vlc_filter_operations) { .filter_audio = Fl32toS32 }  },
-    { VLC_CODEC_FL32, VLC_CODEC_FL64, (struct vlc_filter_operations) { .filter_audio = Fl32toFl64 } },
-
-    { VLC_CODEC_S32N, VLC_CODEC_U8,   (struct vlc_filter_operations) { .filter_audio = S32toU8 }    },
-    { VLC_CODEC_S32N, VLC_CODEC_S16N, (struct vlc_filter_operations) { .filter_audio = S32toS16 }   },
-    { VLC_CODEC_S32N, VLC_CODEC_FL32, (struct vlc_filter_operations) { .filter_audio = S32toFl32 }  },
-    { VLC_CODEC_S32N, VLC_CODEC_FL64, (struct vlc_filter_operations) { .filter_audio = S32toFl64 }  },
-
-    { VLC_CODEC_FL64, VLC_CODEC_U8,   (struct vlc_filter_operations) { .filter_audio = Fl64toU8 }   },
-    { VLC_CODEC_FL64, VLC_CODEC_S16N, (struct vlc_filter_operations) { .filter_audio = Fl64toS16 }  },
-    { VLC_CODEC_FL64, VLC_CODEC_FL32, (struct vlc_filter_operations) { .filter_audio = Fl64toFl32 } },
-    { VLC_CODEC_FL64, VLC_CODEC_S32N, (struct vlc_filter_operations) { .filter_audio = Fl64toS32 }  },
-
-    { 0, 0, (struct vlc_filter_operations) { .filter_audio = NULL } }
+    { VLC_CODEC_U8,   VLC_CODEC_S16N, { .filter_audio = U8toS16 }    },
+    { VLC_CODEC_U8,   VLC_CODEC_FL32, { .filter_audio = U8toFl32 }   },
+    { VLC_CODEC_U8,   VLC_CODEC_S32N, { .filter_audio = U8toS32 }    },
+    { VLC_CODEC_U8,   VLC_CODEC_FL64, { .filter_audio = U8toFl64 }   },
+
+    { VLC_CODEC_S16N, VLC_CODEC_U8,   { .filter_audio = S16toU8 }    },
+    { VLC_CODEC_S16N, VLC_CODEC_FL32, { .filter_audio = S16toFl32 }  },
+    { VLC_CODEC_S16N, VLC_CODEC_S32N, { .filter_audio = S16toS32 }   },
+    { VLC_CODEC_S16N, VLC_CODEC_FL64, { .filter_audio = S16toFl64 }  },
+
+    { VLC_CODEC_FL32, VLC_CODEC_U8,   { .filter_audio = Fl32toU8 }   },
+    { VLC_CODEC_FL32, VLC_CODEC_S16N, { .filter_audio = Fl32toS16 }  },
+    { VLC_CODEC_FL32, VLC_CODEC_S32N, { .filter_audio = Fl32toS32 }  },
+    { VLC_CODEC_FL32, VLC_CODEC_FL64, { .filter_audio = Fl32toFl64 } },
+
+    { VLC_CODEC_S32N, VLC_CODEC_U8,   { .filter_audio = S32toU8 }    },
+    { VLC_CODEC_S32N, VLC_CODEC_S16N, { .filter_audio = S32toS16 }   },
+    { VLC_CODEC_S32N, VLC_CODEC_FL32, { .filter_audio = S32toFl32 }  },
+    { VLC_CODEC_S32N, VLC_CODEC_FL64, { .filter_audio = S32toFl64 }  },
+
+    { VLC_CODEC_FL64, VLC_CODEC_U8,   { .filter_audio = Fl64toU8 }   },
+    { VLC_CODEC_FL64, VLC_CODEC_S16N, { .filter_audio = Fl64toS16 }  },
+    { VLC_CODEC_FL64, VLC_CODEC_FL32, { .filter_audio = Fl64toFl32 } },
+    { VLC_CODEC_FL64, VLC_CODEC_S32N, { .filter_audio = Fl64toS32 }  },
+
+    { 0, 0, { .filter_audio = NULL } }
 };
 
 static const struct vlc_filter_operations *FindConversion(vlc_fourcc_t src, vlc_fourcc_t dst)


=====================================
modules/codec/avcodec/directx_va.c
=====================================
@@ -75,7 +75,7 @@ static const int PROF_AV1_HIGH[]    = { FF_PROFILE_AV1_HIGH, FF_PROFILE_AV1_MAIN
 #if defined(WINAPI_FAMILY)
 # undef WINAPI_FAMILY
 #endif
-#define WINAPI_FAMILY WINAPI_PARTITION_DESKTOP
+#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
 
 #include <d3d9.h>
 #include <dxva2api.h>


=====================================
modules/stream_out/rtp.c
=====================================
@@ -1329,8 +1329,11 @@ static void* ThreadSend( void *data )
     vlc_thread_set_name("vlc-rt-send");
 
 #ifdef _WIN32
+# undef ENOBUFS
 # define ENOBUFS      WSAENOBUFS
+# undef EAGAIN
 # define EAGAIN       WSAEWOULDBLOCK
+# undef EWOULDBLOCK
 # define EWOULDBLOCK  WSAEWOULDBLOCK
 #endif
     sout_stream_id_sys_t *id = data;


=====================================
modules/text_renderer/sapi.cpp
=====================================
@@ -38,12 +38,14 @@
 #include <vlc_charset.h>
 #include <vlc_subpicture.h>
 
-#define INITGUID
-
 #include <windows.h>
 #include <sapi.h>
 #include <sphelper.h>
 
+#include <initguid.h>
+// not available in standard libraries and used in inline functions without __uuidof()
+DEFINE_GUID(CLSID_SpObjectTokenCategory, 0xa910187f, 0x0c7a, 0x45ac, 0x92,0xcc, 0x59,0xed,0xaf,0xb7,0x7b,0x53);
+
 static int Create (filter_t *);
 static void Destroy(filter_t *);
 static int RenderText(filter_t *,
@@ -116,7 +118,7 @@ static int Create (filter_t *p_filter)
     p_sys->cpVoice = NULL;
     p_sys->lastString = NULL;
 
-    hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_INPROC_SERVER, IID_ISpVoice, (void**) &p_sys->cpVoice);
+    hr = CoCreateInstance(__uuidof(SpVoice), NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&p_sys->cpVoice));
     if (SUCCEEDED(hr)) {
         ISpObjectToken*        cpVoiceToken = NULL;
         IEnumSpObjectTokens*   cpEnum = NULL;


=====================================
modules/video_chroma/d3d11_fmt.c
=====================================
@@ -54,7 +54,7 @@
 #if defined(WINAPI_FAMILY)
 # undef WINAPI_FAMILY
 #endif
-#define WINAPI_FAMILY WINAPI_PARTITION_DESKTOP
+#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
 #include <wbemidl.h>
 
 #define D3D11_PICCONTEXT_FROM_PICCTX(pic_ctx)  \


=====================================
modules/video_chroma/dxgi_fmt.c
=====================================
@@ -100,7 +100,7 @@ static const d3d_format_t d3d_formats[] = {
     { "B5G6R5",   DXGI_FORMAT_B5G6R5_UNORM,   VLC_CODEC_RGB16,         5, 1, 1, { DXGI_FORMAT_B5G6R5_UNORM } },
     { "I420_OPAQUE", DXGI_FORMAT_420_OPAQUE,  VLC_CODEC_D3D11_OPAQUE,  8, 2, 2, { DXGI_FORMAT_UNKNOWN } },
 
-    { NULL, 0, 0, 0, 0, 0, {} }
+    { NULL, 0, 0, 0, 0, 0, { DXGI_FORMAT_UNKNOWN } }
 };
 
 const char *DxgiFormatToStr(DXGI_FORMAT format)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f417fff8c2ca0f55b95277c52130b4036b408206...f59a9f183d8f45db12d84aafd7bdc6e20e96c066

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f417fff8c2ca0f55b95277c52130b4036b408206...f59a9f183d8f45db12d84aafd7bdc6e20e96c066
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list