mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 20:30:41 +00:00
Bug 1626555 - Add dom/media/mediasink
to the list of non-unified-build-compatible directories. r=sg
Differential Revision: https://phabricator.services.mozilla.com/D95023
This commit is contained in:
parent
f16e83b920
commit
69d369ec4f
@ -12,6 +12,7 @@
|
||||
#include "AudioSampleFormat.h"
|
||||
#include "WebAudioUtils.h"
|
||||
#include "AudioBlock.h"
|
||||
#include "MediaData.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
@ -12,10 +12,10 @@
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
|
||||
#include "AudioSink.h"
|
||||
#include "MediaSink.h"
|
||||
|
||||
namespace mozilla {
|
||||
class AudioSink;
|
||||
class MediaData;
|
||||
template <class T>
|
||||
class MediaQueue;
|
||||
|
@ -7,6 +7,7 @@
|
||||
#ifndef DecodedStream_h_
|
||||
#define DecodedStream_h_
|
||||
|
||||
#include "AudibilityMonitor.h"
|
||||
#include "MediaEventSource.h"
|
||||
#include "MediaInfo.h"
|
||||
#include "MediaSegment.h"
|
||||
|
@ -13,6 +13,8 @@
|
||||
#include "mozilla/dom/MediaDebugInfoBinding.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
|
||||
class AudioDeviceInfo;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class TimeStamp;
|
||||
|
@ -19,9 +19,7 @@
|
||||
#include "mozilla/StaticPrefs_browser.h"
|
||||
#include "mozilla/StaticPrefs_media.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
extern LazyLogModule gMediaDecoderLog;
|
||||
extern mozilla::LazyLogModule gMediaDecoderLog;
|
||||
|
||||
#undef FMT
|
||||
|
||||
@ -40,6 +38,8 @@ extern LazyLogModule gMediaDecoderLog;
|
||||
# define VSINK_ADD_PROFILER_MARKER(tag, startTime, endTime)
|
||||
#endif
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
using namespace mozilla::layers;
|
||||
|
||||
// Minimum update frequency is 1/120th of a second, i.e. half the
|
||||
@ -108,7 +108,7 @@ RefPtr<VideoSink::EndedPromise> VideoSink::OnEnded(TrackType aType) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TimeUnit VideoSink::GetEndTime(TrackType aType) const {
|
||||
media::TimeUnit VideoSink::GetEndTime(TrackType aType) const {
|
||||
AssertOwnerThread();
|
||||
MOZ_ASSERT(mAudioSink->IsStarted(), "Must be called after playback starts.");
|
||||
|
||||
@ -117,10 +117,10 @@ TimeUnit VideoSink::GetEndTime(TrackType aType) const {
|
||||
} else if (aType == TrackInfo::kAudioTrack) {
|
||||
return mAudioSink->GetEndTime(aType);
|
||||
}
|
||||
return TimeUnit::Zero();
|
||||
return media::TimeUnit::Zero();
|
||||
}
|
||||
|
||||
TimeUnit VideoSink::GetPosition(TimeStamp* aTimeStamp) const {
|
||||
media::TimeUnit VideoSink::GetPosition(TimeStamp* aTimeStamp) const {
|
||||
AssertOwnerThread();
|
||||
return mAudioSink->GetPosition(aTimeStamp);
|
||||
}
|
||||
@ -210,7 +210,8 @@ void VideoSink::SetPlaying(bool aPlaying) {
|
||||
EnsureHighResTimersOnOnlyIfPlaying();
|
||||
}
|
||||
|
||||
nsresult VideoSink::Start(const TimeUnit& aStartTime, const MediaInfo& aInfo) {
|
||||
nsresult VideoSink::Start(const media::TimeUnit& aStartTime,
|
||||
const MediaInfo& aInfo) {
|
||||
AssertOwnerThread();
|
||||
VSINK_LOG("[%s]", __func__);
|
||||
|
||||
@ -270,7 +271,7 @@ void VideoSink::Stop() {
|
||||
mEndPromiseHolder.ResolveIfExists(true, __func__);
|
||||
mEndPromise = nullptr;
|
||||
}
|
||||
mVideoFrameEndTime = TimeUnit::Zero();
|
||||
mVideoFrameEndTime = media::TimeUnit::Zero();
|
||||
|
||||
EnsureHighResTimersOnOnlyIfPlaying();
|
||||
}
|
||||
@ -367,7 +368,7 @@ void VideoSink::TryUpdateRenderedVideoFrames() {
|
||||
}
|
||||
|
||||
TimeStamp nowTime;
|
||||
const TimeUnit clockTime = mAudioSink->GetPosition(&nowTime);
|
||||
const media::TimeUnit clockTime = mAudioSink->GetPosition(&nowTime);
|
||||
if (clockTime >= v->mTime) {
|
||||
// Time to render this frame.
|
||||
UpdateRenderedVideoFrames();
|
||||
@ -490,7 +491,7 @@ void VideoSink::UpdateRenderedVideoFrames() {
|
||||
uint32_t droppedInSink = 0;
|
||||
|
||||
// Skip frames up to the playback position.
|
||||
TimeUnit lastFrameEndTime;
|
||||
media::TimeUnit lastFrameEndTime;
|
||||
while (VideoQueue().GetSize() > mMinVideoQueueSize &&
|
||||
clockTime >= VideoQueue().PeekFront()->GetEndTime()) {
|
||||
RefPtr<VideoData> frame = VideoQueue().PopFront();
|
||||
|
Loading…
x
Reference in New Issue
Block a user