SFML community forums

General => SFML projects => Topic started by: zorexx on March 25, 2011, 05:07:27 am

Title: sfTheora 1.4 - Play videos in SFML
Post by: zorexx on March 25, 2011, 05:07:27 am
What is sfTheora?
sfTheora (previously known as SFMLTheora) is a static library for loading and playing Theora videos on SFML with the help of libtheoraplayer (http://libtheoraplayer.sourceforge.net/ (http://libtheoraplayer.sourceforge.net/)).

GitHub repository:
https://github.com/eXpl0it3r/sfTheora (https://github.com/eXpl0it3r/sfTheora)

Hand over to new maintainer:
After a long period of inactivity, I have decided to hand over this project to eXpl0it3r (https://en.sfml-dev.org/forums/index.php?action=profile;u=3414).
Please checkout the GitHub repository for the latest updates on this project.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on March 27, 2011, 03:24:43 am
Added a short tutorial and a screenshot.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: Ceylo on March 27, 2011, 11:57:54 am
Why do you use a pointer for your video object?
And couldn't Init() work be automatically done in the constructor?
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on March 27, 2011, 12:56:19 pm
You don't have to use a pointer, you can do
Code: [Select]
SFMLTheora::Video testVid;
as well. I just used pointer because I was testing whether it works that way or not, it really doesn't matter.

As for Init(), it's so that you can check if things are constructed properly, if they're not, Init() will return a false, else it'll return a true.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: Ceylo on March 27, 2011, 01:00:07 pm
Maybe you could (and should) do that init stuff in LoadClip(), so that users can still whether something failed and don't have to call Init() first.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on March 27, 2011, 01:27:41 pm
Good idea, I'll leave Init() there for flexibility purpose, but in LoadClip, I changed:
Code: [Select]
if (vidManager_ == NULL || ifaceFactory_ == NULL)
  return false;


to

Code: [Select]
if (vidManager_ == NULL || ifaceFactory_ == NULL) {
  Release();
  if (!Init())
    return false;
}


Thanks for your feedback!  :D

Re-uploaded updated SFMLTheora as SFMLTheora 1.1.1.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: TechRogue on March 30, 2011, 11:58:46 pm
Does this also support audio? I only see a call to Draw().
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on March 31, 2011, 04:13:42 am
Yes, it supports audio (using sf::SoundStream).

Added Play(), Pause(), Stop(), and Seek() to the Video class.
Changed version to 1.2.0.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on April 13, 2011, 12:03:22 am
Hi, No matter what I do the instance of
auto viddy = std::make_shared<SFMLTheora::Video>();
allways causes a heap corruption when shared_ptr is being deleted.

I am using sfml2 and 1.2 version of your library.
Any suggestions?

I had to add OnSeek again just like the bugfix from 1.0
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on April 13, 2011, 08:06:24 pm
Hi, I've never used std::make_shared as well as the auto keyword before, so I'm not very familiar with them.

But, according to the msdn library:
Quote
Since variables with auto storage class are not initialized automatically, you should either explicitly initialize them when you declare them, or assign initial values to them in statements within the block.


The Video class will not be initialized.
In the Release function:
Code: [Select]
if (ifaceFactory_ != NULL) {
  delete ifaceFactory_;
  ifaceFactory_ = NULL;
}

if (vidManager_ != NULL) {
  delete vidManager_;
  vidManager_ = NULL;
}


If the class is not initialized, the ifaceFactory_ and vidManager_ would not be set as NULL, so they will be deleted even if they're not created yet(by the Init function).

Calling the Init function before Release should automatically solve this problem, but in my code, I have this line as the first line in my Init function:
Code: [Select]
Release();

Can you try removing that line and tell me if it works that way?

I included that line so that there will not be a memory leak even if you forgotten to call Release when reusing the same variable for a new video (calling Init would automatically Release the previous video if it exists).

By the way, is there any specific reason for you to be using the auto keyword and std::make_shared?


Quote
I had to add OnSeek again just like the bugfix from 1.0

OnSeek? Where do you add it to?
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: Laurent on April 13, 2011, 09:48:01 pm
Quote
Hi, I've never used std::make_shared as well as the auto keyword before, so I'm not very familiar with them.

He's using features of the new C++ standard:
- "auto" is when you don't want to bother with the type of a variable, it deduces it from its initilization expression ; it has nothing to do with the current meaning of the auto keyword, that you found in the MSDN and which is deprecated
- "std::make_shared" constructs a std::shared_ptr ; it's slightly more optimized than calling "std::shared_ptr<T>(new ...)" since it can allocate both the object and the reference counter with a single call
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on April 14, 2011, 05:46:15 am
Oh. Thanks for clearing things up, Laurent.
I tried reproducing the error, I replaced
Code: [Select]
testVid = new SFMLTheora::Video();
if (testVid == NULL)
  return 1;


with

Code: [Select]
auto testVid = std::make_shared<SFMLTheora::Video>()

I replaced the line
Code: [Select]
delete testVid;
with
Code: [Select]
testVid->Release;

and the code ran smooth without heap corruption.

I reread your post and noticed you mentioned
Quote
allways causes a heap corruption when shared_ptr is being deleted


I suspect what you did was replacing
Code: [Select]
delete testVid;
with
Code: [Select]
delete testVid.get();
instead.

I tried doing that and I got the heap corruption you're talking about.
After some reading, I found that a shared_ptr doesn't need to be deleted as it will be deleted when it goes out of scope, reassigned, or resetted.
The problem here is that, it is deleted twice: Once when you call delete testVid.get(); And once more when testVid goes out of scope(at the end of your program), since the pointer isn't set to NULL.

So the correct way to use it is to either totally skip the deleting part, or replace it with testVid->Release().



Anyway, I just remembered what happened to the OnSeek function, here's the story:
It was when I was making some major changes to the code, I found this OnSeek function that isn't used at all, so I thought it was just some mistake and removed it, woops. xD

Anyway, I've uploaded SFMLTheora 1.2.1 which contains the OnSeek function, thanks for notifying me about this.  :)
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on April 14, 2011, 03:47:56 pm
Hi, thanks for fixing the onseek thing.

Actually I wasnt deleting shared_ptr. I know that it doesnt need to be deleted manually. What I meant by it being deleted was the shared_ptr simply going out of scope.

Heres my code to play videos, I still get the heap corruption :(

Code: [Select]
bool PlayVideo(std::string name)
{
auto viddy = std::make_shared<SFMLTheora::Video>();
if(!viddy)return false;
viddy->LoadClip(name);
//viddy->SetX(0);
//viddy->SetY(0);
//GLR->GetMainWindow()->UseVerticalSync(true);

bool result = true;
bool stopvideo = false;

while(!viddy->GetVideoClip()->isDone())
{
sf::Event sfEvent;
while(GLRenderer::GetInstance()->GetMainWindow()->PollEvent(sfEvent))
{
 if(sfEvent.Type == sf::Event::Closed){result = false; stopvideo = true; break;}

 if((sfEvent.Type == sf::Event::KeyPressed) && (sfEvent.Key.Code == sf::Key::Escape))
 {
 viddy->GetVideoClip()->stop();
 viddy->GetVideoClip()->setAudioGain(0.0f);
 result = true;
 stopvideo = true;
 break;
 }

 if ((sfEvent.Type == sf::Event::KeyPressed) && (sfEvent.Key.Code == sf::Key::F12))Screenshot();
}

if(stopvideo)break;

viddy->Update(GLRenderer::GetInstance()->GetMainWindow()->GetFrameTime());
viddy->Resize(IniOptions::GetInstance()->window_width, IniOptions::GetInstance()->window_height);
GLRenderer::GetInstance()->GetMainWindow()->Clear();
GLRenderer::GetInstance()->GetMainWindow()->Draw(*viddy);
GLRenderer::GetInstance()->GetMainWindow()->Display();
}

//if(!options.vsync)GLR->GetMainWindow()->UseVerticalSync(false);
return result;
}
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on April 14, 2011, 04:03:03 pm
That's weird, I tried rewriting a similar piece of code:
Code: [Select]
int main()
{
  sf::RenderWindow sfApp(sf::VideoMode(800, 600, 32), "SFML Window");

  sfApp.UseVerticalSync(true);

  auto testVid = std::make_shared<SFMLTheora::Video>();
  if (!testVid)
    return 1;

  testVid->LoadClip("bunny.ogg");

  bool stopVideo = false;

  while (!testVid->GetVideoClip()->isDone()) {
    sf::Event sfEvent;
    while (sfApp.GetEvent(sfEvent)) {
      if (sfEvent.Type == sf::Event::Closed)
        sfApp.Close();

      if ((sfEvent.Type == sf::Event::KeyPressed)) {
        switch (sfEvent.Key.Code) {
          case sf::Key::Escape:
            {
              testVid->GetVideoClip()->stop();
              testVid->GetVideoClip()->setAudioGain(0.0f);
              stopVideo = true;
              break;
            }

          case sf::Key::F12:
            {
              sf::Image screen = sfApp.Capture();
              screen.SaveToFile("screenshot.png");

              break;
            }

          case sf::Key::Space:
            {
              testVid->TogglePause();
              break;
            }
        }
      }
    }

    if (stopVideo)
      break;

    testVid->Update(sfApp.GetFrameTime());
    testVid->Resize(800.0f, 600.0f);

    sfApp.Clear();

    sfApp.Draw(*testVid);

    sfApp.Display();
  }

  return EXIT_SUCCESS;
}


But there's no heap corruption, maybe it has something to do with sfml2?
Can you try using new and delete, or just plain SFMLTheora::Video viddy(without pointers), and see if it works that way?


By the way, please use viddy->IsDone() and viddy->Stop() instead of viddy->GetVideoClip()->... (available since 1.2 to avoid syncing problems)
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on April 14, 2011, 04:44:21 pm
Already tried normal new/delete and guess what running it of the stack causes stack corruption.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on April 14, 2011, 04:48:40 pm
viddy->Stop does not exist?
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on April 14, 2011, 05:02:00 pm
It does.

Did you replace all the SFMLTheora files with the 1.2.1 version?

Maybe you left out something? (Maybe this is the cause of the heap corruption?)
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on April 14, 2011, 07:19:45 pm
Ah yes your exactly right. I somehow messed up the folder. Deleted everything and used 1.2.1 and it doesnt cause any heap errors.

However now there seems to be some weird audio skipping. It kind of stutters.
Although when I restart pc it works first time perfect and the second time starts stuttering.

Do I need to call release or something?
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on April 15, 2011, 04:54:53 am
You shouldn't need to.

Is the audio still in sync? Or does it goes out of sync?

Are you using the same code you posted earlier?
Does the example code works properly? If it does try replacing the bunny.ogg with your own video. Else try using the normal new delete method or SFMLTheora::Video without dynamic memory allocation.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on April 15, 2011, 10:29:42 am
Code: [Select]
bool PlayVideo(std::string name)
{
auto viddy = std::make_shared<SFMLTheora::Video>();
if(!viddy)return false;
viddy->LoadClip(name);
//viddy->SetX(0);
//viddy->SetY(0);
GLRenderer::GetInstance()->GetMainWindow()->EnableVerticalSync(true);

bool result = true;
bool stopvideo = false;

while(!viddy->IsDone())
{
sf::Event sfEvent;
while(GLRenderer::GetInstance()->GetMainWindow()->PollEvent(sfEvent))
{
 if(sfEvent.Type == sf::Event::Closed){result = false; stopvideo = true; break;}

 if((sfEvent.Type == sf::Event::KeyPressed) && (sfEvent.Key.Code == sf::Key::Escape))
 {
 viddy->Stop();
 //viddy->SetAudioGain(0.0f);
 result = true;
 stopvideo = true;
 break;
 }

 if ((sfEvent.Type == sf::Event::KeyPressed) && (sfEvent.Key.Code == sf::Key::F12))Screenshot();
}

if(stopvideo)break;

viddy->Resize(IniOptions::GetInstance()->window_width, IniOptions::GetInstance()->window_height);
viddy->Update(GLRenderer::GetInstance()->GetMainWindow()->GetFrameTime());
GLRenderer::GetInstance()->GetMainWindow()->Clear();
GLRenderer::GetInstance()->GetMainWindow()->Draw(*viddy);
GLRenderer::GetInstance()->GetMainWindow()->Display();
}

if(IniOptions::GetInstance()->vsync)GLRenderer::GetInstance()->GetMainWindow()->EnableVerticalSync(true);
else GLRenderer::GetInstance()->GetMainWindow()->EnableVerticalSync(false);

return result;
}


That is my code. Can you please test the library with sfml2. A lot of people use sfml2 and I hope this library will provide support for both sfml1 and sfml2.

I tried other video files and it still stutters. You can barely hear the audio just click click cluck click. I tried without dynamic memory and it still behaves the same
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: WitchD0ctor on April 15, 2011, 10:52:16 am
I think i had the same problem as you when i tried using the sfml audio module to provide sound, if you use the standard openAL that the theora playback lib comes with it will avoid that problem, but you wont be able to hear any other music/sounds that use sfml's stuff,
to fix it you just have to look in the openAL sound factory that it libtheora playback comes with and remove an openal init call.

Hope this helps
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on April 15, 2011, 11:27:59 am
Hey can you please elaborate on that? I cant find that openal init code.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on April 15, 2011, 06:23:51 pm
Hi, I just tried it with sfml2. Here's my results:
1st test: Yes, there's problem with the audio.
Then I went out, and when I came back and ran it again:
2nd test: No problem at all.
Ran it again:
3rd test: The problem came back.
4th test: The problem is gone.
5th test: No problem.
Made some changes to the code, tested for another 5 times (the same code), no problem.

I've just uploaded the latest code, version 1.2.2, try that, it may or may not solve the problem, either way, please let me know the results. :)
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on April 15, 2011, 07:25:35 pm
Nope it still stutters for me with the latest update :(
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on April 15, 2011, 07:46:47 pm
That's odd, I tried running it again:
1st test: Problem occurs.
2nd test: No problem.
3rd test: No problem.

As you can see, it is occurring rather randomly for me, does it happen every time you run yours? Or once in a while like mine?
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on April 15, 2011, 08:09:31 pm
Every time, unless I restart computer in that case it runs fine one time.
Have you tried other videos?
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: WitchD0ctor on April 15, 2011, 08:24:26 pm
in OpenAL_AudioInterface.cpp

you'll find this line,

Code: [Select]
gDevice = alcOpenDevice("");


comment this out
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on April 15, 2011, 09:58:00 pm
I found that file in the demos folder? I dont think its even part of the library.
Anyway I tried it and it did not fix anything sadly.

Its weird because sfmlTheora 1.0 worked perfect with sfml2.
So either something went wrong with sfmlTheora or sfml2.

I am using same folder for libtheora and theoraplayer as I did with 1.0
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on April 16, 2011, 06:47:41 am
Hmm, I suspect it has something to do with the syncing, so I went and check, well, it does go out of sync for a while (bout a second or less) when you seek, so I thought maybe it has something to do with that.

I fixed that and uploaded it as 1.2.3, tested it with 2 videos and there's no audio stuttering, however, when I tried testing it with 1.2.2, there's also no audio stuttering, it really occurs very randomly for me. Please try downloading 1.2.3 and see if it still occurs.

One more thing, try replacing the openal32.dll and libsndfile-1.dll with the new one (In the SFMLTheora 1.2.3 folder or the sfml2 extlibs folder). I forgotten to replace them when I switched over to sfml2, since the 2 dlls changed since sfml 1.6 (there's a big difference in file size).
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on April 16, 2011, 11:22:08 am
Hmm well it still stutters. But you know whats weird. Your sample application also stutters. I am begging to think this must be an audio driver issue so I cleaned out my drivers and reinstalled hoping it would fix it. But nope.

I dunno what else to try. The ogg files play fine with a video player just not with your library :(
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on April 16, 2011, 11:43:53 am
Can you try it with the SFMLTheora 1.0.1 which is still available from the previous thread and see if it still works with the old one?
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on April 16, 2011, 12:03:14 pm
1.0.1 works perfect. Tbh I think I will stickwith it since I dont really need pause functionality. But if the newest one will get fixed that would be awesome.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on April 16, 2011, 12:58:25 pm
Alright, I'll try to fix it meanwhile. Going to take a look at 1.0.1 again and see if I can find anything that might be the cause. ;)
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on April 16, 2011, 01:35:34 pm
Can you try this:
http://hotfile.com/dl/114624944/0818ce1/SFMLTheoraTesting.zip.html

I removed the Play, Pause, and Stop which are inherited from sf::SoundStream.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on April 16, 2011, 03:28:26 pm
That stutters as well.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on April 16, 2011, 04:13:53 pm
Can you try commenting out everything in the OnSeek function and see if it still stutters?
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on April 16, 2011, 04:28:52 pm
Yes that fixed it awesome  :D
Hooray!
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on April 16, 2011, 05:05:19 pm
Awesome, I'll update the code and upload it as 1.2.4.
Thanks for helping me to fix this bug.  :D

Edit: Uploaded as 1.2.4.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on April 17, 2011, 11:42:02 am
Lol now there is another problem.
Memory leak is caused when allocating a video

{314425} normal block at 0x0C6DD638, 32 bytes long.
 Data: <./data/video/log> 2E 2F 64 61 74 61 2F 76 69 64 65 6F 2F 6C 6F 67
{314424} normal block at 0x0C6DD5F0, 8 bytes long.
 Data: <  m     > E8 D4 6D 0C 00 00 00 00
{314421} normal block at 0x0C6DD4E0, 44 bytes long.
 Data: <`   x  X  m 8 m > 60 19 1C 00 78 F5 AF 58 F0 D5 6D 0C 38 D6 6D 0C
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on April 17, 2011, 12:24:36 pm
>.<
How do you trigger that error? (When does it occur?)
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on April 17, 2011, 12:27:44 pm
I tried commenting out my video and it no longer leaks.
As soon as I uncomment it, it produces those 2 leaks.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on April 17, 2011, 01:11:59 pm
Wait, I just remembered something, there was a memory leak all the while, it's caused by the libtheoraplayer (in the TheoraVideoClip class), but since it didn't really cause any problems, I just left it as is.
All we can do now is to wait for the libtheoraplayer author to fix it (the libtheoraplayer project seems to be inactive for sometime already though, so I'm not sure if it'll ever be fixed).
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on April 17, 2011, 03:47:04 pm
Do we have the source for it? Can we try fix it?
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on April 17, 2011, 03:55:16 pm
Yes, the source is available from the libtheoraplayer svn, but I'd prefer to just leave it for now. You can try fixing it if you want to. :)
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on May 22, 2011, 12:11:26 pm
As of the latest sfml2 svn, this library no longer works (white screen)
Also the onseek needs to be changed to unsigned int instead of float.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on May 24, 2011, 03:11:54 pm
Fixed:
http://hotfile.com/dl/118796640/bef0cbb/SFMLTheora127.zip.html

I basically just changed the OnSeek to sf::Uint32 instead of float.
And in the main function (in main.cpp), from plain GetFrameTime() to GetFrameTime() / 1000.0f.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on May 25, 2011, 10:55:05 pm
Hi, thanks a lot for having a look at it again,

Unfortunately it still doesnt work.
Still a blank screen.
Is there anything I should be doing differently when loading and playing video? Since something to do with timers has changed with SFML new version.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on May 26, 2011, 02:57:04 am
Does the example that comes along with it works?

The only thing I've changed outside the SFMLTheora code is in main.cpp:
From
Code: [Select]
testVid->Update(sfApp.GetFrameTime());

To
Code: [Select]
testVid->Update(sfApp.GetFrameTime() / 1000.0f);

I just tried compiling it without changing that line, the result I get is a blank screen with the audio still working.

If you've changed this line and it's still not working, could you try downloading my compiled version of the latest SFML2 from my blog? It's under the Other Downloads section.  :)
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on May 26, 2011, 09:14:48 pm
Its now fixed thank you :D
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on May 27, 2011, 04:30:21 am
You're welcome. Thanks for reporting the bug as well. :)
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: slotdev on June 24, 2011, 06:37:26 pm
This is probably a stupid question but does this work with SFML 2 ?
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on June 25, 2011, 03:51:52 pm
Yes, it does, but since SFML2 isn't a stable release yet and is constantly being updated and changed, the latest SFML 2 may not work with the latest version of SFMLTheora, if this occurs (if you find any bug), please let me know by posting on this forum, my blog, or email me, and I'll try to fix it asap.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: slotdev on June 25, 2011, 10:21:20 pm
Thanks for the reply.

I've tried to integrate this into my project, but on compilation it says:

Quote

1>c:\projects\testproject\SFMLTheora/Video.h(35) : fatal error C1083: Cannot open include file: 'theoraplayer/TheoraPlayer.h': No such file or directory


What am I missing?

Also, I need to static link the libraries, so I guess I have to recompile them?

Thanks
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on June 26, 2011, 05:34:56 am
SFMLTheora depends on libtheoraplayer, you'll need libtheoraplayer for SFMLTheora to work.

You can get it from the libtheoraplayer site, or if you're using MSVC++ 2010, you can get it from my site, the one on my site is compiled with MSVC++ 2010 Express, from the SVN:

http://www.zorexxlkl.com/p/other-downloads.html

If you need static libraries for libtheoraplayer, you'll have to recompile them yourself.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on August 18, 2011, 12:48:00 am
As of the latest sfml2, this is now again broken. It is to do with the sf::Image changes.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on August 18, 2011, 06:04:38 am
I'm overseas right now and don't have access to my files, but I'll fix it once I get back, thanks for reporting again. :)
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on August 22, 2011, 07:07:04 pm
Fixed:
http://hotfile.com/dl/127539502/a4676da/SFMLTheora128.zip.html
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: roosterkin123 on August 23, 2011, 10:43:01 pm
Your amazing, thanks it works again :D
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on August 24, 2011, 05:59:06 pm
No prob, thank you again for reporting.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on September 14, 2011, 07:44:35 am
Update!

SFMLTheora is now a static library, and you don't have to download libtheoraplayer anymore, I've included libogg.dll, libvorbis.dll, libtheora.dll, and libtheoraplayer.dll in a folder named "dependencies", just copy them into your project folder and you're set!
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: Richy19 on September 15, 2011, 08:54:36 pm
Any chance you can add cMake or Premake for us linux users?
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on September 15, 2011, 09:08:20 pm
Actually, I was thinking of doing so (CMake).
But then I'm not too sure if there's any interested linux users.
Since you mention it, I'll work on it asap.
Thank you for your interest.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on September 16, 2011, 12:38:31 am
CMake package available now.

I'm still (very) new to CMake (this is my first CMake script), so if there's any bugs or if you're having problems getting it to work, please let me know.

Also, if you're using the CMake package (rather than those built with Visual C++), you'll have to link libtheoraplayer to your project.

Download it here (also available on the 1st page):
http://ftp://ftp.drivehq.com/zorexxlkl/downloads/SFMLTheora-1.3.1-CMake.zip
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: Richy19 on September 16, 2011, 12:45:44 am
got this

Code: [Select]
Scanning dependencies of target SFMLTheora
[ 50%] Building CXX object CMakeFiles/SFMLTheora.dir/src/SFMLTheora/AudioInterface.cpp.o
/home/richy/libs/SFMLTheora-CMake/src/SFMLTheora/AudioInterface.cpp:32:39: fatal error: SFMLTheora/AudioInterface.h: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/SFMLTheora.dir/src/SFMLTheora/AudioInterface.cpp.o] Error 1
make[1]: *** [CMakeFiles/SFMLTheora.dir/all] Error 2
make: *** [all] Error 2
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on September 16, 2011, 06:04:31 am
Sorry, I think I left out a line.
I've updated it now, please re-download and see if it works.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: Richy19 on September 16, 2011, 01:44:58 pm
Code: [Select]
Scanning dependencies of target SFMLTheora
[ 50%] Building CXX object CMakeFiles/SFMLTheora.dir/src/SFMLTheora/AudioInterface.cpp.o
In file included from /home/richy/libs/SFMLTheora-CMake/src/SFMLTheora/AudioInterface.cpp:32:0:
/home/richy/libs/SFMLTheora-CMake/include/SFMLTheora/AudioInterface.h:38:47: fatal error: theoraplayer/TheoraAudioInterface.h: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/SFMLTheora.dir/src/SFMLTheora/AudioInterface.cpp.o] Error 1
make[1]: *** [CMakeFiles/SFMLTheora.dir/all] Error 2
make: *** [all] Error 2


Using the link on the OP
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: Richy19 on September 16, 2011, 03:32:19 pm
Figured out LibTheoraPlayer is a completelly diferent thing to libTheora so installed the right one.

But now I get:
Code: [Select]

make
[ 50%] Building CXX object CMakeFiles/SFMLTheora.dir/src/SFMLTheora/Video.cpp.o
/home/richy/libs/SFMLTheora-CMake/src/SFMLTheora/Video.cpp: In constructor ‘SFMLTheora::MemoryLoader::MemoryLoader(const string&, const void*, long unsigned int)’:
/home/richy/libs/SFMLTheora-CMake/src/SFMLTheora/Video.cpp:53:24: error: ‘memset’ was not declared in this scope
/home/richy/libs/SFMLTheora-CMake/src/SFMLTheora/Video.cpp:54:27: error: ‘memcpy’ was not declared in this scope
/home/richy/libs/SFMLTheora-CMake/src/SFMLTheora/Video.cpp: In member function ‘void SFMLTheora::MemoryLoader::Set(const string&, const void*, long unsigned int)’:
/home/richy/libs/SFMLTheora-CMake/src/SFMLTheora/Video.cpp:86:24: error: ‘memset’ was not declared in this scope
/home/richy/libs/SFMLTheora-CMake/src/SFMLTheora/Video.cpp:87:27: error: ‘memcpy’ was not declared in this scope
/home/richy/libs/SFMLTheora-CMake/src/SFMLTheora/Video.cpp: In member function ‘virtual int SFMLTheora::MemoryLoader::read(void*, int)’:
/home/richy/libs/SFMLTheora-CMake/src/SFMLTheora/Video.cpp:98:59: error: ‘memcpy’ was not declared in this scope
make[2]: *** [CMakeFiles/SFMLTheora.dir/src/SFMLTheora/Video.cpp.o] Error 1
make[1]: *** [CMakeFiles/SFMLTheora.dir/all] Error 2
make: *** [all] Error 2
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on September 16, 2011, 08:18:08 pm
I found that in GCC we have to include <cstring>, try this:
http://ftp://ftp.drivehq.com/zorexxlkl/downloads/SFMLTheora-1.3.2-CMake.zip
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: greeniekin on September 27, 2011, 08:04:43 am
I tried to use cmake to build for mingw. Though in the cmake gui i was expecting it to ask for the location of libtheoraplayer, but it didn't. So what are the steps to compile this?
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on September 27, 2011, 09:35:31 am
It is a static library and does not need to link with libtheoraplayer during compile.

You only need to link with libtheoraplayer in your project, which means you have to link with both SFMLTheora and libtheoraplayer when you compile your project.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: greeniekin on September 27, 2011, 11:07:58 am
Quote from: "zorexx"
It is a static library and does not need to link with libtheoraplayer during compile.

You only need to link with libtheoraplayer in your project, which means you have to link with both SFMLTheora and libtheoraplayer when you compile your project.

Yes but to compile it as a static library it needs the headers for libtheoraplayer. I ended up just copying from the include directory into your include just to compile.
Though it was a bit weird i think i need to use libtheoraplayer trunk rather than rc2 as it doesn't seem to have been structured like this
includes/libtheoraplayer/*.h
in rc2 it is
includes/*.h

Anyway still have to test it. but i have something to static link to now.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on September 28, 2011, 03:45:37 am
About the headers, the structure is:
include/theoraplayer/*.h

You'll have to add libtheoraplayer include and lib directories to your search path, for example, for Code::Blocks (source: http://www.allegro.cc/forums/thread/600860):
Settings -> Compiler & Debugger Settings -> Search Directories

I compiled libtheoraplayer from svn and uploaded it to my blog, but I've only compiled for MSVC++ 2010, so you'll have to compile it yourself if you're using other compilers. You can check the directory structure from there if you need, though.
http://www.zorexxlkl.com/p/other-downloads.html
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: greeniekin on September 28, 2011, 03:44:26 pm
I have successfully compiled it with mingw.

I did try using cmake to generate a codeblocks version. Though cmake had errors and couldn't generate the codeblocks version. So i selected mingw make instead. There must be a missing piece of information needed by cmake.

cmake generate fine from SFML2 for codeblocks.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on September 28, 2011, 05:55:38 pm
May I know what generator are you using?
I tried using "CodeBlocks - MinGW Makefiles" and it generates fine for me.

Can you paste the errors here?
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: greeniekin on September 29, 2011, 07:45:26 am
It seems to work now. I had left my computer on for a month straight and some strange things were happening i reset recently. So maybe it is related to that.

Also a quick question about libtheoraplayer. I found binaries for msvc_9 though I couldn't see any available with mingw. Have you ever compiled it with MingW. It seems they use codelite. Though when i try load the work space with codelite an error occurs with the project and it is removed for the workspace. Leaving nothing in the workspace to compile.

Not your problem obviously. I just wondered if you might know anyway.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on September 29, 2011, 12:12:42 pm
Glad to know it works now.

I've never compiled it for MinGW before, but I did try the codelite thing once.
The codelite project files are a mess, open it with notepad or any text editor and correct the directories/paths.

I think I managed to get the project files right, but in the end I decided that installing MinGW is too much of a hassle so I think I deleted the files. =(

Let me know if you still can't get it right, I'll try to help you with it.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: greeniekin on September 30, 2011, 12:42:47 pm
I managed to fix codelite project. I just copied the project file to the top directory and in codelite made my own workspace and added it to it.
Though now i need to compile it's dependencies(libogg,libvorbis,libtheora). Which do not use codelite or cmake ><. If I ever manage to get this working I'll make sure to put some binaries on this page. If I don't it means I have gone insane and run off into the woods to live. Likely screaming.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on September 30, 2011, 10:48:53 pm
Good to hear it works now.
For the other 3 dependencies, it's actually pretty easy if you have MSYS.

Open MSYS, type in the following commands:
Code: [Select]

cd <path_to_libogg/libvorbis/libtheora>
./configure --prefix=/mingw
make
make install


You'll have to first compile libogg, libvorbis, then libtheora.
After you're done with that, you can find your libs in src/.libs (for libogg) or lib/.libs (for the other 2).
Or
in your MinGW directory /lib and /bin (for the dll)[/code]
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: greeniekin on October 01, 2011, 02:30:11 pm
Yah i downloaded msys
Though i think because I have spaces in my path for mingw it's causing the generated make script to stop(seems to put extra line breaks for every space)
I either have to make a symbolic link with no spaces or make another installation.
Nothing is ever simple lol.

Once again thank you for all your help. hopefully I can spare some time in the next week as I would love my current(and future) project to become my full time occupation(we all have dreams).
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on October 01, 2011, 08:11:22 pm
Just copy it to C:\ for compiling, it should work.

Good luck on your project!
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: greeniekin on October 04, 2011, 02:04:37 am
I managed to get it all working. I have tested libtheoraplayer player in opengl. I still have not tested it with sfmltheora. Though it should work.

here you can download the binaries for your mingw compiled libtheoraplayer  dll.
It has libogg/libtheora/libvorbis statically linked into the dll.

https://legacy.sfmluploads.org/file/72

EDIT:
Nope SFMLTheora doesn't seem to work.

I get errors like
..\SFMLTheora\lib\libSFMLTheora.a(Video.cpp.obj):Video.cpp|| undefined reference to `_imp___ZN2sf6SpriteC2Ev'|
for video.cpp and audio interface

This is likely to do with the fact i statically link with SFML. Anyway have any suggestions?
Someone is likely to say it's the linking order. Though I link to SFMLTheora after all SFML libs.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on October 04, 2011, 10:54:24 pm
Sorry, I think there's a problem with my CMakeList, I'll try to fix it as soon as possible. It probably has something to do with not setting the dependencies.

I'm still very new to CMake and it seems to work for me if I use CMake to generate VS 2010 build, so I didn't notice the problem. I'll try compiling it with MinGW this time.

If you need it urgently, you can actually just copy the source and header files into your project, that's how SFMLTheora 1.2 and below worked.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: greeniekin on October 05, 2011, 03:35:14 am
I don't need it soon. In fact I've expanded the scope for my project. (I know scope creep is pure evil),from a simple game to having ability for song editing, and a market to submit it to.

If you need me to test it or some information I will be more than happy to help. I will keep a close eye on this topic.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on October 05, 2011, 03:37:05 am
Thank you very much for your help.

Sounds like an interesting project, I'll look forward to seeing the final product.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on October 09, 2011, 02:37:15 am
I've tested it (with MSys/MinGW/g++) and it works just fine.

Except that I also noticed that I forgotten to update the files in the CMake package to 1.3.2 (the zip file is named 1.3.2 but I forgotten to replace the source files with 1.3.2 source files).

I also made some minor changes to the CMakeList.txt, now "make install" will work properly.

Please re-download the CMake package and try again.

Just make sure you link to:
-SFMLTheora
-libtheoraplayer
-SFML-Main
-SFML-System
-SFML-Window
-SFML-Graphics
-SFML-Audio
when you compile your projects.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: greeniekin on October 11, 2011, 12:52:49 pm
I tried fownloading from here.
ftp://ftp.drivehq.com/zorexxlkl/downloads/SFMLTheora-1.3.2-CMake.zip
Though I get
"Error 601 (net::ERR_FTP_FAILED): Unknown error."
I will try again tomorrow see if I have any better luck.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on October 11, 2011, 09:16:35 pm
Sorry, there was some problems with my FTP server, it's fixed now.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on December 29, 2011, 05:59:49 pm
It seems that in the latest github version of SFML2, EnableVerticalSync no longer works as it did, so I've replaced
Code: [Select]

EnableVerticalSync(true)

with
Code: [Select]

SetFramerateLimit(60)
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: Laurent on December 29, 2011, 07:09:09 pm
Quote
It seems that in the latest github version of SFML2, EnableVerticalSync no longer works as it did

EnableVerticalSync was the same as it was in SFML 1.0, I've never touched it (except its name). Are you sure that it's not your graphics drivers settings that have changed?
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on December 30, 2011, 04:08:16 am
I'm not sure, but someone reported that it SFMLTheora became choppy with the latest github version, so I tried, and it did indeed become choppy.

I checked the frame time with GetFrameTime and I got very low values like 1-3, and my CPU usage flew, so I figured out that something went wrong with whatever it is capping the framerate.

In SFMLTheoraTest, I used EnableVerticalSync to cap the framerate, so I changed that to SetFramerateLimit(60) and it works, I told the guy who reported the bug to change that line, and it works for him too.

Edit:
I made a simple test to demonstrate what I mean:
Code: [Select]

#include <iostream>

#include <SFML/Graphics.hpp>



int main()
{
  sf::RenderWindow renderWnd(sf::VideoMode(800, 600, 32), "VSync Test");

  renderWnd.EnableVerticalSync(true);

  while (renderWnd.IsOpened()) {
    sf::Event sfEvent;
    while (renderWnd.PollEvent(sfEvent)) {
      if (sfEvent.Type == sf::Event::Closed)
        renderWnd.Close();

      if ((sfEvent.Type == sf::Event::KeyPressed)) {
        switch (sfEvent.Key.Code) {
     case sf::Keyboard::Escape:
            {
              renderWnd.Close();
              break;
            }
        }
      }
    }
   
    renderWnd.Clear();

    renderWnd.Display();

    std::cout<<renderWnd.GetFrameTime()<<"\n";
  }

  return 0;
}



The values of GetFrameTime are within the range of 0-2 for me, but sometimes peaks at 9-13.

Change the line
Code: [Select]
EnableVerticalSync(true)
to
Code: [Select]
SetFramerateLimit(60)
and the values of GetFrameTime becomes higher at 16-23. (which is roughly 60 fps, working as expected)

Can you test it and see if it's the same for you?
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: Laurent on December 30, 2011, 07:59:00 am
Yes, EnableVerticalSync works for me.

Please make sure that it's not disabled in your graphics driver settings. It should be set to "controlled by application".
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on December 30, 2011, 10:28:03 am
Hmm, weird then.

My graphics driver is set to controlled by application and I have never change it before.

I just tested with the previous SFML2 version I compiled and it seems that the result is the same, maybe it's related to the latest graphic driver then.
Well, SetFramerateLimit does make a good replacement for EnableVerticalSync in this case, though.

Sorry, my mistake.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: akarivs on February 29, 2012, 04:05:09 pm
Hello
I try to use SFML Theora with SFML 1.6
When compile project, i've got errors, that I have unresolved external symbol sf::Texture and some from SF Audio package.

Then I replace SFML libs by libs from fix archieve.
And i've got new errors:

Code: [Select]
1>sfml-audio-s-d.lib(SoundBuffer.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" (__imp_?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ) в функции "public: __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Sentry_base::_Sentry_base(classstd::basic_ostream<char,struct std::char_traits<char> > &)" (??0_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z)


P.S. Sorry for my english, it's not my native language.

[/code]
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on February 29, 2012, 05:09:29 pm
If you want to use SFMLTheora with SFML 1.6, you'll have to recompile SFMLTheora. To compile it you'll have to download libogg, libvorbis, libtheora, and libtheoraplayer, which can all be found (precompiled) on my website at http://www.zorexxlkl.com/downloads.
The precompiled libraries are only for SFML 2 since I compiled them with it.
Do let me know if you face problems compiling it.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: kspes on March 02, 2012, 09:58:43 pm
Hi everyone, I'm Kresimir Spes, author of the libtheoraplayer library, glad to see all you people using my work! :) :) gotta love open source!

I've added SMFLTheora to the project's showcase page:
https://sourceforge.net/apps/mediawiki/libtheoraplayer/index.php?title=Showcase
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on March 03, 2012, 03:36:55 am
Wow, that's awesome.
Great to see libtheoraplayer updated again.
Thanks for putting the project on the showcase page.
There's a bit of spelling error, though, it's SFML, not SMFL,  :) .
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: kspes on March 03, 2012, 10:24:20 am
Quote from: "zorexx"
Wow, that's awesome.
Great to see libtheoraplayer updated again.
Thanks for putting the project on the showcase page.
There's a bit of spelling error, though, it's SFML, not SMFL,  :) .


Typo corrected :)
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: slotdev on March 03, 2012, 11:29:39 am
Hi

Just implementing this in my project, but I get:

" fatal error C1083: Cannot open include file: 'theoraplayer/TheoraPlayer.h': No such file or directory"

I downloaded the "Clean" package - should I have got something else? I am using MSVC 2010.

Thanks
Ed
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: kspes on March 03, 2012, 11:39:43 am
Quote from: "slotdev"
Hi

Just implementing this in my project, but I get:

" fatal error C1083: Cannot open include file: 'theoraplayer/TheoraPlayer.h': No such file or directory"

I downloaded the "Clean" package - should I have got something else? I am using MSVC 2010.

Thanks
Ed


check your project's header search locations. also note that I haven't made msvc2010 projects for libtheoraplayer, only 2008. it's on the todo list.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: slotdev on March 03, 2012, 11:54:33 am
Hi

Thanks for the help. I notice that theoraplayer/TheoraPlayer.h is not in the download at all - hence asking if I need something else.

But if it's not been compiled for VC2010, then I won't bother using it until it is, unless that's something I can do?
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on March 03, 2012, 11:55:45 am
Quote from: "kspes"
Typo corrected :)

Thanks.  :)

Quote from: "slotdev"
Hi

Just implementing this in my project, but I get:

" fatal error C1083: Cannot open include file: 'theoraplayer/TheoraPlayer.h': No such file or directory"

I downloaded the "Clean" package - should I have got something else? I am using MSVC 2010.

Thanks
Ed


Sorry, I forgotten to mention that you need to have libtheoraplayer in order to use SFMLTheora, or at least the header files.

I guess I shall include the headers of libtheoraplayer along with SFMLTheora as well.

You can download a compiled version of the libtheoraplayer for msvc2010 at: http://www.zorexxlkl.com/downloads/


@kspes, I hope you don't mind me distributing the msvc2010 precompiled libtheoraplayer.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: kspes on March 03, 2012, 12:16:11 pm
Quote from: "zorexx"

@kspes, I hope you don't mind me distributing the msvc2010 precompiled libtheoraplayer.


Sure, no problem :)
When I release 1.0stable version, I plan to release msvc2008 and msvc2010 precompiled SDK's.
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on March 03, 2012, 12:18:23 pm
Thanks, that will be great.
I will look forward to seeing the stable version out.
By the way, just reporting a "bug" here,
<TheoraExport.h> in TheoraVideoFrame.h should be "TheoraExport.h".
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: kspes on March 03, 2012, 12:20:31 pm
Quote from: "zorexx"
Thanks, that will be great.
I will look forward to seeing the stable version out.
By the way, just reporting a "bug" here,
<TheoraExport.h> in TheoraVideoFrame.h should be "TheoraExport.h".


well spotted! just corrected it. btw, if you find anything else, please post it on the project's bug tracker, can't keep track of reports all arround the web :)
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on March 03, 2012, 12:27:26 pm
Ok, sure.

@slotdev: I've just updated SFMLTheora (as version 1.3.5) to include libtheoraplayer's header files, now everything should work with just the Clean package, sorry for the inconvenience. Also, since I am using msvc2010, you should not worry about it not working in msvc2010.  :)
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: slotdev on March 03, 2012, 06:25:51 pm
Hi

Thanks for the updated, much appreciated :)

I've downloaded it, included it in my project, but I get errors related to sf::Time, which I guess is a new function in SFML2, since the last version we use (which is from around November 2011 - before the major API update).

We will have to update our system to get this working, but thanks all the same :)

Ed
Title: SFMLTheora 1.3 - Play videos in SFML
Post by: zorexx on March 03, 2012, 06:34:11 pm
Yeap, the sf::Time is a recent change in SFML2.  :)
Title: Re: sfTheora 1.4 - Play videos in SFML
Post by: zorexx on April 05, 2012, 07:22:57 am
So, I'm finally done adapting sfTheora to the latest SFML naming conventions (and, notice the name change  ;D).

I also added some new functions, like getDuration and getTime, as well as a new error handling system.
You can also now load videos by passing it as a parameter to the constructor. This is made possible thanks to the new error handling system.

Dropped SFML 1.6 support as well, since SFML 2.0 will be released as a stable version soon.

See the changelog for the full list of changes.
Title: Re: sfTheora 1.4 - Play videos in SFML
Post by: kspes on April 05, 2012, 08:43:47 am
I've changed the links on theora playbacks' wiki showcase page to account the name change.

@zorexx: are you using 1.0RC2 or the svn trunk version? I've made some pretty cool changes, especially in file seeking speed and accuracy. 1.0RC3 should be out somewhat soon!
Title: Re: sfTheora 1.4 - Play videos in SFML
Post by: zorexx on April 05, 2012, 08:58:13 am
Thanks updating.

I compiled the SVN trunk version on 03/03/2012, hopefully the changes you mentioned are made before that date.
Title: Re: sfTheora 1.4 - Play videos in SFML
Post by: kspes on April 05, 2012, 09:06:09 am
yeah, I think they should be in that revision.