Bug 1652884 - Rename MediaTrack::SetEnabled to SetDisabledTrackMode. r=pehrsons

Differential Revision: https://phabricator.services.mozilla.com/D86070
This commit is contained in:
Jan-Ivar Bruaroey 2020-08-19 22:18:04 +00:00
Родитель 50f3635eb9
Коммит c27b3d3a89
7 изменённых файлов: 18 добавлений и 17 удалений

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

@ -1130,8 +1130,8 @@ class HTMLMediaElement::MediaElementTrackSource
if (!mTrack) {
return;
}
mTrack->SetEnabled(aEnabled ? DisabledTrackMode::ENABLED
: DisabledTrackMode::SILENCE_FREEZE);
mTrack->SetDisabledTrackMode(aEnabled ? DisabledTrackMode::ENABLED
: DisabledTrackMode::SILENCE_FREEZE);
}
void SetPrincipal(RefPtr<nsIPrincipal> aPrincipal) {

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

@ -170,7 +170,7 @@ void ForwardedInputTrack::ProcessInput(GraphTime aFrom, GraphTime aTo,
}
}
void ForwardedInputTrack::SetEnabledImpl(DisabledTrackMode aMode) {
void ForwardedInputTrack::SetDisabledTrackModeImpl(DisabledTrackMode aMode) {
bool enabled = aMode == DisabledTrackMode::ENABLED;
TRACK_LOG(LogLevel::Info, ("ForwardedInputTrack %p was explicitly %s", this,
enabled ? "enabled" : "disabled"));
@ -189,7 +189,7 @@ void ForwardedInputTrack::SetEnabledImpl(DisabledTrackMode aMode) {
listener->IncreaseDisabled(aMode);
}
}
MediaTrack::SetEnabledImpl(aMode);
MediaTrack::SetDisabledTrackModeImpl(aMode);
}
void ForwardedInputTrack::AddDirectListenerImpl(

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

@ -26,7 +26,7 @@ class ForwardedInputTrack : public ProcessedMediaTrack {
void RemoveInput(MediaInputPort* aPort) override;
void ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags) override;
void SetEnabledImpl(DisabledTrackMode aMode) override;
void SetDisabledTrackModeImpl(DisabledTrackMode aMode) override;
friend class MediaTrackGraphImpl;

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

@ -295,8 +295,8 @@ void MediaStreamTrack::SetEnabled(bool aEnabled) {
return;
}
mTrack->SetEnabled(mEnabled ? DisabledTrackMode::ENABLED
: DisabledTrackMode::SILENCE_BLACK);
mTrack->SetDisabledTrackMode(mEnabled ? DisabledTrackMode::ENABLED
: DisabledTrackMode::SILENCE_BLACK);
NotifyEnabledChanged();
}

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

@ -864,7 +864,8 @@ void MediaTrackGraphImpl::ProcessInputData() {
mInputDeviceUsers.GetValue(mInputDeviceID);
MOZ_ASSERT(listeners);
for (auto& listener : *listeners) {
listener->NotifyInputData(this, mInputData, mInputFrames, GraphRate(), mInputChannelCount);
listener->NotifyInputData(this, mInputData, mInputFrames, GraphRate(),
mInputChannelCount);
}
mInputData = nullptr;
@ -2315,7 +2316,7 @@ void MediaTrack::RunAfterPendingUpdates(
graph->AppendMessage(MakeUnique<Message>(this, runnable.forget()));
}
void MediaTrack::SetEnabledImpl(DisabledTrackMode aMode) {
void MediaTrack::SetDisabledTrackModeImpl(DisabledTrackMode aMode) {
if (aMode == DisabledTrackMode::ENABLED) {
mDisabledMode = DisabledTrackMode::ENABLED;
for (const auto& l : mTrackListeners) {
@ -2334,12 +2335,12 @@ void MediaTrack::SetEnabledImpl(DisabledTrackMode aMode) {
}
}
void MediaTrack::SetEnabled(DisabledTrackMode aMode) {
void MediaTrack::SetDisabledTrackMode(DisabledTrackMode aMode) {
class Message : public ControlMessage {
public:
Message(MediaTrack* aTrack, DisabledTrackMode aMode)
: ControlMessage(aTrack), mMode(aMode) {}
void Run() override { mTrack->SetEnabledImpl(mMode); }
void Run() override { mTrack->SetDisabledTrackModeImpl(mMode); }
DisabledTrackMode mMode;
};
if (mMainThreadDestroyed) {
@ -2823,7 +2824,7 @@ void SourceMediaTrack::End() {
}
}
void SourceMediaTrack::SetEnabledImpl(DisabledTrackMode aMode) {
void SourceMediaTrack::SetDisabledTrackModeImpl(DisabledTrackMode aMode) {
{
MutexAutoLock lock(mMutex);
for (const auto& l : mDirectTrackListeners) {
@ -2842,7 +2843,7 @@ void SourceMediaTrack::SetEnabledImpl(DisabledTrackMode aMode) {
}
}
}
MediaTrack::SetEnabledImpl(aMode);
MediaTrack::SetDisabledTrackModeImpl(aMode);
}
void SourceMediaTrack::RemoveAllDirectListenersImpl() {

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

@ -329,7 +329,7 @@ class MediaTrack : public mozilla::LinkedListElement<MediaTrack> {
// A disabled track has video replaced by black, and audio replaced by
// silence.
void SetEnabled(DisabledTrackMode aMode);
void SetDisabledTrackMode(DisabledTrackMode aMode);
// End event will be notified by calling methods of aListener. It is the
// responsibility of the caller to remove aListener before it is destroyed.
@ -411,7 +411,7 @@ class MediaTrack : public mozilla::LinkedListElement<MediaTrack> {
virtual void AddDirectListenerImpl(
already_AddRefed<DirectMediaTrackListener> aListener);
virtual void RemoveDirectListenerImpl(DirectMediaTrackListener* aListener);
virtual void SetEnabledImpl(DisabledTrackMode aMode);
virtual void SetDisabledTrackModeImpl(DisabledTrackMode aMode);
void AddConsumer(MediaInputPort* aPort) { mConsumers.AppendElement(aPort); }
void RemoveConsumer(MediaInputPort* aPort) {
@ -671,7 +671,7 @@ class SourceMediaTrack : public MediaTrack {
// Overriding allows us to hold the mMutex lock while changing the track
// enable status
void SetEnabledImpl(DisabledTrackMode aMode) override;
void SetDisabledTrackModeImpl(DisabledTrackMode aMode) override;
// Overriding allows us to ensure mMutex is locked while changing the track
// enable status

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

@ -547,7 +547,7 @@ AudioDestinationNode::WindowSuspendChanged(nsSuspendedTypes aSuspend) {
DisabledTrackMode disabledMode =
suspended ? DisabledTrackMode::SILENCE_BLACK : DisabledTrackMode::ENABLED;
mTrack->SetEnabled(disabledMode);
mTrack->SetDisabledTrackMode(disabledMode);
AudioChannelService::AudibleState audible =
aSuspend == nsISuspendedTypes::NONE_SUSPENDED