summaryrefslogtreecommitdiffstats
path: root/src/plugins/mediaservices
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2010-02-25 02:52:23 (GMT)
committerAndrew den Exter <andrew.den-exter@nokia.com>2010-02-25 02:52:23 (GMT)
commitf2d89dee45e2f08e8e7613c18660c5c3e133c0ff (patch)
tree502615ed31e26288129cb5a00082b0d926e232a8 /src/plugins/mediaservices
parente9f3edcb0a0223b90606108993999ad3cb37af9f (diff)
downloadQt-f2d89dee45e2f08e8e7613c18660c5c3e133c0ff.zip
Qt-f2d89dee45e2f08e8e7613c18660c5c3e133c0ff.tar.gz
Qt-f2d89dee45e2f08e8e7613c18660c5c3e133c0ff.tar.bz2
Remove all uses of __uuidof from the Direct Show media service.
It's unnecessary and not supported on all compilers. Reviewed-by: Justin McPherson
Diffstat (limited to 'src/plugins/mediaservices')
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp5
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h10
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowioreader.cpp2
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp4
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp2
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp2
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp53
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h1
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp4
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp27
10 files changed, 59 insertions, 51 deletions
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp
index 570b44a..30c05ed 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp
@@ -55,7 +55,7 @@ DirectShowAudioEndpointControl::DirectShowAudioEndpointControl(
, m_deviceEnumerator(0)
{
if (CreateBindCtx(0, &m_bindContext) == S_OK) {
- m_deviceEnumerator = com_new<ICreateDevEnum>(CLSID_SystemDeviceEnum);
+ m_deviceEnumerator = com_new<ICreateDevEnum>(CLSID_SystemDeviceEnum, IID_ICreateDevEnum);
updateEndpoints();
@@ -96,6 +96,7 @@ QString DirectShowAudioEndpointControl::endpointDescription(const QString &name)
propertyBag->Release();
}
}
+
return description;;
}
@@ -120,7 +121,7 @@ void DirectShowAudioEndpointControl::setActiveEndpoint(const QString &name)
if (moniker->BindToObject(
m_bindContext,
0,
- __uuidof(IBaseFilter),
+ IID_IBaseFilter,
reinterpret_cast<void **>(&filter)) == S_OK) {
m_service->setAudioOutput(filter);
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h
index 1c9fe54..7601672 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h
@@ -44,28 +44,26 @@
#include <dshow.h>
-
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-template <typename T> T *com_cast(IUnknown *unknown)
+template <typename T> T *com_cast(IUnknown *unknown, const IID &iid)
{
T *iface = 0;
- return unknown && unknown->QueryInterface(
- __uuidof(T), reinterpret_cast<void **>(&iface)) == S_OK
+ return unknown && unknown->QueryInterface(iid, reinterpret_cast<void **>(&iface)) == S_OK
? iface
: 0;
}
-template <typename T> T *com_new(const IID &clsid)
+template <typename T> T *com_new(const IID &clsid, const IID &iid)
{
T *object = 0;
return CoCreateInstance(
clsid,
NULL,
CLSCTX_INPROC_SERVER,
- __uuidof(T),
+ iid,
reinterpret_cast<void **>(&object)) == S_OK
? object
: 0;
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowioreader.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowioreader.cpp
index 54446b8..7369099 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowioreader.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowioreader.cpp
@@ -143,7 +143,7 @@ HRESULT DirectShowIOReader::RequestAllocator(
return S_OK;
} else {
- *ppActual = com_new<IMemAllocator>(CLSID_MemoryAllocator);
+ *ppActual = com_new<IMemAllocator>(CLSID_MemoryAllocator, IID_IMemAllocator);
if (*ppActual) {
if ((*ppActual)->SetProperties(pProps, &actualProperties) != S_OK) {
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp
index 1dca465..15bfea5 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp
@@ -414,8 +414,8 @@ HRESULT DirectShowIOSource::tryConnect(IPin *pin, const AM_MEDIA_TYPE *type)
} else if (!m_allocator) {
hr = VFW_E_NO_TRANSPORT;
- if (IMemInputPin *memPin = com_cast<IMemInputPin>(pin)) {
- if ((m_allocator = com_new<IMemAllocator>(CLSID_MemoryAllocator))) {
+ if (IMemInputPin *memPin = com_cast<IMemInputPin>(pin, IID_IMemInputPin)) {
+ if ((m_allocator = com_new<IMemAllocator>(CLSID_MemoryAllocator, IID_IMemAllocator))) {
ALLOCATOR_PROPERTIES properties;
if (memPin->GetAllocatorRequirements(&properties) == S_OK
|| m_allocator->GetProperties(&properties) == S_OK) {
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp
index 7b2552f..a33041e 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp
@@ -344,7 +344,7 @@ void DirectShowMetaDataControl::updateGraph(IFilterGraph2 *graph, IBaseFilter *s
if (m_headerInfo)
m_headerInfo->Release();
- m_headerInfo = com_cast<IWMHeaderInfo>(source);
+ m_headerInfo = com_cast<IWMHeaderInfo>(source, IID_IWMHeaderInfo);
#endif
// DirectShowMediaPlayerService holds a lock at this point so defer emitting signals to a later
// time.
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp
index b024557..bb7bac3 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp
@@ -371,7 +371,7 @@ void DirectShowPlayerControl::updateAudioOutput(IBaseFilter *filter)
if (m_audio)
m_audio->Release();
- m_audio = com_cast<IBasicAudio>(filter);
+ m_audio = com_cast<IBasicAudio>(filter, IID_IBasicAudio);
}
void DirectShowPlayerControl::updateError(QMediaPlayer::Error error, const QString &errorString)
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp
index 57f4bec..649f3fb 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp
@@ -205,7 +205,7 @@ void DirectShowPlayerService::load(const QMediaContent &media, QIODevice *stream
} else {
m_graphStatus = Loading;
- m_graph = com_new<IFilterGraph2>(CLSID_FilterGraph);
+ m_graph = com_new<IFilterGraph2>(CLSID_FilterGraph, IID_IFilterGraph2);
if (stream)
m_pendingTasks = SetStreamSource;
@@ -233,13 +233,14 @@ void DirectShowPlayerService::doSetUrlSource(QMutexLocker *locker)
#ifndef QT_NO_WMSDK
if (url.scheme() == QLatin1String("http") || url.scheme() == QLatin1String("https")) {
- if (IFileSourceFilter *fileSource = com_new<IFileSourceFilter>(CLSID_WMAsfReader)) {
+ if (IFileSourceFilter *fileSource = com_new<IFileSourceFilter>(
+ CLSID_WMAsfReader, IID_IFileSourceFilter)) {
locker->unlock();
hr = fileSource->Load(url.toString().utf16(), 0);
locker->relock();
if (SUCCEEDED(hr)) {
- source = com_cast<IBaseFilter>(fileSource);
+ source = com_cast<IBaseFilter>(fileSource, IID_IBaseFilter);
if (!SUCCEEDED(hr = m_graph->AddFilter(source, L"Source")) && source) {
source->Release();
@@ -342,7 +343,7 @@ void DirectShowPlayerService::doRender(QMutexLocker *locker)
{
m_pendingTasks |= m_executedTasks & (Play | Pause);
- if (IMediaControl *control = com_cast<IMediaControl>(m_graph)) {
+ if (IMediaControl *control = com_cast<IMediaControl>(m_graph, IID_IMediaControl)) {
control->Stop();
control->Release();
}
@@ -462,11 +463,11 @@ void DirectShowPlayerService::doRender(QMutexLocker *locker)
void DirectShowPlayerService::doFinalizeLoad(QMutexLocker *locker)
{
if (m_graphStatus != Loaded) {
- if (IMediaEvent *event = com_cast<IMediaEvent>(m_graph)) {
+ if (IMediaEvent *event = com_cast<IMediaEvent>(m_graph, IID_IMediaEvent)) {
event->GetEventHandle(reinterpret_cast<OAEVENT *>(&m_eventHandle));
event->Release();
}
- if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph)) {
+ if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
LONGLONG duration = 0;
seeking->GetDuration(&duration);
m_duration = duration / 10;
@@ -496,7 +497,8 @@ void DirectShowPlayerService::releaseGraph()
{
if (m_graph) {
if (m_executingTask != 0) {
- if (IAMOpenProgress *progress = com_cast<IAMOpenProgress>(m_graph)) {
+ if (IAMOpenProgress *progress = com_cast<IAMOpenProgress>(
+ m_graph, IID_IAMOpenProgress)) {
progress->AbortOperation();
progress->Release();
}
@@ -515,7 +517,7 @@ void DirectShowPlayerService::doReleaseGraph(QMutexLocker *locker)
{
Q_UNUSED(locker);
- if (IMediaControl *control = com_cast<IMediaControl>(m_graph)) {
+ if (IMediaControl *control = com_cast<IMediaControl>(m_graph, IID_IMediaControl)) {
control->Stop();
control->Release();
}
@@ -630,7 +632,7 @@ void DirectShowPlayerService::play()
void DirectShowPlayerService::doPlay(QMutexLocker *locker)
{
- if (IMediaControl *control = com_cast<IMediaControl>(m_graph)) {
+ if (IMediaControl *control = com_cast<IMediaControl>(m_graph, IID_IMediaControl)) {
locker->unlock();
HRESULT hr = control->Run();
locker->relock();
@@ -672,7 +674,7 @@ void DirectShowPlayerService::pause()
void DirectShowPlayerService::doPause(QMutexLocker *locker)
{
- if (IMediaControl *control = com_cast<IMediaControl>(m_graph)) {
+ if (IMediaControl *control = com_cast<IMediaControl>(m_graph, IID_IMediaControl)) {
locker->unlock();
HRESULT hr = control->Pause();
locker->relock();
@@ -680,7 +682,7 @@ void DirectShowPlayerService::doPause(QMutexLocker *locker)
control->Release();
if (SUCCEEDED(hr)) {
- if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph)) {
+ if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
LONGLONG position = 0;
seeking->GetCurrentPosition(&position);
@@ -723,12 +725,12 @@ void DirectShowPlayerService::stop()
void DirectShowPlayerService::doStop(QMutexLocker *locker)
{
if (m_executedTasks & (Play | Pause)) {
- if (IMediaControl *control = com_cast<IMediaControl>(m_graph)) {
+ if (IMediaControl *control = com_cast<IMediaControl>(m_graph, IID_IMediaControl)) {
control->Stop();
control->Release();
}
- if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph)) {
+ if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
LONGLONG position = 0;
seeking->GetCurrentPosition(&position);
@@ -763,7 +765,7 @@ void DirectShowPlayerService::setRate(qreal rate)
void DirectShowPlayerService::doSetRate(QMutexLocker *locker)
{
- if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph)) {
+ if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
// Cache current values as we can't query IMediaSeeking during a seek due to the
// possibility of a deadlock when flushing the VideoSurfaceFilter.
LONGLONG currentPosition = 0;
@@ -801,7 +803,7 @@ qint64 DirectShowPlayerService::position() const
if (m_graphStatus == Loaded) {
if (m_executingTask == Seek || m_executingTask == SetRate) {
return m_position;
- } else if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph)) {
+ } else if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
LONGLONG position = 0;
seeking->GetCurrentPosition(&position);
@@ -822,7 +824,7 @@ QMediaTimeRange DirectShowPlayerService::availablePlaybackRanges() const
if (m_graphStatus == Loaded) {
if (m_executingTask == Seek || m_executingTask == SetRate) {
return m_playbackRange;
- } else if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph)) {
+ } else if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
LONGLONG minimum = 0;
LONGLONG maximum = 0;
@@ -850,7 +852,7 @@ void DirectShowPlayerService::seek(qint64 position)
void DirectShowPlayerService::doSeek(QMutexLocker *locker)
{
- if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph)) {
+ if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
LONGLONG seekPosition = LONGLONG(m_position) * 10;
// Cache current values as we can't query IMediaSeeking during a seek due to the
@@ -886,7 +888,8 @@ int DirectShowPlayerService::bufferStatus() const
#ifndef QT_NO_WMSDK
QMutexLocker locker(const_cast<QMutex *>(&m_mutex));
- if (IWMReaderAdvanced2 *reader = com_cast<IWMReaderAdvanced2>(m_source)) {
+ if (IWMReaderAdvanced2 *reader = com_cast<IWMReaderAdvanced2>(
+ m_source, IID_IWMReaderAdvanced2)) {
DWORD percentage = 0;
reader->GetBufferProgress(&percentage, 0);
@@ -949,7 +952,7 @@ void DirectShowPlayerService::doReleaseAudioOutput(QMutexLocker *locker)
{
m_pendingTasks |= m_executedTasks & (Play | Pause);
- if (IMediaControl *control = com_cast<IMediaControl>(m_graph)) {
+ if (IMediaControl *control = com_cast<IMediaControl>(m_graph, IID_IMediaControl)) {
control->Stop();
control->Release();
}
@@ -960,7 +963,7 @@ void DirectShowPlayerService::doReleaseAudioOutput(QMutexLocker *locker)
decoder->AddRef();
}
- if (IFilterChain *chain = com_cast<IFilterChain>(m_graph)) {
+ if (IFilterChain *chain = com_cast<IFilterChain>(m_graph, IID_IFilterChain)) {
chain->RemoveChain(decoder, m_audioOutput);
chain->Release();
} else {
@@ -1018,7 +1021,7 @@ void DirectShowPlayerService::doReleaseVideoOutput(QMutexLocker *locker)
{
m_pendingTasks |= m_executedTasks & (Play | Pause);
- if (IMediaControl *control = com_cast<IMediaControl>(m_graph)) {
+ if (IMediaControl *control = com_cast<IMediaControl>(m_graph, IID_IMediaControl)) {
control->Stop();
control->Release();
}
@@ -1035,7 +1038,7 @@ void DirectShowPlayerService::doReleaseVideoOutput(QMutexLocker *locker)
decoder->AddRef();
}
- if (IFilterChain *chain = com_cast<IFilterChain>(m_graph)) {
+ if (IFilterChain *chain = com_cast<IFilterChain>(m_graph, IID_IFilterChain)) {
chain->RemoveChain(decoder, m_videoOutput);
chain->Release();
} else {
@@ -1118,7 +1121,7 @@ void DirectShowPlayerService::videoOutputChanged()
void DirectShowPlayerService::graphEvent(QMutexLocker *locker)
{
- if (IMediaEvent *event = com_cast<IMediaEvent>(m_graph)) {
+ if (IMediaEvent *event = com_cast<IMediaEvent>(m_graph, IID_IMediaEvent)) {
long eventCode;
LONG_PTR param1;
LONG_PTR param2;
@@ -1137,7 +1140,7 @@ void DirectShowPlayerService::graphEvent(QMutexLocker *locker)
m_buffering = false;
m_atEnd = true;
- if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph)) {
+ if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
LONGLONG position = 0;
seeking->GetCurrentPosition(&position);
@@ -1149,7 +1152,7 @@ void DirectShowPlayerService::graphEvent(QMutexLocker *locker)
QCoreApplication::postEvent(this, new QEvent(QEvent::Type(EndOfMedia)));
break;
case EC_LENGTH_CHANGED:
- if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph)) {
+ if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
LONGLONG duration = 0;
seeking->GetDuration(&duration);
m_duration = duration / 10;
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h
index a5da9a4..23515d0 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h
@@ -57,7 +57,6 @@
#include <QtCore/private/qwineventnotifier_p.h>
-
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp b/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp
index 7b4aad5..94b6f24 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp
@@ -446,7 +446,7 @@ HRESULT VideoSurfaceFilter::EndOfStream()
QMutexLocker locker(&m_mutex);
if (!m_sampleScheduler.scheduleEndOfStream()) {
- if (IMediaEventSink *sink = com_cast<IMediaEventSink>(m_graph)) {
+ if (IMediaEventSink *sink = com_cast<IMediaEventSink>(m_graph, IID_IMediaEventSink)) {
sink->Notify(
EC_COMPLETE,
S_OK,
@@ -610,7 +610,7 @@ void VideoSurfaceFilter::sampleReady()
sample->Release();
if (eos) {
- if (IMediaEventSink *sink = com_cast<IMediaEventSink>(m_graph)) {
+ if (IMediaEventSink *sink = com_cast<IMediaEventSink>(m_graph, IID_IMediaEventSink)) {
sink->Notify(
EC_COMPLETE,
S_OK,
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp
index a564e14..b1ddd98 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
Vmr9VideoWindowControl::Vmr9VideoWindowControl(QObject *parent)
: QVideoWindowControl(parent)
- , m_filter(com_new<IBaseFilter>(CLSID_VideoMixingRenderer9))
+ , m_filter(com_new<IBaseFilter>(CLSID_VideoMixingRenderer9, IID_IBaseFilter))
, m_windowId(0)
, m_dirtyValues(0)
, m_brightness(0)
@@ -57,7 +57,7 @@ Vmr9VideoWindowControl::Vmr9VideoWindowControl(QObject *parent)
, m_saturation(0)
, m_fullScreen(false)
{
- if (IVMRFilterConfig9 *config = com_cast<IVMRFilterConfig9>(m_filter)) {
+ if (IVMRFilterConfig9 *config = com_cast<IVMRFilterConfig9>(m_filter, IID_IVMRFilterConfig9)) {
config->SetRenderingMode(VMR9Mode_Windowless);
config->SetNumberOfStreams(1);
config->Release();
@@ -81,7 +81,8 @@ void Vmr9VideoWindowControl::setWinId(WId id)
{
m_windowId = id;
- if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(m_filter)) {
+ if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(
+ m_filter, IID_IVMRWindowlessControl9)) {
control->SetVideoClippingWindow(m_windowId);
control->Release();
}
@@ -91,7 +92,8 @@ QRect Vmr9VideoWindowControl::displayRect() const
{
QRect rect;
- if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(m_filter)) {
+ if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(
+ m_filter, IID_IVMRWindowlessControl9)) {
RECT sourceRect;
RECT displayRect;
@@ -109,7 +111,8 @@ QRect Vmr9VideoWindowControl::displayRect() const
void Vmr9VideoWindowControl::setDisplayRect(const QRect &rect)
{
- if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(m_filter)) {
+ if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(
+ m_filter, IID_IVMRWindowlessControl9)) {
RECT sourceRect = { 0, 0, 0, 0 };
RECT displayRect = { rect.left(), rect.top(), rect.right(), rect.bottom() };
@@ -134,7 +137,8 @@ void Vmr9VideoWindowControl::repaint()
if (QWidget *widget = QWidget::find(m_windowId)) {
HDC dc = widget->getDC();
- if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(m_filter)) {
+ if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(
+ m_filter, IID_IVMRWindowlessControl9)) {
control->RepaintVideo(m_windowId, dc);
control->Release();
}
@@ -146,7 +150,8 @@ QSize Vmr9VideoWindowControl::nativeSize() const
{
QSize size;
- if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(m_filter)) {
+ if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(
+ m_filter, IID_IVMRWindowlessControl9)) {
LONG width;
LONG height;
@@ -161,7 +166,8 @@ QVideoWidget::AspectRatioMode Vmr9VideoWindowControl::aspectRatioMode() const
{
QVideoWidget::AspectRatioMode mode = QVideoWidget::KeepAspectRatio;
- if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(m_filter)) {
+ if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(
+ m_filter, IID_IVMRWindowlessControl9)) {
DWORD arMode;
if (control->GetAspectRatioMode(&arMode) == S_OK && arMode == VMR9ARMode_None)
@@ -173,7 +179,8 @@ QVideoWidget::AspectRatioMode Vmr9VideoWindowControl::aspectRatioMode() const
void Vmr9VideoWindowControl::setAspectRatioMode(QVideoWidget::AspectRatioMode mode)
{
- if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(m_filter)) {
+ if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(
+ m_filter, IID_IVMRWindowlessControl9)) {
switch (mode) {
case QVideoWidget::IgnoreAspectRatio:
control->SetAspectRatioMode(VMR9ARMode_None);
@@ -254,7 +261,7 @@ void Vmr9VideoWindowControl::setSaturation(int saturation)
void Vmr9VideoWindowControl::setProcAmpValues()
{
- if (IVMRMixerControl9 *control = com_cast<IVMRMixerControl9>(m_filter)) {
+ if (IVMRMixerControl9 *control = com_cast<IVMRMixerControl9>(m_filter, IID_IVMRMixerControl9)) {
VMR9ProcAmpControl procAmp;
procAmp.dwSize = sizeof(VMR9ProcAmpControl);
procAmp.dwFlags = m_dirtyValues;