00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #pragma once
00023
00024 #include "..\BaseSplitter\BaseSplitter.h"
00025 #include "MpegSplitterFile.h"
00026
00027 [uuid("DC257063-045F-4BE2-BD5B-E12279C464F0")]
00028 class CMpegSplitterFilter : public CBaseSplitterFilter, public IAMStreamSelect
00029 {
00030 REFERENCE_TIME m_rtStartOffset;
00031
00032 protected:
00033 CAutoPtr<CMpegSplitterFile> m_pFile;
00034 HRESULT CreateOutputs(IAsyncReader* pAsyncReader);
00035
00036 bool DemuxInit();
00037 void DemuxSeek(REFERENCE_TIME rt);
00038 bool DemuxLoop();
00039
00040 HRESULT DemuxNextPacket(REFERENCE_TIME rtStartOffset);
00041
00042 public:
00043 CMpegSplitterFilter(LPUNKNOWN pUnk, HRESULT* phr, const CLSID& clsid = __uuidof(CMpegSplitterFilter));
00044
00045 DECLARE_IUNKNOWN
00046 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
00047
00048
00049
00050 STDMETHODIMP Count(DWORD* pcStreams);
00051 STDMETHODIMP Enable(long lIndex, DWORD dwFlags);
00052 STDMETHODIMP Info(long lIndex, AM_MEDIA_TYPE** ppmt, DWORD* pdwFlags, LCID* plcid, DWORD* pdwGroup, WCHAR** ppszName, IUnknown** ppObject, IUnknown** ppUnk);
00053 };
00054
00055 [uuid("1365BE7A-C86A-473C-9A41-C0A6E82C9FA3")]
00056 class CMpegSourceFilter : public CMpegSplitterFilter
00057 {
00058 public:
00059 CMpegSourceFilter(LPUNKNOWN pUnk, HRESULT* phr, const CLSID& clsid = __uuidof(CMpegSourceFilter));
00060 };
00061
00062 class CMpegSplitterOutputPin : public CBaseSplitterOutputPin, protected CCritSec
00063 {
00064 CAutoPtr<Packet> m_p;
00065 REFERENCE_TIME m_rtPrev, m_rtOffset;
00066
00067 protected:
00068 HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
00069 HRESULT DeliverPacket(CAutoPtr<Packet> p);
00070 HRESULT DeliverEndFlush();
00071
00072 public:
00073 CMpegSplitterOutputPin(CArray<CMediaType>& mts, LPCWSTR pName, CBaseFilter* pFilter, CCritSec* pLock, HRESULT* phr);
00074 virtual ~CMpegSplitterOutputPin();
00075 };