mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-17 14:25:49 +00:00
Bug 1746905: dom/media misc cleanup r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D134302
This commit is contained in:
parent
b0196a432d
commit
37df566280
@ -9,6 +9,7 @@
|
||||
|
||||
#include "DecoderDoctorLogger.h"
|
||||
#include "Intervals.h"
|
||||
#include "mozilla/Monitor.h"
|
||||
#include "mozilla/Result.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "mozilla/dom/MediaDebugInfoBinding.h"
|
||||
@ -27,7 +28,6 @@ namespace mozilla {
|
||||
class ChannelMediaResource;
|
||||
typedef media::IntervalSet<int64_t> MediaByteRangeSet;
|
||||
class MediaResource;
|
||||
class MonitorAutoLock;
|
||||
|
||||
/**
|
||||
* Media applications want fast, "on demand" random access to media data,
|
||||
|
@ -53,10 +53,10 @@ void MediaTimer::Destroy() {
|
||||
{
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
Reject();
|
||||
}
|
||||
|
||||
// Cancel the timer if necessary.
|
||||
CancelTimerIfArmed();
|
||||
// Cancel the timer if necessary.
|
||||
CancelTimerIfArmed();
|
||||
}
|
||||
|
||||
delete this;
|
||||
}
|
||||
|
@ -220,14 +220,18 @@ void VideoFrameContainer::ClearFutureFrames(TimeStamp aNow) {
|
||||
}
|
||||
|
||||
void VideoFrameContainer::ClearCachedResources() {
|
||||
MutexAutoLock lock(mMutex);
|
||||
mImageContainer->ClearCachedResources();
|
||||
}
|
||||
|
||||
ImageContainer* VideoFrameContainer::GetImageContainer() {
|
||||
// Note - you'll need the lock to manipulate this. The pointer is not
|
||||
// modified from multiple threads, just the data pointed to by it.
|
||||
return mImageContainer;
|
||||
}
|
||||
|
||||
double VideoFrameContainer::GetFrameDelay() {
|
||||
MutexAutoLock lock(mMutex);
|
||||
return mImageContainer->GetPaintDelay().ToSeconds();
|
||||
}
|
||||
|
||||
|
@ -86,6 +86,7 @@ class VideoFrameContainer {
|
||||
void ForgetElement() { mOwner = nullptr; }
|
||||
|
||||
uint32_t GetDroppedImageCount() {
|
||||
MutexAutoLock lock(mMutex);
|
||||
return mImageContainer->GetDroppedImageCount();
|
||||
}
|
||||
|
||||
@ -94,7 +95,7 @@ class VideoFrameContainer {
|
||||
const gfx::IntSize& aIntrinsicSize,
|
||||
const nsTArray<ImageContainer::NonOwningImage>& aImages);
|
||||
|
||||
// Non-addreffed pointer to the owner. The ownenr calls ForgetElement
|
||||
// Non-addreffed pointer to the owner. The owner calls ForgetElement
|
||||
// to clear this reference when the owner is destroyed.
|
||||
MediaDecoderOwner* mOwner;
|
||||
RefPtr<ImageContainer> mImageContainer;
|
||||
|
@ -746,10 +746,17 @@ void TrackBuffersManager::RemoveAllCodedFrames() {
|
||||
}
|
||||
|
||||
UpdateBufferedRanges();
|
||||
MOZ_ASSERT(mAudioBufferedRanges.IsEmpty(),
|
||||
"Should have no buffered video ranges after evicting everything.");
|
||||
MOZ_ASSERT(mVideoBufferedRanges.IsEmpty(),
|
||||
"Should have no buffered video ranges after evicting everything.");
|
||||
#ifdef DEBUG
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
MOZ_ASSERT(
|
||||
mAudioBufferedRanges.IsEmpty(),
|
||||
"Should have no buffered video ranges after evicting everything.");
|
||||
MOZ_ASSERT(
|
||||
mVideoBufferedRanges.IsEmpty(),
|
||||
"Should have no buffered video ranges after evicting everything.");
|
||||
}
|
||||
#endif
|
||||
mSizeSourceBuffer = mVideoTracks.mSizeBuffer + mAudioTracks.mSizeBuffer;
|
||||
MOZ_ASSERT(mSizeSourceBuffer == 0,
|
||||
"Buffer should be empty after evicting everything!");
|
||||
|
Loading…
x
Reference in New Issue
Block a user