Skip to content

Commit 75054dc

Browse files
authored
fix: Fix ScreenStreamSender on Unity 2019 Windows (#602)
1 parent e10efc1 commit 75054dc

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

com.unity.renderstreaming/Runtime/Scripts/ScreenStreamSender.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected virtual void Awake()
3333
{
3434
var format = WebRTC.WebRTC.GetSupportedRenderTextureFormat(SystemInfo.graphicsDeviceType);
3535
m_screenTexture =
36-
new RenderTexture(Screen.width, Screen.height, depth, format) { antiAliasing = antiAliasing };
36+
new RenderTexture(Screen.width, Screen.height, depth, RenderTextureFormat.Default) { antiAliasing = antiAliasing };
3737
m_screenTexture.Create();
3838

3939
StartCoroutine(RecordScreenFrame());
@@ -104,15 +104,8 @@ IEnumerator RecordScreenFrame()
104104
continue;
105105
}
106106

107-
if (m_screenTexture.width == m_sendTexture.width && m_screenTexture.height == m_sendTexture.height)
108-
{
109-
ScreenCapture.CaptureScreenshotIntoRenderTexture(m_sendTexture);
110-
}
111-
else
112-
{
113-
ScreenCapture.CaptureScreenshotIntoRenderTexture(m_screenTexture);
114-
Graphics.Blit(m_screenTexture, m_sendTexture);
115-
}
107+
ScreenCapture.CaptureScreenshotIntoRenderTexture(m_screenTexture);
108+
Graphics.Blit(m_screenTexture, m_sendTexture);
116109
}
117110
}
118111
}

0 commit comments

Comments
 (0)