diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-06-14 07:22:05 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-06-14 07:23:14 +0200 |
commit | d37b3a7aac87e5f60c49202c824d985e53b7b544 (patch) | |
tree | 165fec322b0166b48e298ebcae0e5015578d6a4a /include/VideoPlayer.hpp | |
parent | 977547ff7f0b609291da56df32e5642d10c530cd (diff) |
Rework around mpv issue: reload video if frozen after seek. Add f5 to reload video, readd video cache
Diffstat (limited to 'include/VideoPlayer.hpp')
-rw-r--r-- | include/VideoPlayer.hpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/include/VideoPlayer.hpp b/include/VideoPlayer.hpp index 1e40de1..a7906a2 100644 --- a/include/VideoPlayer.hpp +++ b/include/VideoPlayer.hpp @@ -35,34 +35,30 @@ namespace QuickMedia { }; // @event_callback is called from another thread - VideoPlayer(bool no_video, bool use_system_mpv_config, bool resume_playback, bool keep_open, EventCallbackFunc event_callback, VideoPlayerWindowCreateCallback window_create_callback, const std::string &resource_root, int monitor_height); + VideoPlayer(bool no_video, bool use_system_mpv_config, bool keep_open, EventCallbackFunc event_callback, VideoPlayerWindowCreateCallback window_create_callback, const std::string &resource_root, int monitor_height); ~VideoPlayer(); VideoPlayer(const VideoPlayer&) = delete; VideoPlayer& operator=(const VideoPlayer&) = delete; // |audio_path| is only set when video and audio are separate files/urls. - // |start_time| is ignored if |resume_playback| is true. - Error load_video(const char *path, const char *audio_path, sf::WindowHandle parent_window, const std::string &plugin_name, const std::string &title, const std::string &start_time = ""); + Error load_video(const char *path, const char *audio_path, sf::WindowHandle parent_window, bool is_youtube, const std::string &title, const std::string &start_time = ""); // Should be called every update frame Error update(); // Returns time in seconds Error get_time_in_file(double *result); - Error quit_and_save_watch_later(); - Error set_property(const std::string &property_name, const Json::Value &value); Error get_property(const std::string &property_name, Json::Value *result, Json::ValueType result_type); int exit_status; private: Error send_command(const char *cmd, size_t size); - Error launch_video_process(const char *path, const char *audio_path, sf::WindowHandle parent_window, const std::string &plugin_name, const std::string &title, const std::string &start_time); + Error launch_video_process(const char *path, const char *audio_path, sf::WindowHandle parent_window, bool is_youtube, const std::string &title, const std::string &start_time); VideoPlayer::Error read_ipc_func(); private: bool no_video; bool use_system_mpv_config; - bool resume_playback; bool keep_open; pid_t video_process_id; bool connected_to_ipc; |