Each scene in the flickable list is implemented in its own QML file - for
example the video-basic scene (which just displays a static \l{VideoOutput}
in the center of the screen) is implemented in the
-\l{multimedia/ideo/qmlvideo/qml/qmlvideo/VideoBasic.qml}{VideoBasic.qml} file. As you
+\l{multimedia/video/qmlvideo/qml/qmlvideo/VideoBasic.qml}{VideoBasic.qml} file. As you
can see from the code, this makes use of a type of inheritance: a
\l{multimedia/video/qmlvideo/qml/qmlvideo/VideoBasic.qml}{VideoBasic} item ...
/*!
\qmlproperty bool QtAudioEngine1::AudioSample::loaded
- This property holds indicates whether this sample has been loaded into memory or not.
+ This property indicates whether this sample has been loaded into memory or not.
*/
bool QDeclarativeAudioSample::isLoaded() const
{
}
/*!
- \omit
- Note: This QML property is documented twice.
- \qmlproperty bool QtAudioEngine1::AudioSample::loaded
-
- This property holds the load status of the audio sample.
- \endomit
-*/
-
-
-/*!
\qmlsignal QtAudioEngine1::AudioSample::onLoadedChanged()
This handler is called when \l loaded is changed
*/
/*!
- \fn void QDeclarativeCamera::opticalZoomChanged(qreal zoom)
\qmlsignal Camera::opticalZoomChanged(zoom)
The optical zoom setting has changed to \a zoom.
*/
/*!
- \fn void QDeclarativeCamera::digitalZoomChanged(qreal zoom)
\qmlsignal Camera::digitalZoomChanged(zoom)
The digital zoom setting has changed to \a zoom.
*/
/*!
- \fn void QDeclarativeCamera::maximumOpticalZoomChanged(qreal zoom)
\qmlsignal Camera::maximumOpticalZoomChanged(zoom)
The maximum optical zoom setting has changed to \a zoom. This
*/
/*!
- \fn void QDeclarativeCamera::maximumDigitalZoomChanged(qreal zoom)
\qmlsignal Camera::maximumDigitalZoomChanged(zoom)
The maximum digital zoom setting has changed to \a zoom. This
For example, to select automatic shutter speed selection:
- \qml
+ \code
camera.exposure.setAutoShutterSpeed()
- \endqml
+ \endcode
Or for a specific shutter speed:
- \qml
+ \code
camera.exposure.manualShutterSpeed = 0.01 // 10ms
- \endqml
+ \endcode
You can only choose one or the other mode.
*/
*/
/*!
\qmlproperty enumeration QtMultimedia5::CameraExposure::exposureMode
- \property QDeclarativeCameraExposure::exposureMode
This property holds the camera exposure mode.
*/
/*!
\qmlproperty enumeration QtMultimedia5::CameraExposure::meteringMode
- \property QDeclarativeCameraExposure::meteringMode
This property holds the camera metering mode (how exposure is balanced).
supported format that is as close as possible to the format with
nearestFormat(). For instance:
- \snippet doc/src/snippets/multimedia-snippets/audio.cpp Setting audio format
+ \snippet multimedia-snippets/audio.cpp Setting audio format
The static
functions defaultInputDevice(), defaultOutputDevice(), and
For instance:
- \snippet doc/src/snippets/multimedia-snippets/audio.cpp Dumping audio formats
+ \snippet multimedia-snippets/audio.cpp Dumping audio formats
In this code sample, we loop through all devices that are able to output
sound, i.e., play an audio stream in a supported format. For each device we
with a QIODevice opened for writing. For instance, to record to a
file, you can:
- \snippet doc/src/snippets/multimedia-snippets/audio.cpp Audio input class members
+ \snippet multimedia-snippets/audio.cpp Audio input class members
- \snippet doc/src/snippets/multimedia-snippets/audio.cpp Audio input setup
+ \snippet multimedia-snippets/audio.cpp Audio input setup
This will start recording if the format specified is supported by
the input device (you can check this with
snags, use the error() function to check what went wrong. We stop
recording in the \c stopRecording() slot.
- \snippet doc/src/snippets/multimedia-snippets/audio.cpp Audio input stop recording
+ \snippet multimedia-snippets/audio.cpp Audio input stop recording
At any point in time, QAudioInput will be in one of four states:
active, suspended, stopped, or idle. These states are specified by
an error is encountered. Connect to the stateChanged() signal to
handle the error:
- \snippet doc/src/snippets/multimedia-snippets/audio.cpp Audio input state changed
+ \snippet multimedia-snippets/audio.cpp Audio input state changed
\sa QAudioOutput, QAudioDeviceInfo
*/
needs from the io device. So playing back an audio file is as
simple as:
- \snippet doc/src/snippets/multimedia-snippets/audio.cpp Audio output class members
+ \snippet multimedia-snippets/audio.cpp Audio output class members
- \snippet doc/src/snippets/multimedia-snippets/audio.cpp Audio output setup
+ \snippet multimedia-snippets/audio.cpp Audio output setup
The file will start playing assuming that the audio system and
output device support it. If you run out of luck, check what's
After the file has finished playing, we need to stop the device:
- \snippet doc/src/snippets/multimedia-snippets/audio.cpp Audio output state changed
+ \snippet multimedia-snippets/audio.cpp Audio output state changed
At any given time, the QAudioOutput will be in one of four states:
active, suspended, stopped, or idle. These states are described
You can check for errors by connecting to the stateChanged()
signal:
- \snippet doc/src/snippets/multimedia-snippets/audio.cpp Audio output state changed
+ \snippet multimedia-snippets/audio.cpp Audio output state changed
\sa QAudioInput, QAudioDeviceInfo
*/
/*!
\class QSound
\brief The QSound class provides a method to play .wav sound files.
-
+ \inmodule QtMultimedia
\ingroup multimedia
\ingroup multimedia_audio
applications: asynchronously playing a sound file. This is most
easily accomplished using the static play() function:
- \snippet doc/src/snippets/multimedia-snippets/qsound.cpp 0
+ \snippet multimedia-snippets/qsound.cpp 0
Alternatively, create a QSound object from the sound file first
and then call the play() slot:
- \snippet doc/src/snippets/multimedia-snippets/qsound.cpp 1
+ \snippet multimedia-snippets/qsound.cpp 1
Once created a QSound object can be queried for its fileName() and
total number of loops() (i.e. the number of times the sound will
This example shows how a looping, somewhat quiet sound effect
can be played:
- \snippet doc/src/snippets/multimedia-snippets/qsound.cpp 2
+ \snippet multimedia-snippets/qsound.cpp 2
Typically the sound effect should be reused, which allows all the
parsing and preparation to be done ahead of time, and only triggered
when necessary. This assists with lower latency audio playback.
- \snippet doc/src/snippets/multimedia-snippets/qsound.cpp 3
+ \snippet multimedia-snippets/qsound.cpp 3
Since QSoundEffect requires slightly more resources to achieve lower
latency playback, the platform may limit the number of simultaneously playing
The following example plays a WAV file on mouse click.
- \snippet doc/src/snippets/multimedia-snippets/soundeffect.qml complete snippet
+ \snippet multimedia-snippets/soundeffect.qml complete snippet
Since SoundEffect requires slightly more resources to achieve lower
latency playback, the platform may limit the number of simultaneously playing
This is the default method for SoundEffect.
- \snippet doc/src/snippets/multimedia-snippets/soundeffect.qml play sound on click
+ \snippet multimedia-snippets/soundeffect.qml play sound on click
*/
/*!
\fn QSoundEffect::play()
See the \l{Camera Overview}{camera overview} for more information.
- \snippet doc/src/snippets/multimedia-snippets/media.cpp Request control
+ \snippet multimedia-snippets/media.cpp Request control
*/
rectangles around areas of the camera frame that are in focus, or changing the
color of a zone as it comes into focus.
- \snippet doc/src/snippets/multimedia-snippets/camera.cpp Camera focus zones
+ \snippet multimedia-snippets/camera.cpp Camera focus zones
\sa QCameraFocus
*/
interesting area of the viewfinder for the hardware to attempt
to focus on.
- \snippet doc/src/snippets/multimedia-snippets/camera.cpp Camera custom zoom
+ \snippet multimedia-snippets/camera.cpp Camera custom zoom
Zooming can be accomplished in a number of ways - usually the more
expensive but higher quality approach is an optical zoom, which allows
checked. The \l zoomTo() method allows changing both optical and
digital zoom at once.
- \snippet doc/src/snippets/multimedia-snippets/camera.cpp Camera combined zoom
+ \snippet multimedia-snippets/camera.cpp Camera combined zoom
\section2 Some notes on autofocus
Some hardware supports a movable focus lens assembly, and typically
are in focus or are being used for autofocusing via the \l focusZones()
property:
- \snippet doc/src/snippets/multimedia-snippets/camera.cpp Camera focus zones
+ \snippet multimedia-snippets/camera.cpp Camera focus zones
\sa QCameraFocusZone
*/
It's not intended to be used alone but for accessing the media
recording functions of other media objects, like QCamera.
- \snippet doc/src/snippets/multimedia-snippets/camera.cpp Camera
+ \snippet multimedia-snippets/camera.cpp Camera
- \snippet doc/src/snippets/multimedia-snippets/camera.cpp Camera keys
+ \snippet multimedia-snippets/camera.cpp Camera keys
\sa QCamera
*/
For example, you can set the white balance (or color temperature) used
for processing images:
- \snippet doc/src/snippets/multimedia-snippets/camera.cpp Camera image whitebalance
+ \snippet multimedia-snippets/camera.cpp Camera image whitebalance
Or adjust the amount of denoising performed:
- \snippet doc/src/snippets/multimedia-snippets/camera.cpp Camera image denoising
+ \snippet multimedia-snippets/camera.cpp Camera image denoising
In some cases changing these settings may result in a longer delay
before an image is ready.
QAbstractVideoSurface may be set as the video render target of a
QMediaService.
- \snippet doc/src/snippets/multimedia-snippets/video.cpp Video renderer control
+ \snippet multimedia-snippets/video.cpp Video renderer control
QVideoRendererControl is one of a number of possible video output controls.
should be rendered to, and the aspectRatioMode() property indicates how the
video should be scaled to fit the displayRect().
- \snippet doc/src/snippets/multimedia-snippets/video.cpp Video window control
+ \snippet multimedia-snippets/video.cpp Video window control
QVideoWindowControl is one of a number of possible video output controls.
simple viewfinder:
\qml
+import QtQuick 2.0
+import QtMultimedia 5.0
+
+VideoOutput {
+ source: camera
+
Camera {
id: camera
// You can adjust various settings in here
}
-
- VideoOutput {
- source: camera
- }
+}
\endqml
In C++, your choice depends on whether you are using widgets, or QGraphicsView.
\section2 QML Types
The following types are accessed by using:
-\qml
+\code
import QtMultimedia 5.0
-\endqml
+\endcode
\annotatedlist multimedia_qml
The following types are accessed by using \l {Positional Audio} {QtAudioEngine}:
-\qml
+\code
import QtAudioEngine 1.0
-\endqml
+\endcode
\annotatedlist multimedia_audioengine
\section2 Multimedia Classes
main or canonical URL with additional information attached. When provided
with a QMediaContent playback may be able to commence.
- \snippet doc/src/snippets/multimedia-snippets/media.cpp Player
+ \snippet multimedia-snippets/media.cpp Player
QVideoWidget can be used with QMediaPlayer for video rendering and QMediaPlaylist
for accessing playlist functionality.
- \snippet doc/src/snippets/multimedia-snippets/media.cpp Movie playlist
+ \snippet multimedia-snippets/media.cpp Movie playlist
Since QMediaPlayer is a QMediaObject, you can use several of the QMediaObject
functions for things like:
QMediaPlaylist allows to access the service intrinsic playlist functionality
if available, otherwise it provides the the local memory playlist implementation.
- \snippet doc/src/snippets/multimedia-snippets/media.cpp Movie playlist
+ \snippet multimedia-snippets/media.cpp Movie playlist
Depending on playlist source implementation, most of the playlist mutating
operations can be asynchronous.
\ingroup multimedia
\ingroup multimedia_control
\ingroup multimedia_core
-
+ \inmodule QtMultimedia
Media services provide implementations of the functionality promised
by media objects, and allow multiple providers to implement a QMediaObject.
/*!
\class QMediaServiceProviderPlugin
-
+ \inmodule QtMultimedia
\brief The QMediaServiceProviderPlugin class interface provides an interface for QMediaService
plug-ins.
/*!
\class QMediaServiceSupportedFormatsInterface
+ \inmodule QtMultimedia
\brief The QMediaServiceSupportedFormatsInterface class interface
identifies if a media service plug-in supports a media format.
/*!
\class QMediaServiceSupportedDevicesInterface
+ \inmodule QtMultimedia
\brief The QMediaServiceSupportedDevicesInterface class interface
identifies the devices supported by a media service plug-in.
/*!
\class QMediaServiceFeaturesInterface
+ \inmodule QtMultimedia
\brief The QMediaServiceFeaturesInterface class interface identifies
features supported by a media service plug-in.
\brief The QMediaTimeRange class represents a set of zero or more disjoint
time intervals.
\ingroup multimedia
+ \inmodule QtMultimedia
\reentrant
\inmodule QtMultimediaWidgets
\ingroup camera
- \snippet doc/src/snippets/multimedia-snippets/camera.cpp Camera
+ \snippet multimedia-snippets/camera.cpp Camera
*/
is attached to a media object by passing a pointer to the QMediaObject
to the setMediaObject() function.
- \snippet doc/src/snippets/multimedia-snippets/video.cpp Video graphics item
+ \snippet multimedia-snippets/video.cpp Video graphics item
\b {Note}: Only a single display output can be attached to a media
object at one time.
to media object by passing a pointer to the QMediaObject in its
constructor, and detached by destroying the QVideoWidget.
- \snippet doc/src/snippets/multimedia-snippets/video.cpp Video widget
+ \snippet multimedia-snippets/video.cpp Video widget
\b {Note}: Only a single display output can be attached to a media
object at one time.
video widget implemented by the control's media service. This widget is
owned by the media service and so care should be taken not to delete it.
- \snippet doc/src/snippets/multimedia-snippets/video.cpp Video widget control
+ \snippet multimedia-snippets/video.cpp Video widget control
QVideoWidgetControl is one of number of possible video output controls.