feat: add the flag to select encoder by karasusan · Pull Request #216 · Unity-Technologies/UnityRenderStreaming · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Assets/Scripts/Editor/RenderStreamingEditor.cs
8 changes: 6 additions & 2 deletions Assets/Scripts/RenderStreaming.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public class RenderStreaming : MonoBehaviour
[SerializeField, Tooltip("Camera to capture video stream")]
private Camera captureCamera;

[SerializeField, Tooltip("Enable or disable hardware encoder")]
private bool hardwareEncoderSupport = true;

[SerializeField, Tooltip("Array to set your own click event")]
private ButtonClickElement[] arrayButtonClickEvent;
#pragma warning restore 0649
Expand All @@ -56,7 +59,8 @@ public class RenderStreaming : MonoBehaviour

public void Awake()
{
WebRTC.WebRTC.Initialize();
var encoderType = hardwareEncoderSupport ? EncoderType.Hardware : EncoderType.Software;
WebRTC.WebRTC.Initialize(encoderType);
RemoteInput.Initialize();
RemoteInput.ActionButtonClick = OnButtonClick;
}
Expand Down Expand Up @@ -130,7 +134,7 @@ IEnumerator GetOffer()
}
foreach (var offer in obj.offers)
{
RTCSessionDescription _desc = default;
RTCSessionDescription _desc;
_desc.type = RTCSdpType.Offer;
_desc.sdp = offer.sdp;
var connectionId = offer.connectionId;
Expand Down
4 changes: 2 additions & 2 deletions EmptyProjectForTest~/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.ide.rider": "1.1.4",
"com.unity.ide.vscode": "1.1.3",
"com.unity.ide.vscode": "1.1.4",
"com.unity.test-framework": "1.1.9",
"com.unity.textmeshpro": "2.0.1",
"com.unity.ugui": "1.0.0",
Expand Down Expand Up @@ -43,7 +43,7 @@
"lock": {
"com.unity.webrtc": {
"revision": "release/1.1.0",
"hash": "0f45d9be2546030d6e7c9f71788670ddc2b88554"
"hash": "97a06335330c7f0a92f5e03c658dc89c04a641a6"
}
}
}
4 changes: 2 additions & 2 deletions EmptyProjectForTest~/ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 2019.3.0f5
m_EditorVersionWithRevision: 2019.3.0f5 (44796c9d3c2c)
m_EditorVersion: 2019.3.0f6
m_EditorVersionWithRevision: 2019.3.0f6 (27ab2135bccf)
2 changes: 1 addition & 1 deletion Packages/com.unity.renderstreaming/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"unity": "2019.1",
"description": "This is HDRP sample scene project integrated with Unity Render Streaming technology.\n\nAlong with its signaling web server, you could play around the scene in any webrtc supported web browser.",
"dependencies": {
"com.unity.webrtc": "1.1.0-preview.1",
"com.unity.webrtc": "1.1.0-preview.2",
"com.unity.inputsystem": "0.9.6-preview"
},
"samples": [ {
Expand Down
2 changes: 1 addition & 1 deletion Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"lock": {
"com.unity.webrtc": {
"revision": "release/1.1.0",
"hash": "0f45d9be2546030d6e7c9f71788670ddc2b88554"
"hash": "97a06335330c7f0a92f5e03c658dc89c04a641a6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.ide.rider": "1.1.4",
"com.unity.ide.vscode": "1.1.3",
"com.unity.ide.vscode": "1.1.4",
"com.unity.inputsystem": "0.9.6-preview",
"com.unity.render-pipelines.high-definition": "7.1.7",
"com.unity.render-pipelines.high-definition": "7.1.8",
"com.unity.test-framework": "1.1.9",
"com.unity.textmeshpro": "2.0.1",
"com.unity.ugui": "1.0.0",
"com.unity.webrtc": "1.0.1-preview",
"com.unity.webrtc": "https://github.com/Unity-Technologies/com.unity.webrtc.git#release/1.1.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
Expand Down Expand Up @@ -41,5 +41,11 @@
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.wind": "1.0.0",
"com.unity.modules.xr": "1.0.0"
},
"lock": {
"com.unity.webrtc": {
"revision": "release/1.1.0",
"hash": "97a06335330c7f0a92f5e03c658dc89c04a641a6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ MonoBehaviour:
m_ProjectSettingFolderPath: HDRPDefaultResources
m_WizardPopupAtStart: 0
m_WizardActiveTab: 0
m_PackageVersionForMaterials: 7.1.7
m_PackageVersionForMaterials: 7.1.8
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 2019.3.0f5
m_EditorVersionWithRevision: 2019.3.0f5 (44796c9d3c2c)
m_EditorVersion: 2019.3.0f6
m_EditorVersionWithRevision: 2019.3.0f6 (27ab2135bccf)
12 changes: 6 additions & 6 deletions RenderStreamingSampleSrc~/RS_URPSampleSrc/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.ads": "2.0.8",
"com.unity.analytics": "3.3.4",
"com.unity.analytics": "3.3.5",
"com.unity.collab-proxy": "1.2.16",
"com.unity.ide.rider": "1.1.4",
"com.unity.ide.vscode": "1.1.3",
"com.unity.ide.vscode": "1.1.4",
"com.unity.inputsystem": "0.9.6-preview",
"com.unity.postprocessing": "2.2.2",
"com.unity.postprocessing": "2.3.0",
"com.unity.purchasing": "2.0.6",
"com.unity.render-pipelines.universal": "7.1.7",
"com.unity.render-pipelines.universal": "7.1.8",
"com.unity.test-framework": "1.1.9",
"com.unity.textmeshpro": "2.0.1",
"com.unity.timeline": "1.2.9",
"com.unity.timeline": "1.2.10",
"com.unity.ugui": "1.0.0",
"com.unity.webrtc": "https://github.com/Unity-Technologies/com.unity.webrtc.git#release/1.1.0",
"com.unity.modules.ai": "1.0.0",
Expand Down Expand Up @@ -51,7 +51,7 @@
"lock": {
"com.unity.webrtc": {
"revision": "release/1.1.0",
"hash": "0f45d9be2546030d6e7c9f71788670ddc2b88554"
"hash": "97a06335330c7f0a92f5e03c658dc89c04a641a6"
}
}
}