AviSplitter.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 <atlbase.h>
00025 #include <atlcoll.h>
00026 #include <afxtempl.h>
00027 #include "..\BaseSplitter\BaseSplitter.h"
00028 
00029 class CAviFile;
00030 
00031 class CAviSplitterOutputPin : public CBaseSplitterOutputPin
00032 {
00033 public:
00034         CAviSplitterOutputPin(CArray<CMediaType>& mts, LPCWSTR pName, CBaseFilter* pFilter, CCritSec* pLock, HRESULT* phr);
00035 
00036         HRESULT CheckConnect(IPin* pPin);
00037 };
00038 
00039 [uuid("9736D831-9D6C-4E72-B6E7-560EF9181001")]
00040 class CAviSplitterFilter : public CBaseSplitterFilter
00041 {
00042         CAutoVectorPtr<DWORD> m_tFrame;
00043 
00044 protected:
00045         CAutoPtr<CAviFile> m_pFile;
00046         HRESULT CreateOutputs(IAsyncReader* pAsyncReader);
00047 
00048         bool DemuxInit();
00049         void DemuxSeek(REFERENCE_TIME rt);
00050         bool DemuxLoop();
00051 
00052         HRESULT ReIndex(__int64 end, UINT64* pSize);
00053 
00054 public:
00055         CAviSplitterFilter(LPUNKNOWN pUnk, HRESULT* phr);
00056 
00057         DECLARE_IUNKNOWN;
00058     STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
00059 
00060         // IMediaSeeking
00061 
00062         STDMETHODIMP GetDuration(LONGLONG* pDuration);
00063 
00064         // TODO: this is too ugly, integrate this with the baseclass somehow
00065         GUID m_timeformat;
00066         STDMETHODIMP IsFormatSupported(const GUID* pFormat);
00067         STDMETHODIMP GetTimeFormat(GUID* pFormat);
00068         STDMETHODIMP IsUsingTimeFormat(const GUID* pFormat);
00069         STDMETHODIMP SetTimeFormat(const GUID* pFormat);
00070         STDMETHODIMP GetStopPosition(LONGLONG* pStop);
00071         STDMETHODIMP ConvertTimeFormat(LONGLONG* pTarget, const GUID* pTargetFormat, LONGLONG Source, const GUID* pSourceFormat);
00072         STDMETHODIMP GetPositions(LONGLONG* pCurrent, LONGLONG* pStop);
00073 
00074         HRESULT SetPositionsInternal(void* id, LONGLONG* pCurrent, DWORD dwCurrentFlags, LONGLONG* pStop, DWORD dwStopFlags);
00075 
00076         // IKeyFrameInfo
00077 
00078         STDMETHODIMP GetKeyFrameCount(UINT& nKFs);
00079         STDMETHODIMP GetKeyFrames(const GUID* pFormat, REFERENCE_TIME* pKFs, UINT& nKFs);
00080 };
00081 
00082 [uuid("CEA8DEFF-0AF7-4DB9-9A38-FB3C3AEFC0DE")]
00083 class CAviSourceFilter : public CAviSplitterFilter
00084 {
00085 public:
00086         CAviSourceFilter(LPUNKNOWN pUnk, HRESULT* phr);
00087 };

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