From ecb8c2c045909091160705df5823b51b91f4bca1 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 23 Sep 2015 08:41:00 -0700 Subject: [PATCH] Revert "UI: Always create a display capture on first run" This reverts commit 35b2ce565a2b90909e2b94da5f28de4bb3a87ff0. There is far too much potential for issues to occur if the first-time start creates a display capture by default on linux and windows. Display capture on windows laptops will not be guaranteed to capture properly, leaving the user with a blank screen. Display capture on linux downloads its image off the graphics processor, so it's quite inefficient to have on by default. --- obs/window-basic-main.cpp | 25 ++----------------------- obs/window-basic-main.hpp | 2 +- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/obs/window-basic-main.cpp b/obs/window-basic-main.cpp index 8efd71287..cc9340fb3 100644 --- a/obs/window-basic-main.cpp +++ b/obs/window-basic-main.cpp @@ -350,31 +350,10 @@ static inline bool HasAudioDevices(const char *source_id) return count != 0; } -void OBSBasic::CreateFirstRunSources(obs_scene_t *scene) +void OBSBasic::CreateFirstRunSources() { bool hasDesktopAudio = HasAudioDevices(App()->OutputAudioSource()); bool hasInputAudio = HasAudioDevices(App()->InputAudioSource()); - const char *displayCaptureType = nullptr; - obs_source_t *source = nullptr; - -#ifdef __APPLE__ - displayCaptureType = "display_capture"; -#elif _WIN32 - if (GetWindowsVersion() >= 0x602) - displayCaptureType = "monitor_capture"; -#else //X11 - displayCaptureType = "xshm_input"; -#endif - if (displayCaptureType) { - source = obs_source_create(OBS_SOURCE_TYPE_INPUT, - displayCaptureType, Str("Basic.DisplayCapture"), - NULL, nullptr); - } - if (source) { - obs_scene_add(scene, source); - obs_add_source(source); - obs_source_release(source); - } if (hasDesktopAudio) ResetAudioDevice(App()->OutputAudioSource(), "default", @@ -396,7 +375,7 @@ void OBSBasic::CreateDefaultScene(bool firstStart) obs_add_source(source); if (firstStart) - CreateFirstRunSources(scene); + CreateFirstRunSources(); obs_set_output_source(0, obs_scene_get_source(scene)); obs_scene_release(scene); diff --git a/obs/window-basic-main.hpp b/obs/window-basic-main.hpp index 0421b2e28..33bf478f5 100644 --- a/obs/window-basic-main.hpp +++ b/obs/window-basic-main.hpp @@ -117,7 +117,7 @@ private: void SetupEncoders(); - void CreateFirstRunSources(obs_scene_t *scene); + void CreateFirstRunSources(); void CreateDefaultScene(bool firstStart); void ClearVolumeControls();