diff options
Diffstat (limited to 'thirdparties/win32/include/directshow')
34 files changed, 1081 insertions, 879 deletions
diff --git a/thirdparties/win32/include/directshow/amextra.h b/thirdparties/win32/include/directshow/amextra.h index 3caf64c..df3f74e 100755 --- a/thirdparties/win32/include/directshow/amextra.h +++ b/thirdparties/win32/include/directshow/amextra.h @@ -34,7 +34,7 @@ public: __inout HRESULT *phr, __in_opt LPCWSTR pName); #endif - + // Override methods to track end of stream state STDMETHODIMP EndOfStream(); STDMETHODIMP EndFlush(); diff --git a/thirdparties/win32/include/directshow/amfilter.h b/thirdparties/win32/include/directshow/amfilter.h index 8646bc0..b86ece5 100755 --- a/thirdparties/win32/include/directshow/amfilter.h +++ b/thirdparties/win32/include/directshow/amfilter.h @@ -54,7 +54,7 @@ class CMemAllocator; // Implements memory buffer allocation //===================================================================== class AM_NOVTABLE CBaseMediaFilter : public CUnknown, - public IMediaFilter + public IMediaFilter { protected: @@ -67,7 +67,7 @@ protected: CRefTime m_tStart; CLSID m_clsid; // This filters clsid - // used for serialization + // used for serialization CCritSec *m_pLock; // Object we use for locking public: @@ -76,7 +76,7 @@ public: __in_opt LPCTSTR pName, __inout_opt LPUNKNOWN pUnk, __in CCritSec *pLock, - REFCLSID clsid); + REFCLSID clsid); virtual ~CBaseMediaFilter(); @@ -146,18 +146,18 @@ public: class AM_NOVTABLE CBaseFilter : public CUnknown, // Handles an IUnknown - public IBaseFilter, // The Filter Interface - public IAMovieSetup // For un/registration + public IBaseFilter, // The Filter Interface + public IAMovieSetup // For un/registration { -friend class CBasePin; + friend class CBasePin; protected: FILTER_STATE m_State; // current state: running, paused IReferenceClock *m_pClock; // this graph's ref clock CRefTime m_tStart; // offset from stream time to reference time CLSID m_clsid; // This filters clsid - // used for serialization + // used for serialization CCritSec *m_pLock; // Object we use for locking WCHAR *m_pName; // Full filter name @@ -171,26 +171,26 @@ public: __in_opt LPCTSTR pName, // Object description __inout_opt LPUNKNOWN pUnk, // IUnknown of delegating object __in CCritSec *pLock, // Object who maintains lock - REFCLSID clsid); // The clsid to be used to serialize this filter + REFCLSID clsid); // The clsid to be used to serialize this filter CBaseFilter( __in_opt LPCTSTR pName, // Object description __in_opt LPUNKNOWN pUnk, // IUnknown of delegating object __in CCritSec *pLock, // Object who maintains lock - REFCLSID clsid, // The clsid to be used to serialize this filter + REFCLSID clsid, // The clsid to be used to serialize this filter __inout HRESULT *phr); // General OLE return code #ifdef UNICODE CBaseFilter( __in_opt LPCSTR pName, // Object description __in_opt LPUNKNOWN pUnk, // IUnknown of delegating object __in CCritSec *pLock, // Object who maintains lock - REFCLSID clsid); // The clsid to be used to serialize this filter + REFCLSID clsid); // The clsid to be used to serialize this filter CBaseFilter( __in_opt LPCSTR pName, // Object description __in_opt LPUNKNOWN pUnk, // IUnknown of delegating object __in CCritSec *pLock, // Object who maintains lock - REFCLSID clsid, // The clsid to be used to serialize this filter + REFCLSID clsid, // The clsid to be used to serialize this filter __inout HRESULT *phr); // General OLE return code #endif ~CBaseFilter(); @@ -253,7 +253,7 @@ public: // pin enumerator STDMETHODIMP EnumPins( - __deref_out IEnumPins ** ppEnum); + __deref_out IEnumPins ** ppEnum); // default behaviour of FindPin assumes pin ids are their names @@ -263,18 +263,18 @@ public: ); STDMETHODIMP QueryFilterInfo( - __out FILTER_INFO * pInfo); + __out FILTER_INFO * pInfo); STDMETHODIMP JoinFilterGraph( - __inout_opt IFilterGraph * pGraph, - __in_opt LPCWSTR pName); + __inout_opt IFilterGraph * pGraph, + __in_opt LPCWSTR pName); // return a Vendor information string. Optional - may return E_NOTIMPL. // memory returned should be freed using CoTaskMemFree // default implementation returns E_NOTIMPL STDMETHODIMP QueryVendorInfo( - __deref_out LPWSTR* pVendorInfo - ); + __deref_out LPWSTR* pVendorInfo + ); // --- helper methods --- @@ -314,7 +314,9 @@ public: // --- setup helper methods --- // (override to return filters setup data) - virtual __out_opt LPAMOVIESETUP_FILTER GetSetupData(){ return NULL; } + virtual __out_opt LPAMOVIESETUP_FILTER GetSetupData() { + return NULL; + } }; @@ -339,7 +341,7 @@ protected: bool m_bRunTimeError; // Run time error generated bool m_bCanReconnectWhenActive; // OK to reconnect when active bool m_bTryMyTypesFirst; // When connecting enumerate - // this pin's types first + // this pin's types first CBaseFilter *m_pFilter; // Filter we were created by IQualityControl *m_pQSink; // Target for Quality messages LONG m_TypeVersion; // Holds current type version @@ -376,17 +378,17 @@ protected: // try all the media types in this enumerator - for each that // we accept, try to connect using ReceiveConnection. HRESULT TryMediaTypes( - IPin *pReceivePin, // connect to this pin - __in_opt const CMediaType *pmt, // proposed type from Connect - IEnumMediaTypes *pEnum); // try this enumerator + IPin *pReceivePin, // connect to this pin + __in_opt const CMediaType *pmt, // proposed type from Connect + IEnumMediaTypes *pEnum); // try this enumerator // establish a connection with a suitable mediatype. Needs to // propose a media type if the pmt pointer is null or partially // specified - use TryMediaTypes on both our and then the other pin's // enumerator until we find one that works. HRESULT AgreeMediaType( - IPin *pReceivePin, // connect to this pin - const CMediaType *pmt); // proposed type from Connect + IPin *pReceivePin, // connect to this pin + const CMediaType *pmt); // proposed type from Connect public: @@ -441,7 +443,7 @@ public: ); STDMETHODIMP QueryDirection( - __out PIN_DIRECTION * pPinDir + __out PIN_DIRECTION * pPinDir ); STDMETHODIMP QueryId( @@ -466,10 +468,12 @@ public: // all visible output pins and vice versa. // apPin can be NULL if nPin==0 (not otherwise). STDMETHODIMP QueryInternalConnections( - __out_ecount_part(*nPin,*nPin) IPin* *apPin, // array of IPin* + __out_ecount_part(*nPin,*nPin) IPin**apPin, // array of IPin* __inout ULONG *nPin // on input, the number of slots - // on output the number of pins - ) { return E_NOTIMPL; } + // on output the number of pins + ) { + return E_NOTIMPL; + } // Called when no more data will be sent STDMETHODIMP EndOfStream(void); @@ -481,9 +485,9 @@ public: // returns S_OK. // Override this to pass downstream. STDMETHODIMP NewSegment( - REFERENCE_TIME tStart, - REFERENCE_TIME tStop, - double dRate); + REFERENCE_TIME tStart, + REFERENCE_TIME tStop, + double dRate); //================================================================================ // IQualityControl methods @@ -496,9 +500,13 @@ public: // --- helper methods --- // Returns true if the pin is connected. false otherwise. - BOOL IsConnected(void) {return (m_Connected != NULL); }; + BOOL IsConnected(void) { + return (m_Connected != NULL); + }; // Return the pin this is connected to (if any) - IPin * GetConnected() { return m_Connected; }; + IPin * GetConnected() { + return m_Connected; + }; // Check if our filter is currently stopped BOOL IsStopped() { @@ -548,16 +556,16 @@ public: } // Access name - LPWSTR Name() { return m_pName; }; + LPWSTR Name() { + return m_pName; + }; // Can reconnectwhen active? - void SetReconnectWhenActive(bool bCanReconnect) - { + void SetReconnectWhenActive(bool bCanReconnect) { m_bCanReconnectWhenActive = bCanReconnect; } - bool CanReconnectWhenActive() - { + bool CanReconnectWhenActive() { return m_bCanReconnectWhenActive; } @@ -590,8 +598,8 @@ class CEnumPins : public IEnumPins // The interface we support typedef CGenericList<CBasePin> CPinList; CPinList m_PinCache; // These pointers have not been AddRef'ed and - // so they should not be dereferenced. They are - // merely kept to ID which pins have been enumerated. + // so they should not be dereferenced. They are + // merely kept to ID which pins have been enumerated. #ifdef DEBUG DWORD m_dwCookie; @@ -716,7 +724,7 @@ protected: IMemAllocator *m_pAllocator; IMemInputPin *m_pInputPin; // interface on the downstreaminput pin - // set up in CheckConnect when we connect. + // set up in CheckConnect when we connect. public: @@ -791,9 +799,9 @@ public: // deliver NewSegment to connected pin - you will need to // override this if you queue any data in your output pin. virtual HRESULT DeliverNewSegment( - REFERENCE_TIME tStart, - REFERENCE_TIME tStop, - double dRate); + REFERENCE_TIME tStart, + REFERENCE_TIME tStop, + double dRate); //================================================================================ // IQualityControl methods @@ -817,7 +825,7 @@ public: //===================================================================== class AM_NOVTABLE CBaseInputPin : public CBasePin, - public IMemInputPin + public IMemInputPin { protected: @@ -866,8 +874,8 @@ public: // tell the input pin which allocator the output pin is actually // going to use. STDMETHODIMP NotifyAllocator( - IMemAllocator * pAllocator, - BOOL bReadOnly); + IMemAllocator * pAllocator, + BOOL bReadOnly); // do something with this media sample STDMETHODIMP Receive(IMediaSample *pSample); @@ -947,7 +955,7 @@ public: // class CDynamicOutputPin : public CBaseOutputPin, - public IPinFlowControl + public IPinFlowControl { public: #ifdef UNICODE @@ -981,11 +989,11 @@ public: // Set graph config info void SetConfigInfo(IGraphConfig *pGraphConfig, HANDLE hStopEvent); - #ifdef DEBUG +#ifdef DEBUG virtual HRESULT Deliver(IMediaSample *pSample); virtual HRESULT DeliverEndOfStream(void); virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate); - #endif // DEBUG +#endif // DEBUG HRESULT DeliverBeginFlush(void); HRESULT DeliverEndFlush(void); @@ -999,12 +1007,12 @@ public: virtual bool StreamingThreadUsingOutputPin(void); HRESULT ChangeOutputFormat - ( + ( const AM_MEDIA_TYPE *pmt, REFERENCE_TIME tSegmentStart, REFERENCE_TIME tSegmentStop, double dSegmentRate - ); + ); HRESULT ChangeMediaType(const CMediaType *pmt); HRESULT DynamicReconnect(const CMediaType *pmt); @@ -1018,8 +1026,7 @@ protected: static HRESULT WaitEvent(HANDLE hEvent); - enum BLOCK_STATE - { + enum BLOCK_STATE { NOT_BLOCKED, PENDING, BLOCKED @@ -1075,9 +1082,9 @@ private: HRESULT Initialize(void); HRESULT ChangeMediaTypeHelper(const CMediaType *pmt); - #ifdef DEBUG +#ifdef DEBUG void AssertValid(void); - #endif // DEBUG +#endif // DEBUG }; class CAutoUsingOutputPin @@ -1101,8 +1108,7 @@ inline CAutoUsingOutputPin::CAutoUsingOutputPin( __in CDynamicOutputPin* pOutput ASSERT( S_OK == *phr ); HRESULT hr = pOutputPin->StartUsingOutputPin(); - if( FAILED( hr ) ) - { + if( FAILED( hr ) ) { *phr = hr; return; } @@ -1112,8 +1118,7 @@ inline CAutoUsingOutputPin::CAutoUsingOutputPin( __in CDynamicOutputPin* pOutput inline CAutoUsingOutputPin::~CAutoUsingOutputPin() { - if( NULL != m_pOutputPin ) - { + if( NULL != m_pOutputPin ) { m_pOutputPin->StopUsingOutputPin(); } } @@ -1209,9 +1214,9 @@ protected: we do no internal processing on it we leave it as a pointer */ DWORD m_dwFlags; /* Flags for this sample */ - /* Type specific flags are packed - into the top word - */ + /* Type specific flags are packed + into the top word + */ DWORD m_dwTypeSpecificFlags; /* Media type specific flags */ __field_ecount_opt(m_cbBuffer) LPBYTE m_pBuffer; /* Pointer to the complete buffer */ LONG m_lActual; /* Length of data in this sample */ @@ -1298,14 +1303,14 @@ public: // get the media times for this sample STDMETHODIMP GetMediaTime( - __out LONGLONG * pTimeStart, - __out LONGLONG * pTimeEnd + __out LONGLONG * pTimeStart, + __out LONGLONG * pTimeEnd ); // Set the media times for this sample STDMETHODIMP SetMediaTime( - __in_opt LONGLONG * pTimeStart, - __in_opt LONGLONG * pTimeEnd + __in_opt LONGLONG * pTimeStart, + __in_opt LONGLONG * pTimeEnd ); // Set and get properties (IMediaSample2) @@ -1337,15 +1342,14 @@ public: //===================================================================== class AM_NOVTABLE CBaseAllocator : public CUnknown,// A non delegating IUnknown - public IMemAllocatorCallbackTemp, // The interface we support - public CCritSec // Provides object locking + public IMemAllocatorCallbackTemp, // The interface we support + public CCritSec // Provides object locking { class CSampleList; friend class CSampleList; /* Trick to get at protected member in CMediaSample */ - static CMediaSample * &NextSample(__in CMediaSample *pSample) - { + static CMediaSample * &NextSample(__in CMediaSample *pSample) { return pSample->m_pNext; }; @@ -1355,23 +1359,26 @@ class AM_NOVTABLE CBaseAllocator : public CUnknown,// A non delegating IUnknown public: CSampleList() : m_List(NULL), m_nOnList(0) {}; #ifdef DEBUG - ~CSampleList() - { + ~CSampleList() { ASSERT(m_nOnList == 0); }; #endif - CMediaSample *Head() const { return m_List; }; - CMediaSample *Next(__in CMediaSample *pSample) const { return CBaseAllocator::NextSample(pSample); }; - int GetCount() const { return m_nOnList; }; - void Add(__inout CMediaSample *pSample) - { + CMediaSample *Head() const { + return m_List; + }; + CMediaSample *Next(__in CMediaSample *pSample) const { + return CBaseAllocator::NextSample(pSample); + }; + int GetCount() const { + return m_nOnList; + }; + void Add(__inout CMediaSample *pSample) { ASSERT(pSample != NULL); CBaseAllocator::NextSample(pSample) = m_List; m_List = pSample; m_nOnList++; }; - CMediaSample *RemoveHead() - { + CMediaSample *RemoveHead() { CMediaSample *pSample = m_List; if (pSample != NULL) { m_List = CBaseAllocator::NextSample(m_List); @@ -1470,12 +1477,12 @@ public: STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void **ppv); STDMETHODIMP SetProperties( - __in ALLOCATOR_PROPERTIES* pRequest, - __out ALLOCATOR_PROPERTIES* pActual); + __in ALLOCATOR_PROPERTIES* pRequest, + __out ALLOCATOR_PROPERTIES* pActual); // return the properties actually being used on this allocator STDMETHODIMP GetProperties( - __out ALLOCATOR_PROPERTIES* pProps); + __out ALLOCATOR_PROPERTIES* pProps); // override Commit to allocate memory. We handle the GetBuffer //state changes @@ -1511,7 +1518,9 @@ public: void NotifySample(); // Notify that we're waiting for a sample - void SetWaiting() { m_lWaiting++; }; + void SetWaiting() { + m_lWaiting++; + }; }; @@ -1557,8 +1566,8 @@ public: static CUnknown *CreateInstance(__inout_opt LPUNKNOWN, __inout HRESULT *); STDMETHODIMP SetProperties( - __in ALLOCATOR_PROPERTIES* pRequest, - __out ALLOCATOR_PROPERTIES* pActual); + __in ALLOCATOR_PROPERTIES* pRequest, + __out ALLOCATOR_PROPERTIES* pActual); CMemAllocator(__in_opt LPCTSTR , __inout_opt LPUNKNOWN, __inout HRESULT *); #ifdef UNICODE @@ -1570,8 +1579,8 @@ public: // helper used by IAMovieSetup implementation STDAPI AMovieSetupRegisterFilter( const AMOVIESETUP_FILTER * const psetupdata - , IFilterMapper * pIFM - , BOOL bRegister ); + , IFilterMapper * pIFM + , BOOL bRegister ); /////////////////////////////////////////////////////////////////////////// diff --git a/thirdparties/win32/include/directshow/cache.h b/thirdparties/win32/include/directshow/cache.h index a2d5752..4a38253 100755 --- a/thirdparties/win32/include/directshow/cache.h +++ b/thirdparties/win32/include/directshow/cache.h @@ -31,7 +31,8 @@ #define __CACHE__ -class CCache : CBaseObject { +class CCache : CBaseObject +{ /* Make copy constructor and assignment operator inaccessible */ @@ -67,7 +68,9 @@ public: void RemoveAll(void); /* Return the cache size which is set during construction */ - INT GetCacheSize(void) const {return m_iCacheSize;}; + INT GetCacheSize(void) const { + return m_iCacheSize; + }; }; #endif /* __CACHE__ */ diff --git a/thirdparties/win32/include/directshow/checkbmi.h b/thirdparties/win32/include/directshow/checkbmi.h index 9761dae..882d3fc 100755 --- a/thirdparties/win32/include/directshow/checkbmi.h +++ b/thirdparties/win32/include/directshow/checkbmi.h @@ -8,7 +8,8 @@ extern "C" { #endif // Helper -__inline BOOL MultiplyCheckOverflow(DWORD a, DWORD b, __deref_out_range(==, a * b) DWORD *pab) { +__inline BOOL MultiplyCheckOverflow(DWORD a, DWORD b, __deref_out_range(==, a * b) DWORD *pab) +{ *pab = a * b; if ((a == 0) || (((*pab) / a) == b)) { return TRUE; @@ -43,8 +44,8 @@ __success(return != 0) __inline BOOL ValidateBitmapInfoHeader( // Reject bad parameters - do the size check first to avoid reading bad memory if (cbSize < sizeof(BITMAPINFOHEADER) || - pbmi->biSize < sizeof(BITMAPINFOHEADER) || - pbmi->biSize > 4096) { + pbmi->biSize < sizeof(BITMAPINFOHEADER) || + pbmi->biSize > 4096) { return FALSE; } @@ -78,7 +79,7 @@ __success(return != 0) __inline BOOL ValidateBitmapInfoHeader( // Also don't allow huge values > 1GB which might cause arithmetic // errors for users if (dwSizeImage > 0x40000000 || - pbmi->biSizeImage > 0x40000000) { + pbmi->biSizeImage > 0x40000000) { return FALSE; } @@ -89,13 +90,14 @@ __success(return != 0) __inline BOOL ValidateBitmapInfoHeader( if (pbmi->biClrUsed == 0 && pbmi->biBitCount <= 8 && pbmi->biBitCount > 0) { dwClrUsed = (1 << pbmi->biBitCount); - } else { + } + else { dwClrUsed = pbmi->biClrUsed; } // Check total size if (cbSize < pbmi->biSize + dwClrUsed * sizeof(RGBQUAD) + - (pbmi->biCompression == BI_BITFIELDS ? 3 * sizeof(DWORD) : 0)) { + (pbmi->biCompression == BI_BITFIELDS ? 3 * sizeof(DWORD) : 0)) { return FALSE; } diff --git a/thirdparties/win32/include/directshow/combase.h b/thirdparties/win32/include/directshow/combase.h index 44ca535..c917923 100755 --- a/thirdparties/win32/include/directshow/combase.h +++ b/thirdparties/win32/include/directshow/combase.h @@ -113,13 +113,12 @@ AMOVIESETUP_MEDIATYPE, * PAMOVIESETUP_MEDIATYPE, * FAR LPAMOVIESETUP_MEDIATYPE; typedef REGFILTERPINS AMOVIESETUP_PIN, * PAMOVIESETUP_PIN, * FAR LPAMOVIESETUP_PIN; -typedef struct _AMOVIESETUP_FILTER -{ - const CLSID * clsID; - const WCHAR * strName; - DWORD dwMerit; - UINT nPins; - const AMOVIESETUP_PIN * lpPin; +typedef struct _AMOVIESETUP_FILTER { + const CLSID * clsID; + const WCHAR * strName; + DWORD dwMerit; + UINT nPins; + const AMOVIESETUP_PIN * lpPin; } AMOVIESETUP_FILTER, * PAMOVIESETUP_FILTER, * FAR LPAMOVIESETUP_FILTER; @@ -198,7 +197,7 @@ public: support, and an implementation of the core non delegating IUnknown */ class AM_NOVTABLE CUnknown : public INonDelegatingUnknown, - public CBaseObject + public CBaseObject { private: const LPUNKNOWN m_pUnknown; /* Owner of this object */ @@ -257,7 +256,8 @@ typedef void (CALLBACK *LPFNInitRoutine)(BOOL bLoading, const CLSID *rclsid); /* Create one of these per object class in an array so that the default class factory code can create new instances */ -class CFactoryTemplate { +class CFactoryTemplate +{ public: diff --git a/thirdparties/win32/include/directshow/cprop.h b/thirdparties/win32/include/directshow/cprop.h index a030f8f..99151f0 100755 --- a/thirdparties/win32/include/directshow/cprop.h +++ b/thirdparties/win32/include/directshow/cprop.h @@ -58,7 +58,7 @@ public: #ifdef UNICODE CBasePropertyPage(__in_opt LPCSTR pName, __inout_opt LPUNKNOWN pUnk, - int DialogId, + int DialogId, int TitleId); #endif virtual ~CBasePropertyPage() { }; @@ -66,11 +66,21 @@ public: // Override these virtual methods - virtual HRESULT OnConnect(IUnknown *pUnknown) { return NOERROR; }; - virtual HRESULT OnDisconnect() { return NOERROR; }; - virtual HRESULT OnActivate() { return NOERROR; }; - virtual HRESULT OnDeactivate() { return NOERROR; }; - virtual HRESULT OnApplyChanges() { return NOERROR; }; + virtual HRESULT OnConnect(IUnknown *pUnknown) { + return NOERROR; + }; + virtual HRESULT OnDisconnect() { + return NOERROR; + }; + virtual HRESULT OnActivate() { + return NOERROR; + }; + virtual HRESULT OnDeactivate() { + return NOERROR; + }; + virtual HRESULT OnApplyChanges() { + return NOERROR; + }; virtual INT_PTR OnReceiveMessage(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam); // These implement an IPropertyPage interface @@ -85,10 +95,16 @@ public: STDMETHODIMP SetObjects(ULONG cObjects, __in_ecount_opt(cObjects) LPUNKNOWN *ppUnk); STDMETHODIMP Show(UINT nCmdShow); STDMETHODIMP Move(LPCRECT prect); - STDMETHODIMP IsPageDirty(void) { return m_bDirty ? S_OK : S_FALSE; } + STDMETHODIMP IsPageDirty(void) { + return m_bDirty ? S_OK : S_FALSE; + } STDMETHODIMP Apply(void); - STDMETHODIMP Help(LPCWSTR lpszHelpDir) { return E_NOTIMPL; } - STDMETHODIMP TranslateAccelerator(__inout LPMSG lpMsg) { return E_NOTIMPL; } + STDMETHODIMP Help(LPCWSTR lpszHelpDir) { + return E_NOTIMPL; + } + STDMETHODIMP TranslateAccelerator(__inout LPMSG lpMsg) { + return E_NOTIMPL; + } }; #endif // __CPROP__ diff --git a/thirdparties/win32/include/directshow/ctlutil.h b/thirdparties/win32/include/directshow/ctlutil.h index e3f7085..e851339 100755 --- a/thirdparties/win32/include/directshow/ctlutil.h +++ b/thirdparties/win32/include/directshow/ctlutil.h @@ -36,17 +36,17 @@ public: STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo); STDMETHODIMP GetTypeInfo( - REFIID riid, - UINT itinfo, - LCID lcid, - __deref_out ITypeInfo ** pptinfo); + REFIID riid, + UINT itinfo, + LCID lcid, + __deref_out ITypeInfo ** pptinfo); STDMETHODIMP GetIDsOfNames( - REFIID riid, - __in_ecount(cNames) LPOLESTR * rgszNames, - UINT cNames, - LCID lcid, - __out_ecount(cNames) DISPID * rgdispid); + REFIID riid, + __in_ecount(cNames) LPOLESTR * rgszNames, + UINT cNames, + LCID lcid, + __out_ecount(cNames) DISPID * rgdispid); }; @@ -69,26 +69,26 @@ public: STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo); STDMETHODIMP GetTypeInfo( - UINT itinfo, - LCID lcid, - __deref_out ITypeInfo ** pptinfo); + UINT itinfo, + LCID lcid, + __deref_out ITypeInfo ** pptinfo); STDMETHODIMP GetIDsOfNames( - REFIID riid, - __in_ecount(cNames) LPOLESTR * rgszNames, - UINT cNames, - LCID lcid, - __out_ecount(cNames) DISPID * rgdispid); + REFIID riid, + __in_ecount(cNames) LPOLESTR * rgszNames, + UINT cNames, + LCID lcid, + __out_ecount(cNames) DISPID * rgdispid); STDMETHODIMP Invoke( - DISPID dispidMember, - REFIID riid, - LCID lcid, - WORD wFlags, - __in DISPPARAMS * pdispparams, - __out_opt VARIANT * pvarResult, - __out_opt EXCEPINFO * pexcepinfo, - __out_opt UINT * puArgErr); + DISPID dispidMember, + REFIID riid, + LCID lcid, + WORD wFlags, + __in DISPPARAMS * pdispparams, + __out_opt VARIANT * pvarResult, + __out_opt EXCEPINFO * pexcepinfo, + __out_opt UINT * puArgErr); }; @@ -111,26 +111,26 @@ public: STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo); STDMETHODIMP GetTypeInfo( - UINT itinfo, - LCID lcid, - __deref_out ITypeInfo ** pptinfo); + UINT itinfo, + LCID lcid, + __deref_out ITypeInfo ** pptinfo); STDMETHODIMP GetIDsOfNames( - REFIID riid, - __in_ecount(cNames) LPOLESTR * rgszNames, - UINT cNames, - LCID lcid, - __out_ecount(cNames) DISPID * rgdispid); + REFIID riid, + __in_ecount(cNames) LPOLESTR * rgszNames, + UINT cNames, + LCID lcid, + __out_ecount(cNames) DISPID * rgdispid); STDMETHODIMP Invoke( - DISPID dispidMember, - REFIID riid, - LCID lcid, - WORD wFlags, - __in DISPPARAMS * pdispparams, - __out_opt VARIANT * pvarResult, - __out_opt EXCEPINFO * pexcepinfo, - __out_opt UINT * puArgErr); + DISPID dispidMember, + REFIID riid, + LCID lcid, + WORD wFlags, + __in DISPPARAMS * pdispparams, + __out_opt VARIANT * pvarResult, + __out_opt EXCEPINFO * pexcepinfo, + __out_opt UINT * puArgErr); }; @@ -155,26 +155,26 @@ public: STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo); STDMETHODIMP GetTypeInfo( - UINT itinfo, - LCID lcid, - __deref_out ITypeInfo ** pptinfo); + UINT itinfo, + LCID lcid, + __deref_out ITypeInfo ** pptinfo); STDMETHODIMP GetIDsOfNames( - REFIID riid, - __in_ecount(cNames) LPOLESTR * rgszNames, - UINT cNames, - LCID lcid, - __out_ecount(cNames) DISPID * rgdispid); + REFIID riid, + __in_ecount(cNames) LPOLESTR * rgszNames, + UINT cNames, + LCID lcid, + __out_ecount(cNames) DISPID * rgdispid); STDMETHODIMP Invoke( - DISPID dispidMember, - REFIID riid, - LCID lcid, - WORD wFlags, - __in DISPPARAMS * pdispparams, - __out_opt VARIANT * pvarResult, - __out_opt EXCEPINFO * pexcepinfo, - __out_opt UINT * puArgErr); + DISPID dispidMember, + REFIID riid, + LCID lcid, + WORD wFlags, + __in DISPPARAMS * pdispparams, + __out_opt VARIANT * pvarResult, + __out_opt EXCEPINFO * pexcepinfo, + __out_opt UINT * puArgErr); }; @@ -183,20 +183,19 @@ public: // and REFERENCE_TIME (essentially a LONGLONG) within filters. // this class converts between the two -class COARefTime : public CRefTime { +class COARefTime : public CRefTime +{ public: COARefTime() { }; COARefTime(CRefTime t) - : CRefTime(t) - { + : CRefTime(t) { }; COARefTime(REFERENCE_TIME t) - : CRefTime(t) - { + : CRefTime(t) { }; COARefTime(double d) { @@ -221,53 +220,43 @@ public: return *this; } - inline BOOL operator==(const COARefTime& rt) - { + inline BOOL operator==(const COARefTime& rt) { return m_time == rt.m_time; }; - inline BOOL operator!=(const COARefTime& rt) - { + inline BOOL operator!=(const COARefTime& rt) { return m_time != rt.m_time; }; - inline BOOL operator < (const COARefTime& rt) - { + inline BOOL operator < (const COARefTime& rt) { return m_time < rt.m_time; }; - inline BOOL operator > (const COARefTime& rt) - { + inline BOOL operator > (const COARefTime& rt) { return m_time > rt.m_time; }; - inline BOOL operator >= (const COARefTime& rt) - { + inline BOOL operator >= (const COARefTime& rt) { return m_time >= rt.m_time; }; - inline BOOL operator <= (const COARefTime& rt) - { + inline BOOL operator <= (const COARefTime& rt) { return m_time <= rt.m_time; }; - inline COARefTime operator+(const COARefTime& rt) - { + inline COARefTime operator+(const COARefTime& rt) { return COARefTime(m_time + rt.m_time); }; - inline COARefTime operator-(const COARefTime& rt) - { + inline COARefTime operator-(const COARefTime& rt) { return COARefTime(m_time - rt.m_time); }; - inline COARefTime operator*(LONG l) - { + inline COARefTime operator*(LONG l) { return COARefTime(m_time * l); }; - inline COARefTime operator/(LONG l) - { + inline COARefTime operator/(LONG l) { return COARefTime(m_time / l); }; @@ -327,12 +316,12 @@ public: STDMETHODIMP IsUsingTimeFormat(const GUID * pFormat); STDMETHODIMP IsFormatSupported( const GUID * pFormat); STDMETHODIMP QueryPreferredFormat( __out GUID *pFormat); - STDMETHODIMP ConvertTimeFormat(__out LONGLONG * pTarget, + STDMETHODIMP ConvertTimeFormat(__out LONGLONG * pTarget, __in_opt const GUID * pTargetFormat, - LONGLONG Source, + LONGLONG Source, __in_opt const GUID * pSourceFormat ); STDMETHODIMP SetPositions( __inout_opt LONGLONG * pCurrent, DWORD CurrentFlags - , __inout_opt LONGLONG * pStop, DWORD StopFlags ); + , __inout_opt LONGLONG * pStop, DWORD StopFlags ); STDMETHODIMP GetPositions( __out_opt LONGLONG * pCurrent, __out_opt LONGLONG * pStop ); STDMETHODIMP GetCurrentPosition( __out LONGLONG * pCurrent ); @@ -410,26 +399,26 @@ public: STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo); STDMETHODIMP GetTypeInfo( - UINT itinfo, - LCID lcid, - __deref_out ITypeInfo ** pptinfo); + UINT itinfo, + LCID lcid, + __deref_out ITypeInfo ** pptinfo); STDMETHODIMP GetIDsOfNames( - REFIID riid, - __in_ecount(cNames) LPOLESTR * rgszNames, - UINT cNames, - LCID lcid, - __out_ecount(cNames) DISPID * rgdispid); + REFIID riid, + __in_ecount(cNames) LPOLESTR * rgszNames, + UINT cNames, + LCID lcid, + __out_ecount(cNames) DISPID * rgdispid); STDMETHODIMP Invoke( - DISPID dispidMember, - REFIID riid, - LCID lcid, - WORD wFlags, - __in DISPPARAMS * pdispparams, - __out_opt VARIANT * pvarResult, - __out_opt EXCEPINFO * pexcepinfo, - __out_opt UINT * puArgErr); + DISPID dispidMember, + REFIID riid, + LCID lcid, + WORD wFlags, + __in DISPPARAMS * pdispparams, + __out_opt VARIANT * pvarResult, + __out_opt EXCEPINFO * pexcepinfo, + __out_opt UINT * puArgErr); }; @@ -453,31 +442,30 @@ public: STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo); STDMETHODIMP GetTypeInfo( - UINT itinfo, - LCID lcid, - __deref_out ITypeInfo ** pptinfo); + UINT itinfo, + LCID lcid, + __deref_out ITypeInfo ** pptinfo); STDMETHODIMP GetIDsOfNames( - REFIID riid, - __in_ecount(cNames) LPOLESTR * rgszNames, - UINT cNames, - LCID lcid, - __out_ecount(cNames) DISPID * rgdispid); + REFIID riid, + __in_ecount(cNames) LPOLESTR * rgszNames, + UINT cNames, + LCID lcid, + __out_ecount(cNames) DISPID * rgdispid); STDMETHODIMP Invoke( - DISPID dispidMember, - REFIID riid, - LCID lcid, - WORD wFlags, - __in DISPPARAMS * pdispparams, - __out_opt VARIANT * pvarResult, - __out_opt EXCEPINFO * pexcepinfo, - __out_opt UINT * puArgErr); + DISPID dispidMember, + REFIID riid, + LCID lcid, + WORD wFlags, + __in DISPPARAMS * pdispparams, + __out_opt VARIANT * pvarResult, + __out_opt EXCEPINFO * pexcepinfo, + __out_opt UINT * puArgErr); STDMETHODIMP GetPreferredAspectRatio( - __out long *plAspectX, - __out long *plAspectY) - { + __out long *plAspectX, + __out long *plAspectY) { return E_NOTIMPL; } }; @@ -503,26 +491,26 @@ public: STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo); STDMETHODIMP GetTypeInfo( - UINT itinfo, - LCID lcid, - __deref_out ITypeInfo ** pptinfo); + UINT itinfo, + LCID lcid, + __deref_out ITypeInfo ** pptinfo); STDMETHODIMP GetIDsOfNames( - REFIID riid, - __in_ecount(cNames) LPOLESTR * rgszNames, - UINT cNames, - LCID lcid, - __out_ecount(cNames) DISPID * rgdispid); + REFIID riid, + __in_ecount(cNames) LPOLESTR * rgszNames, + UINT cNames, + LCID lcid, + __out_ecount(cNames) DISPID * rgdispid); STDMETHODIMP Invoke( - DISPID dispidMember, - REFIID riid, - LCID lcid, - WORD wFlags, - __in DISPPARAMS * pdispparams, - __out_opt VARIANT * pvarResult, - __out_opt EXCEPINFO * pexcepinfo, - __out_opt UINT * puArgErr); + DISPID dispidMember, + REFIID riid, + LCID lcid, + WORD wFlags, + __in DISPPARAMS * pdispparams, + __out_opt VARIANT * pvarResult, + __out_opt EXCEPINFO * pexcepinfo, + __out_opt UINT * puArgErr); }; @@ -591,13 +579,13 @@ public: STDMETHODIMP GetCurrentPosition(__out LONGLONG *pCurrent); STDMETHODIMP GetCapabilities( __out DWORD * pCapabilities ); STDMETHODIMP CheckCapabilities( __inout DWORD * pCapabilities ); - STDMETHODIMP ConvertTimeFormat( __out LONGLONG * pTarget, + STDMETHODIMP ConvertTimeFormat( __out LONGLONG * pTarget, __in_opt const GUID * pTargetFormat, - LONGLONG Source, + LONGLONG Source, __in_opt const GUID * pSourceFormat ); STDMETHODIMP SetPositions( __inout_opt LONGLONG * pCurrent, DWORD CurrentFlags - , __inout_opt LONGLONG * pStop, DWORD StopFlags ); + , __inout_opt LONGLONG * pStop, DWORD StopFlags ); STDMETHODIMP GetPositions( __out_opt LONGLONG * pCurrent, __out_opt LONGLONG * pStop ); @@ -667,7 +655,7 @@ public: class CDeferredCommand : public CUnknown, - public IDeferredCommand + public IDeferredCommand { public: @@ -685,7 +673,7 @@ public: __out VARIANT* pvarResult, __out short* puArgErr, BOOL bStream - ); + ); DECLARE_IUNKNOWN @@ -695,11 +683,11 @@ public: // IDeferredCommand methods STDMETHODIMP Cancel(); STDMETHODIMP Confidence( - __out LONG* pConfidence); + __out LONG* pConfidence); STDMETHODIMP Postpone( - REFTIME newtime); + REFTIME newtime); STDMETHODIMP GetHResult( - __out HRESULT* phrResult); + __out HRESULT* phrResult); // other public methods @@ -709,7 +697,7 @@ public: // returns TRUE if streamtime, FALSE if presentation time BOOL IsStreamTime() { - return m_bStream; + return m_bStream; }; CRefTime GetTime() { diff --git a/thirdparties/win32/include/directshow/ddmm.h b/thirdparties/win32/include/directshow/ddmm.h index c773d58..b11f1e8 100755 --- a/thirdparties/win32/include/directshow/ddmm.h +++ b/thirdparties/win32/include/directshow/ddmm.h @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // File: DDMM.h // -// Desc: DirectShow base classes - efines routines for using DirectDraw +// Desc: DirectShow base classes - efines routines for using DirectDraw // on a multimonitor system. // // Copyright (c) 1995-2001 Microsoft Corporation. All rights reserved. diff --git a/thirdparties/win32/include/directshow/dllsetup.h b/thirdparties/win32/include/directshow/dllsetup.h index aaac2ec..73babf2 100755 --- a/thirdparties/win32/include/directshow/dllsetup.h +++ b/thirdparties/win32/include/directshow/dllsetup.h @@ -41,6 +41,6 @@ STDAPI EliminateSubKey( HKEY, LPCTSTR ); STDAPI AMovieSetupRegisterFilter2( const AMOVIESETUP_FILTER * const psetupdata - , IFilterMapper2 * pIFM2 - , BOOL bRegister ); + , IFilterMapper2 * pIFM2 + , BOOL bRegister ); diff --git a/thirdparties/win32/include/directshow/dsschedule.h b/thirdparties/win32/include/directshow/dsschedule.h index a81c576..8348f7b 100755 --- a/thirdparties/win32/include/directshow/dsschedule.h +++ b/thirdparties/win32/include/directshow/dsschedule.h @@ -31,7 +31,9 @@ public: REFERENCE_TIME Advise( const REFERENCE_TIME & rtTime ); // Get the event handle which will be set if advise time requires re-evaluation. - HANDLE GetEvent() const { return m_ev; } + HANDLE GetEvent() const { + return m_ev; + } private: // We define the nodes that will be used in our singly linked list @@ -40,8 +42,8 @@ private: class CAdvisePacket { public: - CAdvisePacket() - {} + CAdvisePacket() { + } CAdvisePacket * m_next; DWORD_PTR m_dwAdviseCookie; @@ -50,40 +52,40 @@ private: HANDLE m_hNotify; // Handle to event or semephore BOOL m_bPeriodic; // TRUE => Periodic event - CAdvisePacket( CAdvisePacket * next, LONGLONG time ) : m_next(next), m_rtEventTime(time) - {} + CAdvisePacket( CAdvisePacket * next, LONGLONG time ) : m_next(next), m_rtEventTime(time) { + } - void InsertAfter( CAdvisePacket * p ) - { + void InsertAfter( CAdvisePacket * p ) { p->m_next = m_next; m_next = p; } - int IsZ() const // That is, is it the node that represents the end of the list - { return m_next == 0; } + int IsZ() const { // That is, is it the node that represents the end of the list + return m_next == 0; + } - CAdvisePacket * RemoveNext() - { + CAdvisePacket * RemoveNext() { CAdvisePacket *const next = m_next; CAdvisePacket *const new_next = next->m_next; m_next = new_next; return next; } - void DeleteNext() - { + void DeleteNext() { delete RemoveNext(); } - CAdvisePacket * Next() const - { + CAdvisePacket * Next() const { CAdvisePacket * result = m_next; - if (result->IsZ()) result = 0; + if (result->IsZ()) { + result = 0; + } return result; } - DWORD_PTR Cookie() const - { return m_dwAdviseCookie; } + DWORD_PTR Cookie() const { + return m_dwAdviseCookie; + } }; // Structure is: diff --git a/thirdparties/win32/include/directshow/dxmperf.h b/thirdparties/win32/include/directshow/dxmperf.h index dc58ad7..29b4859 100755 --- a/thirdparties/win32/include/directshow/dxmperf.h +++ b/thirdparties/win32/include/directshow/dxmperf.h @@ -19,7 +19,8 @@ extern "C" unsigned __int64 __getReg( int whichReg ); #endif // _IA64_ -inline ULONGLONG _RDTSC( void ) { +inline ULONGLONG _RDTSC( void ) +{ #ifdef _X86_ LARGE_INTEGER li; __asm { @@ -216,7 +217,7 @@ inline ULONGLONG _RDTSC( void ) { perfData.data.sampleDuration = (msecs); \ PerflogTraceEvent ((PEVENT_TRACE_HEADER) &perfData); \ } \ - + inline VOID PERFLOG_STREAMTRACE( @@ -227,10 +228,9 @@ VOID PERFLOG_STREAMTRACE( ULONGLONG Data2, ULONGLONG Data3, ULONGLONG Data4 - ) +) { - if (Level <= PerflogModuleLevel) - { + if (Level <= PerflogModuleLevel) { PERFINFO_WMI_STREAMTRACE perfData; memset( &perfData, 0, sizeof( perfData ) ); perfData.header.Size = sizeof( perfData ); diff --git a/thirdparties/win32/include/directshow/fourcc.h b/thirdparties/win32/include/directshow/fourcc.h index f4f71e9..168396c 100755 --- a/thirdparties/win32/include/directshow/fourcc.h +++ b/thirdparties/win32/include/directshow/fourcc.h @@ -51,7 +51,8 @@ private: #define GUID_Data4_2 0x719b3800 inline void -FOURCCMap::InitGUID() { +FOURCCMap::InitGUID() +{ Data2 = GUID_Data2; Data3 = GUID_Data3; ((DWORD *)Data4)[0] = GUID_Data4_1; @@ -59,7 +60,8 @@ FOURCCMap::InitGUID() { } inline -FOURCCMap::FOURCCMap() { +FOURCCMap::FOURCCMap() +{ InitGUID(); SetFOURCC( DWORD(0)); } diff --git a/thirdparties/win32/include/directshow/msgthrd.h b/thirdparties/win32/include/directshow/msgthrd.h index 208f03c..16ab25e 100755 --- a/thirdparties/win32/include/directshow/msgthrd.h +++ b/thirdparties/win32/include/directshow/msgthrd.h @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // File: MsgThrd.h // -// Desc: DirectShow base classes - provides support for a worker thread +// Desc: DirectShow base classes - provides support for a worker thread // class to which one can asynchronously post messages. // // Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved. @@ -10,7 +10,8 @@ // Message class - really just a structure. // -class CMsg { +class CMsg +{ public: UINT uMsg; DWORD dwFlags; @@ -29,7 +30,8 @@ public: // that it is prompted to perform particaular tasks by responding to messages // posted to its message queue. // -class AM_NOVTABLE CMsgThread { +class AM_NOVTABLE CMsgThread +{ private: static DWORD WINAPI DefaultThreadProc(__inout LPVOID lpParam); DWORD m_ThreadId; @@ -47,13 +49,12 @@ protected: public: CMsgThread() : m_ThreadId(0), - m_hThread(NULL), - m_lWaiting(0), - m_hSem(NULL), - // make a list with a cache of 5 items - m_ThreadQueue(NAME("MsgThread list"), 5) - { - } + m_hThread(NULL), + m_lWaiting(0), + m_hSem(NULL), + // make a list with a cache of 5 items + m_ThreadQueue(NAME("MsgThread list"), 5) { + } ~CMsgThread(); // override this if you want to block on other things as well diff --git a/thirdparties/win32/include/directshow/mtype.h b/thirdparties/win32/include/directshow/mtype.h index 9402f06..0a5d189 100755 --- a/thirdparties/win32/include/directshow/mtype.h +++ b/thirdparties/win32/include/directshow/mtype.h @@ -15,7 +15,8 @@ types etc. Has same data members as the struct AM_MEDIA_TYPE defined in the streams IDL file, but also has (non-virtual) functions */ -class CMediaType : public _AMMediaType { +class CMediaType : public _AMMediaType +{ public: @@ -36,13 +37,21 @@ public: BOOL IsValid() const; - const GUID *Type() const { return &majortype;} ; + const GUID *Type() const { + return &majortype; + } ; void SetType(const GUID *); - const GUID *Subtype() const { return &subtype;} ; + const GUID *Subtype() const { + return &subtype; + } ; void SetSubtype(const GUID *); - BOOL IsFixedSize() const {return bFixedSizeSamples; }; - BOOL IsTemporalCompressed() const {return bTemporalCompression; }; + BOOL IsFixedSize() const { + return bFixedSizeSamples; + }; + BOOL IsTemporalCompressed() const { + return bTemporalCompression; + }; ULONG GetSampleSize() const; void SetSampleSize(ULONG sz); @@ -52,11 +61,17 @@ public: // read/write pointer to format - can't change length without // calling SetFormat, AllocFormatBuffer or ReallocFormatBuffer - BYTE* Format() const {return pbFormat; }; - ULONG FormatLength() const { return cbFormat; }; + BYTE* Format() const { + return pbFormat; + }; + ULONG FormatLength() const { + return cbFormat; + }; void SetFormatType(const GUID *); - const GUID *FormatType() const {return &formattype; }; + const GUID *FormatType() const { + return &formattype; + }; BOOL SetFormat(__in_bcount(length) BYTE *pFormat, ULONG length); void ResetFormatBuffer(); BYTE* AllocFormatBuffer(ULONG length); diff --git a/thirdparties/win32/include/directshow/outputq.h b/thirdparties/win32/include/directshow/outputq.h index 7e60b53..b3cec61 100755 --- a/thirdparties/win32/include/directshow/outputq.h +++ b/thirdparties/win32/include/directshow/outputq.h @@ -2,7 +2,7 @@ // File: OutputQ.h // // Desc: DirectShow base classes - defines the COutputQueue class, which -// makes a queue of samples and sends them to an output pin. The +// makes a queue of samples and sends them to an output pin. The // class will optionally send the samples to the pin directly. // // Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved. @@ -19,13 +19,13 @@ public: __inout HRESULT *phr, // 'Return code' BOOL bAuto = TRUE, // Ask pin if blocks BOOL bQueue = TRUE, // Send through queue (ignored if - // bAuto set) + // bAuto set) LONG lBatchSize = 1, // Batch BOOL bBatchExact = FALSE,// Batch exactly to BatchSize LONG lListSize = // Likely number in the list - DEFAULTCACHE, + DEFAULTCACHE, DWORD dwPriority = // Priority of thread to create - THREAD_PRIORITY_NORMAL, + THREAD_PRIORITY_NORMAL, bool bFlushingOpt = false // flushing optimization ); ~COutputQueue(); @@ -35,16 +35,16 @@ public: // re-enable receives (pass this downstream) void EndFlush(); // Complete flush of samples - downstream - // pin guaranteed not to block at this stage + // pin guaranteed not to block at this stage void EOS(); // Call this on End of stream void SendAnyway(); // Send batched samples anyway (if bBatchExact set) void NewSegment( - REFERENCE_TIME tStart, - REFERENCE_TIME tStop, - double dRate); + REFERENCE_TIME tStart, + REFERENCE_TIME tStop, + double dRate); HRESULT Receive(IMediaSample *pSample); @@ -65,16 +65,14 @@ public: protected: static DWORD WINAPI InitialThreadProc(__in LPVOID pv); DWORD ThreadProc(); - BOOL IsQueued() - { + BOOL IsQueued() { return m_List != NULL; }; // The critical section MUST be held when this is called void QueueSample(IMediaSample *pSample); - BOOL IsSpecialSample(IMediaSample *pSample) - { + BOOL IsSpecialSample(IMediaSample *pSample) { return (DWORD_PTR)pSample > (DWORD_PTR)(LONG_PTR)(-16); }; @@ -87,10 +85,10 @@ protected: protected: // Queue 'messages' - #define SEND_PACKET ((IMediaSample *)(LONG_PTR)(-2)) // Send batch - #define EOS_PACKET ((IMediaSample *)(LONG_PTR)(-3)) // End of stream - #define RESET_PACKET ((IMediaSample *)(LONG_PTR)(-4)) // Reset m_hr - #define NEW_SEGMENT ((IMediaSample *)(LONG_PTR)(-5)) // send NewSegment +#define SEND_PACKET ((IMediaSample *)(LONG_PTR)(-2)) // Send batch +#define EOS_PACKET ((IMediaSample *)(LONG_PTR)(-3)) // End of stream +#define RESET_PACKET ((IMediaSample *)(LONG_PTR)(-4)) // Reset m_hr +#define NEW_SEGMENT ((IMediaSample *)(LONG_PTR)(-5)) // send NewSegment // new segment packet is always followed by one of these struct NewSegmentPacket { diff --git a/thirdparties/win32/include/directshow/perflog.h b/thirdparties/win32/include/directshow/perflog.h index 05d6404..7d2ca39 100755 --- a/thirdparties/win32/include/directshow/perflog.h +++ b/thirdparties/win32/include/directshow/perflog.h @@ -17,22 +17,22 @@ BOOL PerflogInitIfEnabled( IN HINSTANCE hInstance, __in PPERFLOG_LOGGING_PARAMS LogParams - ); +); BOOL PerflogInitialize ( __in PPERFLOG_LOGGING_PARAMS LogParams - ); +); VOID PerflogShutdown ( VOID - ); +); VOID PerflogTraceEvent ( __in PEVENT_TRACE_HEADER Event - ); +); extern ULONG PerflogEnableFlags; extern UCHAR PerflogEnableLevel; @@ -48,9 +48,9 @@ VOID PerflogTraceEventLevel( ULONG Level, __in PEVENT_TRACE_HEADER Event - ); +); VOID PerflogTraceEvent ( __in PEVENT_TRACE_HEADER Event - ); +); diff --git a/thirdparties/win32/include/directshow/perfstruct.h b/thirdparties/win32/include/directshow/perfstruct.h index b57657c..3c365e4 100755 --- a/thirdparties/win32/include/directshow/perfstruct.h +++ b/thirdparties/win32/include/directshow/perfstruct.h @@ -15,49 +15,49 @@ // {28CF047A-2437-4b24-B653-B9446A419A69} DEFINE_GUID(GUID_DSHOW_CTL, -0x28cf047a, 0x2437, 0x4b24, 0xb6, 0x53, 0xb9, 0x44, 0x6a, 0x41, 0x9a, 0x69); + 0x28cf047a, 0x2437, 0x4b24, 0xb6, 0x53, 0xb9, 0x44, 0x6a, 0x41, 0x9a, 0x69); // {D0DA7AD6-AE80-4de5-AAFC-C126711E7593} DEFINE_GUID(GUID_VIDEOREND, -0xd0da7ad6, 0xae80, 0x4de5, 0xaa, 0xfc, 0xc1, 0x26, 0x71, 0x1e, 0x75, 0x93); + 0xd0da7ad6, 0xae80, 0x4de5, 0xaa, 0xfc, 0xc1, 0x26, 0x71, 0x1e, 0x75, 0x93); // {DC70AC3E-93E5-48db-88AB-E42064EC276A} DEFINE_GUID(GUID_DSOUNDGLITCH, -0xdc70ac3e, 0x93e5, 0x48db, 0x88, 0xab, 0xe4, 0x20, 0x64, 0xec, 0x27, 0x6a); + 0xdc70ac3e, 0x93e5, 0x48db, 0x88, 0xab, 0xe4, 0x20, 0x64, 0xec, 0x27, 0x6a); // {3d7e7d93-2fc8-4a07-a719-e0922ff2899} DEFINE_GUID(GUID_STREAMTRACE, -0x3d7e7d93, 0x2fc8, 0x4a07, 0xa7, 0x19, 0xe0, 0x92, 0x2f, 0xf2, 0x89, 0x9e); + 0x3d7e7d93, 0x2fc8, 0x4a07, 0xa7, 0x19, 0xe0, 0x92, 0x2f, 0xf2, 0x89, 0x9e); // AZFIX: the following GUIDs aren't useful right now. // {3C33F7F5-EE54-493c-BA25-1656539C05AC} DEFINE_GUID(GUID_GETTIME, -0x3c33f7f5, 0xee54, 0x493c, 0xba, 0x25, 0x16, 0x56, 0x53, 0x9c, 0x5, 0xac); + 0x3c33f7f5, 0xee54, 0x493c, 0xba, 0x25, 0x16, 0x56, 0x53, 0x9c, 0x5, 0xac); // {CC44B44D-8169-4952-9E4A-A4E13295E492} DEFINE_GUID(GUID_AUDIOREND, -0xcc44b44d, 0x8169, 0x4952, 0x9e, 0x4a, 0xa4, 0xe1, 0x32, 0x95, 0xe4, 0x92); + 0xcc44b44d, 0x8169, 0x4952, 0x9e, 0x4a, 0xa4, 0xe1, 0x32, 0x95, 0xe4, 0x92); // {775D19BF-4D8B-4de6-8DC9-66BAC7B310A2} DEFINE_GUID(GUID_FRAMEDROP, -0x775d19bf, 0x4d8b, 0x4de6, 0x8d, 0xc9, 0x66, 0xba, 0xc7, 0xb3, 0x10, 0xa2); + 0x775d19bf, 0x4d8b, 0x4de6, 0x8d, 0xc9, 0x66, 0xba, 0xc7, 0xb3, 0x10, 0xa2); // {56D29065-EFBE-42dc-8C29-E325DC9C27D5} DEFINE_GUID(GUID_AUDIOBREAK, -0x56d29065, 0xefbe, 0x42dc, 0x8c, 0x29, 0xe3, 0x25, 0xdc, 0x9c, 0x27, 0xd5); + 0x56d29065, 0xefbe, 0x42dc, 0x8c, 0x29, 0xe3, 0x25, 0xdc, 0x9c, 0x27, 0xd5); // {E1E6EA87-95A8-497e-BFBA-0295AEBCC707} DEFINE_GUID(GUID_AUDIORECV, -0xe1e6ea87, 0x95a8, 0x497e, 0xbf, 0xba, 0x2, 0x95, 0xae, 0xbc, 0xc7, 0x7); + 0xe1e6ea87, 0x95a8, 0x497e, 0xbf, 0xba, 0x2, 0x95, 0xae, 0xbc, 0xc7, 0x7); // {10F7768A-B1E7-4242-AD90-A2D44683D9F0} DEFINE_GUID(GUID_AUDIOSLAVE, -0x10f7768a, 0xb1e7, 0x4242, 0xad, 0x90, 0xa2, 0xd4, 0x46, 0x83, 0xd9, 0xf0); + 0x10f7768a, 0xb1e7, 0x4242, 0xad, 0x90, 0xa2, 0xd4, 0x46, 0x83, 0xd9, 0xf0); // {8983803D-691A-49bc-8FF6-962A39C0198F} DEFINE_GUID(GUID_AUDIOADDBREAK, -0x8983803d, 0x691a, 0x49bc, 0x8f, 0xf6, 0x96, 0x2a, 0x39, 0xc0, 0x19, 0x8f); + 0x8983803d, 0x691a, 0x49bc, 0x8f, 0xf6, 0x96, 0x2a, 0x39, 0xc0, 0x19, 0x8f); #define GLITCHTYPE_DSOUNDFIRSTGOOD 0 #define GLITCHTYPE_DSOUNDFIRSTBAD 1 diff --git a/thirdparties/win32/include/directshow/pstream.h b/thirdparties/win32/include/directshow/pstream.h index 2e278ab..a7a7db8 100755 --- a/thirdparties/win32/include/directshow/pstream.h +++ b/thirdparties/win32/include/directshow/pstream.h @@ -44,60 +44,71 @@ // Implements IPersistStream. // See 'OLE Programmers Reference (Vol 1):Structured Storage Overview' for // more implementation information. -class CPersistStream : public IPersistStream { - private: +class CPersistStream : public IPersistStream +{ +private: - // Internal state: + // Internal state: - protected: - DWORD mPS_dwFileVersion; // version number of file (being read) - BOOL mPS_fDirty; +protected: + DWORD mPS_dwFileVersion; // version number of file (being read) + BOOL mPS_fDirty; - public: +public: - // IPersistStream methods + // IPersistStream methods - STDMETHODIMP IsDirty() - {return (mPS_fDirty ? S_OK : S_FALSE);} // note FALSE means clean - STDMETHODIMP Load(LPSTREAM pStm); - STDMETHODIMP Save(LPSTREAM pStm, BOOL fClearDirty); - STDMETHODIMP GetSizeMax(__out ULARGE_INTEGER * pcbSize) - // Allow 24 bytes for version. - { pcbSize->QuadPart = 12*sizeof(WCHAR)+SizeMax(); return NOERROR; } + STDMETHODIMP IsDirty() { + return (mPS_fDirty ? S_OK : S_FALSE); // note FALSE means clean + } + STDMETHODIMP Load(LPSTREAM pStm); + STDMETHODIMP Save(LPSTREAM pStm, BOOL fClearDirty); + STDMETHODIMP GetSizeMax(__out ULARGE_INTEGER * pcbSize) + // Allow 24 bytes for version. + { + pcbSize->QuadPart = 12*sizeof(WCHAR)+SizeMax(); + return NOERROR; + } - // implementation + // implementation - CPersistStream(IUnknown *punk, __inout HRESULT *phr); - ~CPersistStream(); + CPersistStream(IUnknown *punk, __inout HRESULT *phr); + ~CPersistStream(); - HRESULT SetDirty(BOOL fDirty) - { mPS_fDirty = fDirty; return NOERROR;} + HRESULT SetDirty(BOOL fDirty) { + mPS_fDirty = fDirty; + return NOERROR; + } - // override to reveal IPersist & IPersistStream - // STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv); + // override to reveal IPersist & IPersistStream + // STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv); - // --- IPersist --- + // --- IPersist --- - // You must override this to provide your own class id - STDMETHODIMP GetClassID(__out CLSID *pClsid) PURE; + // You must override this to provide your own class id + STDMETHODIMP GetClassID(__out CLSID *pClsid) PURE; - // overrideable if you want - // file version number. Override it if you ever change format - virtual DWORD GetSoftwareVersion(void) { return 0; } + // overrideable if you want + // file version number. Override it if you ever change format + virtual DWORD GetSoftwareVersion(void) { + return 0; + } - //========================================================================= - // OVERRIDE THESE to read and write your data - // OVERRIDE THESE to read and write your data - // OVERRIDE THESE to read and write your data + //========================================================================= + // OVERRIDE THESE to read and write your data + // OVERRIDE THESE to read and write your data + // OVERRIDE THESE to read and write your data - virtual int SizeMax() {return 0;} - virtual HRESULT WriteToStream(IStream *pStream); - virtual HRESULT ReadFromStream(IStream *pStream); - //========================================================================= + virtual int SizeMax() { + return 0; + } + virtual HRESULT WriteToStream(IStream *pStream); + virtual HRESULT ReadFromStream(IStream *pStream); + //========================================================================= - private: +private: }; diff --git a/thirdparties/win32/include/directshow/pullpin.h b/thirdparties/win32/include/directshow/pullpin.h index db4f407..e79f595 100755 --- a/thirdparties/win32/include/directshow/pullpin.h +++ b/thirdparties/win32/include/directshow/pullpin.h @@ -30,9 +30,9 @@ class CPullPin : public CAMThread BOOL m_bSync; enum ThreadMsg { - TM_Pause, // stop pulling and wait for next message - TM_Start, // start pulling - TM_Exit, // stop and exit + TM_Pause, // stop pulling and wait for next message + TM_Start, // start pulling + TM_Exit, // stop and exit }; ThreadMsg m_State; @@ -57,18 +57,18 @@ class CPullPin : public CAMThread // called from ProcessAsync to queue and collect requests HRESULT QueueSample( - __inout REFERENCE_TIME& tCurrent, - REFERENCE_TIME tAlignStop, - BOOL bDiscontinuity); + __inout REFERENCE_TIME& tCurrent, + REFERENCE_TIME tAlignStop, + BOOL bDiscontinuity); HRESULT CollectAndDeliver( - REFERENCE_TIME tStart, - REFERENCE_TIME tStop); + REFERENCE_TIME tStart, + REFERENCE_TIME tStop); HRESULT DeliverSample( - IMediaSample* pSample, - REFERENCE_TIME tStart, - REFERENCE_TIME tStop); + IMediaSample* pSample, + REFERENCE_TIME tStart, + REFERENCE_TIME tStop); protected: IMemAllocator * m_pAlloc; @@ -94,8 +94,8 @@ public: // optional IMemAllocator interface is offered as a preferred allocator // but no error occurs if it can't be met. virtual HRESULT DecideAllocator( - IMemAllocator* pAlloc, - __inout_opt ALLOCATOR_PROPERTIES * pProps); + IMemAllocator* pAlloc, + __inout_opt ALLOCATOR_PROPERTIES * pProps); // set start and stop position. if active, will start immediately at // the new position. Default is 0 to duration @@ -112,20 +112,20 @@ public: // helper functions LONGLONG AlignDown(LONGLONG ll, LONG lAlign) { - // aligning downwards is just truncation - return ll & ~(lAlign-1); + // aligning downwards is just truncation + return ll & ~(lAlign-1); }; LONGLONG AlignUp(LONGLONG ll, LONG lAlign) { - // align up: round up to next boundary - return (ll + (lAlign -1)) & ~(lAlign -1); + // align up: round up to next boundary + return (ll + (lAlign -1)) & ~(lAlign -1); }; // GetReader returns the (addrefed) IAsyncReader interface // for SyncRead etc IAsyncReader* GetReader() { - m_pReader->AddRef(); - return m_pReader; + m_pReader->AddRef(); + return m_pReader; }; // -- pure -- diff --git a/thirdparties/win32/include/directshow/refclock.h b/thirdparties/win32/include/directshow/refclock.h index df822e0..f310321 100755 --- a/thirdparties/win32/include/directshow/refclock.h +++ b/thirdparties/win32/include/directshow/refclock.h @@ -72,14 +72,14 @@ inline LONGLONG WINAPI ConvertToMilliseconds(const REFERENCE_TIME& RT) */ class CBaseReferenceClock -: public CUnknown, public IReferenceClock, public CCritSec, public IReferenceClockTimerControl + : public CUnknown, public IReferenceClock, public CCritSec, public IReferenceClockTimerControl { protected: virtual ~CBaseReferenceClock(); // Don't let me be created on the stack! public: - CBaseReferenceClock(__in_opt LPCTSTR pName, - __inout_opt LPUNKNOWN pUnk, - __inout HRESULT *phr, + CBaseReferenceClock(__in_opt LPCTSTR pName, + __inout_opt LPUNKNOWN pUnk, + __inout HRESULT *phr, __inout_opt CAMSchedule * pSched = 0 ); STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void ** ppv); @@ -136,7 +136,9 @@ public: /* Provide a method for correcting drift */ STDMETHODIMP SetTimeDelta( const REFERENCE_TIME& TimeDelta ); - CAMSchedule * GetSchedule() const { return m_pSchedule; } + CAMSchedule * GetSchedule() const { + return m_pSchedule; + } // IReferenceClockTimerControl methods // @@ -161,8 +163,8 @@ private: // Thread stuff public: - void TriggerThread() // Wakes thread up. Need to do this if - { // time to next advise needs reevaluating. + void TriggerThread() { // Wakes thread up. Need to do this if + // time to next advise needs reevaluating. EXECUTE_ASSERT(SetEvent(m_pSchedule->GetEvent())); } diff --git a/thirdparties/win32/include/directshow/reftime.h b/thirdparties/win32/include/directshow/reftime.h index 0ed32f6..3ddd4ab 100755 --- a/thirdparties/win32/include/directshow/reftime.h +++ b/thirdparties/win32/include/directshow/reftime.h @@ -56,56 +56,46 @@ public: REFERENCE_TIME m_time; - inline CRefTime() - { + inline CRefTime() { // default to 0 time m_time = 0; }; - inline CRefTime(LONG msecs) - { + inline CRefTime(LONG msecs) { m_time = MILLISECONDS_TO_100NS_UNITS(msecs); }; - inline CRefTime(REFERENCE_TIME rt) - { + inline CRefTime(REFERENCE_TIME rt) { m_time = rt; }; - inline operator REFERENCE_TIME() const - { + inline operator REFERENCE_TIME() const { return m_time; }; - inline CRefTime& operator=(const CRefTime& rt) - { + inline CRefTime& operator=(const CRefTime& rt) { m_time = rt.m_time; return *this; }; - inline CRefTime& operator=(const LONGLONG ll) - { + inline CRefTime& operator=(const LONGLONG ll) { m_time = ll; return *this; }; - inline CRefTime& operator+=(const CRefTime& rt) - { + inline CRefTime& operator+=(const CRefTime& rt) { return (*this = *this + rt); }; - inline CRefTime& operator-=(const CRefTime& rt) - { + inline CRefTime& operator-=(const CRefTime& rt) { return (*this = *this - rt); }; - inline LONG Millisecs(void) - { + inline LONG Millisecs(void) { return (LONG)(m_time / (UNITS / MILLISECONDS)); }; - inline LONGLONG GetUnits(void) - { + inline LONGLONG GetUnits(void) { return m_time; }; }; diff --git a/thirdparties/win32/include/directshow/renbase.h b/thirdparties/win32/include/directshow/renbase.h index 8634c6b..dedaea5 100755 --- a/thirdparties/win32/include/directshow/renbase.h +++ b/thirdparties/win32/include/directshow/renbase.h @@ -49,8 +49,7 @@ public: STDMETHODIMP Receive(IMediaSample *pMediaSample); // Helper - IMemAllocator inline *Allocator() const - { + IMemAllocator inline *Allocator() const { return m_pAllocator; } }; @@ -86,13 +85,13 @@ protected: BOOL m_bRepaintStatus; // Can we signal an EC_REPAINT // Avoid some deadlocks by tracking filter during stop volatile BOOL m_bInReceive; // Inside Receive between PrepareReceive - // And actually processing the sample + // And actually processing the sample REFERENCE_TIME m_SignalTime; // Time when we signal EC_COMPLETE UINT m_EndOfStreamTimer; // Used to signal end of stream CCritSec m_ObjectCreationLock; // This lock protects the creation and - // of m_pPosition and m_pInputPin. It - // ensures that two threads cannot create - // either object simultaneously. + // of m_pPosition and m_pInputPin. It + // ensures that two threads cannot create + // either object simultaneously. public: @@ -119,18 +118,34 @@ public: // Return internal information about this filter - BOOL IsEndOfStream() { return m_bEOS; }; - BOOL IsEndOfStreamDelivered() { return m_bEOSDelivered; }; - BOOL IsStreaming() { return m_bStreaming; }; - void SetAbortSignal(BOOL bAbort) { m_bAbort = bAbort; }; + BOOL IsEndOfStream() { + return m_bEOS; + }; + BOOL IsEndOfStreamDelivered() { + return m_bEOSDelivered; + }; + BOOL IsStreaming() { + return m_bStreaming; + }; + void SetAbortSignal(BOOL bAbort) { + m_bAbort = bAbort; + }; virtual void OnReceiveFirstSample(IMediaSample *pMediaSample) { }; - CAMEvent *GetRenderEvent() { return &m_RenderEvent; }; + CAMEvent *GetRenderEvent() { + return &m_RenderEvent; + }; // Permit access to the transition state - void Ready() { m_evComplete.Set(); }; - void NotReady() { m_evComplete.Reset(); }; - BOOL CheckReady() { return m_evComplete.Check(); }; + void Ready() { + m_evComplete.Set(); + }; + void NotReady() { + m_evComplete.Reset(); + }; + BOOL CheckReady() { + return m_evComplete.Check(); + }; virtual int GetPinCount(); virtual CBasePin *GetPin(int n); @@ -152,15 +167,19 @@ public: virtual void OnRenderStart(IMediaSample *pMediaSample); virtual void OnRenderEnd(IMediaSample *pMediaSample); - virtual HRESULT OnStartStreaming() { return NOERROR; }; - virtual HRESULT OnStopStreaming() { return NOERROR; }; + virtual HRESULT OnStartStreaming() { + return NOERROR; + }; + virtual HRESULT OnStopStreaming() { + return NOERROR; + }; virtual void OnWaitStart() { }; virtual void OnWaitEnd() { }; virtual void PrepareRender() { }; #ifdef PERF REFERENCE_TIME m_trRenderStart; // Just before we started drawing - // Set in OnRenderStart, Used in OnRenderEnd + // Set in OnRenderStart, Used in OnRenderEnd int m_idBaseStamp; // MSR_id for frame time stamp int m_idBaseRenderTime; // MSR_id for true wait time int m_idBaseAccuracy; // MSR_id for time frame is late (int) @@ -248,8 +267,8 @@ public: // Spot the bug in this macro - I can't. but it doesn't work! class CBaseVideoRenderer : public CBaseRenderer, // Base renderer class - public IQualProp, // Property page guff - public IQualityControl // Allow throttling + public IQualProp, // Property page guff + public IQualityControl // Allow throttling { protected: @@ -271,19 +290,19 @@ protected: // We therefore need to know whether we are playing frames early or not. int m_nNormal; // The number of consecutive frames - // drawn at their normal time (not early) - // -1 means we just dropped a frame. + // drawn at their normal time (not early) + // -1 means we just dropped a frame. #ifdef PERF BOOL m_bDrawLateFrames; // Don't drop any frames (debug and I'm - // not keen on people using it!) + // not keen on people using it!) #endif BOOL m_bSupplierHandlingQuality;// The response to Quality messages says - // our supplier is handling things. - // We will allow things to go extra late - // before dropping frames. We will play - // very early after he has dropped one. + // our supplier is handling things. + // We will allow things to go extra late + // before dropping frames. We will play + // very early after he has dropped one. // Control of scheduling, frame dropping etc. // We need to know where the time is being spent so as to tell whether @@ -313,7 +332,7 @@ protected: int m_trRenderAvg; // Time frames are taking to blt int m_trRenderLast; // Time for last frame blt int m_tRenderStart; // Just before we started drawing (mSec) - // derived from timeGetTime. + // derived from timeGetTime. // When frames are dropped we will play the next frame as early as we can. // If it was a false alarm and the machine is fast we slide gently back to @@ -335,8 +354,8 @@ protected: // controls whether we bother to drop a frame or whether we reckon that // we're doing well enough that we can stand a one-frame glitch. int m_trWaitAvg; // Average of last few wait times - // (actually we just average how early - // we were). Negative here means LATE. + // (actually we just average how early + // we were). Negative here means LATE. // The average inter-frame time. // This is used to calculate the proportion of the time used by the @@ -363,7 +382,7 @@ protected: //int m_idSendQuality; // MSR_id for timing the notifications per se #endif // PERF REFERENCE_TIME m_trRememberStampForPerf; // original time stamp of frame - // with no earliness fudges etc. + // with no earliness fudges etc. #ifdef PERF REFERENCE_TIME m_trRememberFrameForPerf; // time when previous frame rendered @@ -378,7 +397,7 @@ protected: int m_cFramesDropped; // cumulative frames dropped IN THE RENDERER int m_cFramesDrawn; // Frames since streaming started seen BY THE - // RENDERER (some may be dropped upstream) + // RENDERER (some may be dropped upstream) // Next two support average sync offset and standard deviation of sync offset. LONGLONG m_iTotAcc; // Sum of accuracies in mSec @@ -398,8 +417,8 @@ protected: int m_trFrame; // hold onto inter-frame time int m_tStreamingStart; // if streaming then time streaming started - // else time of last streaming session - // used for property page statistics + // else time of last streaming session + // used for property page statistics #ifdef PERF LONGLONG m_llTimeOffset; // timeGetTime()*10000+m_llTimeOffset==ref time #endif diff --git a/thirdparties/win32/include/directshow/schedule.h b/thirdparties/win32/include/directshow/schedule.h index 65ed402..d270c1e 100755 --- a/thirdparties/win32/include/directshow/schedule.h +++ b/thirdparties/win32/include/directshow/schedule.h @@ -31,7 +31,9 @@ public: REFERENCE_TIME Advise( const REFERENCE_TIME & rtTime ); // Get the event handle which will be set if advise time requires re-evaluation. - HANDLE GetEvent() const { return m_ev; } + HANDLE GetEvent() const { + return m_ev; + } private: // We define the nodes that will be used in our singly linked list @@ -40,8 +42,8 @@ private: class CAdvisePacket { public: - CAdvisePacket() - {} + CAdvisePacket() { + } CAdvisePacket * m_next; DWORD_PTR m_dwAdviseCookie; @@ -50,40 +52,40 @@ private: HANDLE m_hNotify; // Handle to event or semephore BOOL m_bPeriodic; // TRUE => Periodic event - CAdvisePacket( __inout_opt CAdvisePacket * next, LONGLONG time ) : m_next(next), m_rtEventTime(time) - {} + CAdvisePacket( __inout_opt CAdvisePacket * next, LONGLONG time ) : m_next(next), m_rtEventTime(time) { + } - void InsertAfter( __inout CAdvisePacket * p ) - { + void InsertAfter( __inout CAdvisePacket * p ) { p->m_next = m_next; m_next = p; } - int IsZ() const // That is, is it the node that represents the end of the list - { return m_next == 0; } + int IsZ() const { // That is, is it the node that represents the end of the list + return m_next == 0; + } - CAdvisePacket * RemoveNext() - { + CAdvisePacket * RemoveNext() { CAdvisePacket *const next = m_next; CAdvisePacket *const new_next = next->m_next; m_next = new_next; return next; } - void DeleteNext() - { + void DeleteNext() { delete RemoveNext(); } - CAdvisePacket * Next() const - { + CAdvisePacket * Next() const { CAdvisePacket * result = m_next; - if (result->IsZ()) result = 0; + if (result->IsZ()) { + result = 0; + } return result; } - DWORD_PTR Cookie() const - { return m_dwAdviseCookie; } + DWORD_PTR Cookie() const { + return m_dwAdviseCookie; + } }; // Structure is: diff --git a/thirdparties/win32/include/directshow/source.h b/thirdparties/win32/include/directshow/source.h index e6e451b..3270d56 100755 --- a/thirdparties/win32/include/directshow/source.h +++ b/thirdparties/win32/include/directshow/source.h @@ -40,7 +40,8 @@ class CSourceStream; // The class that will handle each pin // // Override construction to provide a means of creating // CSourceStream derived objects - ie a way of creating pins. -class CSource : public CBaseFilter { +class CSource : public CBaseFilter +{ public: CSource(__in_opt LPCTSTR pName, __inout_opt LPUNKNOWN lpunk, CLSID clsid, __inout HRESULT *phr); @@ -56,7 +57,9 @@ public: // -- Utilities -- - CCritSec* pStateLock(void) { return &m_cStateLock; } // provide our critical section + CCritSec* pStateLock(void) { + return &m_cStateLock; // provide our critical section + } HRESULT AddPin(__in CSourceStream *); HRESULT RemovePin(__in CSourceStream *); @@ -67,11 +70,11 @@ public: ); int FindPinNumber(__in IPin *iPin); - + protected: int m_iPins; // The number of pins on this filter. Updated by CSourceStream - // constructors & destructors. + // constructors & destructors. CSourceStream **m_paStreams; // the pins on this filter. CCritSec m_cStateLock; // Lock this to serialize function accesses to the filter state @@ -85,7 +88,8 @@ protected: // Use this class to manage a stream of data that comes from a // pin. // Uses a worker thread to put data on the pin. -class CSourceStream : public CAMThread, public CBaseOutputPin { +class CSourceStream : public CAMThread, public CBaseOutputPin +{ public: CSourceStream(__in_opt LPCTSTR pObjectName, @@ -119,9 +123,15 @@ protected: // Called as the thread is created/destroyed - use to perform // jobs such as start/stop streaming mode // If OnThreadCreate returns an error the thread will exit. - virtual HRESULT OnThreadCreate(void) {return NOERROR;}; - virtual HRESULT OnThreadDestroy(void) {return NOERROR;}; - virtual HRESULT OnThreadStartPlay(void) {return NOERROR;}; + virtual HRESULT OnThreadCreate(void) { + return NOERROR; + }; + virtual HRESULT OnThreadDestroy(void) { + return NOERROR; + }; + virtual HRESULT OnThreadStartPlay(void) { + return NOERROR; + }; // * // * Worker Thread @@ -133,15 +143,29 @@ protected: public: // thread commands enum Command {CMD_INIT, CMD_PAUSE, CMD_RUN, CMD_STOP, CMD_EXIT}; - HRESULT Init(void) { return CallWorker(CMD_INIT); } - HRESULT Exit(void) { return CallWorker(CMD_EXIT); } - HRESULT Run(void) { return CallWorker(CMD_RUN); } - HRESULT Pause(void) { return CallWorker(CMD_PAUSE); } - HRESULT Stop(void) { return CallWorker(CMD_STOP); } + HRESULT Init(void) { + return CallWorker(CMD_INIT); + } + HRESULT Exit(void) { + return CallWorker(CMD_EXIT); + } + HRESULT Run(void) { + return CallWorker(CMD_RUN); + } + HRESULT Pause(void) { + return CallWorker(CMD_PAUSE); + } + HRESULT Stop(void) { + return CallWorker(CMD_STOP); + } protected: - Command GetRequest(void) { return (Command) CAMThread::GetRequest(); } - BOOL CheckRequest(Command *pCom) { return CAMThread::CheckRequest( (DWORD *) pCom); } + Command GetRequest(void) { + return (Command) CAMThread::GetRequest(); + } + BOOL CheckRequest(Command *pCom) { + return CAMThread::CheckRequest( (DWORD *) pCom); + } // override these if you want to add thread commands virtual DWORD ThreadProc(void); // the thread function @@ -161,7 +185,9 @@ protected: // This will only be called by the default implementations // of CheckMediaType and GetMediaType(int, CMediaType*) // You must override this fn. or the above 2! - virtual HRESULT GetMediaType(__inout CMediaType *pMediaType) {return E_UNEXPECTED;} + virtual HRESULT GetMediaType(__inout CMediaType *pMediaType) { + return E_UNEXPECTED; + } STDMETHODIMP QueryId( __deref_out LPWSTR * Id diff --git a/thirdparties/win32/include/directshow/streams.h b/thirdparties/win32/include/directshow/streams.h index 72c6fd0..e021680 100755 --- a/thirdparties/win32/include/directshow/streams.h +++ b/thirdparties/win32/include/directshow/streams.h @@ -45,10 +45,10 @@ #ifndef NUMELMS #if _WIN32_WINNT < 0x0600 - #define NUMELMS(aa) (sizeof(aa)/sizeof((aa)[0])) +#define NUMELMS(aa) (sizeof(aa)/sizeof((aa)[0])) #else - #define NUMELMS(aa) ARRAYSIZE(aa) -#endif +#define NUMELMS(aa) ARRAYSIZE(aa) +#endif #endif /////////////////////////////////////////////////////////////////////////// @@ -56,7 +56,7 @@ // the applicaiton is being compiled with the headers from Visual C++ 6.0. /////////////////////////////////////////////////// //////////////////////// #ifndef InterlockedExchangePointer - #define InterlockedExchangePointer(Target, Value) \ +#define InterlockedExchangePointer(Target, Value) \ (PVOID)InterlockedExchange((PLONG)(Target), (LONG)(Value)) #endif @@ -70,7 +70,7 @@ typedef struct { WORD wReserved; /* If neither applies, set to zero. */ } Samples; DWORD dwChannelMask; /* which channels are */ - /* present in stream */ + /* present in stream */ GUID SubFormat; } WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE; #endif // !_WAVEFORMATEXTENSIBLE_ @@ -80,48 +80,48 @@ typedef struct { #endif // !defined(WAVE_FORMAT_EXTENSIBLE) #ifndef GetWindowLongPtr - #define GetWindowLongPtrA GetWindowLongA - #define GetWindowLongPtrW GetWindowLongW - #ifdef UNICODE - #define GetWindowLongPtr GetWindowLongPtrW - #else - #define GetWindowLongPtr GetWindowLongPtrA - #endif // !UNICODE +#define GetWindowLongPtrA GetWindowLongA +#define GetWindowLongPtrW GetWindowLongW +#ifdef UNICODE +#define GetWindowLongPtr GetWindowLongPtrW +#else +#define GetWindowLongPtr GetWindowLongPtrA +#endif // !UNICODE #endif // !GetWindowLongPtr #ifndef SetWindowLongPtr - #define SetWindowLongPtrA SetWindowLongA - #define SetWindowLongPtrW SetWindowLongW - #ifdef UNICODE - #define SetWindowLongPtr SetWindowLongPtrW - #else - #define SetWindowLongPtr SetWindowLongPtrA - #endif // !UNICODE +#define SetWindowLongPtrA SetWindowLongA +#define SetWindowLongPtrW SetWindowLongW +#ifdef UNICODE +#define SetWindowLongPtr SetWindowLongPtrW +#else +#define SetWindowLongPtr SetWindowLongPtrA +#endif // !UNICODE #endif // !SetWindowLongPtr #ifndef GWLP_WNDPROC - #define GWLP_WNDPROC (-4) +#define GWLP_WNDPROC (-4) #endif #ifndef GWLP_HINSTANCE - #define GWLP_HINSTANCE (-6) +#define GWLP_HINSTANCE (-6) #endif #ifndef GWLP_HWNDPARENT - #define GWLP_HWNDPARENT (-8) +#define GWLP_HWNDPARENT (-8) #endif #ifndef GWLP_USERDATA - #define GWLP_USERDATA (-21) +#define GWLP_USERDATA (-21) #endif #ifndef GWLP_ID - #define GWLP_ID (-12) +#define GWLP_ID (-12) #endif #ifndef DWLP_MSGRESULT - #define DWLP_MSGRESULT 0 +#define DWLP_MSGRESULT 0 #endif -#ifndef DWLP_DLGPROC - #define DWLP_DLGPROC DWLP_MSGRESULT + sizeof(LRESULT) +#ifndef DWLP_DLGPROC +#define DWLP_DLGPROC DWLP_MSGRESULT + sizeof(LRESULT) #endif #ifndef DWLP_USER - #define DWLP_USER DWLP_DLGPROC + sizeof(DLGPROC) +#define DWLP_USER DWLP_DLGPROC + sizeof(DLGPROC) #endif @@ -195,8 +195,8 @@ LONG_PTR _SetWindowLongPtr(HWND hwnd, int nIndex, T p) #else - #ifdef DEBUG - #pragma message("STREAMS.H included TWICE") - #endif +#ifdef DEBUG +#pragma message("STREAMS.H included TWICE") +#endif #endif // __STREAMS__ diff --git a/thirdparties/win32/include/directshow/strmctl.h b/thirdparties/win32/include/directshow/strmctl.h index 4077e6c..b0a019b 100755 --- a/thirdparties/win32/include/directshow/strmctl.h +++ b/thirdparties/win32/include/directshow/strmctl.h @@ -14,15 +14,15 @@ class CBaseStreamControl : public IAMStreamControl { public: // Used by the implementation - enum StreamControlState - { STREAM_FLOWING = 0x1000, - STREAM_DISCARDING + enum StreamControlState { + STREAM_FLOWING = 0x1000, + STREAM_DISCARDING }; private: enum StreamControlState m_StreamState; // Current stream state enum StreamControlState m_StreamStateOnStop; // State after next stop - // (i.e.Blocking or Discarding) + // (i.e.Blocking or Discarding) REFERENCE_TIME m_tStartTime; // MAX_TIME implies none REFERENCE_TIME m_tStopTime; // MAX_TIME implies none @@ -51,14 +51,14 @@ private: // Your pin must also expose IAMStreamControl when QI'd for it! // IReferenceClock * m_pRefClock; // Need it to set advises - // Filter must tell us via - // SetSyncSource + // Filter must tell us via + // SetSyncSource IMediaEventSink * m_pSink; // Event sink - // Filter must tell us after it - // creates it in JoinFilterGraph() + // Filter must tell us after it + // creates it in JoinFilterGraph() FILTER_STATE m_FilterState; // Just need it! - // Filter must tell us via - // NotifyFilterState + // Filter must tell us via + // NotifyFilterState REFERENCE_TIME m_tRunStart; // Per the Run call to the filter // This guy will return one of the three StreamControlState's. Here's what @@ -72,7 +72,7 @@ private: // fires, call me back - I've changed my mind. // enum StreamControlState CheckSampleTimes( __in const REFERENCE_TIME * pSampleStart, - __in const REFERENCE_TIME * pSampleStop ); + __in const REFERENCE_TIME * pSampleStop ); public: // You don't have to tell us much when we're created, but there are other @@ -90,18 +90,21 @@ public: // We need a clock to see what time it is. This is for the // "discard in a timely fashion" logic. If we discard everything as // quick as possible, a whole 60 minute file could get discarded in the - // first 10 seconds, and if somebody wants to turn streaming on at 30 + // first 10 seconds, and if somebody wants to turn streaming on at 30 // minutes into the file, and they make the call more than a few seconds // after the graph is run, it may be too late! // So we hold every sample until it's time has gone, then we discard it. // The filter should call this when it gets a SetSyncSource // - void SetSyncSource( IReferenceClock * pRefClock ) - { - CAutoLock lck(&m_CritSec); - if (m_pRefClock) m_pRefClock->Release(); - m_pRefClock = pRefClock; - if (m_pRefClock) m_pRefClock->AddRef(); + void SetSyncSource( IReferenceClock * pRefClock ) { + CAutoLock lck(&m_CritSec); + if (m_pRefClock) { + m_pRefClock->Release(); + } + m_pRefClock = pRefClock; + if (m_pRefClock) { + m_pRefClock->AddRef(); + } } // Set event sink for notifications @@ -130,10 +133,10 @@ public: // muting and unmuting of the stream. STDMETHODIMP StopAt( const REFERENCE_TIME * ptStop = NULL, - BOOL bSendExtra = FALSE, - DWORD dwCookie = 0 ); + BOOL bSendExtra = FALSE, + DWORD dwCookie = 0 ); STDMETHODIMP StartAt( const REFERENCE_TIME * ptStart = NULL, - DWORD dwCookie = 0 ); + DWORD dwCookie = 0 ); STDMETHODIMP GetInfo( __out AM_STREAM_INFO *pInfo); // Helper function for pin's receive method. Call this with @@ -149,9 +152,15 @@ private: // These don't require locking, but we are relying on the fact that // m_StreamState can be retrieved with integrity, and is a snap shot that // may have just been, or may be just about to be, changed. - HANDLE GetStreamEventHandle() const { return m_StreamEvent; } - enum StreamControlState GetStreamState() const { return m_StreamState; } - BOOL IsStreaming() const { return m_StreamState == STREAM_FLOWING; } + HANDLE GetStreamEventHandle() const { + return m_StreamEvent; + } + enum StreamControlState GetStreamState() const { + return m_StreamState; + } + BOOL IsStreaming() const { + return m_StreamState == STREAM_FLOWING; + } }; #endif diff --git a/thirdparties/win32/include/directshow/transfrm.h b/thirdparties/win32/include/directshow/transfrm.h index 36c2e0d..39f40ce 100755 --- a/thirdparties/win32/include/directshow/transfrm.h +++ b/thirdparties/win32/include/directshow/transfrm.h @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // File: Transfrm.h // -// Desc: DirectShow base classes - defines classes from which simple +// Desc: DirectShow base classes - defines classes from which simple // transform codecs may be derived. // // Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved. @@ -53,8 +53,7 @@ public: __in_opt LPCWSTR pName); #endif - STDMETHODIMP QueryId(__deref_out LPWSTR * Id) - { + STDMETHODIMP QueryId(__deref_out LPWSTR * Id) { return AMGetWideString(L"In", Id); } @@ -88,16 +87,18 @@ public: STDMETHODIMP EndFlush(void); STDMETHODIMP NewSegment( - REFERENCE_TIME tStart, - REFERENCE_TIME tStop, - double dRate); + REFERENCE_TIME tStart, + REFERENCE_TIME tStop, + double dRate); // Check if it's OK to process samples virtual HRESULT CheckStreaming(); // Media type public: - CMediaType& CurrentMediaType() { return m_mt; }; + CMediaType& CurrentMediaType() { + return m_mt; + }; }; @@ -136,8 +137,7 @@ public: // --- CBaseOutputPin ------------ - STDMETHODIMP QueryId(__deref_out LPWSTR * Id) - { + STDMETHODIMP QueryId(__deref_out LPWSTR * Id) { return AMGetWideString(L"Out", Id); } @@ -156,8 +156,8 @@ public: // called from CBaseOutputPin during connection to ask for // the count and size of buffers we need. HRESULT DecideBufferSize( - IMemAllocator * pAlloc, - __inout ALLOCATOR_PROPERTIES *pProp); + IMemAllocator * pAlloc, + __inout ALLOCATOR_PROPERTIES *pProp); // returns the preferred formats for a pin HRESULT GetMediaType(int iPosition, __inout CMediaType *pMediaType); @@ -167,7 +167,9 @@ public: // Media type public: - CMediaType& CurrentMediaType() { return m_mt; }; + CMediaType& CurrentMediaType() { + return m_mt; + }; }; @@ -215,8 +217,8 @@ public: // call the SetProperties function with appropriate arguments virtual HRESULT DecideBufferSize( - IMemAllocator * pAllocator, - __inout ALLOCATOR_PROPERTIES *pprop) PURE; + IMemAllocator * pAllocator, + __inout ALLOCATOR_PROPERTIES *pprop) PURE; // override to suggest OUTPUT pin media types virtual HRESULT GetMediaType(int iPosition, __inout CMediaType *pMediaType) PURE; @@ -253,15 +255,16 @@ public: virtual HRESULT BeginFlush(void); virtual HRESULT EndFlush(void); virtual HRESULT NewSegment( - REFERENCE_TIME tStart, - REFERENCE_TIME tStop, - double dRate); + REFERENCE_TIME tStart, + REFERENCE_TIME tStop, + double dRate); #ifdef PERF // Override to register performance measurement with a less generic string // You should do this to avoid confusion with other filters - virtual void RegisterPerfId() - {m_idTransform = MSR_REGISTER(TEXT("Transform"));} + virtual void RegisterPerfId() { + m_idTransform = MSR_REGISTER(TEXT("Transform")); + } #endif // PERF diff --git a/thirdparties/win32/include/directshow/transip.h b/thirdparties/win32/include/directshow/transip.h index 45fb4e9..b24fc3b 100755 --- a/thirdparties/win32/include/directshow/transip.h +++ b/thirdparties/win32/include/directshow/transip.h @@ -72,15 +72,18 @@ public: // Allow the filter to see what allocator we have // N.B. This does NOT AddRef - __out IMemAllocator * PeekAllocator() const - { return m_pAllocator; } + __out IMemAllocator * PeekAllocator() const { + return m_pAllocator; + } // Pass this on downstream if it ever gets called. STDMETHODIMP GetAllocatorRequirements(__out ALLOCATOR_PROPERTIES *pProps); HRESULT CompleteConnect(IPin *pReceivePin); - inline const BOOL ReadOnly() { return m_bReadOnly ; } + inline const BOOL ReadOnly() { + return m_bReadOnly ; + } }; // CTransInPlaceInputPin @@ -122,13 +125,15 @@ public: // Also called by input pin's GetAllocator() void SetAllocator(IMemAllocator * pAllocator); - __out_opt IMemInputPin * ConnectedIMemInputPin() - { return m_pInputPin; } + __out_opt IMemInputPin * ConnectedIMemInputPin() { + return m_pInputPin; + } // Allow the filter to see what allocator we have // N.B. This does NOT AddRef - __out IMemAllocator * PeekAllocator() const - { return m_pAllocator; } + __out IMemAllocator * PeekAllocator() const { + return m_pAllocator; + } HRESULT CompleteConnect(IPin *pReceivePin); @@ -162,10 +167,10 @@ public: // We override EnumMediaTypes to bypass the transform class enumerator // which would otherwise call this. - HRESULT GetMediaType(int iPosition, __inout CMediaType *pMediaType) - { DbgBreak("CTransInPlaceFilter::GetMediaType should never be called"); - return E_UNEXPECTED; - } + HRESULT GetMediaType(int iPosition, __inout CMediaType *pMediaType) { + DbgBreak("CTransInPlaceFilter::GetMediaType should never be called"); + return E_UNEXPECTED; + } // This is called when we actually have to provide our own allocator. HRESULT DecideBufferSize(IMemAllocator*, __inout ALLOCATOR_PROPERTIES *); @@ -174,8 +179,7 @@ public: // class to call CheckInputType with the assumption that the type // does not change. In Debug builds some calls will be made and // we just ensure that they do not assert. - HRESULT CheckTransform(const CMediaType *mtIn, const CMediaType *mtOut) - { + HRESULT CheckTransform(const CMediaType *mtIn, const CMediaType *mtOut) { return S_OK; }; @@ -202,8 +206,9 @@ public: #ifdef PERF // Override to register performance measurement with a less generic string // You should do this to avoid confusion with other filters - virtual void RegisterPerfId() - {m_idTransInPlace = MSR_REGISTER(TEXT("TransInPlace"));} + virtual void RegisterPerfId() { + m_idTransInPlace = MSR_REGISTER(TEXT("TransInPlace")); + } #endif // PERF @@ -223,25 +228,21 @@ protected: friend class CTransInPlaceInputPin; friend class CTransInPlaceOutputPin; - __out CTransInPlaceInputPin *InputPin() const - { + __out CTransInPlaceInputPin *InputPin() const { return (CTransInPlaceInputPin *)m_pInput; }; - __out CTransInPlaceOutputPin *OutputPin() const - { + __out CTransInPlaceOutputPin *OutputPin() const { return (CTransInPlaceOutputPin *)m_pOutput; }; // Helper to see if the input and output types match - BOOL TypesMatch() - { + BOOL TypesMatch() { return InputPin()->CurrentMediaType() == OutputPin()->CurrentMediaType(); } // Are the input and output allocators different? - BOOL UsingDifferentAllocators() const - { + BOOL UsingDifferentAllocators() const { return InputPin()->PeekAllocator() != OutputPin()->PeekAllocator(); } }; // CTransInPlaceFilter diff --git a/thirdparties/win32/include/directshow/vtrans.h b/thirdparties/win32/include/directshow/vtrans.h index 7122392..a787dbc 100755 --- a/thirdparties/win32/include/directshow/vtrans.h +++ b/thirdparties/win32/include/directshow/vtrans.h @@ -13,7 +13,7 @@ class CVideoTransformFilter : public CTransformFilter { - public: +public: CVideoTransformFilter(__in_opt LPCTSTR, __inout_opt LPUNKNOWN, REFCLSID clsid); ~CVideoTransformFilter(); @@ -62,7 +62,7 @@ class CVideoTransformFilter : public CTransformFilter } #endif - protected: +protected: // =========== QUALITY MANAGEMENT IMPLEMENTATION ======================== // Frames are assumed to come in three types: @@ -101,10 +101,10 @@ class CVideoTransformFilter : public CTransformFilter // the quality management here if you have B-frames. int m_nKeyFramePeriod; // the largest observed interval between type 1 frames - // 1 means every frame is type 1, 2 means every other. + // 1 means every frame is type 1, 2 means every other. int m_nFramesSinceKeyFrame; // Used to count frames since the last type 1. - // becomes the new m_nKeyFramePeriod if greater. + // becomes the new m_nKeyFramePeriod if greater. BOOL m_bSkipping; // we are skipping to the next type 1 frame @@ -126,7 +126,7 @@ class CVideoTransformFilter : public CTransformFilter BOOL ShouldSkipFrame(IMediaSample * pIn); int m_itrLate; // lateness from last Quality message - // (this overflows at 214 secs late). + // (this overflows at 214 secs late). int m_tDecodeStart; // timeGetTime when decode started. int m_itrAvgDecode; // Average decode time in reference units. diff --git a/thirdparties/win32/include/directshow/winctrl.h b/thirdparties/win32/include/directshow/winctrl.h index f18ba82..9c0ddda 100755 --- a/thirdparties/win32/include/directshow/winctrl.h +++ b/thirdparties/win32/include/directshow/winctrl.h @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // File: WinCtrl.h // -// Desc: DirectShow base classes - defines classes for video control +// Desc: DirectShow base classes - defines classes for video control // interfaces. // // Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved. @@ -36,13 +36,20 @@ public: HRESULT DoSetWindowStyle(long Style,long WindowLong); HRESULT DoGetWindowStyle(__out long *pStyle,long WindowLong); - BOOL IsAutoShowEnabled() { return m_bAutoShow; }; - COLORREF GetBorderColour() { return m_BorderColour; }; - HWND GetOwnerWindow() { return m_hwndOwner; }; - BOOL IsCursorHidden() { return m_bCursorHidden; }; - - inline BOOL PossiblyEatMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) - { + BOOL IsAutoShowEnabled() { + return m_bAutoShow; + }; + COLORREF GetBorderColour() { + return m_BorderColour; + }; + HWND GetOwnerWindow() { + return m_hwndOwner; + }; + BOOL IsCursorHidden() { + return m_bCursorHidden; + }; + + inline BOOL PossiblyEatMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) { return ::PossiblyEatMessage(m_hwndDrain, uMsg, wParam, lParam); } @@ -106,7 +113,7 @@ public: STDMETHODIMP SetWindowPosition(long Left,long Top,long Width,long Height); STDMETHODIMP GetWindowPosition(__out long *pLeft,__out long *pTop,__out long *pWidth,__out long *pHeight); STDMETHODIMP GetRestorePosition(__out long *pLeft,__out long *pTop,__out long *pWidth,__out long *pHeight); - STDMETHODIMP HideCursor(long HideCursor); + STDMETHODIMP HideCursor(long HideCursor); STDMETHODIMP IsCursorHidden(__out long *CursorHidden); }; @@ -156,7 +163,9 @@ public: __in RECT *pSourceRect); // Override this if you want notifying when the rectangles change - virtual HRESULT OnUpdateRectangles() { return NOERROR; }; + virtual HRESULT OnUpdateRectangles() { + return NOERROR; + }; virtual HRESULT OnVideoSizeChange(); // Derived classes must call this to set the pin the filter is using diff --git a/thirdparties/win32/include/directshow/winutil.h b/thirdparties/win32/include/directshow/winutil.h index 641b53a..89a5eaf 100755 --- a/thirdparties/win32/include/directshow/winutil.h +++ b/thirdparties/win32/include/directshow/winutil.h @@ -59,8 +59,8 @@ protected: BOOL m_bDoGetDC; // Should this window get a DC bool m_bDoPostToDestroy; // Use PostMessage to destroy CCritSec m_PaletteLock; // This lock protects m_hPalette. - // It should be held anytime the - // program use the value of m_hPalette. + // It should be held anytime the + // program use the value of m_hPalette. // Maps windows message procedure into C++ methods friend LRESULT CALLBACK WndProc(HWND hwnd, // Window handle @@ -96,8 +96,7 @@ public: void PaintWindow(BOOL bErase); void DoSetWindowForeground(BOOL bFocus); virtual HRESULT SetPalette(HPALETTE hPalette); - void SetRealize(BOOL bRealize) - { + void SetRealize(BOOL bRealize) { m_bNoRealize = !bRealize; } @@ -109,8 +108,9 @@ public: void LockPaletteLock(); void UnlockPaletteLock(); - virtual BOOL PossiblyEatMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) - { return FALSE; }; + virtual BOOL PossiblyEatMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) { + return FALSE; + }; // Access our window information @@ -121,9 +121,9 @@ public: HDC GetMemoryHDC(); HDC GetWindowHDC(); - #ifdef DEBUG +#ifdef DEBUG HPALETTE GetPalette(); - #endif // DEBUG +#endif // DEBUG // This is the window procedure the derived object should override @@ -135,9 +135,9 @@ public: // Must be overriden to return class and window styles virtual LPTSTR GetClassWindowStyles( - __out DWORD *pClassStyles, // Class styles - __out DWORD *pWindowStyles, // Window styles - __out DWORD *pWindowStylesEx) PURE; // Extended styles + __out DWORD *pClassStyles, // Class styles + __out DWORD *pWindowStyles, // Window styles + __out DWORD *pWindowStylesEx) PURE; // Extended styles }; @@ -350,8 +350,7 @@ public: BOOL ShouldUpdate(const VIDEOINFOHEADER *pNewInfo,const VIDEOINFOHEADER *pOldInfo); HRESULT PreparePalette(const CMediaType *pmtNew,const CMediaType *pmtOld,__in LPSTR szDevice); - BOOL DrawVideoImageHere(HDC hdc, IMediaSample *pMediaSample, __in LPRECT lprcSrc, __in LPRECT lprcDst) - { + BOOL DrawVideoImageHere(HDC hdc, IMediaSample *pMediaSample, __in LPRECT lprcSrc, __in LPRECT lprcDst) { return m_pDrawImage->DrawVideoImageHere(hdc, pMediaSample, lprcSrc,lprcDst); } }; diff --git a/thirdparties/win32/include/directshow/wxdebug.h b/thirdparties/win32/include/directshow/wxdebug.h index 62efffb..29478de 100755 --- a/thirdparties/win32/include/directshow/wxdebug.h +++ b/thirdparties/win32/include/directshow/wxdebug.h @@ -51,12 +51,13 @@ enum { LOG_TIMING = 0x01, // Timing and performance measurements LOG_CUSTOM3 = 0x80, LOG_CUSTOM4 = 0x100, LOG_CUSTOM5 = 0x200, -}; + }; #define LOG_FORCIBLY_SET 0x80000000 enum { CDISP_HEX = 0x01, - CDISP_DEC = 0x02}; + CDISP_DEC = 0x02 + }; // For each object created derived from CBaseObject (in debug builds) we // create a descriptor that holds it's name (statically allocated memory) @@ -75,148 +76,148 @@ typedef struct tag_ObjectDesc { #ifdef DEBUG - #define NAME(x) TEXT(x) +#define NAME(x) TEXT(x) - // These are used internally by the debug library (PRIVATE) +// These are used internally by the debug library (PRIVATE) - void WINAPI DbgInitKeyLevels(HKEY hKey, bool fTakeMax); - void WINAPI DbgInitGlobalSettings(bool fTakeMax); - void WINAPI DbgInitModuleSettings(bool fTakeMax); - void WINAPI DbgInitModuleName(); - DWORD WINAPI DbgRegisterObjectCreation( - LPCSTR szObjectName, LPCWSTR wszObjectName); +void WINAPI DbgInitKeyLevels(HKEY hKey, bool fTakeMax); +void WINAPI DbgInitGlobalSettings(bool fTakeMax); +void WINAPI DbgInitModuleSettings(bool fTakeMax); +void WINAPI DbgInitModuleName(); +DWORD WINAPI DbgRegisterObjectCreation( + LPCSTR szObjectName, LPCWSTR wszObjectName); - BOOL WINAPI DbgRegisterObjectDestruction(DWORD dwCookie); +BOOL WINAPI DbgRegisterObjectDestruction(DWORD dwCookie); - // These are the PUBLIC entry points +// These are the PUBLIC entry points - BOOL WINAPI DbgCheckModuleLevel(DWORD Type,DWORD Level); - void WINAPI DbgSetModuleLevel(DWORD Type,DWORD Level); - void WINAPI DbgSetAutoRefreshLevels(bool fAuto); +BOOL WINAPI DbgCheckModuleLevel(DWORD Type,DWORD Level); +void WINAPI DbgSetModuleLevel(DWORD Type,DWORD Level); +void WINAPI DbgSetAutoRefreshLevels(bool fAuto); - // Initialise the library with the module handle +// Initialise the library with the module handle - void WINAPI DbgInitialise(HINSTANCE hInst); - void WINAPI DbgTerminate(); +void WINAPI DbgInitialise(HINSTANCE hInst); +void WINAPI DbgTerminate(); - void WINAPI DbgDumpObjectRegister(); +void WINAPI DbgDumpObjectRegister(); - // Display error and logging to the user +// Display error and logging to the user - void WINAPI DbgAssert(LPCTSTR pCondition,LPCTSTR pFileName,INT iLine); - void WINAPI DbgBreakPoint(LPCTSTR pCondition,LPCTSTR pFileName,INT iLine); - void WINAPI DbgBreakPoint(LPCTSTR pFileName,INT iLine,__format_string LPCTSTR szFormatString,...); +void WINAPI DbgAssert(LPCTSTR pCondition,LPCTSTR pFileName,INT iLine); +void WINAPI DbgBreakPoint(LPCTSTR pCondition,LPCTSTR pFileName,INT iLine); +void WINAPI DbgBreakPoint(LPCTSTR pFileName,INT iLine,__format_string LPCTSTR szFormatString,...); - void WINAPI DbgKernelAssert(LPCTSTR pCondition,LPCTSTR pFileName,INT iLine); - void WINAPI DbgLogInfo(DWORD Type,DWORD Level,__format_string LPCTSTR pFormat,...); +void WINAPI DbgKernelAssert(LPCTSTR pCondition,LPCTSTR pFileName,INT iLine); +void WINAPI DbgLogInfo(DWORD Type,DWORD Level,__format_string LPCTSTR pFormat,...); #ifdef UNICODE - void WINAPI DbgLogInfo(DWORD Type,DWORD Level,__format_string LPCSTR pFormat,...); - void WINAPI DbgAssert(LPCSTR pCondition,LPCSTR pFileName,INT iLine); - void WINAPI DbgBreakPoint(LPCSTR pCondition,LPCSTR pFileName,INT iLine); - void WINAPI DbgKernelAssert(LPCSTR pCondition,LPCSTR pFileName,INT iLine); +void WINAPI DbgLogInfo(DWORD Type,DWORD Level,__format_string LPCSTR pFormat,...); +void WINAPI DbgAssert(LPCSTR pCondition,LPCSTR pFileName,INT iLine); +void WINAPI DbgBreakPoint(LPCSTR pCondition,LPCSTR pFileName,INT iLine); +void WINAPI DbgKernelAssert(LPCSTR pCondition,LPCSTR pFileName,INT iLine); #endif - void WINAPI DbgOutString(LPCTSTR psz); +void WINAPI DbgOutString(LPCTSTR psz); - // Debug infinite wait stuff - DWORD WINAPI DbgWaitForSingleObject(HANDLE h); - DWORD WINAPI DbgWaitForMultipleObjects(DWORD nCount, - __in_ecount(nCount) CONST HANDLE *lpHandles, - BOOL bWaitAll); - void WINAPI DbgSetWaitTimeout(DWORD dwTimeout); +// Debug infinite wait stuff +DWORD WINAPI DbgWaitForSingleObject(HANDLE h); +DWORD WINAPI DbgWaitForMultipleObjects(DWORD nCount, + __in_ecount(nCount) CONST HANDLE *lpHandles, + BOOL bWaitAll); +void WINAPI DbgSetWaitTimeout(DWORD dwTimeout); #ifdef __strmif_h__ - // Display a media type: Terse at level 2, verbose at level 5 - void WINAPI DisplayType(LPCTSTR label, const AM_MEDIA_TYPE *pmtIn); +// Display a media type: Terse at level 2, verbose at level 5 +void WINAPI DisplayType(LPCTSTR label, const AM_MEDIA_TYPE *pmtIn); - // Dump lots of information about a filter graph - void WINAPI DumpGraph(IFilterGraph *pGraph, DWORD dwLevel); +// Dump lots of information about a filter graph +void WINAPI DumpGraph(IFilterGraph *pGraph, DWORD dwLevel); #endif - #define KASSERT(_x_) if (!(_x_)) \ +#define KASSERT(_x_) if (!(_x_)) \ DbgKernelAssert(TEXT(#_x_),TEXT(__FILE__),__LINE__) - // Break on the debugger without putting up a message box - // message goes to debugger instead +// Break on the debugger without putting up a message box +// message goes to debugger instead - #define KDbgBreak(_x_) \ +#define KDbgBreak(_x_) \ DbgKernelAssert(TEXT(#_x_),TEXT(__FILE__),__LINE__) - // We chose a common name for our ASSERT macro, MFC also uses this name - // So long as the implementation evaluates the condition and handles it - // then we will be ok. Rather than override the behaviour expected we - // will leave whatever first defines ASSERT as the handler (i.e. MFC) - #ifndef ASSERT - #define ASSERT(_x_) if (!(_x_)) \ +// We chose a common name for our ASSERT macro, MFC also uses this name +// So long as the implementation evaluates the condition and handles it +// then we will be ok. Rather than override the behaviour expected we +// will leave whatever first defines ASSERT as the handler (i.e. MFC) +#ifndef ASSERT +#define ASSERT(_x_) if (!(_x_)) \ DbgAssert(TEXT(#_x_),TEXT(__FILE__),__LINE__) - #endif +#endif - #define DbgAssertAligned( _ptr_, _alignment_ ) ASSERT( ((DWORD_PTR) (_ptr_)) % (_alignment_) == 0) +#define DbgAssertAligned( _ptr_, _alignment_ ) ASSERT( ((DWORD_PTR) (_ptr_)) % (_alignment_) == 0) - // Put up a message box informing the user of a halt - // condition in the program +// Put up a message box informing the user of a halt +// condition in the program - #define DbgBreak(_x_) \ +#define DbgBreak(_x_) \ DbgBreakPoint(TEXT(#_x_),TEXT(__FILE__),__LINE__) - #define EXECUTE_ASSERT(_x_) ASSERT(_x_) - #define DbgLog(_x_) DbgLogInfo _x_ - // MFC style trace macros +#define EXECUTE_ASSERT(_x_) ASSERT(_x_) +#define DbgLog(_x_) DbgLogInfo _x_ +// MFC style trace macros - #define NOTE(_x_) DbgLog((LOG_TRACE,5,TEXT(_x_))) - #define NOTE1(_x_,a) DbgLog((LOG_TRACE,5,TEXT(_x_),a)) - #define NOTE2(_x_,a,b) DbgLog((LOG_TRACE,5,TEXT(_x_),a,b)) - #define NOTE3(_x_,a,b,c) DbgLog((LOG_TRACE,5,TEXT(_x_),a,b,c)) - #define NOTE4(_x_,a,b,c,d) DbgLog((LOG_TRACE,5,TEXT(_x_),a,b,c,d)) - #define NOTE5(_x_,a,b,c,d,e) DbgLog((LOG_TRACE,5,TEXT(_x_),a,b,c,d,e)) +#define NOTE(_x_) DbgLog((LOG_TRACE,5,TEXT(_x_))) +#define NOTE1(_x_,a) DbgLog((LOG_TRACE,5,TEXT(_x_),a)) +#define NOTE2(_x_,a,b) DbgLog((LOG_TRACE,5,TEXT(_x_),a,b)) +#define NOTE3(_x_,a,b,c) DbgLog((LOG_TRACE,5,TEXT(_x_),a,b,c)) +#define NOTE4(_x_,a,b,c,d) DbgLog((LOG_TRACE,5,TEXT(_x_),a,b,c,d)) +#define NOTE5(_x_,a,b,c,d,e) DbgLog((LOG_TRACE,5,TEXT(_x_),a,b,c,d,e)) #else - // Retail builds make public debug functions inert - WARNING the source - // files do not define or build any of the entry points in debug builds - // (public entry points compile to nothing) so if you go trying to call - // any of the private entry points in your source they won't compile +// Retail builds make public debug functions inert - WARNING the source +// files do not define or build any of the entry points in debug builds +// (public entry points compile to nothing) so if you go trying to call +// any of the private entry points in your source they won't compile - #define NAME(_x_) ((LPTSTR) NULL) +#define NAME(_x_) ((LPTSTR) NULL) - #define DbgInitialise(hInst) - #define DbgTerminate() - #define DbgLog(_x_) 0 - #define DbgOutString(psz) - #define DbgAssertAligned( _ptr_, _alignment_ ) 0 +#define DbgInitialise(hInst) +#define DbgTerminate() +#define DbgLog(_x_) 0 +#define DbgOutString(psz) +#define DbgAssertAligned( _ptr_, _alignment_ ) 0 - #define DbgRegisterObjectCreation(pObjectName) - #define DbgRegisterObjectDestruction(dwCookie) - #define DbgDumpObjectRegister() +#define DbgRegisterObjectCreation(pObjectName) +#define DbgRegisterObjectDestruction(dwCookie) +#define DbgDumpObjectRegister() - #define DbgCheckModuleLevel(Type,Level) - #define DbgSetModuleLevel(Type,Level) - #define DbgSetAutoRefreshLevels(fAuto) +#define DbgCheckModuleLevel(Type,Level) +#define DbgSetModuleLevel(Type,Level) +#define DbgSetAutoRefreshLevels(fAuto) - #define DbgWaitForSingleObject(h) WaitForSingleObject(h, INFINITE) - #define DbgWaitForMultipleObjects(nCount, lpHandles, bWaitAll) \ +#define DbgWaitForSingleObject(h) WaitForSingleObject(h, INFINITE) +#define DbgWaitForMultipleObjects(nCount, lpHandles, bWaitAll) \ WaitForMultipleObjects(nCount, lpHandles, bWaitAll, INFINITE) - #define DbgSetWaitTimeout(dwTimeout) +#define DbgSetWaitTimeout(dwTimeout) - #define KDbgBreak(_x_) - #define DbgBreak(_x_) +#define KDbgBreak(_x_) +#define DbgBreak(_x_) - #define KASSERT(_x_) ((void)0) - #ifndef ASSERT - #define ASSERT(_x_) ((void)0) - #endif - #define EXECUTE_ASSERT(_x_) ((void)(_x_)) +#define KASSERT(_x_) ((void)0) +#ifndef ASSERT +#define ASSERT(_x_) ((void)0) +#endif +#define EXECUTE_ASSERT(_x_) ((void)(_x_)) - // MFC style trace macros +// MFC style trace macros - #define NOTE(_x_) ((void)0) - #define NOTE1(_x_,a) ((void)0) - #define NOTE2(_x_,a,b) ((void)0) - #define NOTE3(_x_,a,b,c) ((void)0) - #define NOTE4(_x_,a,b,c,d) ((void)0) - #define NOTE5(_x_,a,b,c,d,e) ((void)0) +#define NOTE(_x_) ((void)0) +#define NOTE1(_x_,a) ((void)0) +#define NOTE2(_x_,a,b) ((void)0) +#define NOTE3(_x_,a,b,c) ((void)0) +#define NOTE4(_x_,a,b,c,d) ((void)0) +#define NOTE5(_x_,a,b,c,d,e) ((void)0) - #define DisplayType(label, pmtIn) ((void)0) - #define DumpGraph(pGraph, label) ((void)0) +#define DisplayType(label, pmtIn) ((void)0) +#define DumpGraph(pGraph, label) ((void)0) #endif @@ -246,37 +247,38 @@ typedef struct tag_ObjectDesc { #ifdef _OBJBASE_H_ - // Outputting GUID names. If you want to include the name - // associated with a GUID (eg CLSID_...) then - // - // GuidNames[yourGUID] - // - // Returns the name defined in uuids.h as a string - - typedef struct { - CHAR *szName; - GUID guid; - } GUID_STRING_ENTRY; - - class CGuidNameList { - public: - CHAR *operator [] (const GUID& guid); - }; +// Outputting GUID names. If you want to include the name +// associated with a GUID (eg CLSID_...) then +// +// GuidNames[yourGUID] +// +// Returns the name defined in uuids.h as a string - extern CGuidNameList GuidNames; +typedef struct { + CHAR *szName; + GUID guid; +} GUID_STRING_ENTRY; + +class CGuidNameList +{ +public: + CHAR *operator [] (const GUID& guid); +}; + +extern CGuidNameList GuidNames; #endif #ifndef REMIND - // REMIND macro - generates warning as reminder to complete coding - // (eg) usage: - // - // #pragma message (REMIND("Add automation support")) +// REMIND macro - generates warning as reminder to complete coding +// (eg) usage: +// +// #pragma message (REMIND("Add automation support")) - #define QUOTE(x) #x - #define QQUOTE(y) QUOTE(y) - #define REMIND(str) __FILE__ "(" QQUOTE(__LINE__) ") : " str +#define QUOTE(x) #x +#define QQUOTE(y) QUOTE(y) +#define REMIND(str) __FILE__ "(" QQUOTE(__LINE__) ") : " str #endif // Method to display objects in a useful format @@ -289,7 +291,9 @@ typedef struct tag_ObjectDesc { class CDispBasic { public: - CDispBasic() { m_pString = m_String; }; + CDispBasic() { + m_pString = m_String; + }; ~CDispBasic(); protected: PTCHAR m_pString; // normally points to m_String... unless too much data @@ -311,8 +315,7 @@ public: ~CDisp(); // Implement cast to (LPCTSTR) as parameter to logger - operator LPCTSTR() - { + operator LPCTSTR() { return (LPCTSTR)m_pString; }; }; @@ -328,11 +331,13 @@ private: static const TCHAR _szLeaving[]; public: CAutoTrace(LPCTSTR szBlkName, const int level = 15) - : _szBlkName(szBlkName), _level(level) - {DbgLog((LOG_TRACE, _level, _szEntering, _szBlkName));} + : _szBlkName(szBlkName), _level(level) { + DbgLog((LOG_TRACE, _level, _szEntering, _szBlkName)); + } - ~CAutoTrace() - {DbgLog((LOG_TRACE, _level, _szLeaving, _szBlkName));} + ~CAutoTrace() { + DbgLog((LOG_TRACE, _level, _szLeaving, _szBlkName)); + } }; #if defined (__FUNCTION__) diff --git a/thirdparties/win32/include/directshow/wxlist.h b/thirdparties/win32/include/directshow/wxlist.h index 931893d..fd8024f 100755 --- a/thirdparties/win32/include/directshow/wxlist.h +++ b/thirdparties/win32/include/directshow/wxlist.h @@ -27,30 +27,32 @@ #ifndef __WXLIST__ #define __WXLIST__ - /* A POSITION represents (in some fashion that's opaque) a cursor - on the list that can be set to identify any element. NULL is - a valid value and several operations regard NULL as the position - "one step off the end of the list". (In an n element list there - are n+1 places to insert and NULL is that "n+1-th" value). - The POSITION of an element in the list is only invalidated if - that element is deleted. Move operations may mean that what - was a valid POSITION in one list is now a valid POSITION in - a different list. - - Some operations which at first sight are illegal are allowed as - harmless no-ops. For instance RemoveHead is legal on an empty - list and it returns NULL. This allows an atomic way to test if - there is an element there, and if so, get it. The two operations - AddTail and RemoveHead thus implement a MONITOR (See Hoare's paper). - - Single element operations return POSITIONs, non-NULL means it worked. - whole list operations return a BOOL. TRUE means it all worked. - - This definition is the same as the POSITION type for MFCs, so we must - avoid defining it twice. - */ +/* A POSITION represents (in some fashion that's opaque) a cursor + on the list that can be set to identify any element. NULL is + a valid value and several operations regard NULL as the position + "one step off the end of the list". (In an n element list there + are n+1 places to insert and NULL is that "n+1-th" value). + The POSITION of an element in the list is only invalidated if + that element is deleted. Move operations may mean that what + was a valid POSITION in one list is now a valid POSITION in + a different list. + + Some operations which at first sight are illegal are allowed as + harmless no-ops. For instance RemoveHead is legal on an empty + list and it returns NULL. This allows an atomic way to test if + there is an element there, and if so, get it. The two operations + AddTail and RemoveHead thus implement a MONITOR (See Hoare's paper). + + Single element operations return POSITIONs, non-NULL means it worked. + whole list operations return a BOOL. TRUE means it all worked. + + This definition is the same as the POSITION type for MFCs, so we must + avoid defining it twice. +*/ #ifndef __AFX_H__ -struct __POSITION { int unused; }; +struct __POSITION { + int unused; +}; typedef __POSITION* POSITION; #endif @@ -61,22 +63,24 @@ const int DEFAULTCACHE = 10; /* Default node object cache size */ to the object that it looks after. All of these pointers can be retrieved or set through member functions. */ -class CBaseList +class CBaseList #ifdef DEBUG : public CBaseObject #endif { /* Making these classes inherit from CBaseObject does nothing functionally but it allows us to check there are no memory - leaks in debug builds. + leaks in debug builds. */ public: #ifdef DEBUG - class CNode : public CBaseObject { + class CNode : public CBaseObject + { #else - class CNode { + class CNode + { #endif CNode *m_pPrev; /* Previous node in the list */ @@ -95,36 +99,48 @@ public: /* Return the previous node before this one */ - __out CNode *Prev() const { return m_pPrev; }; + __out CNode *Prev() const { + return m_pPrev; + }; /* Return the next node after this one */ - __out CNode *Next() const { return m_pNext; }; + __out CNode *Next() const { + return m_pNext; + }; /* Set the previous node before this one */ - void SetPrev(__in_opt CNode *p) { m_pPrev = p; }; + void SetPrev(__in_opt CNode *p) { + m_pPrev = p; + }; /* Set the next node after this one */ - void SetNext(__in_opt CNode *p) { m_pNext = p; }; + void SetNext(__in_opt CNode *p) { + m_pNext = p; + }; /* Get the pointer to the object for this node */ - __out void *GetData() const { return m_pObject; }; + __out void *GetData() const { + return m_pObject; + }; /* Set the pointer to the object for this node */ - void SetData(__in void *p) { m_pObject = p; }; + void SetData(__in void *p) { + m_pObject = p; + }; }; class CNodeCache { public: CNodeCache(INT iCacheSize) : m_iCacheSize(iCacheSize), - m_pHead(NULL), - m_iUsed(0) - {}; + m_pHead(NULL), + m_iUsed(0) { + }; ~CNodeCache() { CNode *pNode = m_pHead; while (pNode) { @@ -133,24 +149,24 @@ public: delete pCurrent; } }; - void AddToCache(__inout CNode *pNode) - { + void AddToCache(__inout CNode *pNode) { if (m_iUsed < m_iCacheSize) { pNode->SetNext(m_pHead); m_pHead = pNode; m_iUsed++; - } else { + } + else { delete pNode; } }; - CNode *RemoveFromCache() - { + CNode *RemoveFromCache() { CNode *pNode = m_pHead; if (pNode != NULL) { m_pHead = pNode->Next(); m_iUsed--; ASSERT(m_iUsed >= 0); - } else { + } + else { ASSERT(m_iUsed == 0); } return pNode; @@ -258,8 +274,7 @@ public: in ALL cases. All the other arguments probably are reflections of the algebraic point. */ - __out_opt POSITION Next(__in_opt POSITION pos) const - { + __out_opt POSITION Next(__in_opt POSITION pos) const { if (pos == NULL) { return (POSITION) m_pFirst; } @@ -268,8 +283,7 @@ public: } //Next // See Next - __out_opt POSITION Prev(__in_opt POSITION pos) const - { + __out_opt POSITION Prev(__in_opt POSITION pos) const { if (pos == NULL) { return (POSITION) m_pLast; } @@ -380,9 +394,9 @@ public: Return the position of the new object, NULL if it fails Existing POSITIONs in *this are undisturbed, including p. */ - protected: +protected: __out_opt POSITION AddBeforeI(__in_opt POSITION p, __in void * pObj); - public: +public: /* Add the list *pList to *this before position p in *this AddAfter(NULL,x) adds x to the start - equivalent to AddHead @@ -479,7 +493,7 @@ public: /* set cursor to the position of each element of list in turn */ - #define TRAVERSELIST(list, cursor) \ +#define TRAVERSELIST(list, cursor) \ for ( cursor = (list).GetHeadPosition() \ ; cursor!=NULL \ ; cursor = (list).Next(cursor) \ @@ -489,7 +503,7 @@ public: /* set cursor to the position of each element of list in turn in reverse order */ - #define REVERSETRAVERSELIST(list, cursor) \ +#define REVERSETRAVERSELIST(list, cursor) \ for ( cursor = (list).GetTailPosition() \ ; cursor!=NULL \ ; cursor = (list).Prev(cursor) \ @@ -504,42 +518,76 @@ public: INT iItems, BOOL bLock = TRUE, BOOL bAlert = FALSE) : - CBaseList(pName, iItems) { + CBaseList(pName, iItems) { UNREFERENCED_PARAMETER(bAlert); UNREFERENCED_PARAMETER(bLock); }; CGenericList(__in_opt LPCTSTR pName) : - CBaseList(pName) { + CBaseList(pName) { }; - __out_opt POSITION GetHeadPosition() const { return (POSITION)m_pFirst; } - __out_opt POSITION GetTailPosition() const { return (POSITION)m_pLast; } - int GetCount() const { return m_Count; } - - __out OBJECT *GetNext(__inout POSITION& rp) const { return (OBJECT *) GetNextI(rp); } - - __out_opt OBJECT *Get(__in_opt POSITION p) const { return (OBJECT *) GetI(p); } - __out OBJECT *GetValid(__in POSITION p) const { return (OBJECT *) GetValidI(p); } - __out_opt OBJECT *GetHead() const { return Get(GetHeadPosition()); } - - __out_opt OBJECT *RemoveHead() { return (OBJECT *) RemoveHeadI(); } - - __out_opt OBJECT *RemoveTail() { return (OBJECT *) RemoveTailI(); } - - __out_opt OBJECT *Remove(__in_opt POSITION p) { return (OBJECT *) RemoveI(p); } - __out_opt POSITION AddBefore(__in_opt POSITION p, __in OBJECT * pObj) { return AddBeforeI(p, pObj); } - __out_opt POSITION AddAfter(__in_opt POSITION p, __in OBJECT * pObj) { return AddAfterI(p, pObj); } - __out_opt POSITION AddHead(__in OBJECT * pObj) { return AddHeadI(pObj); } - __out_opt POSITION AddTail(__in OBJECT * pObj) { return AddTailI(pObj); } - BOOL AddTail(__in CGenericList<OBJECT> *pList) - { return CBaseList::AddTail((CBaseList *) pList); } - BOOL AddHead(__in CGenericList<OBJECT> *pList) - { return CBaseList::AddHead((CBaseList *) pList); } - BOOL AddAfter(__in_opt POSITION p, __in CGenericList<OBJECT> *pList) - { return CBaseList::AddAfter(p, (CBaseList *) pList); }; - BOOL AddBefore(__in_opt POSITION p, __in CGenericList<OBJECT> *pList) - { return CBaseList::AddBefore(p, (CBaseList *) pList); }; - __out_opt POSITION Find( __in OBJECT * pObj) const { return FindI(pObj); } + __out_opt POSITION GetHeadPosition() const { + return (POSITION)m_pFirst; + } + __out_opt POSITION GetTailPosition() const { + return (POSITION)m_pLast; + } + int GetCount() const { + return m_Count; + } + + __out OBJECT *GetNext(__inout POSITION& rp) const { + return (OBJECT *) GetNextI(rp); + } + + __out_opt OBJECT *Get(__in_opt POSITION p) const { + return (OBJECT *) GetI(p); + } + __out OBJECT *GetValid(__in POSITION p) const { + return (OBJECT *) GetValidI(p); + } + __out_opt OBJECT *GetHead() const { + return Get(GetHeadPosition()); + } + + __out_opt OBJECT *RemoveHead() { + return (OBJECT *) RemoveHeadI(); + } + + __out_opt OBJECT *RemoveTail() { + return (OBJECT *) RemoveTailI(); + } + + __out_opt OBJECT *Remove(__in_opt POSITION p) { + return (OBJECT *) RemoveI(p); + } + __out_opt POSITION AddBefore(__in_opt POSITION p, __in OBJECT * pObj) { + return AddBeforeI(p, pObj); + } + __out_opt POSITION AddAfter(__in_opt POSITION p, __in OBJECT * pObj) { + return AddAfterI(p, pObj); + } + __out_opt POSITION AddHead(__in OBJECT * pObj) { + return AddHeadI(pObj); + } + __out_opt POSITION AddTail(__in OBJECT * pObj) { + return AddTailI(pObj); + } + BOOL AddTail(__in CGenericList<OBJECT> *pList) { + return CBaseList::AddTail((CBaseList *) pList); + } + BOOL AddHead(__in CGenericList<OBJECT> *pList) { + return CBaseList::AddHead((CBaseList *) pList); + } + BOOL AddAfter(__in_opt POSITION p, __in CGenericList<OBJECT> *pList) { + return CBaseList::AddAfter(p, (CBaseList *) pList); + }; + BOOL AddBefore(__in_opt POSITION p, __in CGenericList<OBJECT> *pList) { + return CBaseList::AddBefore(p, (CBaseList *) pList); + }; + __out_opt POSITION Find( __in OBJECT * pObj) const { + return FindI(pObj); + } }; // end of class declaration diff --git a/thirdparties/win32/include/directshow/wxutil.h b/thirdparties/win32/include/directshow/wxutil.h index 3bfc2d2..db2149d 100755 --- a/thirdparties/win32/include/directshow/wxutil.h +++ b/thirdparties/win32/include/directshow/wxutil.h @@ -15,7 +15,8 @@ #pragma warning(disable: 4705) // wrapper for whatever critical section we have -class CCritSec { +class CCritSec +{ // make copy constructor and assignment operator inaccessible @@ -66,21 +67,22 @@ public: // #ifdef DEBUG - BOOL WINAPI CritCheckIn(CCritSec * pcCrit); - BOOL WINAPI CritCheckIn(const CCritSec * pcCrit); - BOOL WINAPI CritCheckOut(CCritSec * pcCrit); - BOOL WINAPI CritCheckOut(const CCritSec * pcCrit); - void WINAPI DbgLockTrace(CCritSec * pcCrit, BOOL fTrace); +BOOL WINAPI CritCheckIn(CCritSec * pcCrit); +BOOL WINAPI CritCheckIn(const CCritSec * pcCrit); +BOOL WINAPI CritCheckOut(CCritSec * pcCrit); +BOOL WINAPI CritCheckOut(const CCritSec * pcCrit); +void WINAPI DbgLockTrace(CCritSec * pcCrit, BOOL fTrace); #else - #define CritCheckIn(x) TRUE - #define CritCheckOut(x) TRUE - #define DbgLockTrace(pc, fT) +#define CritCheckIn(x) TRUE +#define CritCheckOut(x) TRUE +#define DbgLockTrace(pc, fT) #endif // locks a critical section, and unlocks it automatically // when the lock goes out of scope -class CAutoLock { +class CAutoLock +{ // make copy constructor and assignment operator inaccessible @@ -91,8 +93,7 @@ protected: CCritSec * m_pLock; public: - CAutoLock(CCritSec * plock) - { + CAutoLock(CCritSec * plock) { m_pLock = plock; m_pLock->Lock(); }; @@ -121,14 +122,22 @@ public: ~CAMEvent(); // Cast to HANDLE - we don't support this as an lvalue - operator HANDLE () const { return m_hEvent; }; + operator HANDLE () const { + return m_hEvent; + }; - void Set() {EXECUTE_ASSERT(SetEvent(m_hEvent));}; + void Set() { + EXECUTE_ASSERT(SetEvent(m_hEvent)); + }; BOOL Wait(DWORD dwTimeout = INFINITE) { - return (WaitForSingleObject(m_hEvent, dwTimeout) == WAIT_OBJECT_0); + return (WaitForSingleObject(m_hEvent, dwTimeout) == WAIT_OBJECT_0); + }; + void Reset() { + ResetEvent(m_hEvent); + }; + BOOL Check() { + return Wait(0); }; - void Reset() { ResetEvent(m_hEvent); }; - BOOL Check() { return Wait(0); }; }; @@ -155,7 +164,8 @@ public: #ifdef AM_NOVTABLE // simple thread class supports creation of worker thread, synchronization // and communication. Can be derived to simplify parameter passing -class AM_NOVTABLE CAMThread { +class AM_NOVTABLE CAMThread +{ // make copy constructor and assignment operator inaccessible @@ -211,11 +221,11 @@ public: // ThreadExists // Return TRUE if the thread exists. FALSE otherwise - BOOL ThreadExists(void) const - { + BOOL ThreadExists(void) const { if (m_hThread == 0) { return FALSE; - } else { + } + else { return TRUE; } } @@ -231,10 +241,14 @@ public: // If you want to do WaitForMultipleObjects you'll need to include // this handle in your wait list or you won't be responsive - HANDLE GetRequestHandle() const { return m_EventSend; }; + HANDLE GetRequestHandle() const { + return m_EventSend; + }; // Find out what the request was - DWORD GetRequestParam() const { return m_dwParam; }; + DWORD GetRequestParam() const { + return m_dwParam; + }; // call CoInitializeEx (COINIT_DISABLE_OLE1DDE) if // available. S_FALSE means it's not available. @@ -258,7 +272,8 @@ public: #define DEFAULT_QUEUESIZE 2 -template <class T> class CQueue { +template <class T> class CQueue +{ private: HANDLE hSemPut; // Semaphore controlling queue "putting" HANDLE hSemGet; // Semaphore controlling queue "getting" @@ -375,9 +390,9 @@ inline void * __cdecl memchrInternal(const void *buf, int chr, size_t cnt) repne scasb // look for the byte in the byte stream jnz exit_memchr // Z flag set if byte found dec edi // scasb always increments edi even when it - // finds the required byte + // finds the required byte mov pRet, edi -exit_memchr: + exit_memchr: } return pRet; @@ -482,38 +497,65 @@ IUnknown* QzAtlComPtrAssign(__deref_inout_opt IUnknown** pp, __in_opt IUnknown* template <class T> class QzCComPtr { -public: - typedef T _PtrClass; - QzCComPtr() {p=NULL;} - QzCComPtr(T* lp) - { - if ((p = lp) != NULL) - p->AddRef(); - } - QzCComPtr(const QzCComPtr<T>& lp) - { - if ((p = lp.p) != NULL) - p->AddRef(); - } - ~QzCComPtr() {if (p) p->Release();} - void Release() {if (p) p->Release(); p=NULL;} - operator T*() {return (T*)p;} - T& operator*() {ASSERT(p!=NULL); return *p; } - //The assert on operator& usually indicates a bug. If this is really - //what is needed, however, take the address of the p member explicitly. - T** operator&() { ASSERT(p==NULL); return &p; } - T* operator->() { ASSERT(p!=NULL); return p; } - T* operator=(T* lp){return (T*)QzAtlComPtrAssign((IUnknown**)&p, lp);} - T* operator=(const QzCComPtr<T>& lp) - { - return (T*)QzAtlComPtrAssign((IUnknown**)&p, lp.p); - } + public: + typedef T _PtrClass; + QzCComPtr() { + p=NULL; + } + QzCComPtr(T* lp) { + if ((p = lp) != NULL) { + p->AddRef(); + } + } + QzCComPtr(const QzCComPtr<T>& lp) { + if ((p = lp.p) != NULL) { + p->AddRef(); + } + } + ~QzCComPtr() { + if (p) { + p->Release(); + } + } + void Release() { + if (p) { + p->Release(); + } + p=NULL; + } + operator T*() { + return (T*)p; + } + T& operator*() { + ASSERT(p!=NULL); + return *p; + } + //The assert on operator& usually indicates a bug. If this is really + //what is needed, however, take the address of the p member explicitly. + T** operator&() { + ASSERT(p==NULL); + return &p; + } + T* operator->() { + ASSERT(p!=NULL); + return p; + } + T* operator=(T* lp) { + return (T*)QzAtlComPtrAssign((IUnknown**)&p, lp); + } + T* operator=(const QzCComPtr<T>& lp) { + return (T*)QzAtlComPtrAssign((IUnknown**)&p, lp.p); + } #if _MSC_VER>1020 - bool operator!(){return (p == NULL);} + bool operator!() { + return (p == NULL); + } #else - BOOL operator!(){return (p == NULL) ? TRUE : FALSE;} + BOOL operator!() { + return (p == NULL) ? TRUE : FALSE; + } #endif - T* p; + T* p; }; MMRESULT CompatibleTimeSetEvent( UINT uDelay, UINT uResolution, __in LPTIMECALLBACK lpTimeProc, DWORD_PTR dwUser, UINT fuEvent ); |