libobs-metal: Add new Metal renderer.
This commit is contained in:
parent
dd68493590
commit
e8ea0baede
26 changed files with 4990 additions and 23 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue