Comments (4)
I am using Unity 2020.3.30f1 version. I installed Agora SDK and started screen sharing. I used the StartScreenCaptureByScreenRect function to share the monitor area and Unity crashes.
What's the problem?
I have 2 monitors and each has a different resolution.
hi @seungsunkim could you pls share the crash stack trace with us?
I have solved this by realloc the buffer size.
In the VideoSurface.cs
of the demo, there is a constexpr private System.IntPtr data = Marshal.AllocHGlobal(1920 * 1080* 4);
For the client(audience, receiver):
It will crash while the size of buffer sent by the native method updateVideoRawData
is greater than the allocated size.
For the server(broadcaster, sender):
The third parameter of method StartScreenCaptureByScreenRect
is the struct ScreenCaptureParameters
.
It will crash while the ScreenCaptureParameters.dimensions.width * ScreenCaptureParameters.dimensions.height
is greater than the allocated size.
from agora-unity-quickstart.
hi @seungsunkim could you pls share the crash stack trace with us?
from agora-unity-quickstart.
hi @seungsunkim could you pls share the crash stack trace with us?
This issue also happens on me with Unity 2020.3.2f1.
And the stacktrace is as bellow:
Stacktrace:
at <0xffffffff>
at (wrapper managed-to-native) agora_gaming_rtc.IRtcEngineNative.updateVideoRawData (intptr,uint) [0x0000a] in :0
at agora_gaming_rtc.VideoRender.UpdateVideoRawData (uint,intptr,int&,int&) [0x00013] in D:\Agora_Unity_SDK_FULL\samples\Hello-Video-Unity-Agora\Assets\AgoraEngine\Scripts\AgoraGamingSDK\videoRender\VideoRender.cs:93
at agora_gaming_rtc.VideoSurface.Update () [0x000f4] in D:\Agora_Unity_SDK_FULL\samples\Hello-Video-Unity-Agora\Assets\AgoraEngine\Scripts\AgoraGamingSDK\videoRender\VideoSurface.cs:122
at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) [0x00020] in <695d1cc93cca45069c528c15c9fdd749>:0
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
Received signal SIGSEGV
Stack trace:
0x00007ffb7f6b7e46 (agoraSdkCWrapper) deleteEngine
0x0000018ba2f5db86 (Mono JIT Code) (wrapper managed-to-native) agora_gaming_rtc.IRtcEngineNative:updateVideoRawData (intptr,uint)
0x0000018ba2f5d973 (Mono JIT Code) [VideoRender.cs:93] agora_gaming_rtc.VideoRender:UpdateVideoRawData (uint,intptr,int&,int&)
0x0000018ba2ef786b (Mono JIT Code) [VideoSurface.cs:122] agora_gaming_rtc.VideoSurface:Update ()
0x0000018b94aed3f8 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ffb9e79f280 (mono-2.0-bdwgc) [mini-runtime.c:2827] mono_jit_runtime_invoke
0x00007ffb9e722ac2 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke
0x00007ffb9e72bb1f (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke
0x00007ff7172e29c4 (Unity) scripting_method_invoke
0x00007ff7172daeb5 (Unity) ScriptingInvocation::Invoke
0x00007ff7172865f4 (Unity) MonoBehaviour::CallMethodIfAvailable
0x00007ff7172866fc (Unity) MonoBehaviour::CallUpdateMethod
0x00007ff71673d398 (Unity) BaseBehaviourManager::CommonUpdate
0x00007ff7167472ea (Unity) BehaviourManager::Update
0x00007ff716bbb73d (Unity) InitPlayerLoopCallbacks'::
2'::UpdateScriptRunBehaviourUpdateRegistrator::Forward
0x00007ff716b9c19c (Unity) ExecutePlayerLoop
0x00007ff716b9c273 (Unity) ExecutePlayerLoop
0x00007ff716ba30a9 (Unity) PlayerLoop
0x00007ff717ffc4a1 (Unity) PlayerLoopController::UpdateScene
0x00007ff717ffa109 (Unity) Application::TickTimer
0x00007ff71899b4a1 (Unity) MainMessageLoop
0x00007ff71899f4e1 (Unity) WinMain
0x00007ff71a7fdef6 (Unity) __scrt_common_main_seh
0x00007ffc2db854e0 (KERNEL32) BaseThreadInitThunk
0x00007ffc2eea485b (ntdll) RtlUserThreadStart
from agora-unity-quickstart.
@Arlen-LT - not sure if you only want to share an area of the screen or it is the display you want to share. In the latest SDK version, you may call startScreenCaptureForDisplay() now for the display capture.
from agora-unity-quickstart.
Related Issues (20)
- test
- So many errors (with error code CS0246,CS0234,CS0115) even after importing the SDK HOT 3
- Unity Cloud Build Failure because of Linked Frameworks HOT 6
- Error 110 - attempting to use BasicVideoCallScene HOT 2
- User Joined event not triggering all the the time HOT 1
- 请问支持HoloLens 2平台吗? HOT 1
- Unity Android and iOS (possible) phone overheat HOT 1
- Challenges with Code Signing on Mac Following Agora Integration HOT 4
- Screen Share not work in iOS HOT 4
- A lot of errors when starting with UnityEditor. HOT 6
- Screen Sharing with system audio capture Mac/Windows HOT 2
- Does this support the uwp platform HOT 2
- initialize engine fail HOT 1
- 音频在ipad pro上会导致声音变成听筒模式 HOT 3
- Sometimes OnUserJoin dose not trigger for newly joined users HOT 2
- Can not open Example Scene with 2019 or 2020 HOT 2
- Create engine failed, error code: -7 , with Fetching the Token scene HOT 3
- Demo演示,3D物体上的视频不会渲染,而UI正常 HOT 5
- Token is Invalid HOT 2
- Are Android and IOS screenshare support? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agora-unity-quickstart.