Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
19c5f43
[camera_windows] Initial plugin implementation
jokerttu Jan 5, 2022
dbd214d
[camera_windows] Improve README
jokerttu Jan 5, 2022
8937405
[camera_windows] Update pubspec files
jokerttu Jan 5, 2022
420e6c8
[camera_windows] Add integration tests
jokerttu Jan 5, 2022
49e9222
[camera_windows] Fix formatting for windows runner
jokerttu Jan 5, 2022
f188352
[camera_windows] Add missing license blocks
jokerttu Jan 5, 2022
34297ff
Merge remote-tracking branch 'origin/master' into camera_windows
jokerttu Jan 5, 2022
01478ed
[camera_windows] Update camera_platform_interface
jokerttu Jan 5, 2022
646ddbd
Merge branch 'main' into camera_windows
jokerttu Jan 7, 2022
7b7e9aa
Merge remote-tracking branch 'origin/main' into camera_windows
jokerttu Jan 11, 2022
ccc8ca0
[camera_windows] Use smart pointers for IUnknown classes
jokerttu Jan 11, 2022
2a5fcdc
Merge remote-tracking branch 'origin/main' into camera_windows
jokerttu Jan 12, 2022
0ee296f
[camera_windows] Code cleanup, fix memory leak
jokerttu Jan 12, 2022
5664077
[camera_windows] Improve event and error handling
jokerttu Jan 13, 2022
930a6b2
[camera_windows] Fix format
jokerttu Jan 13, 2022
8a80e1c
[camera_windows] capture controller test mocks
jokerttu Jan 14, 2022
8c651ec
[camera_windows] Fix intergration tests
jokerttu Jan 14, 2022
1eca936
[camera_windows] fix example dart format
jokerttu Jan 14, 2022
7c34172
[camera_windows] code cleanup
jokerttu Jan 14, 2022
8379548
[camera_windows] Add more test cases
jokerttu Jan 15, 2022
1827226
[camera_windows] Add start record tests
jokerttu Jan 17, 2022
b391226
[camera_windows] Add tests to rest of the capture_controller success …
jokerttu Jan 17, 2022
06b3865
[camera_windows] Fix formatting
jokerttu Jan 17, 2022
b75df3f
Merge remote-tracking branch 'origin/main' into camera_windows
jokerttu Jan 17, 2022
9d03c50
Merge remote-tracking branch 'origin/main' into camera_windows
jokerttu Jan 24, 2022
d50f9fd
[camera_windows] update readme.md
jokerttu Jan 24, 2022
1fa0fce
[camera_windows] remove todo from integration_tests
jokerttu Jan 24, 2022
60023f4
[camera_windows] remove unnecessary library
jokerttu Jan 24, 2022
8b4fe0c
[camera_windows] return unimplemented errors
jokerttu Jan 24, 2022
64fd233
[camera_windows] change minimum cmake version to 3.14
jokerttu Jan 24, 2022
7c0f3db
[camera_windows] remove url_launcher dependency
jokerttu Jan 24, 2022
6678a5a
[camera_windows] removed boilerplate from example readme
jokerttu Jan 24, 2022
14dedf2
[camera_windows] return unimplemented error
jokerttu Jan 24, 2022
1033686
[camera_windows] dart comments fixed
jokerttu Jan 24, 2022
87d0870
[camera_windows] fix dart comments
jokerttu Jan 24, 2022
89a0911
[camera_windows] rename pixel format structs
jokerttu Jan 24, 2022
d13ef86
[camera_windows] code cleanup
jokerttu Jan 24, 2022
0a13788
[camera_windows] rename plugin and camera channels
jokerttu Jan 24, 2022
9b97fd9
[camera_windows] change flutter version to >=2.5.0
jokerttu Jan 24, 2022
44305ff
[camera_windows] Fix comment formatting
jokerttu Jan 24, 2022
166698f
[camera_windows] format fixes
jokerttu Jan 24, 2022
caa38a2
[camera_windows] code cleanup
jokerttu Jan 24, 2022
d41b64a
[camera_windows] prefer initializing at declaration rather than in th…
jokerttu Jan 24, 2022
c2bd09c
[camera_windows] fix wrong return type
jokerttu Jan 24, 2022
9cd612d
[camera_windows] separate record handler
jokerttu Jan 26, 2022
528b94a
[camera_windows] type-align pointers
jokerttu Jan 26, 2022
c123cd2
[camera_windows] refactor capture_controller
jokerttu Jan 26, 2022
2e23161
[camera_windows] fix unit tests
jokerttu Jan 26, 2022
b7679f1
[camera_windows] prefer smart pointers
jokerttu Jan 26, 2022
2f6763a
[camera_windows] re-use cameras method channel
jokerttu Jan 26, 2022
3fe7119
[camera_windows] Fix dart documentation errors
jokerttu Jan 26, 2022
81691bc
[camera_windows] fix depedencies
jokerttu Jan 26, 2022
85c7d85
[camera_windows] fix class member declaration order
jokerttu Jan 26, 2022
40cb353
[camera_windows] use friend class for tests
jokerttu Jan 27, 2022
8bb54ea
[camera_windows] remove need for atl support
jokerttu Jan 27, 2022
eecaa0d
[camera_windows] multicamera support for example
jokerttu Jan 27, 2022
c10e101
[camera_windows] fix media type for preview
jokerttu Jan 27, 2022
ac273f6
[camera_windows] use constexpr
jokerttu Jan 27, 2022
c86970c
[camera_windows] add resolution presets to example app
jokerttu Jan 27, 2022
5aa5dcd
[camera_windows] fixes to comments
jokerttu Jan 27, 2022
44855d9
[camera_windows] prefer best framerate
jokerttu Jan 28, 2022
de9367e
[camera_windows] mock frame rate
jokerttu Jan 28, 2022
fe8d25a
Merge remote-tracking branch 'origin/main' into camera_windows
jokerttu Jan 28, 2022
9b4399f
[camera_windows] Add AUTHORS file
jokerttu Jan 28, 2022
d151466
[camera_windows] separate texture handler
jokerttu Jan 28, 2022
951fd07
[camera_windows] fix formatting
jokerttu Jan 28, 2022
d24228e
[camera_windows] Remove generated_plugin_registrant.h
jokerttu Jan 28, 2022
3433387
[camera_windows] fix buffer locking
jokerttu Jan 31, 2022
bd27944
[camera_windows] Minor fixes
jokerttu Jan 31, 2022
a0e10f7
[camera_windows] Software mirror preview support
jokerttu Jan 31, 2022
b8be9cf
[camera_windows] add missing camera_closing event support
jokerttu Jan 31, 2022
dbf7e66
[camera_windows] add trailing white spaces
jokerttu Jan 31, 2022
ab9dfb4
[camera_windows] fix camera tests
jokerttu Jan 31, 2022
7f0f9b6
[camera_windows] fix integration tests
jokerttu Jan 31, 2022
54e445d
[camera_windows] handle both 32bit and 64bit camera ids
jokerttu Jan 31, 2022
1004d9f
[camera_windows] update readme and todos
jokerttu Jan 31, 2022
059216f
[camera_windows] update version number
jokerttu Jan 31, 2022
9ae75fb
[camera_windows] minor fixes to comments
jokerttu Jan 31, 2022
0c6ebc3
[camera_windows] revert device orientation change
jokerttu Jan 31, 2022
3414b91
[camera_windows] fix error type
jokerttu Jan 31, 2022
3852a61
[camera_windows] fix example error handling
jokerttu Feb 1, 2022
0e76d03
[camera_windows] language check for README
jokerttu Feb 1, 2022
c895ff4
[camera_windows] code style fixes
jokerttu Feb 1, 2022
c7ddc0c
[camera_windows] refactor pixelbuffer logic
jokerttu Feb 1, 2022
66a598f
[camera_windows] prefer smart pointers
jokerttu Feb 1, 2022
44e5b90
[camera_windows] fix error format to utf8
jokerttu Feb 2, 2022
73fdb7f
[camera_windows] improve example app quality
jokerttu Feb 2, 2022
518f1f2
[camera_windows] fix type casts
jokerttu Feb 2, 2022
0a68ffb
[camera_windows] minor code style fixes
jokerttu Feb 2, 2022
417b705
[camera_windows] mirror preview by default
jokerttu Feb 2, 2022
883ffa0
Merge remote-tracking branch 'origin/main' into camera_windows
jokerttu Feb 2, 2022
3bbbf49
[camera_windows] add stub dart tests
jokerttu Feb 2, 2022
6966b9d
[camera_windows] add class and enum descriptions
jokerttu Feb 2, 2022
98b70e5
Merge remote-tracking branch 'origin/main' into camera_windows
jokerttu Feb 2, 2022
a44e5a0
[camera_windows] language checks for class comments
jokerttu Feb 2, 2022
4cfd610
[camera_windows] add dart unit tests
jokerttu Feb 2, 2022
6daee1b
[camera_windows] add missing test dependency
jokerttu Feb 2, 2022
31c2e95
Tweaks and cleanup for documentation comments
cbracken Feb 2, 2022
6bcb485
Make functions const where possible
cbracken Feb 2, 2022
003f5f4
Pass strings by const reference
cbracken Feb 3, 2022
b689b2c
[camera_windows] tweaks to the documentation
jokerttu Feb 3, 2022
7b1845f
[camera_windows] fix formatting
jokerttu Feb 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/camera/camera_windows/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
.dart_tool/

.packages
.pub/

build/
10 changes: 10 additions & 0 deletions packages/camera/camera_windows/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: 18116933e77adc82f80866c928266a5b4f1ed645
channel: stable

project_type: plugin
8 changes: 8 additions & 0 deletions packages/camera/camera_windows/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Below is a list of people and organizations that have contributed
# to the Flutter project. Names should be added to the list like so:
#
# Name/Organization <email address>

Google Inc.
Joonas Kerttula <[email protected]>
Codemate Ltd.
3 changes: 3 additions & 0 deletions packages/camera/camera_windows/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.1.0

* Initial release
25 changes: 25 additions & 0 deletions packages/camera/camera_windows/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Copyright 2013 The Flutter Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
66 changes: 66 additions & 0 deletions packages/camera/camera_windows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Camera Windows Plugin

The Windows implementation of [`camera`][camera].

*Note*: This plugin is under development.
See [missing implementations and limitations](#missing-features-on-the-windows-platform).

## Usage

### Depend on the package

This package is not an [endorsed][endorsed-federated-plugin]
implementation of the [`camera`][camera] plugin, so you'll need to
[add it explicitly][install].

## Missing features on the Windows platform

### Device orientation

Device orientation detection
is not yet implemented: [issue #97540][device-orientation-issue].

### Pause and Resume video recording

Pausing and resuming the video recording
is not supported due to Windows API limitations.

### Exposure mode, point and offset

Support for explosure mode and offset
is not yet implemented: [issue #97537][camera-control-issue].

Exposure points are not supported due to
limitations of the Windows API.

### Focus mode and point

Support for explosure mode and offset
is not yet implemented: [issue #97537][camera-control-issue].

### Flash mode

Support for flash mode is not yet implemented: [issue #97537][camera-control-issue].

Focus points are not supported due to
current limitations of the Windows API.

### Streaming of frames

Support for image streaming is not yet implemented: [issue #97542][image-streams-issue].

## Error handling

Camera errors can be listened using the platform's `onCameraError` method.

Listening to errors is important, and in certain situations,
disposing of the camera is the only way to reset the situation.

<!-- Links -->

[camera]: https://pub.dev/packages/camera
[endorsed-federated-plugin]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin
[install]: https://pub.dev/packages/camera_windows/install
[camera-control-issue]: https://github.com/flutter/flutter/issues/97537
[device-orientation-issue]: https://github.com/flutter/flutter/issues/97540
[image-streams-issue]: https://github.com/flutter/flutter/issues/97542
46 changes: 46 additions & 0 deletions packages/camera/camera_windows/example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
10 changes: 10 additions & 0 deletions packages/camera/camera_windows/example/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: 18116933e77adc82f80866c928266a5b4f1ed645
channel: stable

project_type: app
3 changes: 3 additions & 0 deletions packages/camera/camera_windows/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# camera_windows_example

Demonstrates how to use the camera_windows plugin.
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// 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.

import 'dart:async';
import 'package:async/async.dart';
import 'package:camera_platform_interface/camera_platform_interface.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';

// Note that these integration tests do not currently cover
// most features and code paths, as they can only be tested if
// one or more cameras are available in the test environment.
// Native unit tests with better coverage are available at
// the native part of the plugin implementation.

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

group('initializeCamera', () {
testWidgets('throws exception if camera is not created',
(WidgetTester _) async {
final CameraPlatform camera = CameraPlatform.instance;

expect(() async => await camera.initializeCamera(1234),
throwsA(isA<CameraException>()));
});
});

group('takePicture', () {
testWidgets('throws exception if camera is not created',
(WidgetTester _) async {
final CameraPlatform camera = CameraPlatform.instance;

expect(() async => await camera.takePicture(1234),
throwsA(isA<PlatformException>()));
});
});

group('startVideoRecording', () {
testWidgets('throws exception if camera is not created',
(WidgetTester _) async {
final CameraPlatform camera = CameraPlatform.instance;

expect(() async => await camera.startVideoRecording(1234),
throwsA(isA<PlatformException>()));
});
});

group('stopVideoRecording', () {
testWidgets('throws exception if camera is not created',
(WidgetTester _) async {
final CameraPlatform camera = CameraPlatform.instance;

expect(() async => await camera.stopVideoRecording(1234),
throwsA(isA<PlatformException>()));
});
});

group('pausePreview', () {
testWidgets('throws exception if camera is not created',
(WidgetTester _) async {
final CameraPlatform camera = CameraPlatform.instance;

expect(() async => await camera.pausePreview(1234),
throwsA(isA<PlatformException>()));
});
});

group('resumePreview', () {
testWidgets('throws exception if camera is not created',
(WidgetTester _) async {
final CameraPlatform camera = CameraPlatform.instance;

expect(() async => await camera.resumePreview(1234),
throwsA(isA<PlatformException>()));
});
});

group('onDeviceOrientationChanged', () {
testWidgets('emits the initial DeviceOrientationChangedEvent',
(WidgetTester _) async {
final Stream<DeviceOrientationChangedEvent> eventStream =
CameraPlatform.instance.onDeviceOrientationChanged();

final StreamQueue<DeviceOrientationChangedEvent> streamQueue =
StreamQueue<DeviceOrientationChangedEvent>(eventStream);

expect(
await streamQueue.next,
equals(
const DeviceOrientationChangedEvent(
DeviceOrientation.landscapeRight,
),
),
);
});
});
}
Loading