Bug 1219163. Part 2 - Move some functions that are never called from the interface of AbstractMediaDecoder down the class hierarchy. r=jya.

This commit is contained in:
JW Wang 2015-11-23 10:26:49 +08:00
Родитель a7be18a6e3
Коммит b194bb0f80
4 изменённых файлов: 7 добавлений и 47 удалений

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

@ -57,10 +57,6 @@ public:
// by currentSrc. Returns what was passed to Load(), if Load() has been called.
virtual MediaResource* GetResource() const = 0;
// Called by the decode thread to keep track of the number of bytes read
// from the resource.
virtual void NotifyBytesConsumed(int64_t aBytes, int64_t aOffset) = 0;
// Increments the parsed, decoded and dropped frame counters by the passed in
// counts.
// Can be called on any thread.
@ -102,12 +98,6 @@ public:
virtual VideoFrameContainer* GetVideoFrameContainer() = 0;
virtual mozilla::layers::ImageContainer* GetImageContainer() = 0;
// Return true if the media layer supports seeking.
virtual bool IsTransportSeekable() = 0;
// Return true if the transport layer supports seeking.
virtual bool IsMediaSeekable() = 0;
virtual void MetadataLoaded(nsAutoPtr<MediaInfo> aInfo, nsAutoPtr<MetadataTags> aTags, MediaDecoderEventVisibility aEventVisibility) = 0;
virtual void FirstFrameLoaded(nsAutoPtr<MediaInfo> aInfo, MediaDecoderEventVisibility aEventVisibility) = 0;
@ -115,16 +105,9 @@ public:
// on the main thread.
virtual MediaDecoderOwner* GetOwner() = 0;
// Called by the reader's MediaResource as data arrives over the network.
// Must be called on the main thread.
virtual void NotifyDataArrived() = 0;
// Set by Reader if the current audio track can be offloaded
virtual void SetPlatformCanOffloadAudio(bool aCanOffloadAudio) {}
// Called from HTMLMediaElement when owner document activity changes
virtual void SetElementVisibility(bool aIsVisible) {}
// Stack based class to assist in notifying the frame statistics of
// parsed and decoded frames. Use inside video demux & decode functions
// to ensure all parsed and decoded frames are reported on all return paths.

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

@ -442,7 +442,7 @@ public:
// Called as data arrives on the stream and is read into the cache. Called
// on the main thread only.
virtual void NotifyDataArrived() override;
void NotifyDataArrived();
// Return true if we are currently seeking in the media resource.
// Call on the main thread only.
@ -463,17 +463,20 @@ protected:
// changed, this causes a durationchanged event to fire to the media
// element.
void UpdateEstimatedMediaDuration(int64_t aDuration) override;
public:
// Called from HTMLMediaElement when owner document activity changes
virtual void SetElementVisibility(bool aIsVisible) {}
// Set a flag indicating whether seeking is supported
virtual void SetMediaSeekable(bool aMediaSeekable) override;
// Returns true if this media supports seeking. False for example for WebM
// files without an index and chained ogg files.
virtual bool IsMediaSeekable() final override;
bool IsMediaSeekable();
// Returns true if seeking is supported on a transport level (e.g. the server
// supports range requests, we are playing a file, etc.).
virtual bool IsTransportSeekable() override;
bool IsTransportSeekable();
// Return the time ranges that can be seeked into.
virtual media::TimeIntervals GetSeekable();
@ -1081,7 +1084,7 @@ private:
// Called by the MediaResource to keep track of the number of bytes read
// from the resource. Called on the main by an event runner dispatched
// by the MediaResource read functions.
void NotifyBytesConsumed(int64_t aBytes, int64_t aOffset) final override;
void NotifyBytesConsumed(int64_t aBytes, int64_t aOffset);
// Called by nsChannelToPipeListener or MediaResource when the
// download has ended. Called on the main thread only. aStatus is

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

@ -39,12 +39,6 @@ BufferDecoder::GetResource() const
return mResource;
}
void
BufferDecoder::NotifyBytesConsumed(int64_t aBytes, int64_t aOffset)
{
// ignore
}
void
BufferDecoder::NotifyDecodedFrames(uint32_t aParsed, uint32_t aDecoded,
uint32_t aDropped)
@ -72,18 +66,6 @@ BufferDecoder::GetImageContainer()
return nullptr;
}
bool
BufferDecoder::IsTransportSeekable()
{
return false;
}
bool
BufferDecoder::IsMediaSeekable()
{
return false;
}
void
BufferDecoder::MetadataLoaded(nsAutoPtr<MediaInfo> aInfo, nsAutoPtr<MetadataTags> aTags, MediaDecoderEventVisibility aEventVisibility)
{

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

@ -33,8 +33,6 @@ public:
virtual MediaResource* GetResource() const final override;
virtual void NotifyBytesConsumed(int64_t aBytes, int64_t aOffset) final override;
virtual void NotifyDecodedFrames(uint32_t aParsed, uint32_t aDecoded,
uint32_t aDropped) final override;
@ -43,10 +41,6 @@ public:
virtual VideoFrameContainer* GetVideoFrameContainer() final override;
virtual layers::ImageContainer* GetImageContainer() final override;
virtual bool IsTransportSeekable() final override;
virtual bool IsMediaSeekable() final override;
virtual void MetadataLoaded(nsAutoPtr<MediaInfo> aInfo,
nsAutoPtr<MetadataTags> aTags,
MediaDecoderEventVisibility aEventVisibility) final override;
@ -55,8 +49,6 @@ public:
virtual MediaDecoderOwner* GetOwner() final override;
virtual void NotifyDataArrived() final override {};
private:
virtual ~BufferDecoder();
RefPtr<TaskQueue> mTaskQueueIdentity;