00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #pragma once
00033 #include "oggmuxdllstuff.h"
00034 #include "OggMuxInputPin.h"
00035 #include "IOggMuxProgress.h"
00036 #include "BasicSeekPassThrough.h"
00037 #include <libOOOgg/OggPageInterleaver.h>
00038 #include <libOOOgg/INotifyComplete.h>
00039
00040 #include <string>
00041
00042 #include <fstream>
00043 #include <libOOOgg/IOggCallback.h>
00044 using namespace std;
00045 #include <libilliCore/StringHelper.h>
00046 class OggMuxInputPin;
00047
00048 class OGG_MUX_API OggMuxFilter
00049 : public IFileSinkFilter
00050 , public CBaseFilter
00051 , public IOggCallback
00052 , public IAMFilterMiscFlags
00053 , public BasicSeekPassThrough
00054 , public INotifyComplete
00055 , public IOggMuxProgress
00056 {
00057 public:
00058 OggMuxFilter(void);
00059 OggMuxFilter(REFCLSID inFilterGUID);
00060 virtual ~OggMuxFilter(void);
00061
00062
00063 friend class OggMuxInputPin;
00064
00065 DECLARE_IUNKNOWN
00066 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
00067 static CUnknown * WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
00068
00069
00070
00071
00072
00074 ULONG STDMETHODCALLTYPE GetMiscFlags(void);
00075
00076
00077
00078
00079
00081 virtual bool acceptOggPage(OggPage* inOggPage);
00082
00083
00084
00085
00086
00088 STDMETHODIMP SetFileName(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType);
00089
00091 STDMETHODIMP GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType);
00092
00093
00094
00095
00096
00098 virtual int GetPinCount();
00099
00101 virtual CBasePin* GetPin(int inPinNo);
00102
00103
00104
00105
00106
00108 STDMETHODIMP Run(REFERENCE_TIME tStart);
00109
00111 STDMETHODIMP Pause(void);
00112
00114 STDMETHODIMP Stop(void);
00115
00116
00117
00118
00119
00121 virtual STDMETHODIMP_(LONGLONG) getProgressTime();
00122
00124 virtual STDMETHODIMP_(LONGLONG) getBytesWritten();
00125
00126
00127
00128 virtual HRESULT addAnotherPin();
00129 virtual void NotifyComplete();
00130
00131
00132 virtual STDMETHODIMP GetPositions(LONGLONG *pCurrent, LONGLONG *pStop);
00133 virtual STDMETHODIMP GetCurrentPosition(LONGLONG *pCurrent);
00134 protected:
00135
00136 bool SetupOutput();
00137 bool CloseOutput();
00138
00139 wstring mFileName;
00140 vector<OggMuxInputPin*> mInputPins;
00141
00142 OggPageInterleaver* mInterleaver;
00143
00144 CCritSec* mStreamLock;
00145
00146 fstream mOutputFile;
00147 fstream debugLog;
00148 HRESULT mHR;
00149
00150
00151 };