[vlc-commits] [Git][videolan/vlc][master] 3 commits: dshow: define STRSAFE_NO_DEPRECATE when including dshow.h
Steve Lhomme (@robUx4)
gitlab at videolan.org
Fri Jun 28 08:55:00 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
c7ef6b86 by Steve Lhomme at 2024-06-28T08:42:59+00:00
dshow: define STRSAFE_NO_DEPRECATE when including dshow.h
Similar to 4118b49f06a1c315102b54695703d98dd218c9c9 we need this define
to avoid compilation errors when using string functions.
This was the case in mingw-w64 before version 12 but is no longer needed.
- - - - -
e68f089d by Steve Lhomme at 2024-06-28T08:42:59+00:00
bdagraph: inlcude mpeg2structs.h to get official values
No need to define the structures and classes. They are part of the Windows SDK and
mingw-w64 v2 (03a5b84c5fdd3156ec477caf26b8775d6065c57d).
mingw-w64 emits a warning about possible interface layout, but we don't use these interfaces.
- - - - -
9d8a7b9a by Steve Lhomme at 2024-06-28T08:42:59+00:00
bdagraph: remove definition of unused classes
The header doesn't exist in mingw-w64.
- - - - -
4 changed files:
- modules/access/Makefile.am
- modules/access/dshow/access.h
- modules/access/dtv/bdadefs.h
- modules/access/dtv/bdagraph.hpp
Changes:
=====================================
modules/access/Makefile.am
=====================================
@@ -168,7 +168,6 @@ endif
libdshow_plugin_la_SOURCES = access/dshow/dshow.cpp access/dshow/access.h \
access/dshow/filter.cpp access/dshow/filter.h access/dshow/crossbar.cpp ../src/win32/mta_holder.h
-libdshow_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DSTRSAFE_NO_DEPRECATE
libdshow_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(LIBCOMCXXFLAGS)
libdshow_plugin_la_LIBADD = $(LIBCOM) -luuid -lstrmiids -lksuser
if HAVE_WIN32_DESKTOP
=====================================
modules/access/dshow/access.h
=====================================
@@ -25,6 +25,12 @@
* Preamble
*****************************************************************************/
+#if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 12
+// before 1ec7fa221644b6d02a617a47f6e80f5069cdc893 using strcpy
+// is replaced by strcpy_instead_use_StringCbCopyA_or_StringCchCopyA
+#define STRSAFE_NO_DEPRECATE
+#endif
+
#include <dshow.h>
#include <vector>
=====================================
modules/access/dtv/bdadefs.h
=====================================
@@ -21,6 +21,7 @@
*****************************************************************************/
#include <tuner.h>
+#include <mpeg2structs.h>
#ifndef __ISampleGrabberCB_FWD_DEFINED__
#define __ISampleGrabberCB_FWD_DEFINED__
@@ -38,15 +39,6 @@ interface ISampleGrabber;
#endif /* __cplusplus */
#endif
-class IMpeg2Data;
-class IGuideData;
-class IGuideDataEvent;
-class ISectionList;
-class IEnumTuneRequests;
-class IEnumGuideDataProperties;
-class IGuideDataProperty;
-class IMpeg2Stream;
-
/*****************************************************************************
* ISampleGrabberCB interface
@@ -290,275 +282,6 @@ static FORCEINLINE HRESULT ISampleGrabber_SetCallback(ISampleGrabber* This,ISamp
#endif /* __ISampleGrabber_INTERFACE_DEFINED__ */
-typedef struct _MPEG_HEADER_BITS_MIDL
-{
- WORD Bits;
-} MPEG_HEADER_BITS_MIDL;
-
-typedef struct _MPEG_HEADER_VERSION_BITS_MIDL
-{
- BYTE Bits;
-} MPEG_HEADER_VERSION_BITS_MIDL;
-
-typedef WORD PID;
-
-typedef BYTE TID;
-
-typedef struct _SECTION
-{
- TID TableId;
- union
- {
- MPEG_HEADER_BITS_MIDL S;
- WORD W;
- } Header;
- BYTE SectionData[ 1 ];
-} SECTION, *PSECTION;
-
-typedef struct _LONG_SECTION
-{
- TID TableId;
- union
- {
- MPEG_HEADER_BITS_MIDL S;
- WORD W;
- } Header;
- WORD TableIdExtension;
- union
- {
- MPEG_HEADER_VERSION_BITS_MIDL S;
- BYTE B;
- } Version;
- BYTE SectionNumber;
- BYTE LastSectionNumber;
- BYTE RemainingData[ 1 ];
-} LONG_SECTION;
-
-typedef struct _MPEG_BCS_DEMUX
-{
- DWORD AVMGraphId;
-} MPEG_BCS_DEMUX;
-
-typedef struct _MPEG_WINSOC
-{
- DWORD AVMGraphId;
-} MPEG_WINSOCK;
-
-typedef enum
-{
- MPEG_CONTEXT_BCS_DEMUX = 0,
- MPEG_CONTEXT_WINSOCK = MPEG_CONTEXT_BCS_DEMUX + 1
-} MPEG_CONTEXT_TYPE;
-
-typedef struct _MPEG_RQST_PACKET
-{
- DWORD dwLength;
- PSECTION pSection;
-} MPEG_RQST_PACKET, *PMPEG_RQST_PACKET;
-
-typedef struct _MPEG_PACKET_LIST
-{
- WORD wPacketCount;
- PMPEG_RQST_PACKET PacketList[ 1 ];
-} MPEG_PACKET_LIST, *PMPEG_PACKET_LIST;
-
-typedef struct _DSMCC_FILTER_OPTIONS
-{
- BOOL fSpecifyProtocol;
- BYTE Protocol;
- BOOL fSpecifyType;
- BYTE Type;
- BOOL fSpecifyMessageId;
- WORD MessageId;
- BOOL fSpecifyTransactionId;
- BOOL fUseTrxIdMessageIdMask;
- DWORD TransactionId;
- BOOL fSpecifyModuleVersion;
- BYTE ModuleVersion;
- BOOL fSpecifyBlockNumber;
- WORD BlockNumber;
- BOOL fGetModuleCall;
- WORD NumberOfBlocksInModule;
-} DSMCC_FILTER_OPTIONS;
-
-typedef struct _ATSC_FILTER_OPTIONS
-{
- BOOL fSpecifyEtmId;
- DWORD EtmId;
-} ATSC_FILTER_OPTIONS;
-
-typedef struct _MPEG_STREAM_BUFFER
-{
- HRESULT hr;
- DWORD dwDataBufferSize;
- DWORD dwSizeOfDataRead;
- BYTE *pDataBuffer;
-} MPEG_STREAM_BUFFER, *PMPEG_STREAM_BUFFER;
-
-typedef struct _MPEG_CONTEXT
-{
- MPEG_CONTEXT_TYPE Type;
- union
- {
- MPEG_BCS_DEMUX Demux;
- MPEG_WINSOCK Winsock;
- } U;
-} MPEG_CONTEXT, *PMPEG_CONTEXT;
-
-typedef enum
-{
- MPEG_RQST_UNKNOWN = 0,
- MPEG_RQST_GET_SECTION = MPEG_RQST_UNKNOWN + 1,
- MPEG_RQST_GET_SECTION_ASYNC = MPEG_RQST_GET_SECTION + 1,
- MPEG_RQST_GET_TABLE = MPEG_RQST_GET_SECTION_ASYNC + 1,
- MPEG_RQST_GET_TABLE_ASYNC = MPEG_RQST_GET_TABLE + 1,
- MPEG_RQST_GET_SECTIONS_STREAM = MPEG_RQST_GET_TABLE_ASYNC + 1,
- MPEG_RQST_GET_PES_STREAM = MPEG_RQST_GET_SECTIONS_STREAM + 1,
- MPEG_RQST_GET_TS_STREAM = MPEG_RQST_GET_PES_STREAM + 1,
- MPEG_RQST_START_MPE_STREAM = MPEG_RQST_GET_TS_STREAM + 1
-} MPEG_REQUEST_TYPE;
-
-typedef struct _MPEG2_FILTER
-{
- BYTE bVersionNumber;
- WORD wFilterSize;
- BOOL fUseRawFilteringBits;
- BYTE Filter[ 16 ];
- BYTE Mask[ 16 ];
- BOOL fSpecifyTableIdExtension;
- WORD TableIdExtension;
- BOOL fSpecifyVersion;
- BYTE Version;
- BOOL fSpecifySectionNumber;
- BYTE SectionNumber;
- BOOL fSpecifyCurrentNext;
- BOOL fNext;
- BOOL fSpecifyDsmccOptions;
- DSMCC_FILTER_OPTIONS Dsmcc;
- BOOL fSpecifyAtscOptions;
- ATSC_FILTER_OPTIONS Atsc;
-} MPEG2_FILTER, *PMPEG2_FILTER;
-
-typedef struct _MPEG_HEADER_BITS
-{
- WORD SectionLength : 12;
- WORD Reserved : 2;
- WORD PrivateIndicator : 1;
- WORD SectionSyntaxIndicator : 1;
-} MPEG_HEADER_BITS, *PMPEG_HEADER_BITS;
-
-typedef struct _MPEG_HEADER_VERSION_BITS
-{
- BYTE CurrentNextIndicator : 1;
- BYTE VersionNumber : 5;
- BYTE Reserved : 2;
-} MPEG_HEADER_VERSION_BITS, *PMPEG_HEADER_VERSION_BITS;
-
-class IMpeg2Data : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE GetSection( PID pid, TID tid,
- PMPEG2_FILTER pFilter, DWORD dwTimeout,
- ISectionList **ppSectionList )=0;
- virtual HRESULT STDMETHODCALLTYPE GetTable( PID pid, TID tid, PMPEG2_FILTER pFilter,
- DWORD dwTimeout, ISectionList **ppSectionList )=0;
- virtual HRESULT STDMETHODCALLTYPE GetStreamOfSections( PID pid, TID tid,
- PMPEG2_FILTER pFilter, HANDLE hDataReadyEvent,
- IMpeg2Stream **ppMpegStream )=0;
-};
-
-class IGuideData : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE GetServices(
- IEnumTuneRequests **ppEnumTuneRequestslass )=0;
- virtual HRESULT STDMETHODCALLTYPE GetServiceProperties(
- ITuneRequest *pTuneRequest,
- IEnumGuideDataProperties **ppEnumProperties )=0;
- virtual HRESULT STDMETHODCALLTYPE GetGuideProgramIDs(
- IEnumVARIANT **pEnumPrograms )=0;
- virtual HRESULT STDMETHODCALLTYPE GetProgramProperties(
- VARIANT varProgramDescriptionID,
- IEnumGuideDataProperties **ppEnumProperties )=0;
- virtual HRESULT STDMETHODCALLTYPE GetScheduleEntryIDs(
- IEnumVARIANT **pEnumScheduleEntries )=0;
- virtual HRESULT STDMETHODCALLTYPE GetScheduleEntryProperties(
- VARIANT varScheduleEntryDescriptionID,
- IEnumGuideDataProperties **ppEnumProperties )=0;
-};
-
-class IGuideDataEvent : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE GuideDataAcquired( void )=0;
- virtual HRESULT STDMETHODCALLTYPE ProgramChanged(
- VARIANT varProgramDescriptionID )=0;
- virtual HRESULT STDMETHODCALLTYPE ServiceChanged(
- VARIANT varServiceDescriptionID )=0;
- virtual HRESULT STDMETHODCALLTYPE ScheduleEntryChanged(
- VARIANT varScheduleEntryDescriptionID )=0;
- virtual HRESULT STDMETHODCALLTYPE ProgramDeleted(
- VARIANT varProgramDescriptionID )=0;
- virtual HRESULT STDMETHODCALLTYPE ServiceDeleted(
- VARIANT varServiceDescriptionID )=0;
- virtual HRESULT STDMETHODCALLTYPE ScheduleDeleted(
- VARIANT varScheduleEntryDescriptionID )=0;
-};
-
-class IGuideDataProperty : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE get_Name( BSTR *pbstrName )=0;
- virtual HRESULT STDMETHODCALLTYPE get_Language( long *idLang )=0;
- virtual HRESULT STDMETHODCALLTYPE get_Value( VARIANT *pvar )=0;
-};
-
-class IMpeg2Stream : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE Initialize( MPEG_REQUEST_TYPE requestType,
- IMpeg2Data *pMpeg2Data, PMPEG_CONTEXT pContext, PID pid, TID tid,
- PMPEG2_FILTER pFilter, HANDLE hDataReadyEvent )=0;
- virtual HRESULT STDMETHODCALLTYPE SupplyDataBuffer(
- PMPEG_STREAM_BUFFER pStreamBuffer )=0;
-};
-
-class ISectionList : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE Initialize( MPEG_REQUEST_TYPE requestType,
- IMpeg2Data *pMpeg2Data, PMPEG_CONTEXT pContext, PID pid, TID tid,
- PMPEG2_FILTER pFilter, DWORD timeout, HANDLE hDoneEvent )=0;
- virtual HRESULT STDMETHODCALLTYPE InitializeWithRawSections(
- PMPEG_PACKET_LIST pmplSections )=0;
- virtual HRESULT STDMETHODCALLTYPE CancelPendingRequest( void )=0;
- virtual HRESULT STDMETHODCALLTYPE GetNumberOfSections( WORD *pCount )=0;
- virtual HRESULT STDMETHODCALLTYPE GetSectionData( WORD sectionNumber,
- DWORD *pdwRawPacketLength, PSECTION *ppSection )=0;
- virtual HRESULT STDMETHODCALLTYPE GetProgramIdentifier( PID *pPid )=0;
- virtual HRESULT STDMETHODCALLTYPE GetTableIdentifier( TID *pTableId )=0;
-};
-
-class IEnumGuideDataProperties : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE Next( unsigned long celt,
- IGuideDataProperty **ppprop, unsigned long *pcelt )=0;
- virtual HRESULT STDMETHODCALLTYPE Skip( unsigned long celt )=0;
- virtual HRESULT STDMETHODCALLTYPE Reset( void )=0;
- virtual HRESULT STDMETHODCALLTYPE Clone( IEnumGuideDataProperties **ppenum )=0;
-};
-
-class IEnumTuneRequests : public IUnknown
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE Next( unsigned long celt, ITuneRequest **ppprop,
- unsigned long *pcelt )=0;
- virtual HRESULT STDMETHODCALLTYPE Skip( unsigned long celt )=0;
- virtual HRESULT STDMETHODCALLTYPE Reset( void )=0;
- virtual HRESULT STDMETHODCALLTYPE Clone( IEnumTuneRequests **ppenum )=0;
-};
-
extern "C" {
DEFINE_GUID(CLSID_DigitalCableNetworkType,
0x143827AB,0xF77B,0x498d,0x81,0xCA,0x5A,0x00,0x7A,0xEC,0x28,0xBF);
@@ -577,7 +300,4 @@ DEFINE_GUID(KSDATAFORMAT_SUBTYPE_BDA_MPEG2_TRANSPORT,
extern const CLSID CLSID_SampleGrabber; // found in strmiids
-DEFINE_GUID(IID_IMpeg2Data,
- 0x9B396D40,0xF380,0x4e3c,0xA5,0x14,0x1A,0x82,0xBF,0x6E,0xBF,0xE6);
-
};
=====================================
modules/access/dtv/bdagraph.hpp
=====================================
@@ -29,9 +29,12 @@
#include <ole2.h>
#include <limits.h>
-/* FIXME: mingw.org doesn't define secure versions of
- * http://msdn.microsoft.com/en-us/library/f30dzcf6.aspxu */
-#define NO_DSHOW_STRSAFE
+#if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 12
+// before 1ec7fa221644b6d02a617a47f6e80f5069cdc893 using _snwprintf
+// is replaced by _snwprintf_instead_use_StringCbPrintfW_or_StringCchPrintfW
+#define STRSAFE_NO_DEPRECATE
+#endif
+
#include <dshow.h>
#include <comcat.h>
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e1c739aedabe8f1398dd3bd995980d4ce54b64c0...9d8a7b9ab89b0f8b03d2822e4d5c693cf202c71b
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e1c739aedabe8f1398dd3bd995980d4ce54b64c0...9d8a7b9ab89b0f8b03d2822e4d5c693cf202c71b
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