mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-07 20:21:24 -06:00
Make sure video player is initialized for each video renderable
This commit is contained in:
@@ -40,6 +40,7 @@ class ScreenSpaceVideo : public ScreenSpaceRenderable {
|
||||
public:
|
||||
ScreenSpaceVideo(const ghoul::Dictionary& dictionary);
|
||||
|
||||
bool initializeGL() override;
|
||||
bool deinitializeGL() override;
|
||||
void update() override;
|
||||
void render() override;
|
||||
|
||||
@@ -51,6 +51,8 @@ public:
|
||||
VideoPlayer(const ghoul::Dictionary& dictionary);
|
||||
~VideoPlayer();
|
||||
|
||||
void initialize();
|
||||
|
||||
// Video interaction
|
||||
void pause();
|
||||
void play();
|
||||
|
||||
@@ -224,6 +224,8 @@ void RenderableVideoSphere::initializeGL() {
|
||||
);
|
||||
|
||||
ghoul::opengl::updateUniformLocations(*_shader, _uniformCache, UniformNames);
|
||||
|
||||
_videoPlayer.initialize();
|
||||
}
|
||||
|
||||
void RenderableVideoSphere::deinitializeGL() {
|
||||
|
||||
@@ -88,6 +88,12 @@ void ScreenSpaceVideo::render() {
|
||||
ScreenSpaceRenderable::render();
|
||||
}
|
||||
|
||||
bool ScreenSpaceVideo::initializeGL() {
|
||||
_videoPlayer.initialize();
|
||||
|
||||
return ScreenSpaceRenderable::initializeGL();
|
||||
}
|
||||
|
||||
bool ScreenSpaceVideo::deinitializeGL() {
|
||||
_videoPlayer.destroy();
|
||||
|
||||
|
||||
@@ -360,6 +360,9 @@ void VideoPlayer::stepFrameBackward() {
|
||||
commandAsyncMpv(cmd);
|
||||
}
|
||||
|
||||
void VideoPlayer::initialize() {
|
||||
initializeMpv();
|
||||
}
|
||||
|
||||
void VideoPlayer::initializeMpv() {
|
||||
_mpvHandle = mpv_create();
|
||||
|
||||
@@ -138,7 +138,7 @@ int VideoTileProvider::minLevel() {
|
||||
}
|
||||
|
||||
int VideoTileProvider::maxLevel() {
|
||||
// This is the level where above the tile is marked as unavailable and is no longer
|
||||
// This is the level where above the tile is marked as unavailable and is no longer
|
||||
// displayed. Since we want to display the tiles at all times we set the max level
|
||||
return 1337;
|
||||
}
|
||||
@@ -147,7 +147,9 @@ float VideoTileProvider::noDataValueAsFloat() {
|
||||
return std::numeric_limits<float>::min();
|
||||
}
|
||||
|
||||
void VideoTileProvider::internalInitialize() {}
|
||||
void VideoTileProvider::internalInitialize() {
|
||||
_videoPlayer.initialize();
|
||||
}
|
||||
|
||||
VideoTileProvider::~VideoTileProvider() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user