Bug 1195158. Part 4 - remove unused code. r=cpearce.

This commit is contained in:
JW Wang 2015-09-07 11:39:16 +08:00
parent 70e1c2be8a
commit d080b4eb18
10 changed files with 3 additions and 113 deletions

View File

@ -103,11 +103,8 @@ public:
virtual bool IsMediaSeekable() = 0;
virtual void MetadataLoaded(nsAutoPtr<MediaInfo> aInfo, nsAutoPtr<MetadataTags> aTags, MediaDecoderEventVisibility aEventVisibility) = 0;
virtual void QueueMetadata(const media::TimeUnit& aTime, nsAutoPtr<MediaInfo> aInfo, nsAutoPtr<MetadataTags> aTags) = 0;
virtual void FirstFrameLoaded(nsAutoPtr<MediaInfo> aInfo, MediaDecoderEventVisibility aEventVisibility) = 0;
virtual void RemoveMediaTracks() = 0;
// May be called by the reader to notify this decoder that the metadata from
// the media file has been read. Call on the decode thread only.
virtual void OnReadMetadataCompleted() = 0;
@ -221,45 +218,6 @@ public:
}
};
class MetadataUpdatedEventRunner : public nsRunnable, private MetadataContainer
{
public:
MetadataUpdatedEventRunner(AbstractMediaDecoder* aDecoder,
nsAutoPtr<MediaInfo> aInfo,
nsAutoPtr<MetadataTags> aTags,
MediaDecoderEventVisibility aEventVisibility = MediaDecoderEventVisibility::Observable)
: MetadataContainer(aDecoder, aInfo, aTags, aEventVisibility)
{}
NS_IMETHOD Run() override
{
nsAutoPtr<MediaInfo> info(new MediaInfo());
*info = *mInfo;
mDecoder->MetadataLoaded(info, mTags, mEventVisibility);
mDecoder->FirstFrameLoaded(mInfo, mEventVisibility);
return NS_OK;
}
};
class RemoveMediaTracksEventRunner : public nsRunnable
{
public:
explicit RemoveMediaTracksEventRunner(AbstractMediaDecoder* aDecoder)
: mDecoder(aDecoder)
{}
NS_IMETHOD Run() override
{
MOZ_ASSERT(NS_IsMainThread());
mDecoder->RemoveMediaTracks();
return NS_OK;
}
private:
nsRefPtr<AbstractMediaDecoder> mDecoder;
};
} // namespace mozilla
#endif

View File

@ -639,15 +639,6 @@ already_AddRefed<nsIPrincipal> MediaDecoder::GetCurrentPrincipal()
return mResource ? mResource->GetCurrentPrincipal() : nullptr;
}
void MediaDecoder::QueueMetadata(const TimeUnit& aPublishTime,
nsAutoPtr<MediaInfo> aInfo,
nsAutoPtr<MetadataTags> aTags)
{
MOZ_ASSERT(OnDecodeTaskQueue());
GetReentrantMonitor().AssertCurrentThreadIn();
mDecoderStateMachine->QueueMetadata(aPublishTime, aInfo, aTags);
}
void MediaDecoder::OnMetadataUpdate(TimedMetadata&& aMetadata)
{
MOZ_ASSERT(NS_IsMainThread());

View File

@ -580,13 +580,6 @@ public:
void SetAudioChannel(dom::AudioChannel aChannel) { mAudioChannel = aChannel; }
dom::AudioChannel GetAudioChannel() { return mAudioChannel; }
// Send a new set of metadata to the state machine, to be dispatched to the
// main thread to be presented when the |currentTime| of the media is greater
// or equal to aPublishTime.
void QueueMetadata(const media::TimeUnit& aPublishTime,
nsAutoPtr<MediaInfo> aInfo,
nsAutoPtr<MetadataTags> aTags) override;
/******
* The following methods must only be called on the main
* thread.
@ -619,7 +612,7 @@ public:
// Removes all audio tracks and video tracks that are previously added into
// the track list. Call on the main thread only.
virtual void RemoveMediaTracks() override;
void RemoveMediaTracks();
// Called when the video has completed playing.
// Call on the main thread only.

View File

@ -1101,7 +1101,7 @@ void MediaDecoderStateMachine::UpdatePlaybackPosition(int64_t aTime)
UpdatePlaybackPositionInternal(aTime);
bool fragmentEnded = mFragmentEndTime >= 0 && GetMediaTime() >= mFragmentEndTime;
mMetadataManager.DispatchMetadataIfNeeded(mDecoder, TimeUnit::FromMicroseconds(aTime));
mMetadataManager.DispatchMetadataIfNeeded(TimeUnit::FromMicroseconds(aTime));
if (fragmentEnded) {
StopPlayback();
@ -3028,19 +3028,6 @@ bool MediaDecoderStateMachine::IsShutdown()
return mIsShutdown;
}
void MediaDecoderStateMachine::QueueMetadata(const TimeUnit& aPublishTime,
nsAutoPtr<MediaInfo> aInfo,
nsAutoPtr<MetadataTags> aTags)
{
MOZ_ASSERT(OnDecodeTaskQueue());
AssertCurrentThreadInMonitor();
TimedMetadata* metadata = new TimedMetadata;
metadata->mPublishTime = aPublishTime;
metadata->mInfo = aInfo.forget();
metadata->mTags = aTags.forget();
mMetadataManager.QueueMetadata(metadata);
}
int64_t
MediaDecoderStateMachine::AudioEndTime() const
{

View File

@ -337,10 +337,6 @@ public:
// shutting down. The decoder monitor must be held while calling this.
bool IsShutdown();
void QueueMetadata(const media::TimeUnit& aPublishTime,
nsAutoPtr<MediaInfo> aInfo,
nsAutoPtr<MetadataTags> aTags);
// Returns true if we're currently playing. The decoder monitor must
// be held.
bool IsPlaying() const;

View File

@ -81,11 +81,7 @@ public:
return mTimedMetadataEvent;
}
void QueueMetadata(TimedMetadata* aMetadata) {
mMetadataQueue.insertBack(aMetadata);
}
void DispatchMetadataIfNeeded(AbstractMediaDecoder* aDecoder, const media::TimeUnit& aCurrentTime) {
void DispatchMetadataIfNeeded(const media::TimeUnit& aCurrentTime) {
TimedMetadata* metadata = mMetadataQueue.getFirst();
while (metadata && aCurrentTime >= metadata->mPublishTime) {
// Our listener will figure out what to do with TimedMetadata.

View File

@ -95,20 +95,6 @@ SourceBufferDecoder::FirstFrameLoaded(nsAutoPtr<MediaInfo> aInfo,
MSE_DEBUG("UNIMPLEMENTED");
}
void
SourceBufferDecoder::QueueMetadata(const media::TimeUnit& aTime,
nsAutoPtr<MediaInfo> aInfo,
nsAutoPtr<MetadataTags> aTags)
{
MSE_DEBUG("UNIMPLEMENTED");
}
void
SourceBufferDecoder::RemoveMediaTracks()
{
MSE_DEBUG("UNIMPLEMENTED");
}
bool
SourceBufferDecoder::HasInitializationData()
{

View File

@ -51,8 +51,6 @@ public:
virtual void NotifyDecodedFrames(uint32_t aParsed, uint32_t aDecoded, uint32_t aDropped) final override;
virtual void NotifyWaitingForResourcesStatusChanged() final override;
virtual void OnReadMetadataCompleted() final override;
virtual void QueueMetadata(const media::TimeUnit& aTime, nsAutoPtr<MediaInfo> aInfo, nsAutoPtr<MetadataTags> aTags) final override;
virtual void RemoveMediaTracks() final override;
virtual void SetMediaSeekable(bool aMediaSeekable) final override;
virtual bool HasInitializationData() final override;

View File

@ -129,18 +129,6 @@ BufferDecoder::FirstFrameLoaded(nsAutoPtr<MediaInfo> aInfo, MediaDecoderEventVis
// ignore
}
void
BufferDecoder::QueueMetadata(const media::TimeUnit& aTime, nsAutoPtr<MediaInfo> aInfo, nsAutoPtr<MetadataTags> aTags)
{
// ignore
}
void
BufferDecoder::RemoveMediaTracks()
{
// ignore
}
void
BufferDecoder::OnReadMetadataCompleted()
{

View File

@ -58,12 +58,9 @@ public:
virtual void MetadataLoaded(nsAutoPtr<MediaInfo> aInfo,
nsAutoPtr<MetadataTags> aTags,
MediaDecoderEventVisibility aEventVisibility) final override;
virtual void QueueMetadata(const media::TimeUnit& aTime, nsAutoPtr<MediaInfo> aInfo, nsAutoPtr<MetadataTags> aTags) final override;
virtual void FirstFrameLoaded(nsAutoPtr<MediaInfo> aInfo,
MediaDecoderEventVisibility aEventVisibility) final override;
virtual void RemoveMediaTracks() final override;
virtual void OnReadMetadataCompleted() final override;
virtual MediaDecoderOwner* GetOwner() final override;