TheoraEncodeInputPin.h

Go to the documentation of this file.
00001 //===========================================================================
00002 //Copyright (C) 2003, 2004 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 
00032 #pragma once
00033 #include "theoraencoderdllstuff.h"
00034 #include "TheoraEncoder.h"
00035 
00036 extern "C" {
00037 #include "theora_cdecl.h"
00038 }
00039 
00040 
00041 //Mmmmm macrolicious !
00042 //#define INT_FLOOR(num,scale) (num - (num % scale))
00043 #define CLIP3(x,y,z) ((z < x) ? x : ((z > y) ? y : z))
00044 //
00045 
00046 //DEBUG ONLY
00047 #include <fstream>
00048 using namespace std;
00049 //
00050 
00051 class TheoraEncodeOutputPin;
00052 class TheoraEncodeInputPin
00053         :       public AbstractTransformInputPin
00054 {
00055 public:
00056         TheoraEncodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes);
00057         virtual ~TheoraEncodeInputPin(void);
00058 
00059 
00060         
00061         virtual HRESULT SetMediaType(const CMediaType* inMediaType);
00062         //
00063 
00064         theora_info* theoraInfo();
00065 
00066 protected:
00067 
00068         //PURE VIRTUALS
00069         virtual long TransformData(unsigned char* inBuf, long inNumBytes);
00070         virtual bool ConstructCodec();
00071         virtual void DestroyCodec();
00072 
00073         HRESULT mHR;
00074         //bool mBegun;  //Already in base class !
00075 
00076         HRESULT deliverData(LONGLONG inStart, LONGLONG inEnd, unsigned char* inBuf, unsigned long inNumBytes);
00077 
00078         long encodeYV12ToYV12(unsigned char* inBuf, long inNumBytes);
00079         long encodeYUY2ToYV12(unsigned char* inBuf, long inNumBytes);
00080         long encodeAYUVtoYV12(unsigned char* inBuf, long inNumBytes);
00081         long encodeRGB24toYV12(unsigned char* inBuf, long inNumBytes);
00082         long encodeRGB32toYV12(unsigned char* inBuf, long inNumBytes);
00083         long encodeUYVYToYV12(unsigned char* inBuf, long inNumBytes);
00084         long encodeYVYUToYV12(unsigned char* inBuf, long inNumBytes);
00085         long encodeIYUVToYV12(unsigned char* inBuf, long inNumBytes);
00086         //
00087 //      bool fillTheoraInfo(theora_info* outTheora, sTheoraFormatBlock* inTheoraFormatBlock);           
00088         //
00089         //TheoraEncodeOutputPin* mOutputPin; //Already in the base class. Naughty c++
00090         //__int64 mUptoFrame;   //Already in base class stupid !
00091 
00092         TheoraEncoder mTheoraEncoder;
00093         theora_info mTheoraInfo;
00094         yuv_buffer mYUV;
00095 
00096         unsigned long mXOffset;
00097         unsigned long mYOffset;
00098 
00099         unsigned long mHeight;
00100         unsigned long mWidth;
00101 
00102         unsigned __int64 mUptoFrame;
00103 
00104         CMediaType mPinInputType;
00105         VIDEOINFOHEADER* mVideoFormat;
00106 
00107         bool mBegun;
00108 
00109 
00110         //DEBUG ONLY
00111         //fstream debugLog;
00112         //
00113 
00114         
00115 };

Generated on Tue Feb 15 14:54:17 2005 for oggdsf by  doxygen 1.3.9