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 "IOggMuxSettings.h"
00037 #include "PropsOggMux.h"
00038 #include "BasicSeekPassThrough.h"
00039 #include <libOOOgg/OggPageInterleaver.h>
00040 #include <libOOOgg/INotifyComplete.h>
00041
00042 #include <string>
00043
00044 #include <fstream>
00045 #include <libOOOgg/IOggCallback.h>
00046 using namespace std;
00047 #include <libilliCore/StringHelper.h>
00048 class OggMuxInputPin;
00049
00050 class OGG_MUX_API OggMuxFilter
00051 : public IFileSinkFilter
00052 , public CBaseFilter
00053 , public IOggCallback
00054 , public IAMFilterMiscFlags
00055 , public BasicSeekPassThrough
00056 , public INotifyComplete
00057 , public IOggMuxProgress
00058 , public IOggMuxSettings
00059
00060 {
00061 public:
00062 OggMuxFilter(void);
00063 OggMuxFilter(REFCLSID inFilterGUID);
00064 virtual ~OggMuxFilter(void);
00065
00066
00067 friend class OggMuxInputPin;
00068
00069 DECLARE_IUNKNOWN
00070 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
00071 static CUnknown * WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
00072
00073
00074
00075
00076
00078 ULONG STDMETHODCALLTYPE GetMiscFlags(void);
00079
00080
00081
00082
00083
00085 virtual bool acceptOggPage(OggPage* inOggPage);
00086
00087
00088
00089
00090
00092 STDMETHODIMP SetFileName(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType);
00093
00095 STDMETHODIMP GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType);
00096
00097
00098
00099
00100
00102 virtual int GetPinCount();
00103
00105 virtual CBasePin* GetPin(int inPinNo);
00106
00107
00108
00109
00110
00112 STDMETHODIMP Run(REFERENCE_TIME tStart);
00113
00115 STDMETHODIMP Pause(void);
00116
00118 STDMETHODIMP Stop(void);
00119
00120
00121
00122
00123
00125 virtual STDMETHODIMP_(LONGLONG) getProgressTime();
00126
00128 virtual STDMETHODIMP_(LONGLONG) getBytesWritten();
00129
00130
00131
00132 virtual HRESULT addAnotherPin();
00133 virtual void NotifyComplete();
00134
00135
00136 virtual STDMETHODIMP GetPositions(LONGLONG *pCurrent, LONGLONG *pStop);
00137 virtual STDMETHODIMP GetCurrentPosition(LONGLONG *pCurrent);
00138
00139
00140 STDMETHODIMP_(unsigned long) maxPacketsPerPage();
00141 STDMETHODIMP_(bool) setMaxPacketsPerPage(unsigned long inMaxPacketsPerPage);
00142
00143
00144
00145
00146 protected:
00147
00148 bool SetupOutput();
00149 bool CloseOutput();
00150
00151 wstring mFileName;
00152 vector<OggMuxInputPin*> mInputPins;
00153
00154 OggPageInterleaver* mInterleaver;
00155
00156 CCritSec* mStreamLock;
00157
00158 fstream mOutputFile;
00159 fstream debugLog;
00160 HRESULT mHR;
00161
00162
00163 };