Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Pages: [1] 2 3

Author Topic: Ogre3D TheoraPlugin  (Read 14484 times)

josch

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 18
    • View Profile
Ogre3D TheoraPlugin
« on: September 01, 2005, 10:42:31 AM »

I tried to integrating your TheoraPlugin into our application, which so
far seems to works, but I can't see a thing.
That is, the scene in my test program is obscured, then - obviously when
the video is ended - it appears again.
Since I can't get your CEGUI demo to run and, frankly, I couldn't
understand the source code of the demo, I now like to ask, what I have
to do to display the video.
Ogre: 1.0.4
CEGUI: 0.3.0
TheoraPlugin: CVS

First the demo wouldn't compile, so I changed some things, have to
lookup what this was, but now the demo just crashes without doing much.

Bye JoSch

PS: pjcast, if you like you can also contact me in our IRC channel #pantheon on Quakenet.
Logged
eam Pantheon Coder
http://www.team-pantheon.de
- Maintainer of Linux port
- Multimedia stuff

Anonymous

  • Guest
Ogre3D TheoraPlugin
« Reply #1 on: September 01, 2005, 11:18:43 AM »

I don't really have to much time for much IRC chat (well.. besides the Ogre IRC chat occasionally). I think your problem can be handled here very quickly. I don't think you stated yet... But what compiler/OS are you using?

Also, you'll need to tell me the errors the CEGUI demo gave you, and what you changed.
Logged

josch

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 18
    • View Profile
Ogre3D TheoraPlugin
« Reply #2 on: September 01, 2005, 11:55:45 AM »

I changed the following:

- configure.ac:
  PKG_CHECK_MODULES(CEGUI, CEGUI)
  PKG_CHECK_MODULES(CEGUIOGRE, CEGUI-OGRE)
- Makefile.am:
  Added CEGUI(OGRE)_CFLAGS and CEGUI(OGRE)_LIBS

The program starts up and then:
...
Texture: _cegui_ogre_0: Loading 1 faces(PF_A8R8G8B8,32x32x1) with 0 generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
Texture: _cegui_ogre_1: Loading 1 faces(PF_A8R8G8B8,128x128x1) with 0 generated mipmaps from Image. Internal format is PF_A8R8G8B8,128x128x1.
Memory access error

Basically I copied your demo code, but my demo doesn't crash.

But what I want to know how I should address the texture, resp. where the texture is displayed.


Bye JoSch
Logged
eam Pantheon Coder
http://www.team-pantheon.de
- Maintainer of Linux port
- Multimedia stuff

Anonymous

  • Guest
Ogre3D TheoraPlugin
« Reply #3 on: September 01, 2005, 12:33:05 PM »

Quote from: "josch"
I changed the following:

- configure.ac:
  PKG_CHECK_MODULES(CEGUI, CEGUI)
  PKG_CHECK_MODULES(CEGUIOGRE, CEGUI-OGRE)
- Makefile.am:
  Added CEGUI(OGRE)_CFLAGS and CEGUI(OGRE)_LIBS

But what I want to know how I should address the texture, resp. where the texture is displayed.


Ok, I gather you are using Linux then.. What gcc version? And I don't understand which change you made to PKG_CHECK... you changed it to the top one? You shouldn't need to do that. I hope you have a recent video plugin checkout, as I fixed the linux build scripts recently. So, please do a fresh checkout of ogreaddons/videoplugin.

It sounds like you are not calling if(mClip) mClip->blitFrameCheck(); every frame (which updates the texture). just a crazy guess though. The easiest way forme to help you is to get the Demo going first, because it is known to work. And I can assess the situation better once I know if it is the plugin, or your code.
Logged

josch

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 18
    • View Profile
Ogre3D TheoraPlugin
« Reply #4 on: September 01, 2005, 01:29:56 PM »

Quote from: "Anonymous"

Ok, I gather you are using Linux then.. What gcc version? And I don't understand which change you made to PKG_CHECK... you changed it to the top one? You shouldn't need to do that. I hope you have a recent video plugin checkout, as I fixed the linux build scripts recently. So, please do a fresh checkout of ogreaddons/videoplugin.

I have fetched it last week. I changed the PKG_CHECK because otherwise the linker couldn't find the CEGUI libs.

Quote

It sounds like you are not calling if(mClip) mClip->blitFrameCheck(); every frame (which updates the texture). just a crazy guess though. The easiest way forme to help you is to get the Demo going first, because it is known to work. And I can assess the situation better once I know if it is the plugin, or your code.

I do in a frame listener.


Bye JoSch
Logged
eam Pantheon Coder
http://www.team-pantheon.de
- Maintainer of Linux port
- Multimedia stuff

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Ogre3D TheoraPlugin
« Reply #5 on: September 01, 2005, 02:48:06 PM »

Please, do a clean checkout of the plugin from cvs. As I said, I made some changes regarding the linux build. And, it rebuilds really quickly, so this should be painless.

Also, I would really like to know what gcc version your our using.
Logged

josch

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 18
    • View Profile
Ogre3D TheoraPlugin
« Reply #6 on: September 02, 2005, 12:52:27 AM »

gcc version is 3.3.5.
Logged
eam Pantheon Coder
http://www.team-pantheon.de
- Maintainer of Linux port
- Multimedia stuff

josch

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 18
    • View Profile
Ogre3D TheoraPlugin
« Reply #7 on: September 02, 2005, 02:16:01 AM »

I recompiled the plugin, but  there is a little problem (I fixed that locally):
- You left a merge conflict mark in TheoraMovieClip.h, lines 45ff.
- The same on CEGUI_TheoraDemo/src/Makefile.am, lines 9ff and CEGUI_TheoraDemo/configure.ac, lines 36ff.

The demo still crashes.
Logged
eam Pantheon Coder
http://www.team-pantheon.de
- Maintainer of Linux port
- Multimedia stuff

josch

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 18
    • View Profile
Ogre3D TheoraPlugin
« Reply #8 on: September 02, 2005, 08:56:57 AM »

Ok, now I got my test program running and it shows some video.
If I git it right that the texture is created by the video plugin and and you have display the texture somewhere, for example by painting it on a StaticImage. Is this correct?

In your demo, the texture is fetched by its name or, if not existing, will be created on the fly. Again, is this correct?

Now, for the sound ;-)


Bye JoSch
Logged
eam Pantheon Coder
http://www.team-pantheon.de
- Maintainer of Linux port
- Multimedia stuff

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Ogre3D TheoraPlugin
« Reply #9 on: September 02, 2005, 04:20:46 PM »

Quote from: "josch"
I recompiled the plugin, but  there is a little problem (I fixed that locally):
- You left a merge conflict mark in TheoraMovieClip.h, lines 45ff.
- The same on CEGUI_TheoraDemo/src/Makefile.am, lines 9ff and CEGUI_TheoraDemo/configure.ac, lines 36ff.

The demo still crashes.


 :oops: Didn't know I left a merge conflict in there.. I'm too advanced with cvs yet. Are you saying that during an cvs upate it was unable to merge properly? I usually do a clean cvs checkout myself.. But will keep an eye out in the future, and try to avoid that problem.

Awesome you got some video showing up :D
Ogre has a few different things that apply to materials.. There is the material itself, a technique, a pass, and a texture unit. Now, the plugin will create a textureunit itself. It does not create/destroy materials (even though there is a method named destroyAdvancedMaterial or what not)...

Now, the CEGUI demo creates a material in the movie logic class. Well, since the CEGUI demo always uses the same material to play videos on (even when switching videos), it first checks to see if the material exists. If it doesn't, an exception is thrown from Ogre, which the MovieLogic class catches and then creates a material if one was not found. It also creates the one technique and one pass. Then it creates a textureunit. It also set some state values for the plugin to use when it creates the video texture: void MovieLogic::playMovie( const String& movieName ) of CEGUI demo.

 Now, as I said, the TextureUnitSTate (tus) is created in the CEGUI demo.. though, it is deleted from the Plugin.. Now, why I did this, I cannot really recal right this moment, I think it was related to how the material serialiser worked (as my plugin also works through material scripts). I'll have to look into that.

Feel free to ask anymore questions if you still have problems, or are still unsure how it works.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Ogre3D TheoraPlugin
« Reply #10 on: September 02, 2005, 04:56:04 PM »

I forgot to ask... what  did you do to get video working in your app? I think this will help me fix the problem, or prevent others from making the same mistake. And is the CEGUI demo still crashing?
Logged

josch

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 18
    • View Profile
Ogre3D TheoraPlugin
« Reply #11 on: September 03, 2005, 01:14:27 AM »

Well, you really can't debug my thought processes.
I just was thinking you give the texture name and then, miracally, the video shows up. I just wasn't realizing that you need a surface for the texture to apply to.
You should write a tutorial, manual, explanantion, so that one can use this fine tool.


Bye JoSch
Logged
eam Pantheon Coder
http://www.team-pantheon.de
- Maintainer of Linux port
- Multimedia stuff

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Ogre3D TheoraPlugin
« Reply #12 on: September 03, 2005, 12:20:00 PM »

The actual process is very simple. The added complexity in the CEGUI demo comes from the integration with CEGUi static textures/events. And the use of sound. I plan to put up a wiki, which could definitely (and needs to) host some documentation/tutorial etc.

I will set the wiki up this weekend.
Logged

josch

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 18
    • View Profile
Ogre3D TheoraPlugin
« Reply #13 on: September 06, 2005, 02:36:08 PM »

BTW, is there any method for getting the play status of the clip?
It would really be nice, if one could check the status of the clip through some method in the associated class.
Logged
eam Pantheon Coder
http://www.team-pantheon.de
- Maintainer of Linux port
- Multimedia stuff

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Ogre3D TheoraPlugin
« Reply #14 on: September 06, 2005, 07:21:55 PM »

The current way to know what the clip is doing is remembering what you told it to do (play, pause, stop)...and when the movie stops by itself (either end of file/stream) it will send a notification to the app (via the TheoraMovieMessage class) if it registered itself (see CEGUI demo for example.

However, since it is a trivial thing, here you go...Here's a patch.. I've submitted to cvs.

Code: [Select]

Index: TheoraMovieClip.h
===================================================================
RCS file: /cvsroot/ogre/ogreaddons/videoplugin/TheoraVideo/include/TheoraMovieClip.h,v
retrieving revision 1.16
diff -u -r1.16 TheoraMovieClip.h
--- TheoraMovieClip.h 24 Aug 2005 18:26:51 -0000 1.16
+++ TheoraMovieClip.h 7 Sep 2005 03:09:37 -0000
@@ -137,6 +137,8 @@
  */
  void changePlayMode( eTexturePlayMode eMode );
 
+ eTexturePlayMode getPlayMode() { return mPlayMode; }
+
  /**
  @remarks
  You want audio? Then register an audio class that is derived
Logged
Pages: [1] 2 3