diff --git a/obs/platform-osx.mm b/obs/platform-osx.mm index a5e59f690..275d2447c 100644 --- a/obs/platform-osx.mm +++ b/obs/platform-osx.mm @@ -77,3 +77,7 @@ bool InitApplicationBundle() #endif } +string GetDefaultVideoSavePath() +{ + return string(getenv("HOME")); +} diff --git a/obs/platform-windows.cpp b/obs/platform-windows.cpp index 00a103675..e34f3e526 100644 --- a/obs/platform-windows.cpp +++ b/obs/platform-windows.cpp @@ -23,6 +23,8 @@ using namespace std; #define WIN32_LEAN_AND_MEAN #include +#include +#include static inline bool check_path(const char* data, const char *path, string &output) @@ -67,3 +69,15 @@ bool InitApplicationBundle() { return true; } + +string GetDefaultVideoSavePath() +{ + wchar_t path_utf16[MAX_PATH]; + char path_utf8[MAX_PATH]; + + SHGetFolderPathW(NULL, CSIDL_MYVIDEO, NULL, SHGFP_TYPE_CURRENT, + path_utf16); + + os_wcs_to_utf8(path_utf16, MAX_PATH, path_utf8); + return string(path_utf8); +} diff --git a/obs/platform-x11.cpp b/obs/platform-x11.cpp index a7a927527..3d652369a 100644 --- a/obs/platform-x11.cpp +++ b/obs/platform-x11.cpp @@ -101,3 +101,8 @@ bool InitApplicationBundle() { return true; } + +string GetDefaultVideoSavePath() +{ + return string(getenv("HOME")); +} diff --git a/obs/platform.hpp b/obs/platform.hpp index bd04a81cf..52bdcfbe8 100644 --- a/obs/platform.hpp +++ b/obs/platform.hpp @@ -39,3 +39,4 @@ void GetMonitors(std::vector &monitors); /* Updates the working directory for OSX application bundles */ bool InitApplicationBundle(); +std::string GetDefaultVideoSavePath();