-
Notifications
You must be signed in to change notification settings - Fork 36
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
b38d5a8
commit 7b87c29
Showing
5 changed files
with
131 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
include: package:pedantic/analysis_options.yaml | ||
|
||
linter: | ||
rules: | ||
- always_declare_return_types | ||
- avoid_empty_else | ||
- await_only_futures | ||
- avoid_returning_null_for_void | ||
- camel_case_extensions | ||
- camel_case_types | ||
- cancel_subscriptions | ||
- directives_ordering | ||
- flutter_style_todos | ||
- sort_constructors_first | ||
- sort_unnamed_constructors_first | ||
- sort_pub_dependencies | ||
- type_init_formals | ||
- unnecessary_brace_in_string_interps | ||
- unnecessary_const | ||
- unnecessary_new | ||
- unnecessary_getters_setters | ||
- unnecessary_null_aware_assignments | ||
- unnecessary_null_in_if_null_operators | ||
- unnecessary_overrides | ||
- unnecessary_parenthesis | ||
- unnecessary_statements | ||
- unnecessary_string_interpolations | ||
- unnecessary_this | ||
- unrelated_type_equality_checks | ||
- use_rethrow_when_possible | ||
- valid_regexps | ||
- void_checks | ||
|
||
analyzer: | ||
errors: | ||
# treat missing required parameters as a warning (not a hint) | ||
missing_required_param: warning | ||
# treat missing returns as a warning (not a hint) | ||
missing_return: warning | ||
# allow having TODOs in the code | ||
todo: ignore | ||
# allow self-reference to deprecated members (we do this because otherwise we have | ||
# to annotate every member in every test, assert, etc, when we deprecate something) | ||
deprecated_member_use_from_same_package: ignore | ||
# Ignore analyzer hints for updating pubspecs when using Future or | ||
# Stream and not importing dart:async | ||
# Please see https://github.com/flutter/flutter/pull/24528 for details. | ||
sdk_version_async_exported_from_core: ignore |
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,69 @@ | ||
import 'media_stream.dart'; | ||
|
||
class RTCVideoValue { | ||
const RTCVideoValue({ | ||
this.width = 0.0, | ||
this.height = 0.0, | ||
this.rotation = 0, | ||
this.renderVideo = false, | ||
}); | ||
static const RTCVideoValue empty = RTCVideoValue(); | ||
final double width; | ||
final double height; | ||
final int rotation; | ||
final bool renderVideo; | ||
double get aspectRatio { | ||
if (width == 0.0 || height == 0.0) { | ||
return 1.0; | ||
} | ||
return (rotation == 90 || rotation == 270) | ||
? height / width | ||
: width / height; | ||
} | ||
|
||
RTCVideoValue copyWith({ | ||
double? width, | ||
double? height, | ||
int? rotation, | ||
bool renderVideo = true, | ||
}) { | ||
return RTCVideoValue( | ||
width: width ?? this.width, | ||
height: height ?? this.height, | ||
rotation: rotation ?? this.rotation, | ||
renderVideo: this.width != 0 && this.height != 0 && renderVideo, | ||
); | ||
} | ||
|
||
@override | ||
String toString() => | ||
'$runtimeType(width: $width, height: $height, rotation: $rotation)'; | ||
} | ||
|
||
abstract class VideoRenderer { | ||
VideoRenderer(); | ||
|
||
Function? onResize; | ||
|
||
int get videoWidth; | ||
|
||
int get videoHeight; | ||
|
||
bool get muted; | ||
set muted(bool mute); | ||
|
||
///Return true if the audioOutput have been succesfully changed | ||
Future<bool> audioOutput(String deviceId); | ||
|
||
bool get renderVideo; | ||
|
||
int? get textureId; | ||
|
||
Future<void> initialize(); | ||
|
||
MediaStream? get srcObject; | ||
|
||
set srcObject(MediaStream? stream); | ||
|
||
Future<void> dispose(); | ||
} |
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 |
---|---|---|
@@ -1,15 +1,12 @@ | ||
name: webrtc_interface | ||
description: WebRTC Interface for Dart. | ||
description: WebRTC Interface for Dart-Web/Flutter. | ||
version: 1.0.0 | ||
homepage: https://flutter-webrtc.org | ||
|
||
environment: | ||
sdk: ">=2.12.0 <3.0.0" | ||
|
||
dependencies: | ||
sdp_transform: ^0.3.2 | ||
|
||
dev_dependencies: | ||
dart_code_metrics: ^4.4.0 | ||
pedantic: ^1.11.0 | ||
test: ^1.15.7 | ||
import_sorter: ^4.6.0 | ||
pedantic: ^1.11.1 | ||
test: any |