QCameraDevice¶
The QCameraDevice
class provides general information about camera devices. More…
Synopsis¶
Functions¶
def
__eq__
(other)def
__ne__
(other)def
description
()def
id
()def
isDefault
()def
isNull
()def
photoResolutions
()def
position
()def
videoFormats
()
Detailed Description¶
QCameraDevice
represents a physical camera device and its properties.
You can discover what cameras are available on a system using the availableCameras() and defaultCamera() functions. These are contained within QtMultimedia::MediaDevices.
This example prints the name of all available cameras:
cameras = QMediaDevices.videoInputs() for cameraDevice in cameras: print(cameraDevice.description())
A QCameraDevice
can be used to construct a QCamera
. The following example instantiates a QCamera
whose camera device is named mycamera
:
cameras = QMediaDevices.videoInputs() for cameraDevice in cameras: if (cameraDevice.description() == "mycamera") camera = QCamera(cameraDevice)
You can also use QCameraDevice
to get general information about a camera device such as description, physical position on the system, or camera sensor orientation.
myCamera = QCamera() cameraDevice = camera.cameraDevice() if (cameraDevice.position() == QCameraDevice.FrontFace) print("The camera is on the front face of the hardware system.") elif cameraDevice.position() == QCameraDevice.BackFace: print("The camera is on the back face of the hardware system.") print("The camera sensor orientation is ", cameraDevice.orientation(), " degrees.")See also
- class PySide6.QtMultimedia.QCameraDevice¶
PySide6.QtMultimedia.QCameraDevice(other)
- Parameters
Constructs a null camera device
Constructs a copy of other
.
- PySide6.QtMultimedia.QCameraDevice.Position¶
This enum specifies the physical position of the camera on the system hardware.
Constant
Description
QCameraDevice.UnspecifiedPosition
The camera position is unspecified or unknown.
QCameraDevice.BackFace
The camera is on the back face of the system hardware. For example on a mobile device, it means it is on the opposite side to that of the screen.
QCameraDevice.FrontFace
The camera is on the front face of the system hardware. For example on a mobile device, it means it is on the same side as that of the screen.
See also
New in version 6.1.
- PySide6.QtMultimedia.QCameraDevice.description()¶
- Return type
str
- PySide6.QtMultimedia.QCameraDevice.id()¶
- Return type
- PySide6.QtMultimedia.QCameraDevice.isDefault()¶
- Return type
bool
- PySide6.QtMultimedia.QCameraDevice.isNull()¶
- Return type
bool
Returns true if this QCameraDevice
is null or invalid.
- PySide6.QtMultimedia.QCameraDevice.__ne__(other)¶
- Parameters
- Return type
bool
Returns true if this QCameraDevice
is different from other
.
- PySide6.QtMultimedia.QCameraDevice.__eq__(other)¶
- Parameters
- Return type
bool
Returns true if this QCameraDevice
is equal to other
.
- PySide6.QtMultimedia.QCameraDevice.photoResolutions()¶
- Return type
Returns a list of resolutions that the camera can use to capture still images.
See also
- PySide6.QtMultimedia.QCameraDevice.videoFormats()¶
- Return type
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.