Bug 1605134 - Rename StateComputedEnd to StateComputedTime. r=padenot

StateComputedEnd was likely a typo back in the day. The member in the graph is
mStateComputedTime, so let's center around that.

Differential Revision: https://phabricator.services.mozilla.com/D97404
This commit is contained in:
Andreas Pehrson 2020-11-30 14:16:31 +00:00
Родитель ab951b1607
Коммит 74a8690e5f
4 изменённых файлов: 23 добавлений и 21 удалений

Просмотреть файл

@ -56,13 +56,13 @@ void GraphRunner::Shutdown() {
mThread->Shutdown();
}
auto GraphRunner::OneIteration(GraphTime aStateEnd, GraphTime aIterationEnd,
auto GraphRunner::OneIteration(GraphTime aStateTime, GraphTime aIterationEnd,
AudioMixer* aMixer) -> IterationResult {
TRACE();
MonitorAutoLock lock(mMonitor);
MOZ_ASSERT(mThreadState == ThreadState::Wait);
mIterationState = Some(IterationState(aStateEnd, aIterationEnd, aMixer));
mIterationState = Some(IterationState(aStateTime, aIterationEnd, aMixer));
#ifdef DEBUG
if (auto audioDriver = mGraph->CurrentDriver()->AsAudioCallbackDriver()) {
@ -113,7 +113,7 @@ NS_IMETHODIMP GraphRunner::Run() {
}
MOZ_DIAGNOSTIC_ASSERT(mIterationState.isSome());
TRACE();
mIterationResult = mGraph->OneIterationImpl(mIterationState->StateEnd(),
mIterationResult = mGraph->OneIterationImpl(mIterationState->StateTime(),
mIterationState->IterationEnd(),
mIterationState->Mixer());
// Signal that mIterationResult was updated

Просмотреть файл

@ -35,7 +35,7 @@ class GraphRunner final : public Runnable {
* Signals one iteration of mGraph. Hands state over to mThread and runs
* the iteration there.
*/
IterationResult OneIteration(GraphTime aStateEnd, GraphTime aIterationEnd,
IterationResult OneIteration(GraphTime aStateTime, GraphTime aIterationEnd,
AudioMixer* aMixer);
/**
@ -62,16 +62,18 @@ class GraphRunner final : public Runnable {
~GraphRunner();
class IterationState {
GraphTime mStateEnd;
GraphTime mStateTime;
GraphTime mIterationEnd;
AudioMixer* MOZ_NON_OWNING_REF mMixer;
public:
IterationState(GraphTime aStateEnd, GraphTime aIterationEnd,
IterationState(GraphTime aStateTime, GraphTime aIterationEnd,
AudioMixer* aMixer)
: mStateEnd(aStateEnd), mIterationEnd(aIterationEnd), mMixer(aMixer) {}
: mStateTime(aStateTime),
mIterationEnd(aIterationEnd),
mMixer(aMixer) {}
IterationState& operator=(const IterationState& aOther) = default;
GraphTime StateEnd() const { return mStateEnd; }
GraphTime StateTime() const { return mStateTime; }
GraphTime IterationEnd() const { return mIterationEnd; }
AudioMixer* Mixer() const { return mMixer; }
};
@ -90,8 +92,8 @@ class GraphRunner final : public Runnable {
enum class ThreadState {
Wait, // Waiting for a message. This is the initial state.
// A transition from Run back to Wait occurs on the runner
// thread after it processes as far as mIterationState->mStateEnd
// A transition from Run back to Wait occurs on the runner thread
// after it processes as far as mIterationState->mStateTime
// and sets mIterationResult.
Run, // Set on driver thread after each mIterationState update.
Shutdown, // Set when Shutdown() is called on main thread.

Просмотреть файл

@ -1365,17 +1365,17 @@ bool MediaTrackGraphImpl::UpdateMainThreadState() {
return false;
}
auto MediaTrackGraphImpl::OneIteration(GraphTime aStateEnd,
auto MediaTrackGraphImpl::OneIteration(GraphTime aStateTime,
GraphTime aIterationEnd,
AudioMixer* aMixer) -> IterationResult {
if (mGraphRunner) {
return mGraphRunner->OneIteration(aStateEnd, aIterationEnd, aMixer);
return mGraphRunner->OneIteration(aStateTime, aIterationEnd, aMixer);
}
return OneIterationImpl(aStateEnd, aIterationEnd, aMixer);
return OneIterationImpl(aStateTime, aIterationEnd, aMixer);
}
auto MediaTrackGraphImpl::OneIterationImpl(GraphTime aStateEnd,
auto MediaTrackGraphImpl::OneIterationImpl(GraphTime aStateTime,
GraphTime aIterationEnd,
AudioMixer* aMixer)
-> IterationResult {
@ -1406,14 +1406,14 @@ auto MediaTrackGraphImpl::OneIterationImpl(GraphTime aStateEnd,
NS_ProcessPendingEvents(nullptr);
}
GraphTime stateEnd = std::min(aStateEnd, GraphTime(mEndTime));
UpdateGraph(stateEnd);
GraphTime stateTime = std::min(aStateTime, GraphTime(mEndTime));
UpdateGraph(stateTime);
mStateComputedTime = stateEnd;
mStateComputedTime = stateTime;
GraphTime oldProcessedTime = mProcessedTime;
Process(aMixer);
MOZ_ASSERT(mProcessedTime == stateEnd);
MOZ_ASSERT(mProcessedTime == stateTime);
UpdateCurrentTimeForTracks(oldProcessedTime);

Просмотреть файл

@ -222,14 +222,14 @@ class MediaTrackGraphImpl : public MediaTrackGraph,
* OneIterationImpl is called directly. Output from the graph gets mixed into
* aMixer, if it is non-null.
*/
IterationResult OneIteration(GraphTime aStateEnd, GraphTime aIterationEnd,
IterationResult OneIteration(GraphTime aStateTime, GraphTime aIterationEnd,
AudioMixer* aMixer) override;
/**
* Returns true if this MediaTrackGraph should keep running
*/
IterationResult OneIterationImpl(GraphTime aStateEnd, GraphTime aIterationEnd,
AudioMixer* aMixer);
IterationResult OneIterationImpl(GraphTime aStateTime,
GraphTime aIterationEnd, AudioMixer* aMixer);
/**
* Called from the driver, when the graph thread is about to stop, to tell