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 #pragma once
00032
00033 #include <libOOOgg/OggPacket.h>
00034 #include <libOOOgg/IOggCallback.h>
00035 #include <libOOOgg/OggPacketiser.h>
00036 #include "IOggDecoder.h"
00037 #include "IOggOutputPin.h"
00038
00039 class OggDemuxPacketSourcePin
00040 : public CBaseOutputPin
00041 , public BasicSeekPassThrough
00042 , public IOggCallback
00043 , public IOggOutputPin
00044 , protected IStampedOggPacketSink
00045 {
00046 public:
00047
00048 DECLARE_IUNKNOWN
00049 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
00050
00051 OggDemuxPacketSourcePin( TCHAR* inObjectName,
00052 OggDemuxPacketSourceFilter* inParentFilter,
00053 CCritSec* inFilterLock,
00054 OggPacket* inIdentHeader,
00055 unsigned long inSerialNo);
00056
00057
00058
00059
00060
00061
00062 virtual ~OggDemuxPacketSourcePin(void);
00063
00064 static const unsigned long NUM_PAGE_BUFFERS = 100;
00065
00066 unsigned long getSerialNo();
00067 IOggDecoder* getDecoderInterface();
00068 bool isStreamReady() { return mIsStreamReady; }
00069 void setIsStreamReady(bool inIsStreamReady) { mIsStreamReady = inIsStreamReady; }
00070
00071
00072 virtual bool acceptOggPage(OggPage* inOggPage);
00073
00074
00075
00076 virtual HRESULT GetMediaType(int inPosition, CMediaType* outMediaType);
00077 virtual HRESULT CheckMediaType(const CMediaType* inMediaType);
00078 virtual HRESULT DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest);
00079
00080
00081 virtual HRESULT BreakConnect();
00082 virtual HRESULT CompleteConnect(IPin *inReceivePin);
00083
00084
00085 virtual HRESULT DeliverNewSegment(REFERENCE_TIME inStart, REFERENCE_TIME inStop, double inRate);
00086 virtual HRESULT DeliverEndOfStream(void);
00087 virtual HRESULT DeliverEndFlush(void);
00088 virtual HRESULT DeliverBeginFlush(void);
00089
00090
00091 virtual bool notifyStreamBaseTime(__int64 inStreamTime);
00092 virtual __int64 getGlobalBaseTime();
00093 protected:
00094
00095 virtual bool acceptStampedOggPacket(StampedOggPacket* inPacket);
00096 virtual bool dispatchPacket(StampedOggPacket* inPacket);
00097
00098
00099 HRESULT mFilterHR;
00100
00101 BYTE* getIdentAsFormatBlock();
00102 unsigned long getIdentSize();
00103 unsigned long mSerialNo;
00104
00105 CCritSec* mPacketiserLock;
00106
00107 unsigned long mNumBuffers;
00108
00109 OggPacket* mIdentHeader;
00110 IOggDecoder* mDecoderInterface;
00111 OggPacketiser mPacketiser;
00112
00113 COutputQueue* mDataQueue;
00114
00115 bool mIsStreamReady;
00116 bool mAcceptingData;
00117 };