Backed out 2 changesets (bug 1332619) for frequent Win8 gtest failures in VP8VideoTrackEncoder.SkippedFrames

Backed out changeset 9ea8e4f2edae (bug 1332619)
Backed out changeset 123099d23df5 (bug 1332619)
This commit is contained in:
Phil Ringnalda 2017-01-20 20:02:57 -08:00
Родитель 72dfd3bd3f
Коммит 0fae2ed52a
2 изменённых файлов: 2 добавлений и 49 удалений

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

@ -553,15 +553,11 @@ VP8TrackEncoder::GetEncodedTrack(EncodedFrameContainer& aData)
} else {
// SKIP_FRAME
// Extend the duration of the last encoded data in aData
// because this frame will be skipped.
// because this frame will be skip.
VP8LOG(LogLevel::Warning, "MediaRecorder lagging behind. Skipping a frame.");
RefPtr<EncodedFrame> last = aData.GetEncodedFrames().LastElement();
if (last) {
CheckedInt64 skippedDuration = FramesToUsecs(chunk.mDuration, mTrackRate);
if (skippedDuration.isValid() && skippedDuration.value() > 0) {
last->SetDuration(last->GetDuration() +
(static_cast<uint64_t>(skippedDuration.value())));
}
last->SetDuration(last->GetDuration() + chunk.GetDuration());
}
}

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

@ -429,49 +429,6 @@ TEST(VP8VideoTrackEncoder, NullFrameFirst)
EXPECT_EQ(pointThree, totalDuration);
}
// Test encoding a track that has to skip frames.
TEST(VP8VideoTrackEncoder, SkippedFrames)
{
// Initiate VP8 encoder
TestVP8TrackEncoder encoder;
InitParam param = {true, 640, 480};
encoder.TestInit(param);
YUVBufferGenerator generator;
generator.Init(mozilla::gfx::IntSize(640, 480));
TimeStamp now = TimeStamp::Now();
VideoSegment segment;
// Pass 100 frames of the shortest possible duration where we don't get
// rounding errors between input/output rate.
for (uint32_t i = 0; i < 100; ++i) {
segment.AppendFrame(generator.GenerateI420Image(),
mozilla::StreamTime(9), // 0.1ms
generator.GetSize(),
PRINCIPAL_HANDLE_NONE,
false,
now + TimeDuration::FromMilliseconds(i * 0.1));
}
encoder.SetCurrentFrames(segment);
// End the track.
segment.Clear();
encoder.NotifyQueuedTrackChanges(nullptr, 0, 0, TrackEventCommand::TRACK_EVENT_ENDED, segment);
EncodedFrameContainer container;
ASSERT_TRUE(NS_SUCCEEDED(encoder.GetEncodedTrack(container)));
EXPECT_TRUE(encoder.IsEncodingComplete());
// Verify total duration being 100 * 0.1ms = 10ms.
uint64_t totalDuration = 0;
for (auto& frame : container.GetEncodedFrames()) {
totalDuration += frame->GetDuration();
}
const uint64_t tenMillis = PR_USEC_PER_SEC / 100;
EXPECT_EQ(tenMillis, totalDuration);
}
// EOS test
TEST(VP8VideoTrackEncoder, EncodeComplete)
{