Skip to content

Commit

Permalink
Engine: provided stubs for AGS_NO_VIDEO_PLAYER build
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-mogilko committed Mar 14, 2024
1 parent 3a3fd71 commit fbbcb5a
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 7 deletions.
39 changes: 34 additions & 5 deletions Engine/media/video/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,10 +662,39 @@ void video_shutdown()

#else

HError play_theora_video(const char *name, int video_flags, int state_flags, AGS::Engine::VideoSkipType skip) { return HError::None(); }
HError play_flc_video(int numb, int video_flags, int state_flags, AGS::Engine::VideoSkipType skip) { return HError::None(); }
void video_pause() {}
void video_resume() {}
void video_shutdown() {}
//-----------------------------------------------------------------------------
// Stubs for the video support
//-----------------------------------------------------------------------------

using namespace AGS::Common;

HError play_theora_video(const char *, int, int, AGS::Engine::VideoSkipType)
{
return new Error("Video playback is not supported in this engine build.");
}
HError play_flc_video(int, int, int, AGS::Engine::VideoSkipType)
{
return new Error("Video playback is not supported in this engine build.");
}
void video_single_pause() {}
void video_single_resume() {}
void video_single_stop() {}

HError open_video(const char *, int, int &)
{
return new Error("Video playback is not supported in this engine build.");
}
VideoControl *get_video_control(int) { return nullptr; }
void video_stop(int) { }
void sync_video_playback() { }
void update_video_system_on_game_loop() { }
void video_shutdown() { }

void VideoControl::SetScriptHandle(int) {}
bool VideoControl::Play() { return false; }
void VideoControl::Pause() {}
bool VideoControl::NextFrame() { return false; }
uint32_t VideoControl::SeekFrame(uint32_t) { return -1; }
float VideoControl::SeekMs(float) { return -1.f; }

#endif
22 changes: 20 additions & 2 deletions Engine/media/video/video_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,28 @@ static void video_core_entry()
g_vcore.poll_cv.wait_for(lk, std::chrono::milliseconds(8));
}
}
#endif
#endif // !AGS_DISABLE_THREADS

#else // AGS_NO_VIDEO_PLAYER

// TODO
void video_core_init(/*config*/)
{
Debug::Printf(kDbgMsg_Warn, "VideoCore: video playback is not supported in this engine build.");
}
void video_core_shutdown() { }
int video_core_slot_init(std::unique_ptr<AGS::Common::Stream>,
const AGS::Common::String &, const AGS::Common::String &, const VideoInitParams &)
{
return -1;
}
VideoPlayerLock video_core_get_player(int)
{
throw std::runtime_error("Video playback is not supported in this engine build.");
}
void video_core_slot_stop(int) {}

#if defined(AGS_DISABLE_THREADS)
void video_core_entry_poll() {}
#endif

#endif // !AGS_NO_VIDEO_PLAYER

0 comments on commit fbbcb5a

Please sign in to comment.