2012-12-11 21:49:31 +00:00
|
|
|
#ifndef VIDEOPLAYER_H
|
|
|
|
#define VIDEOPLAYER_H
|
2012-09-25 00:35:50 +00:00
|
|
|
|
2012-12-11 21:49:31 +00:00
|
|
|
#include <OgreRoot.h>
|
|
|
|
#include <OgreHardwarePixelBuffer.h>
|
2012-09-25 00:35:50 +00:00
|
|
|
|
2012-12-11 21:49:31 +00:00
|
|
|
#include <boost/thread.hpp>
|
2012-09-25 00:35:50 +00:00
|
|
|
|
|
|
|
|
2012-12-11 21:49:31 +00:00
|
|
|
#define __STDC_CONSTANT_MACROS
|
|
|
|
#include <stdint.h>
|
|
|
|
extern "C"
|
2012-09-25 00:35:50 +00:00
|
|
|
{
|
2012-12-11 21:49:31 +00:00
|
|
|
#include <libavcodec/avcodec.h>
|
|
|
|
#include <libavformat/avformat.h>
|
|
|
|
#include <libswscale/swscale.h>
|
2012-09-25 00:35:50 +00:00
|
|
|
}
|
|
|
|
|
2012-12-11 21:49:31 +00:00
|
|
|
#include <cstdio>
|
|
|
|
#include <cmath>
|
|
|
|
|
2012-12-13 09:42:20 +00:00
|
|
|
#include "../mwbase/soundmanager.hpp"
|
|
|
|
|
2012-12-11 21:49:31 +00:00
|
|
|
|
2012-09-25 00:35:50 +00:00
|
|
|
namespace MWRender
|
|
|
|
{
|
2012-12-14 09:14:14 +00:00
|
|
|
struct VideoState;
|
|
|
|
|
2012-09-25 00:35:50 +00:00
|
|
|
class VideoPlayer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
VideoPlayer(Ogre::SceneManager* sceneMgr);
|
|
|
|
~VideoPlayer();
|
|
|
|
|
2012-12-11 21:49:31 +00:00
|
|
|
void playVideo (const std::string& resourceName);
|
2012-09-25 00:35:50 +00:00
|
|
|
|
|
|
|
void update();
|
|
|
|
|
|
|
|
void close();
|
|
|
|
|
2012-12-11 21:49:31 +00:00
|
|
|
bool isPlaying();
|
2012-12-03 16:33:02 +00:00
|
|
|
|
|
|
|
|
2012-12-11 21:49:31 +00:00
|
|
|
private:
|
|
|
|
VideoState* mState;
|
2012-12-03 16:33:02 +00:00
|
|
|
|
2012-12-11 21:49:31 +00:00
|
|
|
Ogre::SceneManager* mSceneMgr;
|
|
|
|
Ogre::MaterialPtr mVideoMaterial;
|
2012-12-15 12:01:52 +00:00
|
|
|
Ogre::Rectangle2D* mRectangle;
|
|
|
|
Ogre::SceneNode* mNode;
|
2012-09-25 00:35:50 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|