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 "abstractvideoencoderdllstuff.h"
00034
00035 #include "AbstractVideoEncodeFilter.h"
00036 #include "BasicSeekable.h"
00037 class AbstractVideoEncodeOutputPin;
00038 class AbstractVideoEncodeFilter;
00039 class ABS_VIDEO_ENC_API AbstractVideoEncodeInputPin
00040 : public CBaseInputPin
00041 , public BasicSeekable
00042 {
00043 public:
00044 AbstractVideoEncodeInputPin(AbstractVideoEncodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractVideoEncodeOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName);
00045 virtual ~AbstractVideoEncodeInputPin(void);
00046
00047 static const short SIZE_16_BITS = 2;
00048 static const unsigned long HUNDRED_NANOS = 10000000;
00049 static const signed short SINT_MAX = 32767;
00050 static const signed short SINT_MIN = -32768;
00051
00052 DECLARE_IUNKNOWN
00053 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
00054
00055
00056
00057 virtual long encodeData(unsigned char* inBuf, long inNumBytes) = 0;
00058 virtual bool ConstructCodec() = 0;
00059 virtual void DestroyCodec() = 0;
00060
00061
00062 virtual HRESULT CompleteConnect (IPin *inReceivePin);
00063 STDMETHODIMP Receive(IMediaSample *pSample);
00064 virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
00065 virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
00066 virtual HRESULT SetMediaType(const CMediaType* inMediaType);
00067
00068 virtual void ResetFrameCount();
00069
00070 virtual STDMETHODIMP EndOfStream(void);
00071 virtual STDMETHODIMP BeginFlush();
00072 virtual STDMETHODIMP EndFlush();
00073 virtual STDMETHODIMP NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
00074
00075 protected:
00076
00077 virtual bool SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime);
00078
00079
00080 HRESULT mHR;
00081 bool mBegun;
00082 AbstractVideoEncodeOutputPin* mOutputPin;
00083 __int64 mUptoFrame;
00084 AbstractVideoEncodeFilter* mParentFilter;
00085 CMediaType mPinInputType;
00086
00087
00088
00089
00090
00091
00092 VIDEOINFOHEADER* mVideoFormat;
00093 long mHeight;
00094 long mWidth;
00095
00096
00097 };