TheoraVideoClip and TexturePtr

xabila

01-05-2009 15:05:36

Hi,
I'm using the TexturePtr on the TheoraVideoClip in order to display the video on a CEGUI Window.
But the texturePtr width and height are wrong.

I' ve got 512*512 for a video : 360*287
And 2048*1024 for a 1280*982.

But set the texture on OgreObject don't seem to be a problem. But CEGUI is using the TExturePtr->getWith and getHeight
So i got this :


Any idea to solve that?
Thanks

Kreso

01-05-2009 19:08:32

yeah, I'm using the nearest power of two dimensions for the texture, so 257x257 video clip would be using a 512x512 texture.
In ogre I adjusted the texture matrix so the display card would stretch the texture coordinates to fit the video.

the old plugin used to scale each frame to the texture size which is a massive performance hit.
as for cegui, you can just create an imageset which subsamples the original texture and use that instead of the whole texture.

xabila

01-05-2009 19:12:59

Yes Good idea , i'm gonna try this
Thanks

xabila

01-05-2009 20:09:32

Something else,
Is it possible to add on API of the TheoraVideoClip the public method :
getTexturePtr()
getWidthSrc() and getHeightSrc() ;)

It could be cool, but i can understand if you don't want...

xabila

01-05-2009 20:49:30

So it's not far :


I changed on CEGUI :
textureImageSet->defineImage("RttTex", CEGUI::Point(0.0f, 0.0f), CEGUI::Size(clip->getWidthSrc(), clip->getHeightSrc()), CEGUI::Point(0.0f,0.0f));
//textureImageSet->defineImage("RttTex", CEGUI::Point(0.0f, 0.0f), CEGUI::Size(ceguiTex->getWidth(), ceguiTex->getHeight()), CEGUI::Point(0.0f,0.0f));

Kreso

02-05-2009 11:21:37

Something else,
Is it possible to add on API of the TheoraVideoClip the public method :
getTexturePtr()
getWidthSrc() and getHeightSrc() ;)

It could be cool, but i can understand if you don't want...


sure, I'll put it on my todo list! will be done soon.

xabila

02-05-2009 14:15:36

By the way this
void TheoraVideoClip::load(... on a .h is not allow on linux.
you shoud replace it by void load(...

And on TheoraVideoClip.cpp
i had to change that :
if (mTexture)
{
TextureManager::getSingleton().remove(mTexture);
}


by
if( !(mTexture.isNull()) )
{
mTexture.setNull();
TextureManager::getSingleton().unload( mName );
TextureManager::getSingleton().remove( mName );

}

Don't remember why ;)

Kreso

19-05-2009 17:24:49

Something else,
Is it possible to add on API of the TheoraVideoClip the public method :
getTexturePtr()
getWidthSrc() and getHeightSrc() ;)

It could be cool, but i can understand if you don't want...


I've implemented these functions (the names are different :P) check the latest SVN trunk revision;

I'm currently working on resolving the remaining stability issues and scheduling. Next stop: finish audio seeking sync;

xabila

19-05-2009 17:34:06

Ok thanks,
Don't forget the multi videos ;)

Kreso

19-05-2009 17:43:11

Ok thanks,
Don't forget the multi videos ;)


it's next on my todo list ;)