This commit is contained in:
Glenn Maynard
2005-10-21 01:45:16 +00:00
parent f77dd38f0f
commit 6ee40039a8
3 changed files with 37 additions and 39 deletions
@@ -91,8 +91,7 @@ static void GetVideoCodecDebugInfo()
LOG->Trace( "Scanning codec %s", FourCCToString(info.fccHandler).c_str() ); LOG->Trace( "Scanning codec %s", FourCCToString(info.fccHandler).c_str() );
CHECKPOINT; CHECKPOINT;
HIC hic; HIC hic = ICOpen( info.fccType, info.fccHandler, ICMODE_DECOMPRESS );
hic = ICOpen(info.fccType, info.fccHandler, ICMODE_DECOMPRESS);
if( !hic ) if( !hic )
{ {
LOG->Info("Couldn't open video codec %s", LOG->Info("Couldn't open video codec %s",
@@ -110,21 +109,17 @@ static void GetVideoCodecDebugInfo()
FourCCToString(info.fccHandler).c_str(), info.szName, info.szDescription ); FourCCToString(info.fccHandler).c_str(), info.szName, info.szDescription );
} }
else else
LOG->Info("ICGetInfo(%s) failed", LOG->Info( "ICGetInfo(%s) failed", FourCCToString(info.fccHandler).c_str() );
FourCCToString(info.fccHandler).c_str());
CHECKPOINT; CHECKPOINT;
ICClose(hic); ICClose(hic);
} }
if(!i) if( i == 0 )
LOG->Info( " None found" ); LOG->Info( " None found" );
} }
//-----------------------------------------------------------------------------
// MovieTexture_DShow constructor
//-----------------------------------------------------------------------------
MovieTexture_DShow::MovieTexture_DShow( RageTextureID ID ) : MovieTexture_DShow::MovieTexture_DShow( RageTextureID ID ) :
RageMovieTexture( ID ), RageMovieTexture( ID ),
buffer_lock( "buffer_lock", 1 ), buffer_lock( "buffer_lock", 1 ),
@@ -132,10 +127,10 @@ MovieTexture_DShow::MovieTexture_DShow( RageTextureID ID ) :
{ {
LOG->Trace( "MovieTexture_DShow::MovieTexture_DShow()" ); LOG->Trace( "MovieTexture_DShow::MovieTexture_DShow()" );
static bool first = true; static bool bFirst = true;
if( first ) if( bFirst )
{ {
first = false; bFirst = false;
GetVideoCodecDebugInfo(); GetVideoCodecDebugInfo();
} }
@@ -183,7 +178,8 @@ MovieTexture_DShow::~MovieTexture_DShow()
/* Shut down the graph. We can't call Stop() here, since that will /* Shut down the graph. We can't call Stop() here, since that will
* call SkipUpdates again, which will deadlock if we call it twice * call SkipUpdates again, which will deadlock if we call it twice
* in a row. */ * in a row. */
if (m_pGB) { if( m_pGB )
{
LOG->Trace( "MovieTexture_DShow: shutdown" ); LOG->Trace( "MovieTexture_DShow: shutdown" );
LOG->Flush(); LOG->Flush();
CComPtr<IMediaControl> pMC; CComPtr<IMediaControl> pMC;
@@ -220,7 +216,7 @@ void MovieTexture_DShow::CheckFrame()
CreateTexture(); CreateTexture();
// DirectShow feeds us in BGR8 // DirectShow feeds us in BGR8
RageSurface *fromDShow = CreateSurfaceFrom( RageSurface *pFromDShow = CreateSurfaceFrom(
m_iSourceWidth, m_iSourceHeight, m_iSourceWidth, m_iSourceHeight,
24, 24,
0xFF0000, 0xFF0000,
@@ -229,7 +225,8 @@ void MovieTexture_DShow::CheckFrame()
0x000000, 0x000000,
(uint8_t *) buffer, m_iSourceWidth*3 ); (uint8_t *) buffer, m_iSourceWidth*3 );
/* Optimization notes: /*
* Optimization notes:
* *
* With D3D, this surface can be anything; it'll convert it on the fly. If * With D3D, this surface can be anything; it'll convert it on the fly. If
* it happens to exactly match the texture, it'll copy a little faster. * it happens to exactly match the texture, it'll copy a little faster.
@@ -242,12 +239,12 @@ void MovieTexture_DShow::CheckFrame()
CHECKPOINT; CHECKPOINT;
DISPLAY->UpdateTexture( DISPLAY->UpdateTexture(
m_uTexHandle, m_uTexHandle,
fromDShow, pFromDShow,
0, 0, 0, 0,
m_iImageWidth, m_iImageHeight ); m_iImageWidth, m_iImageHeight );
CHECKPOINT; CHECKPOINT;
delete fromDShow; delete pFromDShow;
buffer = NULL; buffer = NULL;
@@ -36,7 +36,6 @@ protected:
char *output; char *output;
MovieTexture_DShow* m_pTexture; // the video surface we will copy new frames to MovieTexture_DShow* m_pTexture; // the video surface we will copy new frames to
// D3DFORMAT m_TextureFormat; // Texture format
}; };
#endif #endif
@@ -1,5 +1,7 @@
#ifndef RAGEMOVIETEXTURE_FFMPEG_H /* MovieTexture_FFMpeg - FFMpeg movie renderer. */
#define RAGEMOVIETEXTURE_FFMPEG_H
#ifndef RAGE_MOVIE_TEXTURE_FFMPEG_H
#define RAGE_MOVIE_TEXTURE_FFMPEG_H
#include "MovieTexture_Generic.h" #include "MovieTexture_Generic.h"