예제 #1
0
void QuickTimeSampleApp::loadMovieFile( const fs::path& moviePath )
{
	try {
		// load up the movie, set it to loop, and begin playing
		mMovie = qtime::MovieGl( moviePath );
		mMovie.setLoop();
		mMovie.play();
		
		// create a texture for showing some info about the movie
		TextLayout infoText;
		infoText.clear( ColorA( 0.2f, 0.2f, 0.2f, 0.5f ) );
		infoText.setColor( Color::white() );
		infoText.addCenteredLine( getPathFileName( moviePath.string() ) );
		infoText.addLine( toString( mMovie.getWidth() ) + " x " + toString( mMovie.getHeight() ) + " pixels" );
		infoText.addLine( toString( mMovie.getDuration() ) + " seconds" );
		infoText.addLine( toString( mMovie.getNumFrames() ) + " frames" );
		infoText.addLine( toString( mMovie.getFramerate() ) + " fps" );
		infoText.setBorder( 4, 2 );
		mInfoTexture = gl::Texture( infoText.render( true ) );
	}
	catch( ... ) {
		console() << "Unable to load the movie." << std::endl;
		mMovie.reset();
		mInfoTexture.reset();
	}

	mFrameTexture.reset();
}
void QuickTimePlayer::loadMovieFile( const fs::path &moviePath )
{
	try {
		// load up the movie, set it to loop, and begin playing
		mMovie = qtime::MovieGl::create( moviePath );
		
		mMovie->setLoop(mMovie->getDuration()<30.0f) ;
		mMovie->play();
		
		// create a texture for showing some info about the movie
		TextLayout infoText;
		infoText.clear( ColorA( 0.2f, 0.2f, 0.2f, 0.5f ) );
		infoText.setColor( Color::white() );
		infoText.addCenteredLine( moviePath.filename().string() );
		infoText.addLine( toString( mMovie->getWidth() ) + " x " + toString( mMovie->getHeight() ) + " pixels" );
		infoText.addLine( toString( mMovie->getDuration() ) + " seconds" );
		infoText.addLine( toString( mMovie->getNumFrames() ) + " frames" );
		infoText.addLine( toString( mMovie->getFramerate() ) + " fps" );
		infoText.setBorder( 4, 2 );
		mInfoTexture = gl::Texture( infoText.render( true ) );
	}
	catch (const std::exception &e) {
		console() << "Unable to load the movie:" << e.what() << std::endl;
		//mMovie->reset();
		mInfoTexture.reset();
	}

	mFrameTexture.reset();
}
예제 #3
0
파일: VBOTest.cpp 프로젝트: UIKit0/bluegin
void VboSampleApp::cleanup()
{
    //  XXX If GL resources are not cleaned up they are unavailable the next time
    //  the program is run.
    mTexture.reset();
    mVboMesh.reset();
}
예제 #4
0
void QuickTimeSampleApp::loadMovieResource()
{
	try {
		loadResourceMemory( "Upgrade_U_small.mov", RES_UPGADE_U_MOV, "MOV", &data, &dataSize );
		
		mMovie = qtime::MovieGL( data.get(), dataSize, "Upgrade_U_small.mov", "video/quicktime" );
		std::cout << "Dimensions:" << mMovie.getWidth() << " x " << mMovie.getHeight() << std::endl;
		std::cout << "Duration:  " << mMovie.getDuration() << " seconds" << std::endl;
		std::cout << "Frames:    " << mMovie.getNumFrames() << std::endl;
		std::cout << "Framerate: " << mMovie.getFramerate() << std::endl;				
		mMovie.setLoop( true, true );
		
#ifdef USE_DISPLAY_LINK
		mMovie.enableDisplayLink( getDisplayLink() );
#endif
		mMovie.setNewFrameCallback( newFrameCallback, &mMovie );
		mMovie.play();
	}
	catch( ... ) {
		std::cout << "Unable to load the movie." << std::endl;
		mMovie.reset();
	}

	mTexture.reset();
}
예제 #5
0
void QuickTimeSampleApp::update()
{
	if( mMovie )
		mTexture = mMovie.getTexture();
	else
		mTexture.reset();
}
예제 #6
0
void ardroneApp::loadMovieFile( const fs::path &moviePath )
{
    std::string errorMessage = "";
	try {
		// load up the movie, set it to loop, and begin playing
		mMovie.reset();
		mMovie = ffmpeg::MovieGl::create( moviePath );
		//mMovie->setLoop();
		mMovie->play();
        setInfo(moviePath.filename().string());
        if (mIsEqualMovieSize) getWindow()->setSize(mMovie->getWidth(), mMovie->getHeight());
	}
	catch( exception& e ) {
        errorMessage = string("Unable to load the movie. ") + string(e.what());
        console() << errorMessage << std::endl;
    }
    
    setInfo(moviePath.filename().string(), errorMessage);

	mFrameTexture.reset();
}
예제 #7
0
void QuickTimeSampleApp::loadMovieFile( const string &moviePath )
{
	try {
		mMovie = qtime::MovieGL( moviePath );
		std::cout << "Dimensions:" << mMovie.getWidth() << " x " << mMovie.getHeight() << std::endl;
		std::cout << "Duration:  " << mMovie.getDuration() << " seconds" << std::endl;
		std::cout << "Frames:    " << mMovie.getNumFrames() << std::endl;
		std::cout << "Framerate: " << mMovie.getFramerate() << std::endl;				
		mMovie.setLoop( true, true );
		
#ifdef USE_DISPLAY_LINK
		mMovie.enableDisplayLink( getDisplayLink() );
#endif
		mMovie.setNewFrameCallback( newFrameCallback, &mMovie );
		mMovie.play();
	}
	catch( ... ) {
		std::cout << "Unable to load the movie." << std::endl;
		mMovie.reset();
	}

	mTexture.reset();
}