-
Notifications
You must be signed in to change notification settings - Fork 254
Data tracks - incoming manager #1819
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
Open
1egoman
wants to merge
46
commits into
main
Choose a base branch
from
data-track-incoming-manager
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
07ae04b
feat: make improvements to how error generics are parsed
1egoman c5fdaa0
feat: make more modifications to throws-transformer to work with Erro…
1egoman 2923ec2
fix: get rid of collapsing union function in throws-transformer
1egoman 65cba12
feat: migrate whole data tracks implementation to get rid of reasons …
1egoman 45b9ad5
feat: remove signal option from tryPush / tryProcessAndSend
1egoman 85ee46e
feat: add some better handling of new Promise constructor / catch cha…
1egoman 27ae3d0
fix: run npm run format
1egoman 27105a8
refactor: break up data-track/track.ts into LocalDataTrack / types files
1egoman 278a473
feat: add initial IncomingDataTrackManager implementation
1egoman 4487bbe
feat: move RemoteDataTrack into its own file
1egoman 85c5355
fix: address throw transform warnings
1egoman 6dce9ec
fix: run npm run format and lint
1egoman e2323b7
fix: remove unused DataTrackPacketizerReason import
1egoman 3878e4d
feat: apply same rethrow pattern as try_push to break the Throws erro…
1egoman e3c149a
feat: add first pass of track interfaces (idea from from lukas 1:1)
1egoman aa940eb
feat: add first part of tests for IncomingDataTrackManager
1egoman 25de921
feat: add more tests and bugfixes to IncomingDataTrackManager to bett…
1egoman fd9a709
feat: add e2ee subscription test
1egoman 725008a
fix: run npm run format
1egoman b09d811
refactor: rename methods / add docs comments
1egoman 340846a
refactor: move incoming pipeline into its own file
1egoman 6a6b2cb
refactor: get rid of unused DataTrackStreamReader
1egoman c7e6833
refactor: break errors out into separate file
1egoman 1f3c6df
fix: clean up residual dead code left from rust port
1egoman 36cc0cb
fix: delete dead code accidentally commited from development of new t…
1egoman 8df9531
fix: add missing changeset file
1egoman 6e287d0
fix: rework RemoteDataTrack signature to be better for future extension
1egoman 498e181
feat: add new trackUnavailable event after jacob 1:1
1egoman df28392
feat: import incoming data track manager so linting / etc runs on it
1egoman 7e0ec3b
fix: run format and lint
1egoman bbcbbd6
feat: update localitySymbol -> isLocal and add ITrack
1egoman f40f73b
fix: remove changeset based on lukas suggestion
1egoman 9f72217
feat: remove exports for new track interface helpers
1egoman d7d0908
feat: convert to using abort signal polyfills
1egoman d32d628
feat: handle immediate abortsignal abort case in OutgoingDataTrackMan…
1egoman e3dccea
feat: alter the incoming manager subscription logic to fix some subtl…
1egoman d848d81
fix: run npm run format
1egoman 710f20b
feat: add remote participant disconnected handler to terminate in fli…
1egoman 5ff3c2e
fix: add omitted trackAvailable event to tests
1egoman 6cbf73e
feat: add tests for remote participant disconnects cleaning up remote…
1egoman a9718cf
fix: run npm run format
1egoman 4c7b39c
fix: clear descriptors after calling shutdown
1egoman 6bdd819
feat: add explicit queuing strategy to IncomingDataTrackManager Reada…
1egoman edf51bf
fix: address comment typo
1egoman 815e291
feat: add more data track publication tests
1egoman c5a8d77
feat: update default high water mark threshold for incoming `Readable…
1egoman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 13 additions & 10 deletions
23
src/room/data-track/track.ts → src/room/data-track/LocalDataTrack.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| import type Participant from '../participant/Participant'; | ||
| import type { DataTrackFrame } from './frame'; | ||
| import type IncomingDataTrackManager from './incoming/IncomingDataTrackManager'; | ||
| import { | ||
| DataTrackSymbol, | ||
| type IDataTrack, | ||
| type IRemoteTrack, | ||
| TrackSymbol, | ||
| } from './track-interfaces'; | ||
| import { type DataTrackInfo } from './types'; | ||
|
|
||
| type RemoteDataTrackOptions = { | ||
| publisherIdentity: Participant['identity']; | ||
| }; | ||
|
|
||
| export type RemoteDataTrackSubscribeOptions = { | ||
| signal?: AbortSignal; | ||
|
|
||
| /** The number of {@link DataTrackFrame}s to hold in the ReadableStream before disgarding extra | ||
| * frames. Defaults to 4, but this may not be good enough for especially high frequency data. */ | ||
| highWaterMark?: number; | ||
| }; | ||
|
|
||
| export default class RemoteDataTrack implements IRemoteTrack, IDataTrack { | ||
| readonly trackSymbol = TrackSymbol; | ||
|
|
||
| readonly isLocal = false; | ||
|
|
||
| readonly typeSymbol = DataTrackSymbol; | ||
|
|
||
| info: DataTrackInfo; | ||
|
|
||
| publisherIdentity: Participant['identity']; | ||
|
|
||
| protected manager: IncomingDataTrackManager; | ||
|
|
||
| /** @internal */ | ||
| constructor( | ||
| info: DataTrackInfo, | ||
| manager: IncomingDataTrackManager, | ||
| options: RemoteDataTrackOptions, | ||
| ) { | ||
| this.info = info; | ||
| this.manager = manager; | ||
| this.publisherIdentity = options.publisherIdentity; | ||
| } | ||
|
|
||
| /** Subscribes to the data track to receive frames. | ||
| * | ||
| * # Returns | ||
| * | ||
| * A stream that yields {@link DataTrackFrame}s as they arrive. | ||
| * | ||
| * # Multiple Subscriptions | ||
| * | ||
| * An application may call `subscribe` more than once to process frames in | ||
| * multiple places. For example, one async task might plot values on a graph | ||
| * while another writes them to a file. | ||
| * | ||
| * Internally, only the first call to `subscribe` communicates with the SFU and | ||
| * allocates the resources required to receive frames. Additional subscriptions | ||
| * reuse the same underlying pipeline and do not trigger additional signaling. | ||
| * | ||
| * Note that newly created subscriptions only receive frames published after | ||
| * the initial subscription is established. | ||
| */ | ||
| async subscribe( | ||
| options?: RemoteDataTrackSubscribeOptions, | ||
| ): Promise<ReadableStream<DataTrackFrame>> { | ||
| try { | ||
| const stream = await this.manager.subscribeRequest( | ||
| this.info.sid, | ||
| options?.signal, | ||
| options?.highWaterMark, | ||
| ); | ||
| return stream; | ||
| } catch (err) { | ||
| // NOTE: Rethrow errors to break Throws<...> type boundary | ||
| throw err; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.