mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1212176: Remove arguments passed to MediaDataDemuxer::NotifyDataArrived API. r=cpearce
Be more explicit on what it does and how it should be used.
This commit is contained in:
parent
468b7b72d3
commit
628247fc4e
@ -84,11 +84,10 @@ MP3Demuxer::IsSeekable() const {
|
||||
}
|
||||
|
||||
void
|
||||
MP3Demuxer::NotifyDataArrived(uint32_t aLength, int64_t aOffset) {
|
||||
MP3Demuxer::NotifyDataArrived() {
|
||||
// TODO: bug 1169485.
|
||||
NS_WARNING("Unimplemented function NotifyDataArrived");
|
||||
MP3DEMUXER_LOGV("NotifyDataArrived(%u, %" PRId64 ") mOffset=%" PRId64,
|
||||
aLength, aOffset, mTrackDemuxer->GetResourceOffset());
|
||||
MP3DEMUXER_LOGV("NotifyDataArrived()");
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -25,7 +25,7 @@ public:
|
||||
already_AddRefed<MediaTrackDemuxer> GetTrackDemuxer(
|
||||
TrackInfo::TrackType aType, uint32_t aTrackNumber) override;
|
||||
bool IsSeekable() const override;
|
||||
void NotifyDataArrived(uint32_t aLength, int64_t aOffset) override;
|
||||
void NotifyDataArrived() override;
|
||||
void NotifyDataRemoved() override;
|
||||
// Do not shift the calculated buffered range by the start time of the first
|
||||
// decoded frame. The mac MP3 decoder will buffer some samples and the first
|
||||
|
@ -77,15 +77,17 @@ public:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Notifies the demuxer that the underlying resource has received more data.
|
||||
// Notifies the demuxer that the underlying resource has received more data
|
||||
// since the demuxer was initialized.
|
||||
// The demuxer can use this mechanism to inform all track demuxers that new
|
||||
// data is available.
|
||||
virtual void NotifyDataArrived(uint32_t aLength, int64_t aOffset) { }
|
||||
// data is available and to refresh its buffered range.
|
||||
virtual void NotifyDataArrived() { }
|
||||
|
||||
// Notifies the demuxer that the underlying resource has had data removed.
|
||||
// Notifies the demuxer that the underlying resource has had data removed
|
||||
// since the demuxer was initialized.
|
||||
// The demuxer can use this mechanism to inform all track demuxers to update
|
||||
// its TimeIntervals.
|
||||
// This will be called should the demuxer be used with MediaSource.
|
||||
// its buffered range.
|
||||
// This will be called should the demuxer be used with MediaSourceResource.
|
||||
virtual void NotifyDataRemoved() { }
|
||||
|
||||
// Indicate to MediaFormatReader if it should compute the start time
|
||||
|
@ -1603,7 +1603,7 @@ MediaFormatReader::NotifyDemuxer(uint32_t aLength, int64_t aOffset)
|
||||
}
|
||||
|
||||
if (aLength || aOffset) {
|
||||
mDemuxer->NotifyDataArrived(aLength, aOffset);
|
||||
mDemuxer->NotifyDataArrived();
|
||||
} else {
|
||||
mDemuxer->NotifyDataRemoved();
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ MP4Demuxer::IsSeekable() const
|
||||
}
|
||||
|
||||
void
|
||||
MP4Demuxer::NotifyDataArrived(uint32_t aLength, int64_t aOffset)
|
||||
MP4Demuxer::NotifyDataArrived()
|
||||
{
|
||||
for (uint32_t i = 0; i < mDemuxers.Length(); i++) {
|
||||
mDemuxers[i]->NotifyDataArrived();
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
|
||||
virtual UniquePtr<EncryptionInfo> GetCrypto() override;
|
||||
|
||||
virtual void NotifyDataArrived(uint32_t aLength, int64_t aOffset) override;
|
||||
virtual void NotifyDataArrived() override;
|
||||
|
||||
virtual void NotifyDataRemoved() override;
|
||||
|
||||
|
@ -53,7 +53,7 @@ MediaSourceDemuxer::AttemptInit()
|
||||
return p;
|
||||
}
|
||||
|
||||
void MediaSourceDemuxer::NotifyDataArrived(uint32_t aLength, int64_t aOffset)
|
||||
void MediaSourceDemuxer::NotifyDataArrived()
|
||||
{
|
||||
nsRefPtr<MediaSourceDemuxer> self = this;
|
||||
nsCOMPtr<nsIRunnable> task =
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
|
||||
bool ShouldComputeStartTime() const override { return false; }
|
||||
|
||||
void NotifyDataArrived(uint32_t aLength, int64_t aOffset) override;
|
||||
void NotifyDataArrived() override;
|
||||
|
||||
/* interface for TrackBuffersManager */
|
||||
void AttachSourceBuffer(TrackBuffersManager* aSourceBuffer);
|
||||
|
@ -876,10 +876,8 @@ void
|
||||
TrackBuffersManager::AppendDataToCurrentInputBuffer(MediaByteBuffer* aData)
|
||||
{
|
||||
MOZ_ASSERT(mCurrentInputBuffer);
|
||||
int64_t offset = mCurrentInputBuffer->GetLength();
|
||||
mCurrentInputBuffer->AppendData(aData);
|
||||
// A MediaByteBuffer has a maximum size of 2GiB.
|
||||
mInputDemuxer->NotifyDataArrived(uint32_t(aData->Length()), offset);
|
||||
mInputDemuxer->NotifyDataArrived();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -462,9 +462,9 @@ WebMDemuxer::EnsureUpToDateIndex()
|
||||
}
|
||||
|
||||
void
|
||||
WebMDemuxer::NotifyDataArrived(uint32_t aLength, int64_t aOffset)
|
||||
WebMDemuxer::NotifyDataArrived()
|
||||
{
|
||||
WEBM_DEBUG("length: %ld offset: %ld", aLength, aOffset);
|
||||
WEBM_DEBUG("");
|
||||
mNeedReIndex = true;
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,7 @@ private:
|
||||
void Cleanup();
|
||||
void InitBufferedState();
|
||||
nsresult ReadMetadata();
|
||||
void NotifyDataArrived(uint32_t aLength, int64_t aOffset) override;
|
||||
void NotifyDataArrived() override;
|
||||
void NotifyDataRemoved() override;
|
||||
void EnsureUpToDateIndex();
|
||||
media::TimeIntervals GetBuffered();
|
||||
|
Loading…
Reference in New Issue
Block a user