My Project
|
Usage: LoadVideoFile before you want to play any video file. More...
#include <GraphBuilder.h>
Public Member Functions | |
HRESULT | LoadVideoFile (LPCWSTR wFileName, bool bAudioOn) |
Loads a video file from disk. More... | |
HRESULT | RunGraph () |
Start playing the video file This will start playing a stopped video file or a paused video file. More... | |
HRESULT | PauseGraph () |
Pause a video file This will pause a playing video file. More... | |
HRESULT | StopGraph () |
Stop a video file This will stop a playing video file or a paused video file. More... | |
HRESULT | Seek (double seekvalue) |
Seek a video file to a given percentage This will not affect the current state of the video file. More... | |
HRESULT | RestoreDeviceObjects (LPDIRECT3DDEVICE9 pd3dDevice) |
HRESULT | InvalidateDeviceObjects () |
double | GetCurrPos () |
Get the current position of the video file in second. More... | |
double | GetDuration () |
Get the length in second of the video file. More... | |
long | CheckMovieStatus (bool bIsRepeat) |
Check if certain event such as a complete event happens. More... | |
void | CleanupDShow (void) |
int | GetWidth () |
Get the width of frame size of the video file. More... | |
int | GetHeight () |
Get the height of frame size of the video file. More... | |
LPDIRECT3DTEXTURE9 | GetTexture () |
Update and get the texture of the current frame. More... | |
bool | IsNeedCreateTexture () |
Check if the texture has been successfully created. More... | |
Protected Member Functions | |
HRESULT | ConnectWMVFile (LPCWSTR wFileName) |
HRESULT | ConnectOtherFile (LPCWSTR wFileName) |
Protected Attributes | |
LPDIRECT3DTEXTURE9 | m_pTexture |
CComPtr< IGraphBuilder > | m_pGB |
CComPtr< IMediaControl > | m_pMC |
CComPtr< IMediaPosition > | m_pMP |
CComPtr< IMediaEvent > | m_pME |
IFileSourceFilter * | m_pFileSource |
CComPtr< IPin > | m_pPinOut1 |
CComPtr< IPin > | m_pPinOut0 |
CComPtr< IBaseFilter > | m_pRenderer1 |
CTextureRenderer * | m_pRenderer |
bool | m_bLocked |
bool | m_bAudioOn |
Usage: LoadVideoFile before you want to play any video file.
If you want to load other file, call LoadVideoFile again. When the device gets invalidate or restore, call RestoreDeviceObjects and InvalidateDeviceObjects respectively. The loaded video file will not get lost in this process. So you don't need to reload the file again.
long CGraphBuilder::CheckMovieStatus | ( | bool | bIsRepeat | ) |
Check if certain event such as a complete event happens.
This will not affect the current state of the video file.
bIsRepeat | whether to repeat the file from the beginning if it is completed. |
double CGraphBuilder::GetCurrPos | ( | ) |
Get the current position of the video file in second.
This will not affect the current state of the video file.
double CGraphBuilder::GetDuration | ( | ) |
Get the length in second of the video file.
This will not affect the current state of the video file.
int CGraphBuilder::GetHeight | ( | ) |
Get the height of frame size of the video file.
LPDIRECT3DTEXTURE9 CGraphBuilder::GetTexture | ( | ) |
Update and get the texture of the current frame.
int CGraphBuilder::GetWidth | ( | ) |
Get the width of frame size of the video file.
|
inline |
Check if the texture has been successfully created.
If not, load the video file again.
HRESULT CGraphBuilder::LoadVideoFile | ( | LPCWSTR | wFileName, |
bool | bAudioOn | ||
) |
Loads a video file from disk.
wFileName | the input file name, in Unicode |
bAudioOn | whether to allow audio output. |
pTexMutex | for sharing the texture. |
HRESULT CGraphBuilder::PauseGraph | ( | ) |
Pause a video file This will pause a playing video file.
HRESULT CGraphBuilder::RunGraph | ( | ) |
Start playing the video file This will start playing a stopped video file or a paused video file.
HRESULT CGraphBuilder::Seek | ( | double | seekvalue | ) |
Seek a video file to a given percentage This will not affect the current state of the video file.
seekvalue | the percentage of the video file you want to seek to. The range is 0 to 100. |
HRESULT CGraphBuilder::StopGraph | ( | ) |
Stop a video file This will stop a playing video file or a paused video file.
The video position is reset to the beginning.