Skip to content

[camera] Support device orientation and camera facing detection on Windows platform #97540

@jokerttu

Description

@jokerttu

Use case

#4641 adds support for camera on Windows platform but is missing implementation for

  • Device orientation detection
  • Camera facing detection

Proposal

Device orientation

Screen on device orientation need to be handler by windows camera plugin.
Camera plugin implementation must be updated to handle also landscape devices with following rotations:

A landscape oriented devices, i.e. laptops:

  • landscapeLeft: 0 degrees
  • portraitUp: 90 degrees
  • landscapeRight: 180 degrees
  • portraitDown: 270 degrees

Where current portrait impementation uses following values:

  • portraitUp: 0 degrees
  • landscapeRight: 90 degrees
  • portraitDown: 180 degrees
  • landscapeLeft: 270 degrees

Camera plugin should send DeviceOrientationChangedEvent events via method channel.

Camera facing

Plugin should detect camera facing setting as it is one of the following:

  • front
  • back
  • external

On Windows 10+ platform this can be easily read from device with Win10 only DeviceInformation API.
Each camera device should have camera location/panel.

For Windows 8+ this information is not available via APIs, but devices and drivers should write this information to registry: link

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: desktopRunning on desktopc: new featureNothing broken; request for a new capabilityp: cameraThe camera pluginpackageflutter/packages repository. See also p: labels.platform-windowsBuilding on or for Windows specificallyteam-windowsOwned by the Windows platform teamtriaged-windowsTriaged by the Windows platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions