MediaDevice
Unified wrapper for audio/video capture devices.
| Declared in | src/libs/libvideo/media/MediaDevice.hpp |
| Inherits | QObject |
| Group | video |
Detailed description
MediaDevice combines QAudioDevice and QCameraDevice into a single interface. Provides live preview with video frames or audio waveform visualization.
See also MediaDeviceModel, MediaDeviceManager.
Property documentation
details property
[read-only] details : const QString
This property holds a line that names the video part and the audio part of the device.
The text has the form "Video: <description> | Audio: <description>". A part that the device does not have is not in the text.
Access functions:
QStringdetails() const
hasAudio property
[read-only] hasAudio : const bool
This property holds whether the device has an audio part.
The value is true after setAudioDevice().
Access functions:
boolhasAudio() const
hasVideo property
[read-only] hasVideo : const bool
This property holds whether the device has a video part.
The value is true after setVideoDevice().
Access functions:
boolhasVideo() const
name property
[read-only] name : const QString
This property holds the name of the device, for display.
The name is the description of the camera when the device has video, else the description of the audio device. A device with neither is "Unknown Device".
Access functions:
QStringname() const
previewActive property
previewActive : bool
This property holds whether the device captures a live preview.
When the value becomes true, a device with video starts a video preview, and a device with only audio starts an audio scope. Each renders previewPixmap again every 100 ms. When the value becomes false, both stop and the preview pixmap is cleared. A change emits previewActiveChanged() and previewPixmapChanged(). The default is false.
Access functions:
boolpreviewActive() constvoidsetPreviewActive(boolactive)
Notifier signal:
voidpreviewActiveChanged()
previewPixmap property
[read-only] previewPixmap : const QPixmap
This property holds the latest preview image, at thumbnailSize().
The image is a video frame, or for an audio-only device a waveform scope. It is null when previewActive is false. Each new image emits previewPixmapChanged().
Access functions:
QPixmappreviewPixmap() const
Notifier signal:
voidpreviewPixmapChanged()