Backed out changeset 03528baabf55 (bug 1238906)

This commit is contained in:
Carsten "Tomcat" Book 2016-01-20 15:53:42 +01:00
parent ee57b9714e
commit 48c60a840a
8 changed files with 5 additions and 53 deletions

View File

@ -2113,8 +2113,7 @@ HTMLMediaElement::HTMLMediaElement(already_AddRefed<mozilla::dom::NodeInfo>& aNo
mElementInTreeState(ELEMENT_NOT_INTREE),
mHasUserInteraction(false),
mFirstFrameLoaded(false),
mDefaultPlaybackStartPosition(0.0),
mIsAudioTrackAudible(false)
mDefaultPlaybackStartPosition(0.0)
{
mAudioChannel = AudioChannelService::GetDefaultAudioChannel();
@ -5170,14 +5169,5 @@ HTMLMediaElement::IsCurrentlyPlaying() const
return false;
}
void
HTMLMediaElement::NotifyAudibleStateChanged(bool aAudible)
{
if (mIsAudioTrackAudible != aAudible) {
mIsAudioTrackAudible = aAudible;
// To do ...
}
}
} // namespace dom
} // namespace mozilla

View File

@ -397,9 +397,6 @@ public:
// when the connection between Rtsp server and client gets lost.
virtual void ResetConnectionState() final override;
// Called by media decoder when the audible state changed.
virtual void NotifyAudibleStateChanged(bool aAudible) final override;
// XPCOM GetPreload() is OK
void SetPreload(const nsAString& aValue, ErrorResult& aRv)
{
@ -1524,9 +1521,6 @@ private:
// initially be set to zero seconds. This time is used to allow the element to
// be seeked even before the media is loaded.
double mDefaultPlaybackStartPosition;
// True if the audio track is producing audible sound.
bool mIsAudioTrackAudible;
};
} // namespace dom

View File

@ -532,8 +532,6 @@ MediaDecoder::MediaDecoder(MediaDecoderOwner* aOwner)
"MediaDecoder::mStateMachineDuration (Mirror)")
, mPlaybackPosition(AbstractThread::MainThread(), 0,
"MediaDecoder::mPlaybackPosition (Mirror)")
, mIsAudioDataAudible(AbstractThread::MainThread(), false,
"MediaDecoder::mIsAudioDataAudible (Mirror)")
, mVolume(AbstractThread::MainThread(), 0.0,
"MediaDecoder::mVolume (Canonical)")
, mPlaybackRate(AbstractThread::MainThread(), 1.0,
@ -594,8 +592,6 @@ MediaDecoder::MediaDecoder(MediaDecoderOwner* aOwner)
// mIgnoreProgressData
mWatchManager.Watch(mLogicallySeeking, &MediaDecoder::SeekingChanged);
mWatchManager.Watch(mIsAudioDataAudible, &MediaDecoder::NotifyAudibleStateChanged);
MediaShutdownManager::Instance().Register(this);
}
@ -627,8 +623,6 @@ MediaDecoder::Shutdown()
mOnSeekingStart.Disconnect();
mOnMediaNotSeekable.Disconnect();
mWatchManager.Unwatch(mIsAudioDataAudible, &MediaDecoder::NotifyAudibleStateChanged);
shutdown = mDecoderStateMachine->BeginShutdown()
->Then(AbstractThread::MainThread(), __func__, this,
&MediaDecoder::FinishShutdown,
@ -1479,7 +1473,6 @@ MediaDecoder::SetStateMachine(MediaDecoderStateMachine* aStateMachine)
mNextFrameStatus.Connect(mDecoderStateMachine->CanonicalNextFrameStatus());
mCurrentPosition.Connect(mDecoderStateMachine->CanonicalCurrentPosition());
mPlaybackPosition.Connect(mDecoderStateMachine->CanonicalPlaybackOffset());
mIsAudioDataAudible.Connect(mDecoderStateMachine->CanonicalIsAudioDataAudible());
} else {
mStateMachineDuration.DisconnectIfConnected();
mBuffered.DisconnectIfConnected();
@ -1487,7 +1480,6 @@ MediaDecoder::SetStateMachine(MediaDecoderStateMachine* aStateMachine)
mNextFrameStatus.DisconnectIfConnected();
mCurrentPosition.DisconnectIfConnected();
mPlaybackPosition.DisconnectIfConnected();
mIsAudioDataAudible.DisconnectIfConnected();
}
}
@ -1839,13 +1831,6 @@ MediaDecoder::NextFrameBufferedStatus()
: MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE;
}
void
MediaDecoder::NotifyAudibleStateChanged()
{
MOZ_ASSERT(!mShuttingDown);
mOwner->NotifyAudibleStateChanged(mIsAudioDataAudible);
}
MediaMemoryTracker::MediaMemoryTracker()
{
}

View File

@ -773,9 +773,6 @@ protected:
// start playing back again.
Mirror<int64_t> mPlaybackPosition;
// Used to distiguish whether the audio is producing sound.
Mirror<bool> mIsAudioDataAudible;
// Volume of playback. 0.0 = muted. 1.0 = full volume.
Canonical<double> mVolume;
@ -871,9 +868,6 @@ public:
}
private:
// Notify owner when the audible state changed
void NotifyAudibleStateChanged();
/* Functions called by ResourceCallback */
// A media stream is assumed to be infinite if the metadata doesn't

View File

@ -130,9 +130,6 @@ public:
// when the connection between Rtsp server and client gets lost.
virtual void ResetConnectionState() = 0;
// Called by media decoder when the audible state changed
virtual void NotifyAudibleStateChanged(bool aAudible) = 0;
#ifdef MOZ_EME
// Dispatches a "encrypted" event to the HTMLMediaElement, with the
// provided init data. Actual dispatch may be delayed until HAVE_METADATA.

View File

@ -241,6 +241,7 @@ MediaDecoderStateMachine::MediaDecoderStateMachine(MediaDecoder* aDecoder,
mOutputStreamManager(new OutputStreamManager()),
mResource(aDecoder->GetResource()),
mAudioOffloading(false),
mIsAudioDataAudible(false),
mSilentDataDuration(0),
mBuffered(mTaskQueue, TimeIntervals(),
"MediaDecoderStateMachine::mBuffered (Mirror)"),
@ -278,9 +279,7 @@ MediaDecoderStateMachine::MediaDecoderStateMachine(MediaDecoder* aDecoder,
mCurrentPosition(mTaskQueue, 0,
"MediaDecoderStateMachine::mCurrentPosition (Canonical)"),
mPlaybackOffset(mTaskQueue, 0,
"MediaDecoderStateMachine::mPlaybackOffset (Canonical)"),
mIsAudioDataAudible(mTaskQueue, false,
"MediaDecoderStateMachine::mIsAudioDataAudible (Canonical)")
"MediaDecoderStateMachine::mPlaybackOffset (Canonical)")
{
MOZ_COUNT_CTOR(MediaDecoderStateMachine);
NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
@ -2198,7 +2197,6 @@ MediaDecoderStateMachine::FinishShutdown()
mNextFrameStatus.DisconnectAll();
mCurrentPosition.DisconnectAll();
mPlaybackOffset.DisconnectAll();
mIsAudioDataAudible.DisconnectAll();
// Shut down the watch manager before shutting down our task queue.
mWatchManager.Shutdown();

View File

@ -1196,7 +1196,8 @@ private:
// Playback will not start when audio is offloading.
bool mAudioOffloading;
// Duration of the continuous silent data.
// Used to distiguish continuous silent audio data.
bool mIsAudioDataAudible;
uint32_t mSilentDataDuration;
#ifdef MOZ_EME
@ -1267,9 +1268,6 @@ private:
// Current playback position in the stream in bytes.
Canonical<int64_t> mPlaybackOffset;
// Used to distiguish whether the audio is producing sound.
Canonical<bool> mIsAudioDataAudible;
public:
AbstractCanonical<media::TimeIntervals>* CanonicalBuffered() {
return mReader->CanonicalBuffered();
@ -1289,9 +1287,6 @@ public:
AbstractCanonical<int64_t>* CanonicalPlaybackOffset() {
return &mPlaybackOffset;
}
AbstractCanonical<bool>* CanonicalIsAudioDataAudible() {
return &mIsAudioDataAudible;
}
};
} // namespace mozilla

View File

@ -47,7 +47,6 @@ public:
return nullptr;
}
virtual void ResetConnectionState() override {}
virtual void NotifyAudibleStateChanged(bool aAudible) override {};
};
}