Skip to content

[camera] MediaSettings parameter for createCameraWithSettings#3586

Merged
auto-submit[bot] merged 159 commits intoflutter:mainfrom
mtbo-org:main
May 6, 2024
Merged

[camera] MediaSettings parameter for createCameraWithSettings#3586
auto-submit[bot] merged 159 commits intoflutter:mainfrom
mtbo-org:main

Conversation

@PROGrand
Copy link
Contributor

@PROGrand PROGrand commented Mar 29, 2023

This PR is for enabling fps and bitrate control of recorded video.
Allow users to more control over recorded video size.
CameraPlatform.createCameraWithSettings is added, leaving original CameraPlatform.createCamera commented as deprecated. So this is not breaking change.
Tested on a set of mobile devices.
Web support depends on browser (perfect with Firefox).

Fixes flutter/flutter#54339

@PROGrand
Copy link
Contributor Author

PROGrand commented Mar 29, 2023

This is main PR. Platform interface's PR is here: #3615

Copy link
Contributor

@hellohuanlin hellohuanlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. This is very nice feature to have. Can you share a video capture after this change?

PROGrand and others added 5 commits March 31, 2023 01:12
<?code-excerpt "readme_full_example.dart (FullAppExample)"?>
```dart
import 'package:camera/camera.dart';
import 'package:camera_platform_interface/camera_platform_interface.dart';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still here.


// #docregion FullAppExample
import 'package:camera/camera.dart';
import 'package:camera_platform_interface/camera_platform_interface.dart';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

Comment on lines +237 to +244
CameraController(
CameraDescription description,
this.resolutionPreset, {
this.enableAudio = true,
ResolutionPreset resolutionPreset, {
bool enableAudio = true,
this.imageFormatGroup,
}) : mediaSettings = MediaSettings(
resolutionPreset: resolutionPreset, enableAudio: enableAudio),
super(CameraValue.uninitialized(description));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hasn't been addressed.

@PROGrand
Copy link
Contributor Author

PROGrand commented Apr 17, 2024

@stuartmorgan
#3586 (comment)

Sorry, what did you mean?

@stuartmorgan-g
Copy link
Collaborator

@stuartmorgan #3586 (comment)

Sorry, what did you mean?

#3586 (comment)

@PROGrand
Copy link
Contributor Author

@stuartmorgan
Unwrapped media settings class into parameters and added to CameraController constructor as optionals. Is it acceptable?

Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App federated: all_changes PR that contains changes for all packages for a federated plugin change p: camera

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[camera] Support custom frame rate and bit rate