Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unity import package error for CaptureStream arguments changed. #2

Closed
nuoma opened this issue Dec 12, 2022 · 3 comments
Closed

Unity import package error for CaptureStream arguments changed. #2

nuoma opened this issue Dec 12, 2022 · 3 comments
Assignees

Comments

@nuoma
Copy link

nuoma commented Dec 12, 2022

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

@winlinvip
Copy link
Member

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.

@winlinvip
Copy link
Member

winlinvip commented Jan 27, 2023

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.

@winlinvip winlinvip changed the title 导入时报错 Unity import package error for CaptureStream argument error. Jan 27, 2023
@winlinvip winlinvip changed the title Unity import package error for CaptureStream argument error. Unity import package error for CaptureStream arguments changed. Jan 27, 2023
@winlinvip winlinvip self-assigned this Jan 27, 2023
@winlinvip winlinvip reopened this Jan 27, 2023
winlinvip added a commit that referenced this issue Jan 27, 2023
@winlinvip
Copy link
Member

Fixed in v1.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants