VOID Create -> void Create

SetLoopOn/Off -> SetLooping(bool)

CTextureRenderer throws its own exception
This commit is contained in:
Glenn Maynard
2002-08-23 01:55:38 +00:00
parent 5111876b0d
commit 4d1a9e1d68
4 changed files with 10 additions and 34 deletions
+6 -20
View File
@@ -40,7 +40,6 @@ struct __declspec(uuid("{71771540-2017-11cf-ae26-0020afd79767}")) CLSID_TextureR
#include "RageLog.h" #include "RageLog.h"
#include "RageException.h" #include "RageException.h"
#include <stdio.h> #include <stdio.h>
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -65,8 +64,8 @@ public:
HRESULT DoRenderSample(IMediaSample *pMediaSample); // New video sample HRESULT DoRenderSample(IMediaSample *pMediaSample); // New video sample
// new methods // new methods
LONG GetVidWidth() {return m_lVidWidth;}; LONG GetVidWidth() const { return m_lVidWidth; }
LONG GetVidHeight(){return m_lVidHeight;}; LONG GetVidHeight() const { return m_lVidHeight; }
HRESULT SetRenderTarget( RageMovieTexture* pTexture ); HRESULT SetRenderTarget( RageMovieTexture* pTexture );
protected: protected:
@@ -89,6 +88,9 @@ CTextureRenderer::CTextureRenderer( LPUNKNOWN pUnk, HRESULT *phr )
: CBaseVideoRenderer(__uuidof(CLSID_TextureRenderer), : CBaseVideoRenderer(__uuidof(CLSID_TextureRenderer),
NAME("Texture Renderer"), pUnk, phr) NAME("Texture Renderer"), pUnk, phr)
{ {
if( FAILED(*phr) )
throw RageException( *phr, "Could not create texture renderer object!" );
// Store and ARageef the texture for our use. // Store and ARageef the texture for our use.
m_pTexture = NULL; m_pTexture = NULL;
m_bBackBufferLocked = FALSE; m_bBackBufferLocked = FALSE;
@@ -137,8 +139,6 @@ HRESULT CTextureRenderer::CheckMediaType(const CMediaType *pmt)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
HRESULT CTextureRenderer::SetMediaType(const CMediaType *pmt) HRESULT CTextureRenderer::SetMediaType(const CMediaType *pmt)
{ {
// HRESULT hr;
// Retrive the size of this media type // Retrive the size of this media type
VIDEOINFO *pviBmp; // Bitmap info header VIDEOINFO *pviBmp; // Bitmap info header
pviBmp = (VIDEOINFO *)pmt->Format(); pviBmp = (VIDEOINFO *)pmt->Format();
@@ -146,7 +146,6 @@ HRESULT CTextureRenderer::SetMediaType(const CMediaType *pmt)
m_lVidHeight = abs(pviBmp->bmiHeader.biHeight); m_lVidHeight = abs(pviBmp->bmiHeader.biHeight);
m_lVidPitch = (m_lVidWidth * 3 + 3) & ~(3); // We are forcing RGB24 m_lVidPitch = (m_lVidWidth * 3 + 3) & ~(3); // We are forcing RGB24
return S_OK; return S_OK;
} }
@@ -345,7 +344,7 @@ LPDIRECT3DTEXTURE8 RageMovieTexture::GetD3DTexture()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// RageMovieTexture::Create() // RageMovieTexture::Create()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
VOID RageMovieTexture::Create() void RageMovieTexture::Create()
{ {
HRESULT hr; HRESULT hr;
@@ -396,8 +395,6 @@ HRESULT RageMovieTexture::InitDShowTextureRenderer()
// Create the Texture Renderer object // Create the Texture Renderer object
m_pCTR = new CTextureRenderer(NULL, &hr); m_pCTR = new CTextureRenderer(NULL, &hr);
if( FAILED(hr) )
throw RageException( hr, "Could not create texture renderer object!" );
// Get a pointer to the IBaseFilter on the TextureRenderer, add it to graph // Get a pointer to the IBaseFilter on the TextureRenderer, add it to graph
CComPtr<IBaseFilter> pFTR = m_pCTR; CComPtr<IBaseFilter> pFTR = m_pCTR;
@@ -450,7 +447,6 @@ HRESULT RageMovieTexture::InitDShowTextureRenderer()
m_iImageWidth = m_iSourceWidth; m_iImageWidth = m_iSourceWidth;
m_iImageHeight = m_iSourceHeight; m_iImageHeight = m_iSourceHeight;
return S_OK; return S_OK;
} }
@@ -547,16 +543,6 @@ void RageMovieTexture::Stop()
throw RageException( hr, "Could not stop the DirectShow graph." ); throw RageException( hr, "Could not stop the DirectShow graph." );
} }
void RageMovieTexture::TurnLoopOn()
{
m_bLoop = true;
}
void RageMovieTexture::TurnLoopOff()
{
m_bLoop = false;
}
void RageMovieTexture::SetPosition( float fSeconds ) void RageMovieTexture::SetPosition( float fSeconds )
{ {
m_pMP->put_CurrentPosition(0); m_pMP->put_CurrentPosition(0);
+2 -3
View File
@@ -53,8 +53,7 @@ public:
virtual void Stop(); virtual void Stop();
virtual void SetPosition( float fSeconds ); virtual void SetPosition( float fSeconds );
virtual bool IsAMovie() { return true; }; virtual bool IsAMovie() { return true; };
virtual void TurnLoopOn(); void SetLooping(bool looping=true) { m_bLoop = looping; }
virtual void TurnLoopOff();
LPDIRECT3DTEXTURE8 GetBackBuffer() { return m_pd3dTexture[!m_iIndexFrontBuffer]; } LPDIRECT3DTEXTURE8 GetBackBuffer() { return m_pd3dTexture[!m_iIndexFrontBuffer]; }
void Flip() { m_iIndexFrontBuffer = !m_iIndexFrontBuffer; } void Flip() { m_iIndexFrontBuffer = !m_iIndexFrontBuffer; }
@@ -63,7 +62,7 @@ protected:
LPDIRECT3DTEXTURE8 m_pd3dTexture[2]; // double buffered LPDIRECT3DTEXTURE8 m_pd3dTexture[2]; // double buffered
int m_iIndexFrontBuffer; // index of the buffer that should be rendered from - either 0 or 1 int m_iIndexFrontBuffer; // index of the buffer that should be rendered from - either 0 or 1
virtual VOID Create(); virtual void Create();
virtual HRESULT CreateD3DTexture(); virtual HRESULT CreateD3DTexture();
virtual HRESULT InitDShowTextureRenderer(); virtual HRESULT InitDShowTextureRenderer();
-8
View File
@@ -111,11 +111,3 @@ void RageTexture::GetFrameDimensionsFromFileName( CString sPath, int* piFramesWi
} }
} }
void RageTexture::TurnLoopOn()
{
}
void RageTexture::TurnLoopOff()
{
}
+1 -2
View File
@@ -64,8 +64,7 @@ public:
virtual void Pause() {}; virtual void Pause() {};
virtual void SetPosition( float fSeconds ) {}; virtual void SetPosition( float fSeconds ) {};
virtual bool IsAMovie() { return false; }; virtual bool IsAMovie() { return false; };
virtual void TurnLoopOn(); void SetLooping(bool looping=true) { }
virtual void TurnLoopOff();
int GetSourceWidth() {return m_iSourceWidth;}; int GetSourceWidth() {return m_iSourceWidth;};
int GetSourceHeight() {return m_iSourceHeight;}; int GetSourceHeight() {return m_iSourceHeight;};