Unity import package error for CaptureStream arguments changed.
nuoma opened this issue · 3 comments
After import:Assets\ossrs.io\Video Streaming and WebRTC Samples\Streamer\SrsStreamer.cs(96,64): error CS1503: Argument 4: cannot convert from 'int' to 'Unity.WebRTC.RenderTextureDepth'
Version:unity2021.3.6f1, webRTC v3.0.0-pre.2-December 09, 2022
I found this is the API change for Unity WebRTC.
In 2.0, https://docs.unity3d.com/Packages/com.unity.webrtc@2.0/api/Unity.WebRTC.CameraExtension.html
public static MediaStream CaptureStream(this Camera cam, int width, int height, int bitrate, RenderTextureDepth depth = RenderTextureDepth.DEPTH_24)
In 2.4, https://docs.unity3d.com/Packages/com.unity.webrtc@2.4/api/Unity.WebRTC.CameraExtension.html
public static MediaStream CaptureStream(this Camera cam, int width, int height, RenderTextureDepth depth = RenderTextureDepth.Depth24)
The third parameter bitrate
is removed.
It's been removed by this PR Unity-Technologies/com.unity.webrtc#498
So should use 2.4.0-exp.11 or higher version.
Please see https://github.com/ossrs/srs-unity#environments for details.
Fixed in v1.0.1