1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 09:23:52 +00:00
openmw-tes3mp/extern/ogre-ffmpeg-videoplayer/videoplayer.hpp
scrawl eb1c24ffe6 Refactor video player engine to get rid of MWSound dependencies
- Split video player to separate source files.
 - Move video player engine sources to extern/ (repository will be set up on github soon).
 - Audio is handled in a MovieAudioFactory, implemented by the user (here in MWSound subsystem).
 - Handle conversion of unsupported channel layouts via ffmpeg's swresample.
2014-10-22 22:33:32 +02:00

58 lines
1.4 KiB
C++

#ifndef VIDEOPLAYER_H
#define VIDEOPLAYER_H
#include <string>
#include <memory>
#include <boost/shared_ptr.hpp>
namespace Video
{
struct VideoState;
class MovieAudioDecoder;
class MovieAudioFactory;
/**
* @brief Plays a video on an Ogre texture.
*/
class VideoPlayer
{
public:
VideoPlayer();
~VideoPlayer();
/// @note Takes ownership of the passed pointer.
void setAudioFactory (MovieAudioFactory* factory);
/// Return true if a video is currently playing and it has an audio stream.
bool hasAudioStream();
/// Play the given video. If a video is already playing, the old video is closed first.
void playVideo (const std::string& resourceName);
/// This should be called every frame by the user to update the video texture.
void update();
/// Stop the currently playing video, if a video is playing.
void close();
bool isPlaying();
/// Return the texture name of the currently playing video, or "" if no video is playing.
std::string getTextureName();
/// Return the width of the currently playing video, or 0 if no video is playing.
int getVideoWidth();
/// Return the height of the currently playing video, or 0 if no video is playing.
int getVideoHeight();
private:
VideoState* mState;
std::auto_ptr<MovieAudioFactory> mAudioFactory;
};
}
#endif