diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/mediaservices/directshow/mediaplayer/directshowsamplescheduler.cpp | 23 | ||||
-rw-r--r-- | src/plugins/mediaservices/directshow/mediaplayer/directshowsamplescheduler.h | 5 |
2 files changed, 8 insertions, 20 deletions
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowsamplescheduler.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowsamplescheduler.cpp index 150860f..23675fb 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowsamplescheduler.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowsamplescheduler.cpp @@ -118,7 +118,7 @@ bool DirectShowTimedSample::isReady(IReferenceClock *clock) const } DirectShowSampleScheduler::DirectShowSampleScheduler(IUnknown *pin, QObject *parent) - : QWinEventNotifier(parent) + : QObject(parent) , m_pin(pin) , m_clock(0) , m_allocator(0) @@ -131,13 +131,15 @@ DirectShowSampleScheduler::DirectShowSampleScheduler(IUnknown *pin, QObject *par { m_semaphore.release(m_maximumSamples); - setHandle(m_timeoutEvent); - setEnabled(true); + m_eventNotifier.setHandle(m_timeoutEvent); + m_eventNotifier.setEnabled(true); + + connect(&m_eventNotifier, SIGNAL(activated(HANDLE)), this, SIGNAL(sampleReady())); } DirectShowSampleScheduler::~DirectShowSampleScheduler() { - setEnabled(false); + m_eventNotifier.setEnabled(false); ::CloseHandle(m_timeoutEvent); @@ -398,17 +400,4 @@ bool DirectShowSampleScheduler::scheduleEndOfStream() } } -bool DirectShowSampleScheduler::event(QEvent *event) -{ - if (event->type() == QEvent::WinEventAct) { - QObject::event(event); - - emit sampleReady(); - - return true; - } else { - return QWinEventNotifier::event(event); - } -} - QT_END_NAMESPACE diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowsamplescheduler.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowsamplescheduler.h index 007fa99..21823c3 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowsamplescheduler.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowsamplescheduler.h @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE class DirectShowTimedSample; -class DirectShowSampleScheduler : public QWinEventNotifier, public IMemInputPin +class DirectShowSampleScheduler : public QObject, public IMemInputPin { Q_OBJECT public: @@ -101,8 +101,6 @@ public: IMediaSample *takeSample(bool *eos); - bool event(QEvent *event); - Q_SIGNALS: void sampleReady(); @@ -118,6 +116,7 @@ private: HANDLE m_timeoutEvent; QSemaphore m_semaphore; QMutex m_mutex; + QWinEventNotifier m_eventNotifier; }; QT_END_NAMESPACE |