Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4
This commit is contained in:
@@ -760,7 +760,7 @@ qint64 QAlsaAudioInput::elapsedUSecs() const
|
||||
if (deviceState == QAudio::StoppedState)
|
||||
return 0;
|
||||
|
||||
return clockStamp.elapsed()*1000;
|
||||
return clockStamp.elapsed() * qint64(1000);
|
||||
}
|
||||
|
||||
void QAlsaAudioInput::reset()
|
||||
|
||||
@@ -774,7 +774,7 @@ qint64 QAlsaAudioOutput::elapsedUSecs() const
|
||||
if (deviceState == QAudio::StoppedState)
|
||||
return 0;
|
||||
|
||||
return clockStamp.elapsed()*1000;
|
||||
return clockStamp.elapsed() * qint64(1000);
|
||||
}
|
||||
|
||||
void QAlsaAudioOutput::reset()
|
||||
|
||||
@@ -474,7 +474,7 @@ qint64 QOpenSLESAudioInput::elapsedUSecs() const
|
||||
if (m_deviceState == QAudio::StoppedState)
|
||||
return 0;
|
||||
|
||||
return m_clockStamp.elapsed() * 1000;
|
||||
return m_clockStamp.elapsed() * qint64(1000);
|
||||
}
|
||||
|
||||
void QOpenSLESAudioInput::setVolume(qreal vol)
|
||||
|
||||
@@ -273,7 +273,7 @@ qint64 QOpenSLESAudioOutput::elapsedUSecs() const
|
||||
if (m_state == QAudio::StoppedState)
|
||||
return 0;
|
||||
|
||||
return m_clockStamp.elapsed() * 1000;
|
||||
return m_clockStamp.elapsed() * qint64(1000);
|
||||
}
|
||||
|
||||
void QOpenSLESAudioOutput::reset()
|
||||
|
||||
@@ -684,7 +684,7 @@ qint64 QPulseAudioInput::elapsedUSecs() const
|
||||
if (m_deviceState == QAudio::StoppedState)
|
||||
return 0;
|
||||
|
||||
return m_clockStamp.elapsed() * 1000;
|
||||
return m_clockStamp.elapsed() * qint64(1000);
|
||||
}
|
||||
|
||||
void QPulseAudioInput::reset()
|
||||
|
||||
@@ -596,7 +596,7 @@ qint64 QPulseAudioOutput::elapsedUSecs() const
|
||||
if (m_deviceState == QAudio::StoppedState)
|
||||
return 0;
|
||||
|
||||
return m_clockStamp.elapsed() * 1000;
|
||||
return m_clockStamp.elapsed() * qint64(1000);
|
||||
}
|
||||
|
||||
void QPulseAudioOutput::reset()
|
||||
|
||||
@@ -186,7 +186,7 @@ qint64 QnxAudioInput::elapsedUSecs() const
|
||||
if (m_state == QAudio::StoppedState)
|
||||
return 0;
|
||||
|
||||
return m_clockStamp.elapsed() * 1000;
|
||||
return m_clockStamp.elapsed() * qint64(1000);
|
||||
}
|
||||
|
||||
QAudio::Error QnxAudioInput::error() const
|
||||
|
||||
@@ -172,7 +172,7 @@ qint64 QnxAudioOutput::elapsedUSecs() const
|
||||
if (m_state == QAudio::StoppedState)
|
||||
return 0;
|
||||
else
|
||||
return m_startTimeStamp.elapsed() * 1000;
|
||||
return m_startTimeStamp.elapsed() * qint64(1000);
|
||||
}
|
||||
|
||||
QAudio::Error QnxAudioOutput::error() const
|
||||
|
||||
@@ -538,6 +538,7 @@ void MmRendererMediaPlayerControl::play()
|
||||
return;
|
||||
}
|
||||
|
||||
m_stopEventsToIgnore = 0; // once playing, stop events must be proccessed
|
||||
setState( QMediaPlayer::PlayingState);
|
||||
}
|
||||
|
||||
|
||||
@@ -698,7 +698,7 @@ qint64 QWindowsAudioInput::elapsedUSecs() const
|
||||
if (deviceState == QAudio::StoppedState)
|
||||
return 0;
|
||||
|
||||
return timeStampOpened.elapsed()*1000;
|
||||
return timeStampOpened.elapsed() * qint64(1000);
|
||||
}
|
||||
|
||||
void QWindowsAudioInput::reset()
|
||||
|
||||
@@ -674,7 +674,7 @@ qint64 QWindowsAudioOutput::elapsedUSecs() const
|
||||
if (deviceState == QAudio::StoppedState)
|
||||
return 0;
|
||||
|
||||
return timeStampOpened.elapsed()*1000;
|
||||
return timeStampOpened.elapsed() * qint64(1000);
|
||||
}
|
||||
|
||||
QAudio::Error QWindowsAudioOutput::error() const
|
||||
|
||||
@@ -236,7 +236,6 @@ void MFAudioDecoderControl::handleMediaSourceReady()
|
||||
}
|
||||
|
||||
if (m_sourceResolver->mediaSource()) {
|
||||
IMFPresentationDescriptor *pd = 0;
|
||||
if (mediaType && m_resampler) {
|
||||
HRESULT hr = S_OK;
|
||||
hr = m_resampler->SetInputType(m_mfInputStreamID, mediaType, 0);
|
||||
@@ -246,9 +245,11 @@ void MFAudioDecoderControl::handleMediaSourceReady()
|
||||
qWarning() << "MFAudioDecoderControl: failed to SetInputType of resampler" << hr;
|
||||
}
|
||||
}
|
||||
IMFPresentationDescriptor *pd;
|
||||
if (SUCCEEDED(m_sourceResolver->mediaSource()->CreatePresentationDescriptor(&pd))) {
|
||||
UINT64 duration = 0;
|
||||
pd->GetUINT64(MF_PD_DURATION, &duration);
|
||||
pd->Release();
|
||||
duration /= 10000;
|
||||
if (m_duration != qint64(duration)) {
|
||||
m_duration = qint64(duration);
|
||||
|
||||
@@ -258,6 +258,7 @@ void MFPlayerSession::handleMediaSourceReady()
|
||||
//convert from 100 nanosecond to milisecond
|
||||
emit durationUpdate(qint64(m_duration / 10000));
|
||||
setupPlaybackTopology(mediaSource, sourcePD);
|
||||
sourcePD->Release();
|
||||
} else {
|
||||
changeStatus(QMediaPlayer::InvalidMedia);
|
||||
emit error(QMediaPlayer::ResourceError, tr("Cannot create presentation descriptor."), true);
|
||||
@@ -415,12 +416,15 @@ IMFTopologyNode* MFPlayerSession::addOutputNode(IMFStreamDescriptor *streamDesc,
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = node->SetUINT32(MF_TOPONODE_STREAMID, sinkID);
|
||||
if (SUCCEEDED(hr)) {
|
||||
if (SUCCEEDED(topology->AddNode(node)))
|
||||
if (SUCCEEDED(topology->AddNode(node))) {
|
||||
handler->Release();
|
||||
return node;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
handler->Release();
|
||||
}
|
||||
node->Release();
|
||||
return NULL;
|
||||
@@ -609,42 +613,39 @@ HRESULT BindOutputNode(IMFTopologyNode *pNode)
|
||||
// Sets the IMFStreamSink pointers on all of the output nodes in a topology.
|
||||
HRESULT BindOutputNodes(IMFTopology *pTopology)
|
||||
{
|
||||
DWORD cNodes = 0;
|
||||
|
||||
IMFCollection *collection = NULL;
|
||||
IUnknown *element = NULL;
|
||||
IMFTopologyNode *node = NULL;
|
||||
IMFCollection *collection;
|
||||
|
||||
// Get the collection of output nodes.
|
||||
HRESULT hr = pTopology->GetOutputNodeCollection(&collection);
|
||||
|
||||
// Enumerate all of the nodes in the collection.
|
||||
if (SUCCEEDED(hr))
|
||||
if (SUCCEEDED(hr)) {
|
||||
DWORD cNodes;
|
||||
hr = collection->GetElementCount(&cNodes);
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
for (DWORD i = 0; i < cNodes; i++) {
|
||||
hr = collection->GetElement(i, &element);
|
||||
if (FAILED(hr))
|
||||
break;
|
||||
if (SUCCEEDED(hr)) {
|
||||
for (DWORD i = 0; i < cNodes; i++) {
|
||||
IUnknown *element;
|
||||
hr = collection->GetElement(i, &element);
|
||||
if (FAILED(hr))
|
||||
break;
|
||||
|
||||
hr = element->QueryInterface(IID_IMFTopologyNode, (void**)&node);
|
||||
if (FAILED(hr))
|
||||
break;
|
||||
IMFTopologyNode *node;
|
||||
hr = element->QueryInterface(IID_IMFTopologyNode, (void**)&node);
|
||||
element->Release();
|
||||
if (FAILED(hr))
|
||||
break;
|
||||
|
||||
// Bind this node.
|
||||
hr = BindOutputNode(node);
|
||||
if (FAILED(hr))
|
||||
break;
|
||||
// Bind this node.
|
||||
hr = BindOutputNode(node);
|
||||
node->Release();
|
||||
if (FAILED(hr))
|
||||
break;
|
||||
}
|
||||
}
|
||||
collection->Release();
|
||||
}
|
||||
|
||||
if (collection)
|
||||
collection->Release();
|
||||
if (element)
|
||||
element->Release();
|
||||
if (node)
|
||||
node->Release();
|
||||
return hr;
|
||||
}
|
||||
|
||||
@@ -1502,8 +1503,11 @@ HRESULT MFPlayerSession::Invoke(IMFAsyncResult *pResult)
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_closing)
|
||||
if (!m_closing) {
|
||||
emit sessionEvent(pEvent);
|
||||
} else {
|
||||
pEvent->Release();
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -1626,9 +1630,6 @@ void MFPlayerSession::handleSessionEvent(IMFMediaEvent *sessionEvent)
|
||||
}
|
||||
}
|
||||
|
||||
if (SUCCEEDED(MFGetService(m_session, MR_STREAM_VOLUME_SERVICE, IID_PPV_ARGS(&m_volumeControl))))
|
||||
setVolumeInternal(m_muted ? 0 : m_volume);
|
||||
|
||||
DWORD dwCharacteristics = 0;
|
||||
m_sourceResolver->mediaSource()->GetCharacteristics(&dwCharacteristics);
|
||||
emit seekableUpdate(MFMEDIASOURCE_CAN_SEEK & dwCharacteristics);
|
||||
@@ -1699,6 +1700,9 @@ void MFPlayerSession::handleSessionEvent(IMFMediaEvent *sessionEvent)
|
||||
}
|
||||
}
|
||||
MFGetService(m_session, MFNETSOURCE_STATISTICS_SERVICE, IID_PPV_ARGS(&m_netsourceStatistics));
|
||||
|
||||
if (SUCCEEDED(MFGetService(m_session, MR_STREAM_VOLUME_SERVICE, IID_PPV_ARGS(&m_volumeControl))))
|
||||
setVolumeInternal(m_muted ? 0 : m_volume);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,6 +155,9 @@ STDMETHODIMP AudioSampleGrabberCallback::OnProcessSample(REFGUID guidMajorMediaT
|
||||
if (llSampleTime == _I64_MAX) {
|
||||
// Set default QAudioBuffer start time
|
||||
llSampleTime = -1;
|
||||
} else {
|
||||
// WMF uses 100-nanosecond units, Qt uses microseconds
|
||||
llSampleTime /= 10;
|
||||
}
|
||||
|
||||
foreach (MFAudioProbeControl* probe, m_audioProbes)
|
||||
|
||||
Reference in New Issue
Block a user