这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@markgrossnickle
Copy link
Contributor

WIP. Will update this as I go. If you read this before I update here are some quick thoughts:

  • the calls into the FFI native code were not async so our async methods and refactor that trickled down from that was unnecessary. I know there is a task to make the API async but if the methods are sync it doesn't make sense to force it at least for now. Once we get this working and testing and see performance issues then we could circle back there and split methods up with delays/etc.

  • threading. I removed many of them as we were creating threads from threads. If the assumption is that everything can be called from a background thread as the notion dock states then it seems threading should be started outside of the api and we should just support it. I'll share access to our LiveKitTester class which spins up threads for publishing data, mic, and video. That said! We definitely want threads in the high performance areas of audio and video. Areas that previously were coroutines. So I overhauled AudioStream, AudioSource, VideoStream, and VideoSource.

Some thoughts moving forward:

  1. Test. We have an audio issue elsewhere which Cristian is working on so I can't fully test this yet.
  2. For threading in audio/video I am mostly using the last object. Will need to see if we need a queue instead.
  3. For threading again... make sure everything is working on a background thread. I believe the client should handle ensuring texture updates/etc should be done on the main thread.

ashkan-saeedi-mazdeh and others added 30 commits December 15, 2023 13:09
Room Ids are different
modification trying to fix compiler errors
@CLAassistant
Copy link

CLAassistant commented Jan 17, 2024

CLA assistant check
All committers have signed the CLA.

@markgrossnickle
Copy link
Contributor Author

Sorry, was meant for a fork.

cloudwebrtc pushed a commit that referenced this pull request Apr 1, 2024
* fix clear message

* optimise FfiNewRequest - no FfiHandle

* LiveKitInitialize with IntPtr

* const format

* memory pool

* inner message pooling

* ArrayMemoryPool with thread safety

* remove obsolete

* thread safety
cloudwebrtc added a commit that referenced this pull request Apr 8, 2024
* Fixed a memory leak

* Fixed the last error regarding the leak fix

* fix.

* ring buffer as struct

* to prevent null reference

* Multithread refactor (#13)

* disconnect support

* Fix name

* To handle better connection and disconnection from room

* change to avoid using of Coroutines, using async methods instead

* async OnAudioRead

* Cleaning logs

* Cancel tokens

* Cancel token

* remove Task.Run, since usually SendRequest is called from other task

* getting rid of use YieldInstruction

* adding audio filter in main thread

* passing CancellationToken instead of CancellationTokenSource

* added check for cancellation at beginning

* Cleaning handles

* fix await

* remove cruft

* Cancellation token cleanup

* Factory async method

* basic handling of remaining events

* more async

* wip

* Compile pass

* formatting

* fix pending check

* revert async changes

* prep audio filter for threads

* loggin

* logs to debug publishing track

* minor cleanup

* added some methods to handle localtrack and SetSubscribed, Clenaing code

* Cleaning up

* fixes for yield instructions

* macro for verbose logs

* Audio data and pointer fix

Still says samplerate and num of channels are incorrect

* remove possibility of null

* todo ref buffering

* minor cleanup

* cruft

* todo object pooling

* remove redundant Task usages on separated threads

---------

Co-authored-by: cdga777 <cdga777@gmail.com>
Co-authored-by: nickkhalow <nickhalow@gmail.com>

* feat: optimisations (#16)

* remove redundant Task usages on separated threads

* FfiRequestsPool

* IFFIClient interface

* disposable FFIClient

* FFIClient initialize simplify

* PoolableFFIClient

* NativeMethods pass pointer

* response pooling

* tests for reject manual creation of protocol objects

* FfiResponseWrap, remove manual new Request calls

* remove IPoolableFFIClient

* FFIBridge introduction, remove closures, RAII with FfiResponseWrap and FfiRequestWrap

* Clear -> generic ClearMessage

* Make the Ffi Handle type consistent.

* room support spans

* cleanup.

* feat: optimisation - memory pooling, FfiHandles (#18)

* fix clear message

* optimise FfiNewRequest - no FfiHandle

* LiveKitInitialize with IntPtr

* const format

* memory pool

* inner message pooling

* ArrayMemoryPool with thread safety

* remove obsolete

* thread safety

* RingBuffer recycling

* dangerous access for memory buffer (#26)

* feat: Audio/Video Support (#29)

* ensure channels and rate match

* subscription change

* fixing early subscription

* track handle fix

temp logs to confirm

* track handle fix

* streaming fixes

* remix fix

* resample log check

* try off frame

* handler fix

* log cleanup

* saving track for local Participant

* remix potential fix

* cleanup checks

* testing without thread

* revert

* destroy cleanup and possible fix to ringbuffer

* log cleanup

* test

* revert

* disable thread for test

* test

* fix

* adding threading back in for writing

* video prep

* handle fix

* fix cast

* removing streams from video for now

* buffer fix

* hack to get it to send a web texture

* more consistent naming

* format fix

* bad merge fix

* first pass on screen share and memory fix

* debug and formatting

* remove logs

* updated protobuff and fixed compiler errors

* video working

* dynamic buffertype and stride

* split video source and partial wip on cameravideoSource

* camera support

* merge cont.

* wip merging

* adding back stomped change

* latest libs for mac

* Fixes for Audio/Video Streaming

* remove cruft

* fix when an AudioTrack is created

* mac fix

* null check which can occur if you are closing app

* format checks

* utils

* fix for metal

* Subscription management

* cleanup

* log cleanup

* cleanup

* log

---------

Co-authored-by: cdga777 <cdga777@gmail.com>

* update local metadata.

* fix message truncation bug.

* Update livekit_ffi.dll.meta

* Update libwebrtc.jar.meta

* update.

* some minor improvements.

* update.

---------

Co-authored-by: Ashkan Saeidi Mazdeh <ashkan.saeedi.1989@gmail.com>
Co-authored-by: nickkhalow <nickhalow@gmail.com>
Co-authored-by: cdga777 <cdga777@gmail.com>
Co-authored-by: Mark Grossnickle <markgrossnickle@users.noreply.github.com>
Co-authored-by: Nick Khalow <71646502+NickKhalow@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

4 participants