/* * Copyright (c) 2019 The WebM project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/ #include"gtest/gtest.h" #include"test/codec_factory.h" #include"test/encode_test_driver.h" #include"test/util.h" #include"test/video_source.h" #include"vpx_config.h"
// A video source that exposes functions to set the timebase, framerate and // starting pts. class DummyTimebaseVideoSource : public ::libvpx_test::DummyVideoSource { public: // Parameters num and den set the timebase for the video source.
DummyTimebaseVideoSource(int num, int den)
: timebase_({ num, den }), framerate_numerator_(30),
framerate_denominator_(1), starting_pts_(0) {
SetSize(kVideoSourceWidth, kVideoSourceHeight);
set_limit(kFramesToEncode);
}
// Returns one frames duration in timebase units as a double. double FrameDuration() const { return (static_cast<double>(timebase_.den) / timebase_.num) /
(static_cast<double>(framerate_numerator_) / framerate_denominator_);
}
TEST_P(TimestampTest, TestMicrosecondTimebase) { // Set the timebase to microseconds.
DummyTimebaseVideoSource video(1, 1000000);
video.set_limit(1);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.