Bug 1301341. Part 2 - Remove unused members. r=kaku

MozReview-Commit-ID: 3S9hw6w0k1T

--HG--
extra : rebase_source : b14d23f5845caaa00333aca99fbdf49a4f1dc2aa
This commit is contained in:
JW Wang 2016-09-06 14:48:29 +08:00
parent 643e461557
commit 3586f51124
2 changed files with 0 additions and 108 deletions

View File

@ -1840,23 +1840,6 @@ void MediaDecoderStateMachine::ReaderSuspendedChanged()
SetDormant(mIsReaderSuspended);
}
void
MediaDecoderStateMachine::ReadMetadata()
{
MOZ_ASSERT(OnTaskQueue());
MOZ_ASSERT(!IsShutdown());
MOZ_ASSERT(mState == DECODER_STATE_DECODING_METADATA);
MOZ_ASSERT(!mMetadataRequest.Exists());
DECODER_LOG("Dispatching AsyncReadMetadata");
// Set mode to METADATA since we are about to read metadata.
mResource->SetReadMode(MediaCacheStream::MODE_METADATA);
mMetadataRequest.Begin(mReader->ReadMetadata()
->Then(OwnerThread(), __func__, this,
&MediaDecoderStateMachine::OnMetadataRead,
&MediaDecoderStateMachine::OnMetadataNotRead));
}
RefPtr<MediaDecoder::SeekPromise>
MediaDecoderStateMachine::Seek(SeekTarget aTarget)
{
@ -2311,83 +2294,6 @@ MediaDecoderStateMachine::DecodeError()
mOnPlaybackEvent.Notify(MediaEventType::DecodeError);
}
void
MediaDecoderStateMachine::OnMetadataRead(MetadataHolder* aMetadata)
{
MOZ_ASSERT(OnTaskQueue());
MOZ_ASSERT(mState == DECODER_STATE_DECODING_METADATA);
mMetadataRequest.Complete();
if (mPendingDormant) {
mPendingDormant = false;
SetDormant(true);
return;
}
// Set mode to PLAYBACK after reading metadata.
mResource->SetReadMode(MediaCacheStream::MODE_PLAYBACK);
mInfo = aMetadata->mInfo;
mMetadataTags = aMetadata->mTags.forget();
RefPtr<MediaDecoderStateMachine> self = this;
if (mInfo.mMetadataDuration.isSome()) {
RecomputeDuration();
} else if (mInfo.mUnadjustedMetadataEndTime.isSome()) {
mReader->AwaitStartTime()->Then(OwnerThread(), __func__,
[self] () -> void {
NS_ENSURE_TRUE_VOID(!self->IsShutdown());
TimeUnit unadjusted = self->mInfo.mUnadjustedMetadataEndTime.ref();
TimeUnit adjustment = self->mReader->StartTime();
self->mInfo.mMetadataDuration.emplace(unadjusted - adjustment);
self->RecomputeDuration();
}, [] () -> void { NS_WARNING("Adjusting metadata end time failed"); }
);
}
if (HasVideo()) {
DECODER_LOG("Video decode isAsync=%d HWAccel=%d videoQueueSize=%d",
mReader->IsAsync(),
mReader->VideoIsHardwareAccelerated(),
GetAmpleVideoFrames());
}
// In general, we wait until we know the duration before notifying the decoder.
// However, we notify unconditionally in this case without waiting for the start
// time, since the caller might be waiting on metadataloaded to be fired before
// feeding in the CDM, which we need to decode the first frame (and
// thus get the metadata). We could fix this if we could compute the start
// time by demuxing without necessaring decoding.
bool waitingForCDM =
#ifdef MOZ_EME
mInfo.IsEncrypted() && !mCDMProxy;
#else
false;
#endif
mNotifyMetadataBeforeFirstFrame = mDuration.Ref().isSome() || waitingForCDM;
if (mNotifyMetadataBeforeFirstFrame) {
EnqueueLoadedMetadataEvent();
}
if (waitingForCDM) {
// Metadata parsing was successful but we're still waiting for CDM caps
// to become available so that we can build the correct decryptor/decoder.
SetState(DECODER_STATE_WAIT_FOR_CDM);
return;
}
SetState(DECODER_STATE_DECODING_FIRSTFRAME);
}
void
MediaDecoderStateMachine::OnMetadataNotRead(ReadMetadataFailureReason aReason)
{
MOZ_ASSERT(OnTaskQueue());
MOZ_ASSERT(mState == DECODER_STATE_DECODING_METADATA);
mMetadataRequest.Complete();
DECODER_WARN("Decode metadata failed, shutting down decoder");
DecodeError();
}
void
MediaDecoderStateMachine::EnqueueLoadedMetadataEvent()
{

View File

@ -278,8 +278,6 @@ private:
void SetAudioCaptured(bool aCaptured);
void ReadMetadata();
RefPtr<MediaDecoder::SeekPromise> Seek(SeekTarget aTarget);
RefPtr<ShutdownPromise> Shutdown();
@ -537,10 +535,6 @@ protected:
// must be held when calling this. Called on the decode thread.
int64_t GetDecodedAudioDuration();
// Promise callbacks for metadata reading.
void OnMetadataRead(MetadataHolder* aMetadata);
void OnMetadataNotRead(ReadMetadataFailureReason aReason);
// Notify FirstFrameLoaded if having decoded first frames and
// transition to SEEKING if there is any pending seek, or DECODING otherwise.
void MaybeFinishDecodeFirstFrame();
@ -816,11 +810,6 @@ private:
// True if all video frames are already rendered.
Watchable<bool> mVideoCompleted;
// True if we need to enter dormant state after reading metadata. Note that
// we can't enter dormant state until reading metadata is done for some
// limitations of the reader.
bool mPendingDormant = false;
// Flag whether we notify metadata before decoding the first frame or after.
//
// Note that the odd semantics here are designed to replicate the current
@ -853,9 +842,6 @@ private:
// by the decoder monitor.
bool mDecodeThreadWaiting;
// Track our request for metadata from the reader.
MozPromiseRequestHolder<MediaDecoderReader::MetadataPromise> mMetadataRequest;
// Stores presentation info required for playback. The decoder monitor
// must be held when accessing this.
MediaInfo mInfo;