summaryrefslogtreecommitdiffstats
path: root/src/plugins/wmf/sourceresolver.cpp
diff options
context:
space:
mode:
authorVal Doroshchuk <valentyn.doroshchuk@qt.io>2017-11-15 17:03:17 +0100
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2018-08-30 10:28:42 +0000
commit72536fa39c71b32f963322a8aa0c1dee320102fc (patch)
treea32ce84044137c15ce567f3f60f1251f4ac6a521 /src/plugins/wmf/sourceresolver.cpp
parentec597d89320dd312382457a711ebddb085b16a59 (diff)
Do not use QMediaResource internally
Removed usage of QMediaResource internally, since it is going to be deprecated. Task-number: QTBUG-28850 Change-Id: I476ae11ac58215aa4df4a76abb0cec3aa44f206a Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src/plugins/wmf/sourceresolver.cpp')
-rw-r--r--src/plugins/wmf/sourceresolver.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/plugins/wmf/sourceresolver.cpp b/src/plugins/wmf/sourceresolver.cpp
index 83949c976..c6f4e8566 100644
--- a/src/plugins/wmf/sourceresolver.cpp
+++ b/src/plugins/wmf/sourceresolver.cpp
@@ -158,7 +158,7 @@ HRESULT STDMETHODCALLTYPE SourceResolver::GetParameters(DWORD*, DWORD*)
return E_NOTIMPL;
}
-void SourceResolver::load(const QMediaResourceList &resources, QIODevice* stream)
+void SourceResolver::load(const QUrl &url, QIODevice* stream)
{
QMutexLocker locker(&m_mutex);
HRESULT hr = S_OK;
@@ -174,12 +174,10 @@ void SourceResolver::load(const QMediaResourceList &resources, QIODevice* stream
qWarning() << "Failed to create Source Resolver!";
emit error(hr);
} else if (stream) {
- QString url;
- if (!resources.isEmpty())
- url = resources.constFirst().url().toString();
+ QString urlString = url.toString();
m_stream = new MFStream(stream, false);
hr = m_sourceResolver->BeginCreateObjectFromByteStream(
- m_stream, url.isEmpty() ? 0 : reinterpret_cast<LPCWSTR>(url.utf16()),
+ m_stream, urlString.isEmpty() ? 0 : reinterpret_cast<LPCWSTR>(urlString.utf16()),
MF_RESOLUTION_MEDIASOURCE | MF_RESOLUTION_CONTENT_DOES_NOT_HAVE_TO_MATCH_EXTENSION_OR_MIME_TYPE
, NULL, &m_cancelCookie, this, new State(m_sourceResolver, true));
if (FAILED(hr)) {
@@ -187,8 +185,6 @@ void SourceResolver::load(const QMediaResourceList &resources, QIODevice* stream
emit error(hr);
}
} else {
- QMediaResource resource = resources.constFirst();
- QUrl url = resource.url();
#ifdef DEBUG_MEDIAFOUNDATION
qDebug() << "loading :" << url;
qDebug() << "url path =" << url.path().mid(1);