summaryrefslogtreecommitdiffstats
path: root/src/multimedia
diff options
context:
space:
mode:
authorVal Doroshchuk <valentyn.doroshchuk@qt.io>2017-11-15 17:16:08 +0100
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2018-11-05 12:17:18 +0000
commit2a77249b1954f0c57ab9de41cf96345b9e575ee7 (patch)
tree223bb2f66454b4e829a220dd1c0ed2fadad0a0da /src/multimedia
parent3ee6d65377cb563d49d81c3adac0523e4ae8a0b9 (diff)
Deprecate QMediaResource class
QMediaResource class is now deprecated and should not be used. Task-number: QTBUG-28850 Change-Id: Ia0ed5937c548d842eb4bf686da2c24db8b100a9d Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src/multimedia')
-rw-r--r--src/multimedia/playback/qmediacontent.cpp46
-rw-r--r--src/multimedia/playback/qmediacontent.h13
-rw-r--r--src/multimedia/playback/qmediaresource.cpp4
-rw-r--r--src/multimedia/playback/qmediaresource.h4
4 files changed, 62 insertions, 5 deletions
diff --git a/src/multimedia/playback/qmediacontent.cpp b/src/multimedia/playback/qmediacontent.cpp
index fe377b969..bce65ddbc 100644
--- a/src/multimedia/playback/qmediacontent.cpp
+++ b/src/multimedia/playback/qmediacontent.cpp
@@ -61,14 +61,20 @@ public:
isPlaylistOwned(false)
{}
+#if QT_DEPRECATED_SINCE(6, 0)
QMediaContentPrivate(const QMediaResourceList &r):
resources(r),
isPlaylistOwned(false)
{}
+#endif
QMediaContentPrivate(const QMediaContentPrivate &other):
QSharedData(other),
+#if QT_DEPRECATED_SINCE(6, 0)
resources(other.resources),
+#else
+ request(other.request),
+#endif
playlist(other.playlist),
isPlaylistOwned(false)
{}
@@ -77,7 +83,11 @@ public:
playlist(pls),
isPlaylistOwned(isOwn)
{
+#if QT_DEPRECATED_SINCE(6, 0)
resources << QMediaResource(url);
+#else
+ request.setUrl(url);
+#endif
}
~QMediaContentPrivate()
@@ -88,10 +98,18 @@ public:
bool operator ==(const QMediaContentPrivate &other) const
{
+#if QT_DEPRECATED_SINCE(6, 0)
return resources == other.resources && playlist == other.playlist;
+#else
+ return request == other.request && playlist == other.playlist;
+#endif
}
+#if QT_DEPRECATED_SINCE(6, 0)
QMediaResourceList resources;
+#else
+ QNetworkRequest request;
+#endif
QPointer<QMediaPlaylist> playlist;
bool isPlaylistOwned;
@@ -139,7 +157,11 @@ QMediaContent::QMediaContent()
QMediaContent::QMediaContent(const QUrl &url):
d(new QMediaContentPrivate)
{
+#if QT_DEPRECATED_SINCE(6, 0)
d->resources << QMediaResource(url);
+#else
+ d->request.setUrl(url);
+#endif
}
/*!
@@ -152,10 +174,17 @@ QMediaContent::QMediaContent(const QUrl &url):
QMediaContent::QMediaContent(const QNetworkRequest &request):
d(new QMediaContentPrivate)
{
+#if QT_DEPRECATED_SINCE(6, 0)
d->resources << QMediaResource(request);
+#else
+ d->request = request;
+#endif
}
+#if QT_DEPRECATED_SINCE(6, 0)
/*!
+ \obsolete
+
Constructs a media content with \a resource providing a reference to the content.
*/
@@ -166,6 +195,8 @@ QMediaContent::QMediaContent(const QMediaResource &resource):
}
/*!
+ \obsolete
+
Constructs a media content with \a resources providing a reference to the content.
*/
@@ -173,6 +204,7 @@ QMediaContent::QMediaContent(const QMediaResourceList &resources):
d(new QMediaContentPrivate(resources))
{
}
+#endif
/*!
Constructs a copy of the media content \a other.
@@ -250,7 +282,11 @@ bool QMediaContent::isNull() const
QUrl QMediaContent::canonicalUrl() const
{
+#if QT_DEPRECATED_SINCE(6, 0)
return canonicalResource().url();
+#else
+ return canonicalRequest().url();
+#endif
}
/*!
@@ -259,10 +295,17 @@ QUrl QMediaContent::canonicalUrl() const
QNetworkRequest QMediaContent::canonicalRequest() const
{
+#if QT_DEPRECATED_SINCE(6, 0)
return canonicalResource().request();
+#else
+ return d.constData() != 0 ? d->request : QNetworkRequest();
+#endif
}
+#if QT_DEPRECATED_SINCE(6, 0)
/*!
+ \obsolete
+
Returns a QMediaResource that represents that canonical resource for this media content.
*/
@@ -274,6 +317,8 @@ QMediaResource QMediaContent::canonicalResource() const
}
/*!
+ \obsolete
+
Returns a list of alternative resources for this media content. The first item in this list
is always the canonical resource.
*/
@@ -284,6 +329,7 @@ QMediaResourceList QMediaContent::resources() const
? d->resources
: QMediaResourceList();
}
+#endif // #if QT_DEPRECATED_SINCE(6, 0)
/*!
Returns a playlist for this media content or 0 if this QMediaContent is not a playlist.
diff --git a/src/multimedia/playback/qmediacontent.h b/src/multimedia/playback/qmediacontent.h
index f7c086752..5193a1fcc 100644
--- a/src/multimedia/playback/qmediacontent.h
+++ b/src/multimedia/playback/qmediacontent.h
@@ -58,8 +58,10 @@ public:
QMediaContent();
QMediaContent(const QUrl &contentUrl);
QMediaContent(const QNetworkRequest &contentRequest);
- QMediaContent(const QMediaResource &contentResource);
- QMediaContent(const QMediaResourceList &resources);
+#if QT_DEPRECATED_SINCE(6, 0)
+ QT_DEPRECATED QMediaContent(const QMediaResource &contentResource);
+ QT_DEPRECATED QMediaContent(const QMediaResourceList &resources);
+#endif
QMediaContent(const QMediaContent &other);
QMediaContent(QMediaPlaylist *playlist, const QUrl &contentUrl = QUrl(), bool takeOwnership = false);
~QMediaContent();
@@ -73,9 +75,10 @@ public:
QUrl canonicalUrl() const;
QNetworkRequest canonicalRequest() const;
- QMediaResource canonicalResource() const;
-
- QMediaResourceList resources() const;
+#if QT_DEPRECATED_SINCE(6, 0)
+ QT_DEPRECATED QMediaResource canonicalResource() const;
+ QT_DEPRECATED QMediaResourceList resources() const;
+#endif
QMediaPlaylist *playlist() const;
private:
diff --git a/src/multimedia/playback/qmediaresource.cpp b/src/multimedia/playback/qmediaresource.cpp
index 0a59b0de8..181b37525 100644
--- a/src/multimedia/playback/qmediaresource.cpp
+++ b/src/multimedia/playback/qmediaresource.cpp
@@ -39,6 +39,8 @@
#include "qmediaresource.h"
+#if QT_DEPRECATED_SINCE(6, 0)
+
#include <QtCore/qsize.h>
#include <QtCore/qurl.h>
#include <QtCore/qvariant.h>
@@ -61,6 +63,7 @@ Q_CONSTRUCTOR_FUNCTION(qRegisterMediaResourceMetaTypes)
\inmodule QtMultimedia
\ingroup multimedia
\ingroup multimedia_playback
+ \obsolete
A media resource is composed of a \l {url()}{URL} containing the
location of the resource and a set of properties that describe the
@@ -418,3 +421,4 @@ void QMediaResource::setResolution(int width, int height)
}
QT_END_NAMESPACE
+#endif // #if QT_DEPRECATED_SINCE(6, 0)
diff --git a/src/multimedia/playback/qmediaresource.h b/src/multimedia/playback/qmediaresource.h
index 9740166c6..8cded3128 100644
--- a/src/multimedia/playback/qmediaresource.h
+++ b/src/multimedia/playback/qmediaresource.h
@@ -46,6 +46,8 @@
#include <QtMultimedia/qtmultimediaglobal.h>
+#if QT_DEPRECATED_SINCE(6, 0)
+
QT_BEGIN_NAMESPACE
// Class forward declaration required for QDoc bug
@@ -124,4 +126,6 @@ QT_END_NAMESPACE
Q_DECLARE_METATYPE(QMediaResource)
Q_DECLARE_METATYPE(QMediaResourceList)
+#endif // #if QT_DEPRECATED_SINCE(6, 0)
+
#endif