-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR that has only the platform interface package changes from the #3586 …
…PR
- Loading branch information
Showing
9 changed files
with
166 additions
and
24 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
60 changes: 60 additions & 0 deletions
60
packages/camera/camera_platform_interface/lib/src/types/media_settings.dart
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,60 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// ignore_for_file: avoid_equals_and_hash_code_on_mutable_classes | ||
|
||
import 'resolution_preset.dart'; | ||
|
||
/// Recording media settings. | ||
/// | ||
/// Used in [CameraPlatform.createCameraWithSettings]. | ||
/// Allows to tune recorded video parameters, such as resolution, frame rate, bitrate. | ||
class MediaSettings { | ||
/// Creates a [MediaSettings]. | ||
const MediaSettings({ | ||
this.resolutionPreset, | ||
this.fps, | ||
this.videoBitrate, | ||
this.audioBitrate, | ||
this.enableAudio = false, | ||
}); | ||
|
||
/// [ResolutionPreset] affect the quality of video recording and image capture. | ||
final ResolutionPreset? resolutionPreset; | ||
|
||
/// Rate at which frames should be captured by the camera in frames per second. | ||
final int? fps; | ||
|
||
/// The video encoding bit rate for recording. | ||
final int? videoBitrate; | ||
|
||
/// The audio encoding bit rate for recording. | ||
final int? audioBitrate; | ||
|
||
/// Controls audio presence in recorded video. | ||
final bool enableAudio; | ||
|
||
@override | ||
bool operator ==(Object other) => | ||
identical(this, other) || | ||
other is MediaSettings && | ||
runtimeType == other.runtimeType && | ||
resolutionPreset == other.resolutionPreset && | ||
fps == other.fps && | ||
videoBitrate == other.videoBitrate && | ||
audioBitrate == other.audioBitrate && | ||
enableAudio == other.enableAudio; | ||
|
||
@override | ||
int get hashCode => | ||
resolutionPreset.hashCode ^ | ||
fps.hashCode ^ | ||
videoBitrate.hashCode ^ | ||
audioBitrate.hashCode ^ | ||
enableAudio.hashCode; | ||
|
||
@override | ||
String toString() => | ||
'MediaSettings{resolutionPreset: $resolutionPreset, fps: $fps, videoBitrate: $videoBitrate, audioBitrate: $audioBitrate, enableAudio: $enableAudio}'; | ||
} |
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