My Project
|
D3DFMT_X8R8G8B8 and RGB24 renderer. More...
#include <dshowtextures.h>
Public Member Functions | |
CTextureRenderer (LPUNKNOWN pUnk, HRESULT *phr) | |
HRESULT | CheckMediaType (const CMediaType *pmt) |
Format acceptable. | |
HRESULT | SetMediaType (const CMediaType *pmt) |
Video format notification, only by this time we know the size of the video, so that we can create our texture surface accordingly. | |
HRESULT | GetConnectedMediaType (D3DFORMAT *uiTexFmt, LONG *uiVidBpp) |
HRESULT | DoRenderSample (IMediaSample *pMediaSample) |
this is most important function. More... | |
HRESULT | GetDDMediaSample (IMediaSample *pSample) |
HRESULT | lock (byte **data, int *nSize) |
one can retrieve texture data by lock this. More... | |
HRESULT | unlock () |
lock and unlock must be paired | |
int | GetWidth () |
this function will return when the video is initialized and its size is known. More... | |
int | GetHeight () |
this function will return when the video is initialized and its size is known. More... | |
HRESULT | CreateTexture (LPDIRECT3DTEXTURE9 *pTexture) |
this function will return when the video is initialized and its size is known. More... | |
HRESULT | UpdateTexture (LPDIRECT3DTEXTURE9 pTexture) |
update the texture with the latest content. More... | |
![]() | |
CBaseVideoRenderer (REFCLSID RenderClass, TCHAR *pName, LPUNKNOWN pUnk, HRESULT *phr) | |
STDMETHODIMP | SetSink (IQualityControl *piqc) |
STDMETHODIMP | Notify (IBaseFilter *pSelf, Quality q) |
void | OnRenderStart (IMediaSample *pMediaSample) |
void | OnRenderEnd (IMediaSample *pMediaSample) |
void | OnWaitStart () |
void | OnWaitEnd () |
HRESULT | OnStartStreaming () |
HRESULT | OnStopStreaming () |
void | ThrottleWait () |
void | PreparePerformanceData (int trLate, int trFrame) |
virtual void | RecordFrameLateness (int trLate, int trFrame) |
virtual void | OnDirectRender (IMediaSample *pMediaSample) |
virtual HRESULT | ResetStreamingTimes () |
BOOL | ScheduleSample (IMediaSample *pMediaSample) |
HRESULT | ShouldDrawSampleNow (IMediaSample *pMediaSample, REFERENCE_TIME *ptrStart, REFERENCE_TIME *ptrEnd) |
virtual HRESULT | SendQuality (REFERENCE_TIME trLate, REFERENCE_TIME trRealStream) |
STDMETHODIMP | JoinFilterGraph (IFilterGraph *pGraph, LPCWSTR pName) |
HRESULT | GetStdDev (int nSamples, int *piResult, LONGLONG llSumSq, LONGLONG iTot) |
STDMETHODIMP | get_FramesDroppedInRenderer (int *cFramesDropped) |
STDMETHODIMP | get_FramesDrawn (int *pcFramesDrawn) |
STDMETHODIMP | get_AvgFrameRate (int *piAvgFrameRate) |
STDMETHODIMP | get_Jitter (int *piJitter) |
STDMETHODIMP | get_AvgSyncOffset (int *piAvg) |
STDMETHODIMP | get_DevSyncOffset (int *piDev) |
DECLARE_IUNKNOWN STDMETHODIMP | NonDelegatingQueryInterface (REFIID riid, VOID **ppv) |
![]() | |
CBaseRenderer (REFCLSID RenderClass, TCHAR *pName, LPUNKNOWN pUnk, HRESULT *phr) | |
virtual HRESULT | GetMediaPositionInterface (REFIID riid, void **ppv) |
STDMETHODIMP | NonDelegatingQueryInterface (REFIID, void **) |
virtual HRESULT | SourceThreadCanWait (BOOL bCanWait) |
virtual HRESULT | WaitForRenderTime () |
virtual HRESULT | CompleteStateChange (FILTER_STATE OldState) |
BOOL | IsEndOfStream () |
BOOL | IsEndOfStreamDelivered () |
BOOL | IsStreaming () |
void | SetAbortSignal (BOOL bAbort) |
virtual void | OnReceiveFirstSample (IMediaSample *pMediaSample) |
CAMEvent * | GetRenderEvent () |
void | Ready () |
void | NotReady () |
BOOL | CheckReady () |
virtual int | GetPinCount () |
virtual CBasePin * | GetPin (int n) |
FILTER_STATE | GetRealState () |
void | SendRepaint () |
void | SendNotifyWindow (IPin *pPin, HWND hwnd) |
BOOL | OnDisplayChange () |
void | SetRepaintStatus (BOOL bRepaint) |
STDMETHODIMP | Stop () |
STDMETHODIMP | Pause () |
STDMETHODIMP | Run (REFERENCE_TIME StartTime) |
STDMETHODIMP | GetState (DWORD dwMSecs, FILTER_STATE *State) |
STDMETHODIMP | FindPin (LPCWSTR Id, IPin **ppPin) |
virtual void | PrepareRender () |
virtual HRESULT | GetSampleTimes (IMediaSample *pMediaSample, REFERENCE_TIME *pStartTime, REFERENCE_TIME *pEndTime) |
void | TimerCallback () |
void | ResetEndOfStreamTimer () |
HRESULT | NotifyEndOfStream () |
virtual HRESULT | SendEndOfStream () |
virtual HRESULT | ResetEndOfStream () |
virtual HRESULT | EndOfStream () |
void | SignalTimerFired () |
virtual HRESULT | CancelNotification () |
virtual HRESULT | ClearPendingSample () |
virtual HRESULT | Active () |
virtual HRESULT | Inactive () |
virtual HRESULT | StartStreaming () |
virtual HRESULT | StopStreaming () |
virtual HRESULT | BeginFlush () |
virtual HRESULT | EndFlush () |
virtual HRESULT | BreakConnect () |
virtual HRESULT | CompleteConnect (IPin *pReceivePin) |
virtual HRESULT | PrepareReceive (IMediaSample *pMediaSample) |
virtual HRESULT | Receive (IMediaSample *pMediaSample) |
virtual BOOL | HaveCurrentSample () |
virtual IMediaSample * | GetCurrentSample () |
virtual HRESULT | Render (IMediaSample *pMediaSample) |
void | WaitForReceiveToComplete () |
![]() | |
CBaseFilter (const TCHAR *pName, LPUNKNOWN pUnk, CCritSec *pLock, REFCLSID clsid) | |
CBaseFilter (TCHAR *pName, LPUNKNOWN pUnk, CCritSec *pLock, REFCLSID clsid, HRESULT *phr) | |
DECLARE_IUNKNOWN STDMETHODIMP | NonDelegatingQueryInterface (REFIID riid, void **ppv) |
STDMETHODIMP | GetClassID (CLSID *pClsID) |
STDMETHODIMP | GetState (DWORD dwMSecs, FILTER_STATE *State) |
STDMETHODIMP | SetSyncSource (IReferenceClock *pClock) |
STDMETHODIMP | GetSyncSource (IReferenceClock **pClock) |
STDMETHODIMP | Stop () |
STDMETHODIMP | Pause () |
STDMETHODIMP | Run (REFERENCE_TIME tStart) |
virtual HRESULT | StreamTime (CRefTime &rtStream) |
BOOL | IsActive () |
BOOL | IsStopped () |
STDMETHODIMP | EnumPins (IEnumPins **ppEnum) |
STDMETHODIMP | FindPin (LPCWSTR Id, IPin **ppPin) |
STDMETHODIMP | QueryFilterInfo (FILTER_INFO *pInfo) |
STDMETHODIMP | JoinFilterGraph (IFilterGraph *pGraph, LPCWSTR pName) |
STDMETHODIMP | QueryVendorInfo (LPWSTR *pVendorInfo) |
HRESULT | NotifyEvent (long EventCode, LONG_PTR EventParam1, LONG_PTR EventParam2) |
IFilterGraph * | GetFilterGraph () |
HRESULT | ReconnectPin (IPin *pPin, AM_MEDIA_TYPE const *pmt) |
virtual LONG | GetPinVersion () |
void | IncrementPinVersion () |
STDMETHODIMP | Register () |
STDMETHODIMP | Unregister () |
virtual LPAMOVIESETUP_FILTER | GetSetupData () |
![]() | |
CUnknown (const TCHAR *pName, LPUNKNOWN pUnk) | |
CUnknown (TCHAR *pName, LPUNKNOWN pUnk, HRESULT *phr) | |
LPUNKNOWN | GetOwner () const |
STDMETHODIMP | NonDelegatingQueryInterface (REFIID, void **) |
STDMETHODIMP_ (ULONG) NonDelegatingAddRef() | |
STDMETHODIMP_ (ULONG) NonDelegatingRelease() | |
![]() | |
CBaseObject (const TCHAR *pName) | |
Protected Attributes | |
D3DFORMAT | m_TextureFormat |
LONG | m_VideoBpp |
VIDEOINFO | m_viBmp |
bool | m_bUseDynamicTextures |
LONG | m_lVidWidth |
LONG | m_lVidHeight |
LONG | m_lVidPitch |
bool | m_bUpSideDown |
HANDLE | m_hInitDone |
Mutex | mMutex |
vector< byte > | m_textureData |
bool | m_bFrameChanged |
![]() | |
int | m_nNormal |
BOOL | m_bSupplierHandlingQuality |
int | m_trThrottle |
int | m_trRenderAvg |
int | m_trRenderLast |
int | m_tRenderStart |
int | m_trEarliness |
int | m_trTarget |
int | m_trWaitAvg |
int | m_trFrameAvg |
int | m_trDuration |
REFERENCE_TIME | m_trRememberStampForPerf |
int | m_cFramesDropped |
int | m_cFramesDrawn |
LONGLONG | m_iTotAcc |
LONGLONG | m_iSumSqAcc |
REFERENCE_TIME | m_trLastDraw |
LONGLONG | m_iSumSqFrameTime |
LONGLONG | m_iSumFrameTime |
int | m_trLate |
int | m_trFrame |
int | m_tStreamingStart |
![]() | |
CRendererPosPassThru * | m_pPosition |
CAMEvent | m_RenderEvent |
CAMEvent | m_ThreadSignal |
CAMEvent | m_evComplete |
BOOL | m_bAbort |
BOOL | m_bStreaming |
DWORD_PTR | m_dwAdvise |
IMediaSample * | m_pMediaSample |
BOOL | m_bEOS |
BOOL | m_bEOSDelivered |
CRendererInputPin * | m_pInputPin |
CCritSec | m_InterfaceLock |
CCritSec | m_RendererLock |
IQualityControl * | m_pQSink |
BOOL | m_bRepaintStatus |
volatile BOOL | m_bInReceive |
REFERENCE_TIME | m_SignalTime |
UINT | m_EndOfStreamTimer |
CCritSec | m_ObjectCreationLock |
![]() | |
FILTER_STATE | m_State |
IReferenceClock * | m_pClock |
CRefTime | m_tStart |
CLSID | m_clsid |
CCritSec * | m_pLock |
WCHAR * | m_pName |
IFilterGraph * | m_pGraph |
IMediaEventSink * | m_pSink |
LONG | m_PinVersion |
![]() | |
volatile LONG | m_cRef |
Additional Inherited Members | |
![]() | |
static LONG | ObjectsActive () |
D3DFMT_X8R8G8B8 and RGB24 renderer.
Supporting WMV and any video format codec available in the system.
HRESULT CTextureRenderer::CreateTexture | ( | LPDIRECT3DTEXTURE9 * | pTexture | ) |
this function will return when the video is initialized and its size is known.
Internally it will wait for the codec to be ready.
|
virtual |
this is most important function.
this function is called in the codec thread.
Called when a new sample has been rendered. we just keep it in a temporary buffer.
Reimplemented from CBaseRenderer.
int CTextureRenderer::GetHeight | ( | ) |
this function will return when the video is initialized and its size is known.
Internally it will wait for the codec to be ready.
int CTextureRenderer::GetWidth | ( | ) |
this function will return when the video is initialized and its size is known.
Internally it will wait for the codec to be ready.
HRESULT CTextureRenderer::lock | ( | byte ** | data, |
int * | nSize | ||
) |
one can retrieve texture data by lock this.
No longer to use this function if one uses UpdateTexture() to retrieve data directly into a d3d texture created by CreateTexture().
HRESULT CTextureRenderer::UpdateTexture | ( | LPDIRECT3DTEXTURE9 | pTexture | ) |
update the texture with the latest content.
It is safe to call this function at higher frequency than the movie frame rate. it will internally detect if the current frame has changed since the last invocation of this function.