提交 ecb8c2c0 编写于 作者: J jp9000

Revert "UI: Always create a display capture on first run"

This reverts commit 35b2ce56.

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.
上级 9630c303
......@@ -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);
......
......@@ -117,7 +117,7 @@ private:
void SetupEncoders();
void CreateFirstRunSources(obs_scene_t *scene);
void CreateFirstRunSources();
void CreateDefaultScene(bool firstStart);
void ClearVolumeControls();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册