-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a0ee074
commit 70fcedd
Showing
10 changed files
with
164 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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,42 @@ | ||
import 'package:flutter_webrtc/flutter_webrtc.dart'; | ||
|
||
import '../core/room.dart'; | ||
import '../types/other.dart'; | ||
|
||
class ProcessorOptions<T extends TrackType> { | ||
T kind; | ||
MediaStreamTrack track; | ||
ProcessorOptions({ | ||
required this.kind, | ||
required this.track, | ||
}); | ||
} | ||
|
||
class AudioProcessorOptions extends ProcessorOptions { | ||
AudioProcessorOptions({ | ||
required MediaStreamTrack track, | ||
}) : super(kind: TrackType.AUDIO, track: track); | ||
} | ||
|
||
class VideoProcessorOptions extends ProcessorOptions { | ||
VideoProcessorOptions({ | ||
required MediaStreamTrack track, | ||
}) : super(kind: TrackType.VIDEO, track: track); | ||
} | ||
|
||
abstract class TrackProcessor<T extends ProcessorOptions> { | ||
String get name; | ||
|
||
Future<void> init(T options); | ||
|
||
Future<void> restart(); | ||
|
||
Future<void> destroy(); | ||
|
||
/// for flutter web only | ||
MediaStreamTrack? get processedTrack; | ||
|
||
Future<void> onPublish(Room room); | ||
|
||
Future<void> onUnpublish(); | ||
} |
This file contains 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,14 @@ | ||
import 'package:web/web.dart'; | ||
|
||
import 'processor.dart'; | ||
|
||
class AudioProcessorOptionsWeb extends AudioProcessorOptions { | ||
AudioProcessorOptionsWeb({ | ||
this.audioElement, | ||
this.audioContext, | ||
required super.track, | ||
}); | ||
|
||
HTMLAudioElement? audioElement; | ||
AudioContext? audioContext; | ||
} |
This file contains 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