[camera_windows] Support camera on windows desktop platform (#4641)
This PR adds a Windows Desktop implementation of [camera plugin](https://pub.dev/packages/camera) using Media Foundation and CaptureEngine interface.
The implementation supports multiple cameras, video preview, and capturing photos and videos. Works with camera plugin and [camera example](https://pub.dev/packages/camera/example).
The current implementation uses FlutterDesktopPixelBuffer, but could be switched to use shared textures or Platform views after those are supported.
Unit tests are partially done; for the CaptureControllerImpl class all falilure code paths are not yet covered.
Still missing some features, like exposure and focus controls. These can be done later with interfaces IAMCameraControl and IAMVideoProcAmp,
Resolves flutter/flutter#41709: [camera] Add Windows support
[camera_windows] Support camera on windows desktop platform (#4641)
This PR adds a Windows Desktop implementation of [camera plugin](https://pub.dev/packages/camera) using Media Foundation and CaptureEngine interface.
The implementation supports multiple cameras, video preview, and capturing photos and videos. Works with camera plugin and [camera example](https://pub.dev/packages/camera/example).
The current implementation uses FlutterDesktopPixelBuffer, but could be switched to use shared textures or Platform views after those are supported.
Unit tests are partially done; for the CaptureControllerImpl class all falilure code paths are not yet covered.
Still missing some features, like exposure and focus controls. These can be done later with interfaces IAMCameraControl and IAMVideoProcAmp,
Resolves flutter/flutter#41709: [camera] Add Windows support
[camera] Convert Windows to Pigeon (#6925)
Replaces all of the manual method channel code in camera_windows with Pigeon.
I attempted to change the structure as little as possible, since this was already a large change. I don't particularly like the way the native result callback objects are managed (passed to Camera and tracked in a map), but I decided that redesigning that would be out of scope and introduced a std::variant to allow minimal changes to that structure. That does slightly undermine the type safety of the callbacks, but it's still strictly enforced at the level of the helpers that interact with the map.
Fixes https://github.com/flutter/flutter/issues/117905
[camera_windows] Revert: Support image streams on Windows platform (#7951)
This reverts commit b31a279641283f1ef75ee2cc586b53de559148e4 (https://github.com/flutter/packages/pull/7067)
The implementation had significant bugs:
- It had asynchronous results, but never responded to them, violating the engine API contract and preventing futures from completing.
- It std::moved pointers between classes, while still keeping them as ivars and global references and referring to them from long-lived handlers.
[camera_windows] Revert: Support image streams on Windows platform (#7951)
This reverts commit b31a279641283f1ef75ee2cc586b53de559148e4 (https://github.com/flutter/packages/pull/7067)
The implementation had significant bugs:
- It had asynchronous results, but never responded to them, violating the engine API contract and preventing futures from completing.
- It std::moved pointers between classes, while still keeping them as ivars and global references and referring to them from long-lived handlers.
[camera_windows] Revert: Support image streams on Windows platform (#7951)
This reverts commit b31a279641283f1ef75ee2cc586b53de559148e4 (https://github.com/flutter/packages/pull/7067)
The implementation had significant bugs:
- It had asynchronous results, but never responded to them, violating the engine API contract and preventing futures from completing.
- It std::moved pointers between classes, while still keeping them as ivars and global references and referring to them from long-lived handlers.
[camera_windows] Support camera on windows desktop platform (#4641)
This PR adds a Windows Desktop implementation of [camera plugin](https://pub.dev/packages/camera) using Media Foundation and CaptureEngine interface.
The implementation supports multiple cameras, video preview, and capturing photos and videos. Works with camera plugin and [camera example](https://pub.dev/packages/camera/example).
The current implementation uses FlutterDesktopPixelBuffer, but could be switched to use shared textures or Platform views after those are supported.
Unit tests are partially done; for the CaptureControllerImpl class all falilure code paths are not yet covered.
Still missing some features, like exposure and focus controls. These can be done later with interfaces IAMCameraControl and IAMVideoProcAmp,
Resolves flutter/flutter#41709: [camera] Add Windows support
[camera] Clean up maxDuration code (#7039)
maxVideoDuration was added to the platform interface a long time ago in preparation for adding that feature, but the other parts were never landed. The previous state was:
- It has never been implemented for iOS or Android
- It has never been settable from the app-facing package, so is always null unless someone uses the platform interface directly, which we don't consider a supported use case.
- It cannot be implemented in the CameraX Android implementation.
- It was implemented for Windows and web because when those platforms were added much later, nobody realized that the parameter was unused.
There is no compelling need for this feature, as clients of the plugin can simply set their own timer to stop recording. Given that, rather than leave the confusing partial state, this marks the option as deprecated at the platform interface layer and warns implementers that it can be ignored. It also removes the implementations from Windows and web in order to reduce implementation complexity, since that code was not reachable from the app-facing API.
This does not consider the Windows and web changes to be breaking, even though they arguably could be, because we do not expect clients to be calling platform interface methods directly.
Fixes https://github.com/flutter/flutter/issues/150959
[camera_windows] Support camera on windows desktop platform (#4641)
This PR adds a Windows Desktop implementation of [camera plugin](https://pub.dev/packages/camera) using Media Foundation and CaptureEngine interface.
The implementation supports multiple cameras, video preview, and capturing photos and videos. Works with camera plugin and [camera example](https://pub.dev/packages/camera/example).
The current implementation uses FlutterDesktopPixelBuffer, but could be switched to use shared textures or Platform views after those are supported.
Unit tests are partially done; for the CaptureControllerImpl class all falilure code paths are not yet covered.
Still missing some features, like exposure and focus controls. These can be done later with interfaces IAMCameraControl and IAMVideoProcAmp,
Resolves flutter/flutter#41709: [camera] Add Windows support
[camera_windows] Support camera on windows desktop platform (#4641)
This PR adds a Windows Desktop implementation of [camera plugin](https://pub.dev/packages/camera) using Media Foundation and CaptureEngine interface.
The implementation supports multiple cameras, video preview, and capturing photos and videos. Works with camera plugin and [camera example](https://pub.dev/packages/camera/example).
The current implementation uses FlutterDesktopPixelBuffer, but could be switched to use shared textures or Platform views after those are supported.
Unit tests are partially done; for the CaptureControllerImpl class all falilure code paths are not yet covered.
Still missing some features, like exposure and focus controls. These can be done later with interfaces IAMCameraControl and IAMVideoProcAmp,
Resolves flutter/flutter#41709: [camera] Add Windows support
[camera_windows] Support camera on windows desktop platform (#4641)
This PR adds a Windows Desktop implementation of [camera plugin](https://pub.dev/packages/camera) using Media Foundation and CaptureEngine interface.
The implementation supports multiple cameras, video preview, and capturing photos and videos. Works with camera plugin and [camera example](https://pub.dev/packages/camera/example).
The current implementation uses FlutterDesktopPixelBuffer, but could be switched to use shared textures or Platform views after those are supported.
Unit tests are partially done; for the CaptureControllerImpl class all falilure code paths are not yet covered.
Still missing some features, like exposure and focus controls. These can be done later with interfaces IAMCameraControl and IAMVideoProcAmp,
Resolves flutter/flutter#41709: [camera] Add Windows support
[camera_windows] Support camera on windows desktop platform (#4641)
This PR adds a Windows Desktop implementation of [camera plugin](https://pub.dev/packages/camera) using Media Foundation and CaptureEngine interface.
The implementation supports multiple cameras, video preview, and capturing photos and videos. Works with camera plugin and [camera example](https://pub.dev/packages/camera/example).
The current implementation uses FlutterDesktopPixelBuffer, but could be switched to use shared textures or Platform views after those are supported.
Unit tests are partially done; for the CaptureControllerImpl class all falilure code paths are not yet covered.
Still missing some features, like exposure and focus controls. These can be done later with interfaces IAMCameraControl and IAMVideoProcAmp,
Resolves flutter/flutter#41709: [camera] Add Windows support
[camera_windows] Revert: Support image streams on Windows platform (#7951)
This reverts commit b31a279641283f1ef75ee2cc586b53de559148e4 (https://github.com/flutter/packages/pull/7067)
The implementation had significant bugs:
- It had asynchronous results, but never responded to them, violating the engine API contract and preventing futures from completing.
- It std::moved pointers between classes, while still keeping them as ivars and global references and referring to them from long-lived handlers.
[camera_windows] Revert: Support image streams on Windows platform (#7951)
This reverts commit b31a279641283f1ef75ee2cc586b53de559148e4 (https://github.com/flutter/packages/pull/7067)
The implementation had significant bugs:
- It had asynchronous results, but never responded to them, violating the engine API contract and preventing futures from completing.
- It std::moved pointers between classes, while still keeping them as ivars and global references and referring to them from long-lived handlers.
[camera] Clean up maxDuration code (#7039)
maxVideoDuration was added to the platform interface a long time ago in preparation for adding that feature, but the other parts were never landed. The previous state was:
- It has never been implemented for iOS or Android
- It has never been settable from the app-facing package, so is always null unless someone uses the platform interface directly, which we don't consider a supported use case.
- It cannot be implemented in the CameraX Android implementation.
- It was implemented for Windows and web because when those platforms were added much later, nobody realized that the parameter was unused.
There is no compelling need for this feature, as clients of the plugin can simply set their own timer to stop recording. Given that, rather than leave the confusing partial state, this marks the option as deprecated at the platform interface layer and warns implementers that it can be ignored. It also removes the implementations from Windows and web in order to reduce implementation complexity, since that code was not reachable from the app-facing API.
This does not consider the Windows and web changes to be breaking, even though they arguably could be, because we do not expect clients to be calling platform interface methods directly.
Fixes https://github.com/flutter/flutter/issues/150959
[camera] Clean up maxDuration code (#7039)
maxVideoDuration was added to the platform interface a long time ago in preparation for adding that feature, but the other parts were never landed. The previous state was:
- It has never been implemented for iOS or Android
- It has never been settable from the app-facing package, so is always null unless someone uses the platform interface directly, which we don't consider a supported use case.
- It cannot be implemented in the CameraX Android implementation.
- It was implemented for Windows and web because when those platforms were added much later, nobody realized that the parameter was unused.
There is no compelling need for this feature, as clients of the plugin can simply set their own timer to stop recording. Given that, rather than leave the confusing partial state, this marks the option as deprecated at the platform interface layer and warns implementers that it can be ignored. It also removes the implementations from Windows and web in order to reduce implementation complexity, since that code was not reachable from the app-facing API.
This does not consider the Windows and web changes to be breaking, even though they arguably could be, because we do not expect clients to be calling platform interface methods directly.
Fixes https://github.com/flutter/flutter/issues/150959
[camera_windows] Support camera on windows desktop platform (#4641)
This PR adds a Windows Desktop implementation of [camera plugin](https://pub.dev/packages/camera) using Media Foundation and CaptureEngine interface.
The implementation supports multiple cameras, video preview, and capturing photos and videos. Works with camera plugin and [camera example](https://pub.dev/packages/camera/example).
The current implementation uses FlutterDesktopPixelBuffer, but could be switched to use shared textures or Platform views after those are supported.
Unit tests are partially done; for the CaptureControllerImpl class all falilure code paths are not yet covered.
Still missing some features, like exposure and focus controls. These can be done later with interfaces IAMCameraControl and IAMVideoProcAmp,
Resolves flutter/flutter#41709: [camera] Add Windows support
[camera_windows] Support camera on windows desktop platform (#4641)
This PR adds a Windows Desktop implementation of [camera plugin](https://pub.dev/packages/camera) using Media Foundation and CaptureEngine interface.
The implementation supports multiple cameras, video preview, and capturing photos and videos. Works with camera plugin and [camera example](https://pub.dev/packages/camera/example).
The current implementation uses FlutterDesktopPixelBuffer, but could be switched to use shared textures or Platform views after those are supported.
Unit tests are partially done; for the CaptureControllerImpl class all falilure code paths are not yet covered.
Still missing some features, like exposure and focus controls. These can be done later with interfaces IAMCameraControl and IAMVideoProcAmp,
Resolves flutter/flutter#41709: [camera] Add Windows support
[camera_windows] Support camera on windows desktop platform (#4641)
This PR adds a Windows Desktop implementation of [camera plugin](https://pub.dev/packages/camera) using Media Foundation and CaptureEngine interface.
The implementation supports multiple cameras, video preview, and capturing photos and videos. Works with camera plugin and [camera example](https://pub.dev/packages/camera/example).
The current implementation uses FlutterDesktopPixelBuffer, but could be switched to use shared textures or Platform views after those are supported.
Unit tests are partially done; for the CaptureControllerImpl class all falilure code paths are not yet covered.
Still missing some features, like exposure and focus controls. These can be done later with interfaces IAMCameraControl and IAMVideoProcAmp,
Resolves flutter/flutter#41709: [camera] Add Windows support