summaryrefslogtreecommitdiffstats
path: root/dom/media/platforms/wmf/MFMediaEngineStream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/platforms/wmf/MFMediaEngineStream.cpp')
-rw-r--r--dom/media/platforms/wmf/MFMediaEngineStream.cpp33
1 files changed, 20 insertions, 13 deletions
diff --git a/dom/media/platforms/wmf/MFMediaEngineStream.cpp b/dom/media/platforms/wmf/MFMediaEngineStream.cpp
index 6dce37ee35..70ffa50142 100644
--- a/dom/media/platforms/wmf/MFMediaEngineStream.cpp
+++ b/dom/media/platforms/wmf/MFMediaEngineStream.cpp
@@ -107,7 +107,11 @@ MFMediaEngineStreamWrapper::NeedsConversion() const {
}
MFMediaEngineStream::MFMediaEngineStream()
- : mIsShutdown(false), mIsSelected(false), mReceivedEOS(false) {
+ : mIsShutdown(false),
+ mIsSelected(false),
+ mRawDataQueueForFeedingEngine(true /* aEnablePreciseDuration */),
+ mRawDataQueueForGeneratingOutput(true /* aEnablePreciseDuration */),
+ mReceivedEOS(false) {
MOZ_COUNT_CTOR(MFMediaEngineStream);
}
@@ -282,17 +286,8 @@ void MFMediaEngineStream::ReplySampleRequestIfPossible() {
while (!mSampleRequestTokens.empty()) {
mSampleRequestTokens.pop();
}
-
- SLOG("Notify end events");
- MOZ_ASSERT(mRawDataQueueForFeedingEngine.GetSize() == 0);
MOZ_ASSERT(mSampleRequestTokens.empty());
- RETURN_VOID_IF_FAILED(mMediaEventQueue->QueueEventParamUnk(
- MEEndOfStream, GUID_NULL, S_OK, nullptr));
- mEndedEvent.Notify(TrackType());
- PROFILER_MARKER_TEXT(
- "MFMediaEngineStream:NotifyEnd", MEDIA_PLAYBACK, {},
- nsPrintfCString("stream=%s, id=%" PRIu64, GetDescriptionName().get(),
- mStreamId));
+ NotifyEndEvent();
return;
}
@@ -318,6 +313,18 @@ void MFMediaEngineStream::ReplySampleRequestIfPossible() {
MEMediaSample, GUID_NULL, S_OK, inputSample.Get()));
}
+void MFMediaEngineStream::NotifyEndEvent() {
+ AssertOnTaskQueue();
+ SLOG("Notify end event");
+ MOZ_ASSERT(mRawDataQueueForFeedingEngine.GetSize() == 0);
+ RETURN_VOID_IF_FAILED(mMediaEventQueue->QueueEventParamUnk(
+ MEEndOfStream, GUID_NULL, S_OK, nullptr));
+ mEndedEvent.Notify(TrackType());
+ PROFILER_MARKER_TEXT("MFMediaEngineStream:NotifyEnd", MEDIA_PLAYBACK, {},
+ nsPrintfCString("stream=%s, id=%" PRIu64,
+ GetDescriptionName().get(), mStreamId));
+}
+
bool MFMediaEngineStream::ShouldServeSamples() const {
AssertOnTaskQueue();
return mParentSource &&
@@ -486,7 +493,7 @@ void MFMediaEngineStream::NotifyNewData(MediaRawData* aSample) {
"], queue size=%zu, queue duration=%" PRId64,
aSample->mTime.ToMicroseconds(), aSample->GetEndTime().ToMicroseconds(),
mRawDataQueueForFeedingEngine.GetSize(),
- mRawDataQueueForFeedingEngine.Duration());
+ mRawDataQueueForFeedingEngine.PreciseDuration());
if (mReceivedEOS) {
SLOG("Receive a new data, cancel old EOS flag");
mReceivedEOS = false;
@@ -501,7 +508,7 @@ void MFMediaEngineStream::SendRequestSampleEvent(bool aIsEnough) {
AssertOnTaskQueue();
SLOGV("data is %s, queue duration=%" PRId64,
aIsEnough ? "enough" : "not enough",
- mRawDataQueueForFeedingEngine.Duration());
+ mRawDataQueueForFeedingEngine.PreciseDuration());
mParentSource->mRequestSampleEvent.Notify(
SampleRequest{TrackType(), aIsEnough});
}