Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: Is there a Theora Plugin for Ogre 1.6  (Read 6354 times)

akrules

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 5
    • View Profile
Is there a Theora Plugin for Ogre 1.6
« on: October 12, 2008, 05:29:39 PM »

Hello,
I'm kinda new here and would like to know if there's any Theora Plugin for OGRE 1.6.
I need to bundle it with the Vorbis audio codec to enable sound and integrate both these plugins into a game engine.

I think the plugin pjcast made is for OGRE 1.4(correct me if i'm wrong)

Any help on where to start,how to start will be appreciated
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2653
    • View Profile
    • http://www.wreckedgames.com
Re: Is there a Theora Plugin for Ogre 1.6
« Reply #1 on: October 13, 2008, 06:53:24 AM »

Check the other topic and Ogre Addon forums. Someone has decided to make a rewrite of the current plugin. Last I heard, it didn't enable sound. Anyway, the plugin I had works for all 1.2+ versions of Ogre. However, the CEGUI demo works only with CEGUI 4.x IIRC (and for the renderer plugin is most compatible with Ogre 1.2).

Feel free to use the old or new, whatever works best for what you need. The new one claims a speed up in decoding.
Logged

akrules

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 5
    • View Profile
Re: Is there a Theora Plugin for Ogre 1.6
« Reply #2 on: October 14, 2008, 11:52:08 AM »

when you say new one,do you mean the one that Kreso is making?
Where can I find it?
Logged

akrules

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 5
    • View Profile
Re: Is there a Theora Plugin for Ogre 1.6
« Reply #3 on: October 14, 2008, 01:18:32 PM »

Never mind,I found it
:)
For anyone else who's looking for it, here it is :
                        http://www.ogre3d.org/wiki/index.php/TheoraVideoPlugin_Compiling

But now I can't get libtheora to compile/build on Visual Studio 2005 >:(
Getting a linker error which says:
                              1>LIB : fatal error LNK1181: cannot open input file '.\Debug_RTL_dll\bitwise.obj'
                        2>LINK : fatal error LNK1104: cannot open file 'libtheora.lib'
                              3>LINK : fatal error LNK1104: cannot open file 'libtheora.lib'

Any suggestions?
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2653
    • View Profile
    • http://www.wreckedgames.com
Re: Is there a Theora Plugin for Ogre 1.6
« Reply #4 on: October 15, 2008, 06:44:01 PM »

Those errors don't really say much. I can't really recall, but I'm almost sure that I included a precompiled libTheora in the project. But if not, you need Ogg SDK (Vorbis / Ogg) for headers / libs. You can also compile from source. You need libTheora. All these are fairly trivial to build under windows. After which, you need Ogre. Then, if paths are all correct, you should be able to at least build the Plugin_TheoraVideoPlugin.

Logged

akrules

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 5
    • View Profile
Re: Is there a Theora Plugin for Ogre 1.6
« Reply #5 on: October 15, 2008, 07:02:02 PM »

ok..
thanks pj..

i was able to compile everything succesfully finally but I cant get my demo working !

Is it necessary to include ExampleApplication.h ?? ExampleFrameListener.h?
What do they exactly do?? or Why are they needed??
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2653
    • View Profile
    • http://www.wreckedgames.com
Re: Is there a Theora Plugin for Ogre 1.6
« Reply #6 on: October 15, 2008, 07:40:52 PM »

You do not need those files. They are basically examples of how to construct a simple demo. All you really need are the small code tidbits from the demo and add it to any Ogre demo. basically, the code to get the movie texture instance, and the code to control (play stop) the video. The sound stuff is optional, as is the runtime creation of video files.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2653
    • View Profile
    • http://www.wreckedgames.com
Re: Is there a Theora Plugin for Ogre 1.6
« Reply #7 on: October 15, 2008, 07:42:03 PM »

Also, make sure you call the blitFrameCheck every loop to check for update. Also, you can look at the new theora video plugin & wiki in Ogre addons forum.
Logged

akrules

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 5
    • View Profile
Re: Is there a Theora Plugin for Ogre 1.6
« Reply #8 on: October 15, 2008, 07:51:51 PM »

alrite..now i've added this tid bit of code
      
Code: [Select]
TheoraVideoController* mVideoControl;
TheoraMovieClip* mClip;
Rectangle2D* rect;

mVideoControl = static_cast<TheoraVideoController*>
            (Ogre::ExternalTextureSourceManager::getSingleton().getExternalTextureSource("ogg_video"));

  if( !mVideoControl )
OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
"Error grabbing Plugin_TheoraVideoSystem. Added in plugins.cfg file?",
"MovieLogic::initialise");

        mVideoControl->setInputName( "..\\Screens\\Screen1\\apple.ogg" );
        mVideoControl->setPlayMode( TextureEffectPlay_ASAP );
        mVideoControl->setTextureTecPassStateLevel( 0, 0, 0 );

// Grab Our material, then add a new texture unit
MaterialPtr material = MaterialManager::getSingleton().getByName("Examples/TheoraVideoPlayer/Play");

//Create the material the first time through this method
if( material.isNull() ){
    material = MaterialManager::getSingleton().create("Examples/TheoraVideoPlayer/Play", "General");
}

material->getTechnique(0)->getPass(0)->createTextureUnitState();

mVideoControl->createDefinedTexture( "Examples/TheoraVideoPlayer/Play", "General" );

mClip = mVideoControl->getMaterialNameClip( "Examples/TheoraVideoPlayer/Play" );

if( mClip )
{
//mClip->setAudioDriver( pSoundClass->getAudioClip() );
//mClip->changePlayMode( TextureEffectPlay_ASAP );
}

if( !mClip )
//OGRE_EXCEPT( Exception::ERR_ITEM_NOT_FOUND, "Clip not found", "MovieLogic::playMovie" );

//******************************************************************************
// ADD VIDEO MATERIAL TO 2D RECTANGLE
       // Create background rectangle covering the whole screen
       rect = new Rectangle2D(true);
       rect->setCorners(-1.0, 1.0, 1.0, -1.0);
       rect->setMaterial("Examples/TheoraVideoPlayer/Play");

       // Render the background before everything else
       rect->setRenderQueueGroup(RENDER_QUEUE_BACKGROUND);

       // Use infinite AAB to always stay visible
       AxisAlignedBox aabInf;
       aabInf.setInfinite();
       rect->setBoundingBox(aabInf);

       // Attach background to the scene
      pCubeSceneNode->attachObject(rect);
   //******************************************************************************


But I'm getting a runtime error.
It stops at the line :-

Code: [Select]
mVideoControl->createDefinedTexture( "Examples/TheoraVideoPlayer/Play", "General" );
Unhandled exception at 0x01d8d8c6 in Game_Debug.exe: 0xC0000005: Access violation reading location 0xcccccccc.
This was the last line of debug.

And I've checked my material file is fine, also the video is at the proper place.

Does this error relate to the VideoPlugin or my code?
What could be wrong?
« Last Edit: October 15, 2008, 07:56:32 PM by akrules »
Logged