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 [4] 5

Author Topic: Using OpenAL with the plugin  (Read 17633 times)

Rossman

  • Regular
  • *
  • Karma: +0/-0
  • Posts: 30
    • View Profile
Using OpenAL with the plugin
« Reply #45 on: December 12, 2005, 07:32:57 PM »

So, you suggest attaching the movie to an overlay, with what exactly? Do you remember what the attach method for Theora is? Because I was looking through the demo, and I found a few things that I thought might be it, but they didn't work. And I really hope the sound with no image thing gets solved soon, and ya, I'm using cheer.ogg also.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Using OpenAL with the plugin
« Reply #46 on: December 12, 2005, 07:41:02 PM »

The attach thing is not in Theora. It is in Ogre and/or CEGUI. You are looking in the wrong place. You do not need to the plugin API to attach this to anything. Remember, all the plugin does is update the contents of a TextureUnit of a material. You created the material (as is the case of the CEGUI demo) in code or material script.

What you do with it is your own business. In the CEGUi demo, it is attached to a CEGUI static image. It can just as well be put to an Entity with Entity::setMaterialName("WhateverTheMaterialisNamed") or to the Ogre Overlay with OverlayElement::setMaterialName("WhateverTheMaterialisNamed")... And anyother Ogre Object's setMaterialName method.

As for the Video With no Sound. THis is not an issue of the plugin.. If the Demo works for you, then it is an issue with your code, which I cannot easily find myself.

Sorry if I sound a little harse, but, I have spent all day working on various plugin/demo related things, and am a bit tired. Not to come off bad, but, I have said these things before too.  :?
Logged

Rossman

  • Regular
  • *
  • Karma: +0/-0
  • Posts: 30
    • View Profile
Using OpenAL with the plugin
« Reply #47 on: December 12, 2005, 07:46:51 PM »

Really, I'm sorry if I asked the same questions or anything! Didn't mean to get you mad! I just thought that the playMovie method would play the movie, but it only plays the sound. I then thought that I had to do something first, before playing the movie, but I'm not sure. I'll work on it tomorrow, and get back to you if I find a solution. Maybe put it in an updateing function? Again, really sorry to bother you. Thanks for all your help.  :)
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Using OpenAL with the plugin
« Reply #48 on: December 12, 2005, 09:09:29 PM »

Its not really that you are bothering me  :) , just that I have said (and not just in this thread), and you are not the first either.. that it is just a material and can be applied to anything.

As for the playmovie, it does play both sound and video. As for the problem you and M&M are having, I can only speculate I do not share that problem, and the demo works for both of you (IIRC), so there must be some subtle thing missing from your code.
Logged

Anonymous

  • Guest
Using OpenAL with the plugin
« Reply #49 on: December 13, 2005, 06:12:21 AM »

Sorry if this is a dumb question, but what would the material be called? Would it be mMovieControl->getTextureName? Or something else I missed? Again, very sorry if this has been asked before, it's pretty hard to search for my exact problem. But thanks in advance!   :D
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Using OpenAL with the plugin
« Reply #50 on: December 13, 2005, 08:45:27 AM »

IN the CEGUI demo the material name is: Example/TheoraVideoPlayer/Play, which is define at MovieLogic.cpp line 190. IIRC, there is no way to get the Material Name from the plugin (though, I could be wrong), you just have to know what the name you used was. You can, however, get the name of the movie file with THeoraMovieCLip::getMovieName();
Logged

Rossman

  • Regular
  • *
  • Karma: +0/-0
  • Posts: 30
    • View Profile
Using OpenAL with the plugin
« Reply #51 on: December 13, 2005, 11:39:32 AM »

You've been more help than I could've asked for! I wish everyone was as helpful as you! Thanks again, hopefully I don't run into any problems!  :D
Logged

M&M

  • Regular
  • *
  • Karma: +0/-0
  • Posts: 30
    • View Profile
    • http://www.blueprintgames.com
Using OpenAL with the plugin
« Reply #52 on: December 13, 2005, 02:45:11 PM »

Quote
but what would the material be called? Would it be mMovieControl->getTextureName? Or something else I missed?

TheoraMovieClip::getMaterialName()

Rossman, let me know if you get that Overlay thing working. I've tried all the things I could think off to get audio AND video working but I keep getting a black screen like you.
Logged
url=http://www.blueprintgames.com/][/url]

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Using OpenAL with the plugin
« Reply #53 on: December 13, 2005, 06:02:56 PM »

Have either of you looked at the TheoraVideoGui demo? It uses overlays. The only problem with it is that is still uses the old Ogre Gui stuff and resource stuff and the OpenAL is a little out of date. Besides that, all the overlay stuff there applies still.
Logged

Rossman

  • Regular
  • *
  • Karma: +0/-0
  • Posts: 30
    • View Profile
Using OpenAL with the plugin
« Reply #54 on: December 13, 2005, 07:39:42 PM »

Where would this TheoraVideoGui demo be?  :?:
Logged

M&M

  • Guest
Using OpenAL with the plugin
« Reply #55 on: December 13, 2005, 10:28:18 PM »

Quote from: "pjcast"
Have either of you looked at the TheoraVideoGui demo? It uses overlays. The only problem with it is that is still uses the old Ogre Gui stuff and resource stuff and the OpenAL is a little out of date. Besides that, all the overlay stuff there applies still.

yeah, i tried but the outdated ogre made it alittle hard to understand. I suppose I'll give it another go
Logged

Rossman

  • Regular
  • *
  • Karma: +0/-0
  • Posts: 30
    • View Profile
Using OpenAL with the plugin
« Reply #56 on: December 14, 2005, 01:17:54 PM »

Well, I tried this:

Code: [Select]
Ogre::Overlay* movie = OverlayManager::getSingleton().getByName("Example/TheoraVideoPlayer/Play");

movie->show();


and it crashes with no error message, and nothing unusual in the log. I thought you said that the material was Example/TheoraVideoPlayer/Play, and it can be applied to a overlay, no? I did this is the createScene method. Any ideas?  :cry:
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Using OpenAL with the plugin
« Reply #57 on: December 14, 2005, 01:45:36 PM »

OverlayManager::getSingleton().getByName does not return a material at all.. It returns an Overlay element. I said create an overlay element, or if one is already created (if it was created in an overlay script) use that method to get at it, then use setMaterialName("Example... to set the material. Now, of course this has to be done in the correct order. Youc cannot assign the material until after it is created.
Logged

Rossman

  • Regular
  • *
  • Karma: +0/-0
  • Posts: 30
    • View Profile
Using OpenAL with the plugin
« Reply #58 on: December 14, 2005, 07:31:26 PM »

Wow, you've been a crazy great help to me! It was insane how nice and polite you were, in light of my stupid questions! But here, I got fullscreen autoplay video working in the demo posted in this thread, which is pretty much the same as the CEGUI_TheoraDemo, but with OpenAL! Yay!

So, here's the block of code I used:

Code: [Select]

OverlayManager& omgr = OverlayManager::getSingleton();

Ogre::Overlay* movie = OverlayManager::getSingleton().getByName("VideoOverlay1");
movie->show();

OverlayElement* vidContainer;
vidContainer = omgr.getOverlayElement("movieElement");

mMovieControl->playMovie("cheer.ogg");

vidContainer->setMaterialName("Example/TheoraVideoPlayer/Play");


And the movieElement that it's taking is a overlay file that looks like this:

Code: [Select]

VideoOverlay1
{
zorder 500
container Panel(moviePanel)
{
element Panel(movieElement)
{
metrics_mode pixels
top 0
left 0
width 800
height 600
}
}
}


which is, of course, in the directory that's included on my resource file! So it grabs the element, and puts a texture to it. Pretty easy when you think about it! I think it needs a CEGUI setup running at the same time, as when I don't use the createDemoWindows method in the demo, it doesn't work. I need to test more, could just be an Ogre thing.

Thanks sooooo much for the help. Now I gotta stop it at a certain frame, but that SHOULD be easy. Thanks, hope this helps someone.  :D  :D  :D  :D

But a small problem, the sound only syncs up with the video at the beginning, then slowly lags behind. Common problem? Or weird bug?  :?:
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Using OpenAL with the plugin
« Reply #59 on: December 15, 2005, 09:27:12 AM »

Glad you got some working results :D

As far as the CEGUI thing, it is problably just that I init some of the MovieLogic stuff in that method because the demo needs some CEGUI stuff setup before I fully init the class. Because it uses a CEGUI listbox that needs to be loaded really.

As far as sync goes. Certain movies, for whatever reason, do not sync up properly in my plugin - I am not sure why, as they play fine in VLC. But, usually, it is not drifting out of sync, it is just always out of sync. This is a bug somewhere, I am just not sure... And, as most movies play fine, I have not spent the time identifying it - but I definately acknowledge it :D

Now, I have also seen that a long video will play in sync and being smooth during plyback, but after a couple minutes of playback, while still being in sync, the video starts to quickly jump every couple seconds... This is something that is difficult to debug, but I think it is a matter of not decoding theora fast enough.. not sure on that though.
Logged
Pages: 1 2 3 [4] 5