MpegSplitter.h

00001 /* 
00002  *      Copyright (C) 2003-2005 Gabest
00003  *      http://www.gabest.org
00004  *
00005  *  This Program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2, or (at your option)
00008  *  any later version.
00009  *   
00010  *  This Program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013  *  GNU General Public License for more details.
00014  *   
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with GNU Make; see the file COPYING.  If not, write to
00017  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
00018  *  http://www.gnu.org/copyleft/gpl.html
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         // IAMStreamSelect
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 };

Generated on Tue Dec 13 14:47:21 2005 for guliverkli by  doxygen 1.4.5