OggDemuxPacketSourcePin.h

Go to the documentation of this file.
00001 //===========================================================================
00002 //Copyright (C) 2003, 2004, 2005 Zentaro Kavanagh
00003 //
00004 //Redistribution and use in source and binary forms, with or without
00005 //modification, are permitted provided that the following conditions
00006 //are met:
00007 //
00008 //- Redistributions of source code must retain the above copyright
00009 //  notice, this list of conditions and the following disclaimer.
00010 //
00011 //- Redistributions in binary form must reproduce the above copyright
00012 //  notice, this list of conditions and the following disclaimer in the
00013 //  documentation and/or other materials provided with the distribution.
00014 //
00015 //- Neither the name of Zentaro Kavanagh nor the names of contributors 
00016 //  may be used to endorse or promote products derived from this software 
00017 //  without specific prior written permission.
00018 //
00019 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00020 //``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00021 //LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
00022 //PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
00023 //CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00024 //EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00025 //PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00026 //PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00027 //LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00028 //NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00029 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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         //OggDemuxPacketSourcePin(void);
00051         OggDemuxPacketSourcePin(        TCHAR* inObjectName, 
00052                                                         OggDemuxPacketSourceFilter* inParentFilter,
00053                                                         CCritSec* inFilterLock,
00054                                                         OggPacket* inIdentHeader,
00055                                                         unsigned long inSerialNo);
00056                                                         //StreamHeaders* inHeaderSource, 
00057                                                         //CMediaType* inMediaType,
00058                                                         //wstring inPinName,
00059                                                         //bool inAllowSeek,
00060                                                         //unsigned long inNumBuffers,
00061                                                         //unsigned long inBufferSize);
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         //IOggCallback Interface
00072         virtual bool acceptOggPage(OggPage* inOggPage);
00073 
00074 
00075         //CBasePin virtuals
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         //Pin Conenction Methods
00081         virtual HRESULT BreakConnect();
00082         virtual HRESULT CompleteConnect(IPin *inReceivePin);
00083 
00084         //Pin streaming methods
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         //IOggOutputPin interface
00091         virtual bool notifyStreamBaseTime(__int64 inStreamTime);
00092         virtual __int64 getGlobalBaseTime();
00093 protected:
00094         //IStampedOggPacketSink
00095         virtual bool acceptStampedOggPacket(StampedOggPacket* inPacket);
00096         virtual bool dispatchPacket(StampedOggPacket* inPacket);
00097 
00098         //What is this actually for ?
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 };

Generated on Thu Feb 16 23:48:14 2006 for oggdsf by  doxygen 1.3.9