Merge remote-tracking branch 'origin/5.6.0' into 5.6
Change-Id: Iafd0dbf7f015e2dc8e5ef987fb247660db41e9fe
This commit is contained in:
@@ -248,6 +248,12 @@ HRESULT Scheduler::flush()
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Scheduler::areSamplesScheduled()
|
||||||
|
{
|
||||||
|
QMutexLocker locker(&m_mutex);
|
||||||
|
return m_scheduledSamples.count() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
HRESULT Scheduler::scheduleSample(IMFSample *sample, bool presentNow)
|
HRESULT Scheduler::scheduleSample(IMFSample *sample, bool presentNow)
|
||||||
{
|
{
|
||||||
if (!m_schedulerThread)
|
if (!m_schedulerThread)
|
||||||
@@ -441,7 +447,6 @@ DWORD Scheduler::schedulerThreadProcPrivate()
|
|||||||
|
|
||||||
SamplePool::SamplePool()
|
SamplePool::SamplePool()
|
||||||
: m_initialized(false)
|
: m_initialized(false)
|
||||||
, m_pending(0)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -468,8 +473,6 @@ HRESULT SamplePool::getSample(IMFSample **sample)
|
|||||||
|
|
||||||
IMFSample *taken = m_videoSampleQueue.takeFirst();
|
IMFSample *taken = m_videoSampleQueue.takeFirst();
|
||||||
|
|
||||||
m_pending++;
|
|
||||||
|
|
||||||
// Give the sample to the caller.
|
// Give the sample to the caller.
|
||||||
*sample = taken;
|
*sample = taken;
|
||||||
(*sample)->AddRef();
|
(*sample)->AddRef();
|
||||||
@@ -489,25 +492,9 @@ HRESULT SamplePool::returnSample(IMFSample *sample)
|
|||||||
m_videoSampleQueue.append(sample);
|
m_videoSampleQueue.append(sample);
|
||||||
sample->AddRef();
|
sample->AddRef();
|
||||||
|
|
||||||
m_pending--;
|
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL SamplePool::areSamplesPending()
|
|
||||||
{
|
|
||||||
QMutexLocker locker(&m_mutex);
|
|
||||||
|
|
||||||
bool ret = false;
|
|
||||||
|
|
||||||
if (!m_initialized)
|
|
||||||
ret = false;
|
|
||||||
else
|
|
||||||
ret = (m_pending > 0);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
HRESULT SamplePool::initialize(QList<IMFSample*> &samples)
|
HRESULT SamplePool::initialize(QList<IMFSample*> &samples)
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&m_mutex);
|
QMutexLocker locker(&m_mutex);
|
||||||
@@ -540,7 +527,6 @@ HRESULT SamplePool::clear()
|
|||||||
m_videoSampleQueue[i]->Release();
|
m_videoSampleQueue[i]->Release();
|
||||||
m_videoSampleQueue.clear();
|
m_videoSampleQueue.clear();
|
||||||
m_initialized = false;
|
m_initialized = false;
|
||||||
m_pending = 0;
|
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
@@ -1214,7 +1200,7 @@ HRESULT EVRCustomPresenter::checkEndOfStream()
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_samplePool.areSamplesPending()) {
|
if (m_scheduler.areSamplesScheduled()) {
|
||||||
// Samples are still scheduled for rendering.
|
// Samples are still scheduled for rendering.
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,6 +131,8 @@ public:
|
|||||||
HRESULT processSample(IMFSample *sample, LONG *nextSleep);
|
HRESULT processSample(IMFSample *sample, LONG *nextSleep);
|
||||||
HRESULT flush();
|
HRESULT flush();
|
||||||
|
|
||||||
|
bool areSamplesScheduled();
|
||||||
|
|
||||||
// ThreadProc for the scheduler thread.
|
// ThreadProc for the scheduler thread.
|
||||||
static DWORD WINAPI schedulerThreadProc(LPVOID parameter);
|
static DWORD WINAPI schedulerThreadProc(LPVOID parameter);
|
||||||
|
|
||||||
@@ -167,13 +169,11 @@ public:
|
|||||||
|
|
||||||
HRESULT getSample(IMFSample **sample);
|
HRESULT getSample(IMFSample **sample);
|
||||||
HRESULT returnSample(IMFSample *sample);
|
HRESULT returnSample(IMFSample *sample);
|
||||||
BOOL areSamplesPending();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QMutex m_mutex;
|
QMutex m_mutex;
|
||||||
QList<IMFSample*> m_videoSampleQueue;
|
QList<IMFSample*> m_videoSampleQueue;
|
||||||
bool m_initialized;
|
bool m_initialized;
|
||||||
DWORD m_pending;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class EVRCustomPresenter
|
class EVRCustomPresenter
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ qnx:!blackberry {
|
|||||||
SUBDIRS += qnx-audio
|
SUBDIRS += qnx-audio
|
||||||
}
|
}
|
||||||
|
|
||||||
win32:!winrt {
|
win32:!winrt:!wince {
|
||||||
SUBDIRS += audiocapture \
|
SUBDIRS += audiocapture \
|
||||||
windowsaudio
|
windowsaudio
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user