Windows EVR: show frames when pausing from stopped state.
The QAbstractVideoSurface was started only when calling play(), causing frames received before (e.g. when pausing from stopped state) to not be rendered. The surface is now started as soon as a media type is agreed between the EVR and the upstream element. Conversely, the surface is stopped whenever the media type is cleared. Change-Id: Ia96a07dbd277adce67de5a9cfbf9acc0d33b6497 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
This commit is contained in:
@@ -842,8 +842,6 @@ HRESULT EVRCustomPresenter::OnClockStart(MFTIME, LONGLONG clockStartOffset)
|
||||
return hr;
|
||||
}
|
||||
|
||||
startSurface();
|
||||
|
||||
// Now try to get new output samples from the mixer.
|
||||
processOutputLoop();
|
||||
|
||||
@@ -891,8 +889,6 @@ HRESULT EVRCustomPresenter::OnClockStop(MFTIME)
|
||||
cancelFrameStep();
|
||||
}
|
||||
|
||||
stopSurface();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -1400,6 +1396,7 @@ HRESULT EVRCustomPresenter::setMediaType(IMFMediaType *mediaType)
|
||||
|
||||
// Clearing the media type is allowed in any state (including shutdown).
|
||||
if (!mediaType) {
|
||||
stopSurface();
|
||||
qt_evr_safe_release(&m_mediaType);
|
||||
releaseResources();
|
||||
return S_OK;
|
||||
@@ -1460,6 +1457,8 @@ HRESULT EVRCustomPresenter::setMediaType(IMFMediaType *mediaType)
|
||||
m_mediaType = mediaType;
|
||||
m_mediaType->AddRef();
|
||||
|
||||
startSurface();
|
||||
|
||||
done:
|
||||
if (FAILED(hr))
|
||||
releaseResources();
|
||||
|
||||
Reference in New Issue
Block a user