Backed out 9 changesets (bug 1580659) for causing linting failure in /builds/worker/checkouts/gecko/dom/plugins/base/nsNPAPIPluginInstance.cpp CLOSED TREE

Backed out changeset b8c46aaec410 (bug 1580659)
Backed out changeset fd31977767d5 (bug 1580659)
Backed out changeset 8b9f61694270 (bug 1580659)
Backed out changeset 276827f54c71 (bug 1580659)
Backed out changeset ecb2bf9fb452 (bug 1580659)
Backed out changeset b712f15af619 (bug 1580659)
Backed out changeset c25bfc8b31b1 (bug 1580659)
Backed out changeset 20cfcd96a40e (bug 1580659)
Backed out changeset e92ff4ac7f43 (bug 1580659)
This commit is contained in:
shindli
2019-09-24 09:50:42 +03:00
parent 504e527577
commit e097175b42
13 changed files with 157 additions and 167 deletions

View File

@@ -984,6 +984,7 @@ class HTMLMediaElement::AudioChannelAgentCallback final
: mOwner(aOwner),
mAudioChannelVolume(1.0),
mPlayingThroughTheAudioChannel(false),
mAudioCapturedByWindow(false),
mSuspended(nsISuspendedTypes::NONE_SUSPENDED),
mIsOwnerAudible(IsOwnerAudible()),
mIsShutDown(false) {
@@ -1093,7 +1094,11 @@ class HTMLMediaElement::AudioChannelAgentCallback final
NS_IMETHODIMP WindowAudioCaptureChanged(bool aCapture) override {
MOZ_ASSERT(mAudioChannelAgent);
AudioCaptureStreamChangeIfNeeded();
if (mAudioCapturedByWindow != aCapture) {
mAudioCapturedByWindow = aCapture;
AudioCaptureStreamChangeIfNeeded();
}
return NS_OK;
}
@@ -1103,9 +1108,11 @@ class HTMLMediaElement::AudioChannelAgentCallback final
return;
}
MOZ_ASSERT(mAudioChannelAgent);
bool isCapturing = mAudioChannelAgent->IsWindowAudioCapturingEnabled();
mOwner->AudioCaptureStreamChange(isCapturing);
if (!mOwner->HasAudio()) {
return;
}
mOwner->AudioCaptureStreamChange(mAudioCapturedByWindow);
}
void NotifyAudioPlaybackChanged(AudibleChangedReasons aReason) {
@@ -1187,13 +1194,15 @@ class HTMLMediaElement::AudioChannelAgentCallback final
void StartAudioChannelAgent() {
MOZ_ASSERT(mAudioChannelAgent);
MOZ_ASSERT(!mAudioChannelAgent->IsPlayingStarted());
if (NS_WARN_IF(NS_FAILED(
mAudioChannelAgent->NotifyStartedPlaying(IsOwnerAudible())))) {
AudioPlaybackConfig config;
if (NS_WARN_IF(NS_FAILED(mAudioChannelAgent->NotifyStartedPlaying(
&config, IsOwnerAudible())))) {
return;
}
NotifyMediaStarted(mAudioChannelAgent->WindowID());
mAudioChannelAgent->PullInitialUpdate();
WindowVolumeChanged(config.mVolume, config.mMuted);
WindowSuspendChanged(config.mSuspend);
}
void StopAudioChanelAgent() {
@@ -1201,9 +1210,6 @@ class HTMLMediaElement::AudioChannelAgentCallback final
MOZ_ASSERT(mAudioChannelAgent->IsPlayingStarted());
mAudioChannelAgent->NotifyStoppedPlaying();
NotifyMediaStopped(mAudioChannelAgent->WindowID());
// If we have started audio capturing before, we have to tell media element
// to clear the output capturing stream.
mOwner->AudioCaptureStreamChange(false);
}
void SetSuspended(SuspendTypes aSuspend) {
@@ -1399,6 +1405,8 @@ class HTMLMediaElement::AudioChannelAgentCallback final
float mAudioChannelVolume;
// Is this media element playing?
bool mPlayingThroughTheAudioChannel;
// True if the sound is being captured by the window.
bool mAudioCapturedByWindow;
// We have different kinds of suspended cases,
// - SUSPENDED_PAUSE
// It's used when we temporary lost platform audio focus. MediaElement can