summaryrefslogtreecommitdiffstats
path: root/src/plugins/wmf
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/wmf')
-rw-r--r--src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp6
-rw-r--r--src/plugins/wmf/player/mfplayersession.cpp6
-rw-r--r--src/plugins/wmf/player/mfplayersession.h3
-rw-r--r--src/plugins/wmf/sourceresolver.cpp10
-rw-r--r--src/plugins/wmf/sourceresolver.h2
-rw-r--r--src/plugins/wmf/wmf.pro5
-rw-r--r--src/plugins/wmf/wmf_audiodecode.json4
-rw-r--r--src/plugins/wmf/wmfserviceplugin.cpp9
-rw-r--r--src/plugins/wmf/wmfserviceplugin.h5
9 files changed, 13 insertions, 37 deletions
diff --git a/src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp b/src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp
index 438c2aae0..c0eada324 100644
--- a/src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp
+++ b/src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp
@@ -124,14 +124,12 @@ void MFAudioDecoderControl::setSourceFilename(const QString &fileName)
m_sourceFilename = fileName;
if (!m_sourceFilename.isEmpty()) {
m_sourceResolver->shutdown();
- QMediaResourceList rl;
QUrl url;
if (m_sourceFilename.startsWith(':'))
url = QUrl(QStringLiteral("qrc%1").arg(m_sourceFilename));
else
url = QUrl::fromLocalFile(m_sourceFilename);
- rl.push_back(QMediaResource(url));
- m_sourceResolver->load(rl, 0);
+ m_sourceResolver->load(url, 0);
m_loadingSource = true;
} else {
onSourceCleared();
@@ -155,7 +153,7 @@ void MFAudioDecoderControl::setSourceDevice(QIODevice *device)
m_device = device;
if (m_device) {
m_sourceResolver->shutdown();
- m_sourceResolver->load(QMediaResourceList(), m_device);
+ m_sourceResolver->load(QUrl(), m_device);
m_loadingSource = true;
} else {
onSourceCleared();
diff --git a/src/plugins/wmf/player/mfplayersession.cpp b/src/plugins/wmf/player/mfplayersession.cpp
index 3219936a7..9f909252d 100644
--- a/src/plugins/wmf/player/mfplayersession.cpp
+++ b/src/plugins/wmf/player/mfplayersession.cpp
@@ -197,12 +197,12 @@ void MFPlayerSession::load(const QMediaContent &media, QIODevice *stream)
qDebug() << "load";
#endif
clear();
- QMediaResourceList resources = media.resources();
+ QUrl url = media.canonicalUrl();
if (m_status == QMediaPlayer::LoadingMedia && m_sourceResolver)
m_sourceResolver->cancel();
- if (resources.isEmpty() && !stream) {
+ if (url.isEmpty() && !stream) {
changeStatus(QMediaPlayer::NoMedia);
} else if (stream && (!stream->isReadable())) {
changeStatus(QMediaPlayer::InvalidMedia);
@@ -210,7 +210,7 @@ void MFPlayerSession::load(const QMediaContent &media, QIODevice *stream)
} else {
createSession();
changeStatus(QMediaPlayer::LoadingMedia);
- m_sourceResolver->load(resources, stream);
+ m_sourceResolver->load(url, stream);
}
emit positionChanged(position());
}
diff --git a/src/plugins/wmf/player/mfplayersession.h b/src/plugins/wmf/player/mfplayersession.h
index 72dc99d02..21fabbd92 100644
--- a/src/plugins/wmf/player/mfplayersession.h
+++ b/src/plugins/wmf/player/mfplayersession.h
@@ -62,9 +62,6 @@ QT_END_NAMESPACE
QT_USE_NAMESPACE
class SourceResolver;
-#ifndef Q_WS_SIMULATOR
-class EvrVideoWindowControl;
-#endif
class MFAudioEndpointControl;
class MFVideoRendererControl;
class MFPlayerControl;
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);
diff --git a/src/plugins/wmf/sourceresolver.h b/src/plugins/wmf/sourceresolver.h
index 387f59739..aa104a60e 100644
--- a/src/plugins/wmf/sourceresolver.h
+++ b/src/plugins/wmf/sourceresolver.h
@@ -59,7 +59,7 @@ public:
HRESULT STDMETHODCALLTYPE GetParameters(DWORD*, DWORD*);
- void load(const QMediaResourceList &resources, QIODevice* stream);
+ void load(const QUrl &url, QIODevice* stream);
void cancel();
diff --git a/src/plugins/wmf/wmf.pro b/src/plugins/wmf/wmf.pro
index b202ff2a1..7c712233d 100644
--- a/src/plugins/wmf/wmf.pro
+++ b/src/plugins/wmf/wmf.pro
@@ -17,12 +17,11 @@ SOURCES += \
mfstream.cpp \
sourceresolver.cpp
-qtConfig(wmf-player): include (player/player.pri)
+include (player/player.pri)
include (decoder/decoder.pri)
OTHER_FILES += \
- wmf.json \
- wmf_audiodecode.json
+ wmf.json
PLUGIN_TYPE = mediaservice
PLUGIN_CLASS_NAME = WMFServicePlugin
diff --git a/src/plugins/wmf/wmf_audiodecode.json b/src/plugins/wmf/wmf_audiodecode.json
deleted file mode 100644
index 2a65dd758..000000000
--- a/src/plugins/wmf/wmf_audiodecode.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "Keys": ["windowsmediafoundation"],
- "Services": ["org.qt-project.qt.audiodecode"]
-}
diff --git a/src/plugins/wmf/wmfserviceplugin.cpp b/src/plugins/wmf/wmfserviceplugin.cpp
index 1eeb22428..740067600 100644
--- a/src/plugins/wmf/wmfserviceplugin.cpp
+++ b/src/plugins/wmf/wmfserviceplugin.cpp
@@ -42,9 +42,7 @@
#include <QtCore/QFile>
#include "wmfserviceplugin.h"
-#if QT_CONFIG(wmf_player)
#include "mfplayerservice.h"
-#endif
#include "mfdecoderservice.h"
#include <mfapi.h>
@@ -74,12 +72,11 @@ void releaseRefCount()
QMediaService* WMFServicePlugin::create(QString const& key)
{
-#if QT_CONFIG(wmf_player)
if (key == QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER)) {
addRefCount();
return new MFPlayerService;
}
-#endif
+
if (key == QLatin1String(Q_MEDIASERVICE_AUDIODECODER)) {
addRefCount();
return new MFAudioDecoderService;
@@ -97,13 +94,9 @@ void WMFServicePlugin::release(QMediaService *service)
QMediaServiceProviderHint::Features WMFServicePlugin::supportedFeatures(
const QByteArray &service) const
{
-#if QT_CONFIG(wmf_player)
if (service == Q_MEDIASERVICE_MEDIAPLAYER)
return QMediaServiceProviderHint::StreamPlayback;
else
-#else
- Q_UNUSED(service);
-#endif
return QMediaServiceProviderHint::Features();
}
diff --git a/src/plugins/wmf/wmfserviceplugin.h b/src/plugins/wmf/wmfserviceplugin.h
index 826ca1d26..493a0b08c 100644
--- a/src/plugins/wmf/wmfserviceplugin.h
+++ b/src/plugins/wmf/wmfserviceplugin.h
@@ -55,11 +55,8 @@ class WMFServicePlugin
Q_INTERFACES(QMediaServiceSupportedDevicesInterface)
Q_INTERFACES(QMediaServiceDefaultDeviceInterface)
Q_INTERFACES(QMediaServiceFeaturesInterface)
-#if QT_CONFIG(wmf_player)
Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "wmf.json")
-#else
- Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "wmf_audiodecode.json")
-#endif
+
public:
QMediaService* create(QString const& key);
void release(QMediaService *service);