Giter Site home page Giter Site logo

Comments (4)

Arlen-LT avatar Arlen-LT commented on September 23, 2024 1

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.

plutoless avatar plutoless commented on September 23, 2024

hi @seungsunkim could you pls share the crash stack trace with us?

from agora-unity-quickstart.

Arlen-LT avatar Arlen-LT commented on September 23, 2024

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.

icywind avatar icywind commented on September 23, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.