Loading video problem in DirectShowMovieTexture
Posted: Fri May 30, 2014 8:46 am
Hi everyone,
I tried to load video using Direct Show and followed instruction in http://www.ogre3d.org/tikiwiki/tiki-ind ... re+texture. And also add some code in createScene() method for video calling.
But there was an error
Following is my code:
SampleVideo.cpp
If anyone can help me to solve this i'll be much pleased...
I tried to load video using Direct Show and followed instruction in http://www.ogre3d.org/tikiwiki/tiki-ind ... re+texture. And also add some code in createScene() method for video calling.
But there was an error
Code: Select all
error LNK2019: unresolved external symbol "public: class Ogre::TexturePtr __thiscall OgreUtils::DirectShowMovieTexture::getMovieTexture(void)"
SampleVideo.cpp
Code: Select all
#include "SampleVideo.h"
#include "UtilsOgreDshow.h"
void SampleVideo::createScene(void)
{
OgreUtils::DirectShowMovieTexture* dshowMovieTextureSystem = new OgreUtils::DirectShowMovieTexture(320, 240, true);
Ogre::String movieName="C:/Video/composite.avi";
dshowMovieTextureSystem->loadMovie(movieName);
dshowMovieTextureSystem->playMovie();
dshowMovieTextureSystem->pauseMovie();
dshowMovieTextureSystem->stopMovie();
dshowMovieTextureSystem->rewindMovie();
bool isPlaying = dshowMovieTextureSystem->isPlayingMovie();
dshowMovieTextureSystem->updateMovieTexture();
Ogre::MaterialPtr mat;
Ogre::TextureUnitState* tex;
Ogre::String materialName="MyMaterial";
if (!Ogre::MaterialManager::getSingleton().resourceExists(materialName))
{
throw("Error, material doesn't exist!");
//return 0;
}
mat=Ogre::MaterialManager::getSingleton().getByName(materialName);
tex=mat->getTechnique(0)->getPass(0)->getTextureUnitState(0);
tex->setTextureName(
dshowMovieTextureSystem->getMovieTexture()->getName());
delete dshowMovieTextureSystem;
if (Ogre::MaterialManager::getSingleton().resourceExists(materialName))
{
Ogre::MaterialPtr mat;
Ogre::TextureUnitState* tex;
mat=Ogre::MaterialManager::getSingleton().getByName(materialName);
tex=mat->getTechnique(0)->getPass(0)->getTextureUnitState(0);
tex->setTextureName(Ogre::String(""));
}
}
If anyone can help me to solve this i'll be much pleased...