//------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // // The use and distribution terms for this software are covered by the // Microsoft Limited Public License (Ms-LPL) // which can be found in the file MS-LPL.txt at the root of this distribution. // By using this software in any fashion, you are agreeing to be bound by // the terms of this license. // // The software is licensed “as-is.” // // You must not remove this notice, or any other, from this software. // // // // Demux code for Windows CE // //------------------------------------------------------------------------- //====================================================================== // Demux code for Windows CE //====================================================================== /*++ Module Name: mp2enum.h Abstract: This module contains enumerator declarations Revision History: 31-Aug-1999 created Notes: --*/ #ifndef __mp2demux_mp2enum_h #define __mp2demux_mp2enum_h // --------------------------------------------------------------------------- // CEnumStreamMapBase // --------------------------------------------------------------------------- class CEnumStreamMapBase : public IUnknown { LONG m_lRefcount ; GUID m_IID ; protected : struct STREAM_MAP_RECORD { DWORD dwStreamId ; LPWSTR pszPinID ; DWORD dwMediaSampleContent ; LPVOID pvParserArg ; LIST_ENTRY ListEntry ; } ; LIST_ENTRY m_StreamMapListHead ; STREAM_MAP_RECORD * m_pCurStreamMapRecord ; DWORD m_cStreamMaps ; // number in the list DWORD m_cStreamMapsLeft ; // number of PID maps left, m_pCurStreamMapRecord inclusive public : CEnumStreamMapBase ( IN REFIID riid ) ; CEnumStreamMapBase ( IN REFIID riid, IN CEnumStreamMapBase * pCEnumStreamMapBase, OUT HRESULT * pHr ) ; virtual ~CEnumStreamMapBase ( ) ; // object method HRESULT AddStreamMap ( IN DWORD dwStreamId, IN IPin * pIPin, IN DWORD dwMediaSampleContent, IN LPVOID pvParserArg ) ; HRESULT AddStreamMap ( IN DWORD dwStreamId, IN LPWSTR pszPinID, IN DWORD dwMediaSampleContent, IN LPVOID pvParserArg ) ; // IUnknown methods STDMETHODIMP_(ULONG) AddRef ( ) { return InterlockedIncrement (& m_lRefcount) ; } STDMETHODIMP_(ULONG) Release ( ) { if (InterlockedDecrement (& m_lRefcount) == 0) { delete this ; return 0 ; } ASSERT (m_lRefcount > 0) ; return m_lRefcount ; } STDMETHODIMP QueryInterface ( IN REFIID riid, OUT void **ppv ) { if (riid == m_IID || riid == IID_IUnknown) { * ppv = this ; } else { * ppv = NULL ; return E_NOINTERFACE ; } AddRef () ; return S_OK ; } } ; // ---------------------------------------------------------------------------- // BDA transport enum class CDBDADemuxEnumPIDMap : public CEnumStreamMapBase, // storage facilities public IEnumPIDMap // recall facilities { public : CDBDADemuxEnumPIDMap ( ) ; CDBDADemuxEnumPIDMap ( IN CDBDADemuxEnumPIDMap * pCDBDADemuxEnumPIDMap, OUT HRESULT * pHr ) ; ~CDBDADemuxEnumPIDMap ( ) ; // IUnknown STDMETHODIMP_(ULONG) AddRef ( ) { return CEnumStreamMapBase::AddRef () ; } STDMETHODIMP_(ULONG) Release ( ) { return CEnumStreamMapBase::Release () ; } STDMETHODIMP QueryInterface ( IN REFIID riid, OUT void **ppv ) { return CEnumStreamMapBase::QueryInterface (riid, ppv) ; } // IEnumMPEG2PIDMap virtual STDMETHODIMP Next ( IN ULONG, IN OUT PID_MAP *, OUT ULONG * ) ; virtual STDMETHODIMP Skip ( IN ULONG ) ; virtual STDMETHODIMP Reset ( ) ; virtual STDMETHODIMP Clone ( OUT IEnumPIDMap ** ) ; } ; // ---------------------------------------------------------------------------- // BDA program enum class CDBDADemuxEnumStreamIdMap : public CEnumStreamMapBase, // storage facilities public IEnumStreamIdMap // recall facilities { public : CDBDADemuxEnumStreamIdMap ( ) ; CDBDADemuxEnumStreamIdMap ( IN CDBDADemuxEnumStreamIdMap * pCDBDADemuxEnumStreamIdMap, OUT HRESULT * pHr ) ; ~CDBDADemuxEnumStreamIdMap ( ) ; // IUnknown STDMETHODIMP_(ULONG) AddRef ( ) { return CEnumStreamMapBase::AddRef () ; } STDMETHODIMP_(ULONG) Release ( ) { return CEnumStreamMapBase::Release () ; } STDMETHODIMP QueryInterface ( IN REFIID riid, OUT void **ppv ) { return CEnumStreamMapBase::QueryInterface (riid, ppv) ; } // IEnumStreamIdMap virtual STDMETHODIMP Next ( IN ULONG, IN OUT STREAM_ID_MAP *, OUT ULONG * ) ; virtual STDMETHODIMP Skip ( IN ULONG ) ; virtual STDMETHODIMP Reset ( ) ; virtual STDMETHODIMP Clone ( OUT IEnumStreamIdMap ** ) ; } ; #endif // __mp2demux_mp2enum_h