mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-05-30 03:09:35 -04:00
libobs-metal: Add new Metal renderer.
This commit is contained in:
@@ -3460,12 +3460,6 @@ bool OBSBasic::Active() const
|
||||
return outputHandler->Active();
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
#define IS_WIN32 1
|
||||
#else
|
||||
#define IS_WIN32 0
|
||||
#endif
|
||||
|
||||
static inline int AttemptToResetVideo(struct obs_video_info *ovi)
|
||||
{
|
||||
return obs_reset_video(ovi);
|
||||
@@ -3579,14 +3573,15 @@ int OBSBasic::ResetVideo()
|
||||
}
|
||||
|
||||
ret = AttemptToResetVideo(&ovi);
|
||||
if (IS_WIN32 && ret != OBS_VIDEO_SUCCESS) {
|
||||
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MAC_10_11))
|
||||
if (ret != OBS_VIDEO_SUCCESS) {
|
||||
if (ret == OBS_VIDEO_CURRENTLY_ACTIVE) {
|
||||
blog(LOG_WARNING, "Tried to reset when "
|
||||
"already active");
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Try OpenGL if DirectX fails on windows */
|
||||
/* Try OpenGL if DirectX/Metal fails on windows/macOS */
|
||||
if (astrcmpi(ovi.graphics_module, DL_OPENGL) != 0) {
|
||||
blog(LOG_WARNING, "Failed to initialize obs video (%d) "
|
||||
"with graphics_module='%s', retrying "
|
||||
@@ -3597,6 +3592,9 @@ int OBSBasic::ResetVideo()
|
||||
ret = AttemptToResetVideo(&ovi);
|
||||
}
|
||||
} else if (ret == OBS_VIDEO_SUCCESS) {
|
||||
#else
|
||||
if (ret == OBS_VIDEO_SUCCESS) {
|
||||
#endif
|
||||
ResizePreview(ovi.base_width, ovi.base_height);
|
||||
if (program)
|
||||
ResizeProgram(ovi.base_width, ovi.base_height);
|
||||
|
||||
Reference in New Issue
Block a user