Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts: src/imports/multimedia/qdeclarativeaudio.cpp Change-Id: I57c6252b084e4ed796f6f308b2e0c717d0f59b13
This commit is contained in:
@@ -83,8 +83,6 @@ QT_BEGIN_NAMESPACE
|
||||
\ingroup multimedia_audio_qml
|
||||
\inqmlmodule QtMultimedia
|
||||
|
||||
SoundEffect is part of the \b{QtMultimedia 5.0} module.
|
||||
|
||||
This type allows you to play uncompressed audio files (typically WAV files) in
|
||||
a generally lower latency way, and is suitable for "feedback" type sounds in
|
||||
response to user actions (e.g. virtual keyboard sounds, positive or negative
|
||||
|
||||
@@ -72,6 +72,9 @@ static bool qt_sizeLessThan(const QSize &s1, const QSize &s2)
|
||||
|
||||
static bool qt_frameRateRangeLessThan(const QCamera::FrameRateRange &s1, const QCamera::FrameRateRange &s2)
|
||||
{
|
||||
if (s1.maximumFrameRate == s2.maximumFrameRate)
|
||||
return s1.minimumFrameRate < s2.minimumFrameRate;
|
||||
|
||||
return s1.maximumFrameRate < s2.maximumFrameRate;
|
||||
}
|
||||
|
||||
@@ -658,7 +661,7 @@ QList<QCameraViewfinderSettings> QCamera::supportedViewfinderSettings(const QCam
|
||||
&& (qFuzzyIsNull(settings.minimumFrameRate()) || qFuzzyCompare((float)settings.minimumFrameRate(), (float)s.minimumFrameRate()))
|
||||
&& (qFuzzyIsNull(settings.maximumFrameRate()) || qFuzzyCompare((float)settings.maximumFrameRate(), (float)s.maximumFrameRate()))
|
||||
&& (settings.pixelFormat() == QVideoFrame::Format_Invalid || settings.pixelFormat() == s.pixelFormat())
|
||||
&& (settings.pixelAspectRatio() == QSize(1, 1) || settings.pixelAspectRatio() == s.pixelAspectRatio())) {
|
||||
&& (settings.pixelAspectRatio().isEmpty() || settings.pixelAspectRatio() == s.pixelAspectRatio())) {
|
||||
results.append(s);
|
||||
}
|
||||
}
|
||||
@@ -1042,6 +1045,19 @@ void QCamera::unlock()
|
||||
\sa QCamera::supportedViewfinderFrameRateRanges(), QCameraViewfinderSettings
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QCamera::FrameRateRange::FrameRateRange()
|
||||
|
||||
Constructs a null frame rate range, with both minimumFrameRate and maximumFrameRate
|
||||
equal to \c 0.0.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QCamera::FrameRateRange::FrameRateRange(qreal minimum, qreal maximum)
|
||||
|
||||
Constructs a frame rate range with the given \a minimum and \a maximum frame rates.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\variable QCamera::FrameRateRange::minimumFrameRate
|
||||
The minimum frame rate supported by the range, in frames per second.
|
||||
|
||||
@@ -319,7 +319,7 @@ void QCameraImageProcessing::setDenoisingLevel(qreal level)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\enum QCameraImageProcessing::Filter
|
||||
\enum QCameraImageProcessing::ColorFilter
|
||||
|
||||
\value ColorFilterNone No filter is applied to images.
|
||||
\value ColorFilterGrayscale A grayscale filter.
|
||||
|
||||
@@ -50,8 +50,7 @@ public:
|
||||
isNull(true),
|
||||
minimumFrameRate(0.0),
|
||||
maximumFrameRate(0.0),
|
||||
pixelFormat(QVideoFrame::Format_Invalid),
|
||||
pixelAspectRatio(1, 1)
|
||||
pixelFormat(QVideoFrame::Format_Invalid)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -135,6 +134,18 @@ QCameraViewfinderSettings &QCameraViewfinderSettings::operator=(const QCameraVie
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*! \fn QCameraViewfinderSettings &QCameraViewfinderSettings::operator=(QCameraViewfinderSettings &&other)
|
||||
|
||||
Moves \a other to this viewfinder settings object and returns a reference to this object.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QCameraViewfinderSettings::swap(QCameraViewfinderSettings &other)
|
||||
|
||||
Swaps this viewfinder settings object with \a other. This
|
||||
function is very fast and never fails.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\relates QCameraViewfinderSettings
|
||||
\since 5.5
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
//! [complete snippet]
|
||||
import QtQuick 2.0
|
||||
import QtMultimedia 5.0
|
||||
import QtMultimedia 5.5
|
||||
|
||||
//! [complete snippet]
|
||||
Text {
|
||||
text: "Click Me!";
|
||||
font.pointSize: 24;
|
||||
|
||||
@@ -102,9 +102,6 @@ In QML, use the \l{QtMultimedia::QtMultimedia::availableCameras}{QtMultimedia.av
|
||||
property:
|
||||
|
||||
\qml
|
||||
import QtQuick 2.0
|
||||
import QtMultimedia 5.4
|
||||
|
||||
Item {
|
||||
property bool isCameraAvailable: QtMultimedia.availableCameras.length > 0
|
||||
}
|
||||
@@ -163,9 +160,6 @@ In QML, you can use \l Camera and \l VideoOutput together to show a
|
||||
simple viewfinder:
|
||||
|
||||
\qml
|
||||
import QtQuick 2.0
|
||||
import QtMultimedia 5.4
|
||||
|
||||
VideoOutput {
|
||||
source: camera
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ what changed, and what you might need to change when porting code.
|
||||
\section2 QML Types
|
||||
The QML types are accessed by using:
|
||||
\code
|
||||
import QtMultimedia 5.4
|
||||
import QtMultimedia 5.5
|
||||
\endcode
|
||||
\annotatedlist multimedia_qml
|
||||
The following types are accessed by using \l{Qt Audio Engine QML Types}{Qt Audio Engine}:
|
||||
|
||||
@@ -54,10 +54,6 @@
|
||||
|
||||
\qml
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtMultimedia 5.0
|
||||
// ...
|
||||
|
||||
Item {
|
||||
width: 640
|
||||
height: 360
|
||||
@@ -196,9 +192,6 @@
|
||||
|
||||
\qml
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtMultimedia 5.0
|
||||
|
||||
Item {
|
||||
width: 640
|
||||
height: 360
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
import statement in your \c {.qml} file.
|
||||
|
||||
\code
|
||||
import QtMultimedia 5.4
|
||||
import QtMultimedia 5.5
|
||||
\endcode
|
||||
|
||||
If you intend to use the C++ classes in your application, include the C++
|
||||
@@ -104,12 +104,18 @@
|
||||
\row
|
||||
\li QAudioOutput
|
||||
\li Sends audio data to an audio output device
|
||||
\row
|
||||
\li QAudioRecorder
|
||||
\li Record media content from an audio source.
|
||||
\row
|
||||
\li QCamera
|
||||
\li Access camera viewfinder.
|
||||
\row
|
||||
\li QCameraImageCapture
|
||||
\li Record media content. Intended to be used with QCamera to record media.
|
||||
\li Capture still images with a camera.
|
||||
\row
|
||||
\li QMediaRecorder
|
||||
\li Record media content from a camera or radio tuner source.
|
||||
\row
|
||||
\li QMediaPlayer
|
||||
\li Playback media from a source.
|
||||
@@ -120,8 +126,8 @@
|
||||
\li QRadioTuner
|
||||
\li Access radio device.
|
||||
\row
|
||||
\li QVideoRendererControl
|
||||
\li Control video data.
|
||||
\li QAbstractVideoSurface
|
||||
\li Base class for video presentation.
|
||||
\endtable
|
||||
|
||||
\section1 Related Information
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\qmlmodule QtMultimedia 5.4
|
||||
\qmlmodule QtMultimedia 5.5
|
||||
\title Qt Multimedia QML Types
|
||||
\ingroup qmlmodules
|
||||
\brief Provides QML types for multimedia support.
|
||||
@@ -42,7 +42,7 @@ The QML types for \l{Qt Multimedia} support the basic use cases such as:
|
||||
The QML types can be imported into your application using the following import
|
||||
statement in your .qml file:
|
||||
\code
|
||||
import QtMultimedia 5.4
|
||||
import QtMultimedia 5.5
|
||||
\endcode
|
||||
|
||||
\section1 QML types
|
||||
|
||||
120
src/multimedia/gsttools_headers/qgstreamervideooverlay_p.h
Normal file
120
src/multimedia/gsttools_headers/qgstreamervideooverlay_p.h
Normal file
@@ -0,0 +1,120 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2015 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL21$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 or version 3 as published by the Free
|
||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
||||
** following information to ensure the GNU Lesser General Public License
|
||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** As a special exception, The Qt Company gives you certain additional
|
||||
** rights. These rights are described in The Qt Company LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QGSTREAMERVIDEOOVERLAY_P_H
|
||||
#define QGSTREAMERVIDEOOVERLAY_P_H
|
||||
|
||||
#include <private/qgstreamerbushelper_p.h>
|
||||
#include <private/qgstreamerbufferprobe_p.h>
|
||||
#include <QtGui/qwindowdefs.h>
|
||||
#include <QtCore/qsize.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QGstreamerVideoOverlay
|
||||
: public QObject
|
||||
, public QGstreamerSyncMessageFilter
|
||||
, public QGstreamerBusMessageFilter
|
||||
, private QGstreamerBufferProbe
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QGstreamerSyncMessageFilter QGstreamerBusMessageFilter)
|
||||
public:
|
||||
explicit QGstreamerVideoOverlay(QObject *parent = 0, const QByteArray &elementName = QByteArray());
|
||||
virtual ~QGstreamerVideoOverlay();
|
||||
|
||||
GstElement *videoSink() const;
|
||||
QSize nativeVideoSize() const;
|
||||
|
||||
void setWindowHandle(WId id);
|
||||
void expose();
|
||||
void setRenderRectangle(const QRect &rect);
|
||||
|
||||
bool isActive() const;
|
||||
|
||||
Qt::AspectRatioMode aspectRatioMode() const;
|
||||
void setAspectRatioMode(Qt::AspectRatioMode mode);
|
||||
|
||||
int brightness() const;
|
||||
void setBrightness(int brightness);
|
||||
|
||||
int contrast() const;
|
||||
void setContrast(int contrast);
|
||||
|
||||
int hue() const;
|
||||
void setHue(int hue);
|
||||
|
||||
int saturation() const;
|
||||
void setSaturation(int saturation);
|
||||
|
||||
bool processSyncMessage(const QGstreamerMessage &message);
|
||||
bool processBusMessage(const QGstreamerMessage &message);
|
||||
|
||||
Q_SIGNALS:
|
||||
void nativeVideoSizeChanged();
|
||||
void activeChanged();
|
||||
void brightnessChanged(int brightness);
|
||||
void contrastChanged(int contrast);
|
||||
void hueChanged(int hue);
|
||||
void saturationChanged(int saturation);
|
||||
|
||||
private:
|
||||
GstElement *findBestVideoSink() const;
|
||||
void setWindowHandle_helper(WId id);
|
||||
void updateIsActive();
|
||||
void probeCaps(GstCaps *caps);
|
||||
static void showPrerollFrameChanged(GObject *, GParamSpec *, QGstreamerVideoOverlay *);
|
||||
|
||||
GstElement *m_videoSink;
|
||||
QSize m_nativeVideoSize;
|
||||
bool m_isActive;
|
||||
|
||||
bool m_hasForceAspectRatio;
|
||||
bool m_hasBrightness;
|
||||
bool m_hasContrast;
|
||||
bool m_hasHue;
|
||||
bool m_hasSaturation;
|
||||
bool m_hasShowPrerollFrame;
|
||||
|
||||
WId m_windowId;
|
||||
Qt::AspectRatioMode m_aspectRatioMode;
|
||||
int m_brightness;
|
||||
int m_contrast;
|
||||
int m_hue;
|
||||
int m_saturation;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QGSTREAMERVIDEOOVERLAY_P_H
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
#include "qgstreamervideorendererinterface_p.h"
|
||||
#include <private/qgstreamerbushelper_p.h>
|
||||
#include <private/qgstreamervideooverlay_p.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@@ -52,13 +53,15 @@ class QGstreamerVideoWidgetControl
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QGstreamerVideoRendererInterface QGstreamerSyncMessageFilter QGstreamerBusMessageFilter)
|
||||
public:
|
||||
QGstreamerVideoWidgetControl(QObject *parent = 0);
|
||||
explicit QGstreamerVideoWidgetControl(QObject *parent = 0, const QByteArray &elementName = QByteArray());
|
||||
virtual ~QGstreamerVideoWidgetControl();
|
||||
|
||||
GstElement *videoSink();
|
||||
|
||||
QWidget *videoWidget();
|
||||
|
||||
void stopRenderer();
|
||||
|
||||
Qt::AspectRatioMode aspectRatioMode() const;
|
||||
void setAspectRatioMode(Qt::AspectRatioMode mode);
|
||||
|
||||
@@ -77,27 +80,27 @@ public:
|
||||
int saturation() const;
|
||||
void setSaturation(int saturation);
|
||||
|
||||
void setOverlay();
|
||||
|
||||
bool eventFilter(QObject *object, QEvent *event);
|
||||
bool processSyncMessage(const QGstreamerMessage &message);
|
||||
bool processBusMessage(const QGstreamerMessage &message);
|
||||
|
||||
public slots:
|
||||
void updateNativeVideoSize();
|
||||
|
||||
signals:
|
||||
void sinkChanged();
|
||||
void readyChanged(bool);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onOverlayActiveChanged();
|
||||
void onNativeVideoSizeChanged();
|
||||
|
||||
private:
|
||||
void createVideoWidget();
|
||||
void windowExposed();
|
||||
void updateWidgetAttributes();
|
||||
|
||||
GstElement *m_videoSink;
|
||||
bool processSyncMessage(const QGstreamerMessage &message);
|
||||
bool processBusMessage(const QGstreamerMessage &message);
|
||||
|
||||
QGstreamerVideoOverlay m_videoOverlay;
|
||||
QGstreamerVideoWidget *m_widget;
|
||||
bool m_stopped;
|
||||
WId m_windowId;
|
||||
Qt::AspectRatioMode m_aspectRatioMode;
|
||||
bool m_fullScreen;
|
||||
};
|
||||
|
||||
|
||||
@@ -38,23 +38,22 @@
|
||||
|
||||
#include "qgstreamervideorendererinterface_p.h"
|
||||
#include <private/qgstreamerbushelper_p.h>
|
||||
#include <private/qgstreamerbufferprobe_p.h>
|
||||
#include <private/qgstreamervideooverlay_p.h>
|
||||
#include <QtGui/qcolor.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QAbstractVideoSurface;
|
||||
|
||||
class QGstreamerVideoWindow : public QVideoWindowControl,
|
||||
class QGstreamerVideoWindow :
|
||||
public QVideoWindowControl,
|
||||
public QGstreamerVideoRendererInterface,
|
||||
public QGstreamerSyncMessageFilter,
|
||||
private QGstreamerBufferProbe
|
||||
public QGstreamerBusMessageFilter
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QGstreamerVideoRendererInterface QGstreamerSyncMessageFilter)
|
||||
Q_PROPERTY(QColor colorKey READ colorKey WRITE setColorKey)
|
||||
Q_PROPERTY(bool autopaintColorKey READ autopaintColorKey WRITE setAutopaintColorKey)
|
||||
Q_INTERFACES(QGstreamerVideoRendererInterface QGstreamerSyncMessageFilter QGstreamerBusMessageFilter)
|
||||
public:
|
||||
QGstreamerVideoWindow(QObject *parent = 0, const char *elementName = 0);
|
||||
explicit QGstreamerVideoWindow(QObject *parent = 0, const QByteArray &elementName = QByteArray());
|
||||
~QGstreamerVideoWindow();
|
||||
|
||||
WId winId() const;
|
||||
@@ -71,12 +70,6 @@ public:
|
||||
Qt::AspectRatioMode aspectRatioMode() const;
|
||||
void setAspectRatioMode(Qt::AspectRatioMode mode);
|
||||
|
||||
QColor colorKey() const;
|
||||
void setColorKey(const QColor &);
|
||||
|
||||
bool autopaintColorKey() const;
|
||||
void setAutopaintColorKey(bool);
|
||||
|
||||
void repaint();
|
||||
|
||||
int brightness() const;
|
||||
@@ -96,24 +89,18 @@ public:
|
||||
GstElement *videoSink();
|
||||
|
||||
bool processSyncMessage(const QGstreamerMessage &message);
|
||||
bool processBusMessage(const QGstreamerMessage &message);
|
||||
bool isReady() const { return m_windowId != 0; }
|
||||
|
||||
signals:
|
||||
void sinkChanged();
|
||||
void readyChanged(bool);
|
||||
|
||||
private slots:
|
||||
void updateNativeVideoSize(const QSize &size);
|
||||
|
||||
private:
|
||||
void probeCaps(GstCaps *caps);
|
||||
|
||||
GstElement *m_videoSink;
|
||||
QGstreamerVideoOverlay m_videoOverlay;
|
||||
WId m_windowId;
|
||||
Qt::AspectRatioMode m_aspectRatioMode;
|
||||
QRect m_displayRect;
|
||||
bool m_fullScreen;
|
||||
QSize m_nativeSize;
|
||||
mutable QColor m_colorKey;
|
||||
};
|
||||
|
||||
|
||||
@@ -61,11 +61,13 @@
|
||||
# define QT_GSTREAMER_CAMERABIN_ELEMENT_NAME "camerabin"
|
||||
# define QT_GSTREAMER_COLORCONVERSION_ELEMENT_NAME "videoconvert"
|
||||
# define QT_GSTREAMER_RAW_AUDIO_MIME "audio/x-raw"
|
||||
# define QT_GSTREAMER_VIDEOOVERLAY_INTERFACE_NAME "GstVideoOverlay"
|
||||
#else
|
||||
# define QT_GSTREAMER_PLAYBIN_ELEMENT_NAME "playbin2"
|
||||
# define QT_GSTREAMER_CAMERABIN_ELEMENT_NAME "camerabin2"
|
||||
# define QT_GSTREAMER_COLORCONVERSION_ELEMENT_NAME "ffmpegcolorspace"
|
||||
# define QT_GSTREAMER_RAW_AUDIO_MIME "audio/x-raw-int"
|
||||
# define QT_GSTREAMER_VIDEOOVERLAY_INTERFACE_NAME "GstXOverlay"
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
@@ -147,6 +149,7 @@ GstStructure *qt_gst_structure_new_empty(const char *name);
|
||||
gboolean qt_gst_element_query_position(GstElement *element, GstFormat format, gint64 *cur);
|
||||
gboolean qt_gst_element_query_duration(GstElement *element, GstFormat format, gint64 *cur);
|
||||
GstCaps *qt_gst_caps_normalize(GstCaps *caps);
|
||||
const gchar *qt_gst_element_get_factory_name(GstElement *element);
|
||||
|
||||
QDebug operator <<(QDebug debug, GstCaps *caps);
|
||||
|
||||
|
||||
@@ -468,6 +468,7 @@ void QMediaPlayerPrivate::disconnectPlaylist()
|
||||
QObject::disconnect(playlist, SIGNAL(currentMediaChanged(QMediaContent)),
|
||||
q, SLOT(_q_updateMedia(QMediaContent)));
|
||||
QObject::disconnect(playlist, SIGNAL(destroyed()), q, SLOT(_q_playlistDestroyed()));
|
||||
q->unbind(playlist);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -475,6 +476,7 @@ void QMediaPlayerPrivate::connectPlaylist()
|
||||
{
|
||||
Q_Q(QMediaPlayer);
|
||||
if (playlist) {
|
||||
q->bind(playlist);
|
||||
QObject::connect(playlist, SIGNAL(currentMediaChanged(QMediaContent)),
|
||||
q, SLOT(_q_updateMedia(QMediaContent)));
|
||||
QObject::connect(playlist, SIGNAL(destroyed()), q, SLOT(_q_playlistDestroyed()));
|
||||
@@ -622,6 +624,8 @@ QMediaPlayer::~QMediaPlayer()
|
||||
{
|
||||
Q_D(QMediaPlayer);
|
||||
|
||||
d->disconnectPlaylist();
|
||||
|
||||
if (d->service) {
|
||||
if (d->control)
|
||||
d->service->releaseControl(d->control);
|
||||
|
||||
@@ -106,7 +106,7 @@ Q_CONSTRUCTOR_FUNCTION(qRegisterMediaPlaylistMetaTypes)
|
||||
|
||||
|
||||
/*!
|
||||
Create a new playlist object for with the given \a parent.
|
||||
Create a new playlist object with the given \a parent.
|
||||
*/
|
||||
|
||||
QMediaPlaylist::QMediaPlaylist(QObject *parent)
|
||||
@@ -214,8 +214,10 @@ bool QMediaPlaylist::setMediaObject(QMediaObject *mediaObject)
|
||||
connect(d->control, SIGNAL(currentMediaChanged(QMediaContent)),
|
||||
this, SIGNAL(currentMediaChanged(QMediaContent)));
|
||||
|
||||
if (oldSize)
|
||||
if (oldSize) {
|
||||
emit mediaAboutToBeRemoved(0, oldSize-1);
|
||||
emit mediaRemoved(0, oldSize-1);
|
||||
}
|
||||
|
||||
if (playlist->mediaCount()) {
|
||||
emit mediaAboutToBeInserted(0,playlist->mediaCount()-1);
|
||||
@@ -302,7 +304,7 @@ int QMediaPlaylist::mediaCount() const
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns true if the playlist contains no items; otherwise returns false.
|
||||
Returns true if the playlist contains no items, otherwise returns false.
|
||||
|
||||
\sa mediaCount()
|
||||
*/
|
||||
@@ -312,7 +314,7 @@ bool QMediaPlaylist::isEmpty() const
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns true if the playlist can be modified; otherwise returns false.
|
||||
Returns true if the playlist can be modified, otherwise returns false.
|
||||
|
||||
\sa mediaCount()
|
||||
*/
|
||||
@@ -333,7 +335,7 @@ QMediaContent QMediaPlaylist::media(int index) const
|
||||
/*!
|
||||
Append the media \a content to the playlist.
|
||||
|
||||
Returns true if the operation is successful, otherwise return false.
|
||||
Returns true if the operation is successful, otherwise returns false.
|
||||
*/
|
||||
bool QMediaPlaylist::addMedia(const QMediaContent &content)
|
||||
{
|
||||
@@ -343,7 +345,7 @@ bool QMediaPlaylist::addMedia(const QMediaContent &content)
|
||||
/*!
|
||||
Append multiple media content \a items to the playlist.
|
||||
|
||||
Returns true if the operation is successful, otherwise return false.
|
||||
Returns true if the operation is successful, otherwise returns false.
|
||||
*/
|
||||
bool QMediaPlaylist::addMedia(const QList<QMediaContent> &items)
|
||||
{
|
||||
@@ -353,23 +355,25 @@ bool QMediaPlaylist::addMedia(const QList<QMediaContent> &items)
|
||||
/*!
|
||||
Insert the media \a content to the playlist at position \a pos.
|
||||
|
||||
Returns true if the operation is successful, otherwise false.
|
||||
Returns true if the operation is successful, otherwise returns false.
|
||||
*/
|
||||
|
||||
bool QMediaPlaylist::insertMedia(int pos, const QMediaContent &content)
|
||||
{
|
||||
return d_func()->playlist()->insertMedia(pos, content);
|
||||
QMediaPlaylistProvider *playlist = d_func()->playlist();
|
||||
return playlist->insertMedia(qBound(0, pos, playlist->mediaCount()), content);
|
||||
}
|
||||
|
||||
/*!
|
||||
Insert multiple media content \a items to the playlist at position \a pos.
|
||||
|
||||
Returns true if the operation is successful, otherwise false.
|
||||
Returns true if the operation is successful, otherwise returns false.
|
||||
*/
|
||||
|
||||
bool QMediaPlaylist::insertMedia(int pos, const QList<QMediaContent> &items)
|
||||
{
|
||||
return d_func()->playlist()->insertMedia(pos, items);
|
||||
QMediaPlaylistProvider *playlist = d_func()->playlist();
|
||||
return playlist->insertMedia(qBound(0, pos, playlist->mediaCount()), items);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -379,8 +383,11 @@ bool QMediaPlaylist::insertMedia(int pos, const QList<QMediaContent> &items)
|
||||
*/
|
||||
bool QMediaPlaylist::removeMedia(int pos)
|
||||
{
|
||||
Q_D(QMediaPlaylist);
|
||||
return d->playlist()->removeMedia(pos);
|
||||
QMediaPlaylistProvider *playlist = d_func()->playlist();
|
||||
if (pos >= 0 && pos < playlist->mediaCount())
|
||||
return playlist->removeMedia(pos);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -390,8 +397,13 @@ bool QMediaPlaylist::removeMedia(int pos)
|
||||
*/
|
||||
bool QMediaPlaylist::removeMedia(int start, int end)
|
||||
{
|
||||
Q_D(QMediaPlaylist);
|
||||
return d->playlist()->removeMedia(start, end);
|
||||
QMediaPlaylistProvider *playlist = d_func()->playlist();
|
||||
start = qMax(0, start);
|
||||
end = qMin(end, playlist->mediaCount() - 1);
|
||||
if (start <= end)
|
||||
return playlist->removeMedia(start, end);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -53,7 +53,6 @@ public:
|
||||
|
||||
virtual QMediaControl* requestControl(const char *name) = 0;
|
||||
|
||||
#ifndef QT_NO_MEMBER_TEMPLATES
|
||||
template <typename T> inline T requestControl() {
|
||||
if (QMediaControl *control = requestControl(qmediacontrol_iid<T>())) {
|
||||
if (T typedControl = qobject_cast<T>(control))
|
||||
@@ -62,7 +61,6 @@ public:
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
virtual void releaseControl(QMediaControl *control) = 0;
|
||||
|
||||
|
||||
@@ -359,19 +359,14 @@ public:
|
||||
}
|
||||
break;
|
||||
case QMediaServiceProviderHint::Device: {
|
||||
plugin = plugins[0];
|
||||
foreach (QMediaServiceProviderPlugin *currentPlugin, plugins) {
|
||||
QMediaServiceSupportedDevicesInterface *iface =
|
||||
qobject_cast<QMediaServiceSupportedDevicesInterface*>(currentPlugin);
|
||||
|
||||
if (!iface) {
|
||||
// the plugin may support the device,
|
||||
// but this choice still can be overridden
|
||||
if (iface && iface->devices(type).contains(hint.device())) {
|
||||
plugin = currentPlugin;
|
||||
} else {
|
||||
if (iface->devices(type).contains(hint.device())) {
|
||||
plugin = currentPlugin;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -887,14 +882,6 @@ QMediaServiceProvider *QMediaServiceProvider::defaultServiceProvider()
|
||||
Destroys a media service supported devices interface.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\since 5.3
|
||||
|
||||
\fn QByteArray QMediaServiceSupportedDevicesInterface::defaultDevice(const QByteArray &service) const
|
||||
|
||||
Returns the default device for a \a service type.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QList<QByteArray> QMediaServiceSupportedDevicesInterface::devices(const QByteArray &service) const
|
||||
|
||||
@@ -907,6 +894,29 @@ QMediaServiceProvider *QMediaServiceProvider::defaultServiceProvider()
|
||||
Returns the description of a \a device available for a \a service type.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\class QMediaServiceDefaultDeviceInterface
|
||||
\inmodule QtMultimedia
|
||||
\brief The QMediaServiceDefaultDeviceInterface class interface
|
||||
identifies the default device used by a media service plug-in.
|
||||
|
||||
A QMediaServiceProviderPlugin may implement this interface.
|
||||
|
||||
\since 5.3
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QMediaServiceDefaultDeviceInterface::~QMediaServiceDefaultDeviceInterface()
|
||||
|
||||
Destroys a media service default device interface.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QByteArray QMediaServiceDefaultDeviceInterface::defaultDevice(const QByteArray &service) const
|
||||
|
||||
Returns the default device for a \a service type.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\class QMediaServiceCameraInfoInterface
|
||||
\inmodule QtMultimedia
|
||||
@@ -918,6 +928,12 @@ QMediaServiceProvider *QMediaServiceProvider::defaultServiceProvider()
|
||||
implement the QMediaServiceSupportedDevicesInterface.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QMediaServiceCameraInfoInterface::~QMediaServiceCameraInfoInterface()
|
||||
|
||||
Destroys a media service camera info interface.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QMediaServiceCameraInfoInterface::cameraPosition(const QByteArray &device) const
|
||||
|
||||
|
||||
@@ -276,10 +276,13 @@ QAbstractVideoFilter::~QAbstractVideoFilter()
|
||||
}
|
||||
|
||||
/*!
|
||||
\return \c true if the filter is active.
|
||||
\property QAbstractVideoFilter::active
|
||||
\brief the active status of the filter.
|
||||
|
||||
By default filters are active. When set to \c false, the filter will be
|
||||
ignored by the VideoOutput type.
|
||||
This is true if the filter is active, false otherwise.
|
||||
|
||||
By default filters are active. When set to \c false, the filter will be
|
||||
ignored by the VideoOutput type.
|
||||
*/
|
||||
bool QAbstractVideoFilter::isActive() const
|
||||
{
|
||||
@@ -287,9 +290,6 @@ bool QAbstractVideoFilter::isActive() const
|
||||
return d->active;
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
void QAbstractVideoFilter::setActive(bool v)
|
||||
{
|
||||
Q_D(QAbstractVideoFilter);
|
||||
|
||||
Reference in New Issue
Block a user