Unity-Technologies / com.unity.webrtc

WebRTC package for Unity
Other
753 stars 191 forks source link

Command buffer batching #915

Closed aet closed 1 year ago

aet commented 1 year ago

I've had some use cases where I'm dealing with multiple recv/send video tracks and it's hard to profile how much time is spent in total when there's multiple command buffer submissions. It'll save some main/render thread processing time if we just submit the requests in batches. If needed to, you could do "once a frame" bookkeeping on the native side, flush, etc.

karasusan commented 1 year ago

Sorry for the late confirmation. I checked the latest changeset and I found these errors below. Can you see it?

Detail(s): Message: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs(295,42): error CS0117: 'NativeMethods' does not contain a definition for 'GetRenderEventFunc', File: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs, Line: 295
Message: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs(297,27): error CS0117: 'NativeMethods' does not contain a definition for 'GetRenderEventFunc', File: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs, Line: 297
Message: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs(341,42): error CS0117: 'NativeMethods' does not contain a definition for 'GetRenderEventFunc', File: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs, Line: 341
Message: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs(342,47): error CS0117: 'NativeMethods' does not contain a definition for 'GetRenderEventID', File: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs, Line: 342
Message: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs(345,30): error CS0426: The type name 'EncodeData' does not exist in the type 'VideoTrackSource', File: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs, Line: 345
Message: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs(345,69): error CS0426: The type name 'EncodeData' does not exist in the type 'VideoTrackSource', File: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs, Line: 345
Message: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs(346,86): error CS0426: The type name 'EncodeData' does not exist in the type 'VideoTrackSource', File: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs, Line: 346
Message: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs(348,13): error CS0103: The name 'VideoEncoderMethods' does not exist in the current context, File: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs, Line: 348
Message: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs(386,45): error CS0117: 'NativeMethods' does not contain a definition for 'GetRenderEventFunc', File: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs, Line: 386
Message: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs(387,47): error CS0117: 'NativeMethods' does not contain a definition for 'GetRenderEventID', File: Packages/com.unity.webrtc/Tests/Runtime/NativeAPITest.cs, Line: 387
aet commented 1 year ago

I'll have a look

aet commented 1 year ago

@karasusan should be all clear now!

karasusan commented 1 year ago

I found the bug in the unittest code. Could you add this change to your PR? https://github.com/Unity-Technologies/com.unity.webrtc/commit/658bd79aac45f447f9884257636b8b3d437fce41