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 "theoraencoderdllstuff.h"
00034 #include "TheoraEncoder.h"
00035
00036 extern "C" {
00037 #include "theora_cdecl.h"
00038 }
00039
00040
00041
00042
00043 #define CLIP3(x,y,z) ((z < x) ? x : ((z > y) ? y : z))
00044
00045
00046
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
00069 virtual long TransformData(unsigned char* inBuf, long inNumBytes);
00070 virtual bool ConstructCodec();
00071 virtual void DestroyCodec();
00072
00073 HRESULT mHR;
00074
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
00088
00089
00090
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
00111
00112
00113
00114
00115 };