Bug 1265634. Part 1 - add more proxy functions to MediaDecoderReaderWrapper and remove unused members from MDSM. r=kaku.

MozReview-Commit-ID: DpccSccPrxU
This commit is contained in:
JW Wang 2016-04-20 14:45:40 +08:00
Родитель e7a6f22684
Коммит 30774e680f
3 изменённых файлов: 38 добавлений и 22 удалений

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

@ -66,6 +66,15 @@ public:
TimedMetadataEventSource& TimedMetadataEvent() {
return mReader->TimedMetadataEvent();
}
MediaEventSource<void>& OnMediaNotSeekable() {
return mReader->OnMediaNotSeekable();
}
size_t SizeOfVideoQueueInBytes() const {
return mReader->SizeOfVideoQueueInBytes();
}
size_t SizeOfAudioQueueInBytes() const {
return mReader->SizeOfAudioQueueInBytes();
}
size_t SizeOfAudioQueueInFrames() const {
return mReader->SizeOfAudioQueueInFrames();
}

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

@ -219,7 +219,6 @@ MediaDecoderStateMachine::MediaDecoderStateMachine(MediaDecoder* aDecoder,
mCurrentFrameID(0),
mObservedDuration(TimeUnit(), "MediaDecoderStateMachine::mObservedDuration"),
mFragmentEndTime(-1),
mReader(aReader),
mReaderWrapper(new MediaDecoderReaderWrapper(aRealTime, mTaskQueue, aReader)),
mDecodedAudioEndTime(0),
mDecodedVideoEndTime(0),
@ -2688,6 +2687,30 @@ void MediaDecoderStateMachine::RemoveOutputStream(MediaStream* aStream)
}
}
size_t
MediaDecoderStateMachine::SizeOfVideoQueue() const
{
return mReaderWrapper->SizeOfVideoQueueInBytes();
}
size_t
MediaDecoderStateMachine::SizeOfAudioQueue() const
{
return mReaderWrapper->SizeOfAudioQueueInBytes();
}
AbstractCanonical<media::TimeIntervals>*
MediaDecoderStateMachine::CanonicalBuffered()
{
return mReaderWrapper->CanonicalBuffered();
}
MediaEventSource<void>&
MediaDecoderStateMachine::OnMediaNotSeekable()
{
return mReaderWrapper->OnMediaNotSeekable();
}
} // namespace mozilla
// avoid redefined macro in unified build

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

@ -222,9 +222,7 @@ public:
return mMetadataManager.TimedMetadataEvent();
}
MediaEventSource<void>& OnMediaNotSeekable() {
return mReader->OnMediaNotSeekable();
}
MediaEventSource<void>& OnMediaNotSeekable();
MediaEventSourceExc<nsAutoPtr<MediaInfo>,
nsAutoPtr<MetadataTags>,
@ -244,13 +242,9 @@ public:
// Immutable after construction - may be called on any thread.
bool IsRealTime() const { return mRealTime; }
size_t SizeOfVideoQueue() {
return mReader->SizeOfVideoQueueInBytes();
}
size_t SizeOfVideoQueue() const;
size_t SizeOfAudioQueue() {
return mReader->SizeOfAudioQueueInBytes();
}
size_t SizeOfAudioQueue() const;
private:
// Functions used by assertions to ensure we're calling things
@ -648,11 +642,6 @@ private:
// Accessed on state machine, audio, main, and AV thread.
Watchable<State> mState;
// The task queue in which we run decode tasks. This is referred to as
// the "decode thread", though in practise tasks can run on a different
// thread every time they're called.
TaskQueue* DecodeTaskQueue() const { return mReader->OwnerThread(); }
// Time that buffering started. Used for buffering timeout and only
// accessed on the state machine thread. This is null while we're not
// buffering.
@ -699,10 +688,6 @@ private:
// The media sink resource. Used on the state machine thread.
RefPtr<media::MediaSink> mMediaSink;
// The reader, don't call its methods with the decoder monitor held.
// This is created in the state machine's constructor.
const RefPtr<MediaDecoderReader> mReader;
const RefPtr<MediaDecoderReaderWrapper> mReaderWrapper;
// The end time of the last audio frame that's been pushed onto the media sink
@ -1054,9 +1039,8 @@ private:
Canonical<bool> mIsAudioDataAudible;
public:
AbstractCanonical<media::TimeIntervals>* CanonicalBuffered() {
return mReader->CanonicalBuffered();
}
AbstractCanonical<media::TimeIntervals>* CanonicalBuffered();
AbstractCanonical<media::NullableTimeUnit>* CanonicalDuration() {
return &mDuration;
}