bool VideoViewerWindow
::createVideo( QString filename
) {
int length = filename.size( ) + 1;
WCHAR* wfile = new WCHAR[length];
int i = 0;
for( i = 0 ; i < filename.size( ) ; i++ )
{
wfile[i] = filename[i].toAscii( );
}
wfile[i] = '\0';
//mpVideoPlayer->setControl( "DirectShow" );
// Get the interface for DirectShow's GraphBuilder
//CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
// IID_IGraphBuilder, (void **)&pGraphBuilder);
mpVideoPlayer
->queryInterface
( QUuid( IID_IGraphBuilder
),
(void**) &pGraphBuilder
);
pGraphBuilder->RenderFile( wfile, NULL );
// Query for the media control interfaces
//mpVideoPlayer->queryInterface( QUuid( IID_IMediaControl ), (void **)&pMediaControl );
pGraphBuilder->QueryInterface( IID_IMediaControl, (void **)&pMediaControl );
pGraphBuilder->QueryInterface( IID_IMediaEventEx, (void **)&pMediaEvent );
pGraphBuilder->QueryInterface( IID_IMediaSeeking, (void **)&pMediaSeeking );
pGraphBuilder->QueryInterface( IID_IMediaPosition, (void **)&pMediaPosition );
// Query for video interfaces, which may not be relevant for audio files
pGraphBuilder->QueryInterface( IID_IVideoWindow, (void **)&pVideoWindow );
pGraphBuilder->QueryInterface( IID_IBasicVideo, (void **)&pBasicVideo );
// Query for audio interfaces, which may not be relevant for video-only files
pGraphBuilder->QueryInterface( IID_IBasicAudio, (void **)&pBasicAudio );
getFrameStepInterface( );
pMediaControl->Run( );
return true;
}
bool VideoViewerWindow::createVideo( QString filename )
{
int length = filename.size( ) + 1;
WCHAR* wfile = new WCHAR[length];
int i = 0;
for( i = 0 ; i < filename.size( ) ; i++ )
{
wfile[i] = filename[i].toAscii( );
}
wfile[i] = '\0';
//mpVideoPlayer->setControl( "DirectShow" );
// Get the interface for DirectShow's GraphBuilder
//CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
// IID_IGraphBuilder, (void **)&pGraphBuilder);
mpVideoPlayer->queryInterface( QUuid( IID_IGraphBuilder ), (void**) &pGraphBuilder );
pGraphBuilder->RenderFile( wfile, NULL );
// Query for the media control interfaces
//mpVideoPlayer->queryInterface( QUuid( IID_IMediaControl ), (void **)&pMediaControl );
pGraphBuilder->QueryInterface( IID_IMediaControl, (void **)&pMediaControl );
pGraphBuilder->QueryInterface( IID_IMediaEventEx, (void **)&pMediaEvent );
pGraphBuilder->QueryInterface( IID_IMediaSeeking, (void **)&pMediaSeeking );
pGraphBuilder->QueryInterface( IID_IMediaPosition, (void **)&pMediaPosition );
// Query for video interfaces, which may not be relevant for audio files
pGraphBuilder->QueryInterface( IID_IVideoWindow, (void **)&pVideoWindow );
pGraphBuilder->QueryInterface( IID_IBasicVideo, (void **)&pBasicVideo );
// Query for audio interfaces, which may not be relevant for video-only files
pGraphBuilder->QueryInterface( IID_IBasicAudio, (void **)&pBasicAudio );
getFrameStepInterface( );
pMediaControl->Run( );
return true;
}
To copy to clipboard, switch view to plain text mode
Bookmarks