Rename VideoCodecTest to VideoCodecUnitTest.

The VideoCodecTest class is a fixture base class for the
libvpx-VP8, libvpx-VP9, and OpenH264 unit tests. It is unrelated
to the VideoProcessor tests, which we colloquially refer to as
the "codec test".

This rename is thus to reduce this confusion. It should have no
functional impact.

Bug: webrtc:8448
Change-Id: If73443bda5df0f29a71ce6ce069ac128795ff0ad
Reviewed-on: https://webrtc-review.googlesource.com/47160
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21867}
This commit is contained in:
Rasmus Brandt
2018-02-01 15:45:38 +01:00
committed by Commit Bot
parent 682dc619f2
commit 98a867ccd2
7 changed files with 32 additions and 30 deletions

View File

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/video_coding/codecs/test/video_codec_test.h"
#include "modules/video_coding/codecs/test/video_codec_unittest.h"
#include "api/video/i420_buffer.h"
#include "modules/video_coding/include/video_error_codes.h"
@ -28,7 +28,7 @@ static const int kMaxFramerate = 30; // Arbitrary value.
namespace webrtc {
EncodedImageCallback::Result
VideoCodecTest::FakeEncodeCompleteCallback::OnEncodedImage(
VideoCodecUnitTest::FakeEncodeCompleteCallback::OnEncodedImage(
const EncodedImage& frame,
const CodecSpecificInfo* codec_specific_info,
const RTPFragmentationHeader* fragmentation) {
@ -49,7 +49,7 @@ VideoCodecTest::FakeEncodeCompleteCallback::OnEncodedImage(
return Result(Result::OK);
}
void VideoCodecTest::FakeDecodeCompleteCallback::Decoded(
void VideoCodecUnitTest::FakeDecodeCompleteCallback::Decoded(
VideoFrame& frame,
rtc::Optional<int32_t> decode_time_ms,
rtc::Optional<uint8_t> qp) {
@ -59,7 +59,7 @@ void VideoCodecTest::FakeDecodeCompleteCallback::Decoded(
test_->decoded_frame_event_.Set();
}
void VideoCodecTest::SetUp() {
void VideoCodecUnitTest::SetUp() {
// Using a QCIF image. Processing only one frame.
FILE* source_file_ =
fopen(test::ResourcePath("paris_qcif", "yuv").c_str(), "rb");
@ -77,7 +77,7 @@ void VideoCodecTest::SetUp() {
InitCodecs();
}
bool VideoCodecTest::WaitForEncodedFrame(
bool VideoCodecUnitTest::WaitForEncodedFrame(
EncodedImage* frame,
CodecSpecificInfo* codec_specific_info) {
std::vector<EncodedImage> frames;
@ -91,12 +91,12 @@ bool VideoCodecTest::WaitForEncodedFrame(
return true;
}
void VideoCodecTest::SetWaitForEncodedFramesThreshold(size_t num_frames) {
void VideoCodecUnitTest::SetWaitForEncodedFramesThreshold(size_t num_frames) {
rtc::CritScope lock(&encoded_frame_section_);
wait_for_encoded_frames_threshold_ = num_frames;
}
bool VideoCodecTest::WaitForEncodedFrames(
bool VideoCodecUnitTest::WaitForEncodedFrames(
std::vector<EncodedImage>* frames,
std::vector<CodecSpecificInfo>* codec_specific_info) {
EXPECT_TRUE(encoded_frame_event_.Wait(kEncodeTimeoutMs))
@ -118,8 +118,8 @@ bool VideoCodecTest::WaitForEncodedFrames(
}
}
bool VideoCodecTest::WaitForDecodedFrame(std::unique_ptr<VideoFrame>* frame,
rtc::Optional<uint8_t>* qp) {
bool VideoCodecUnitTest::WaitForDecodedFrame(std::unique_ptr<VideoFrame>* frame,
rtc::Optional<uint8_t>* qp) {
bool ret = decoded_frame_event_.Wait(kDecodeTimeoutMs);
EXPECT_TRUE(ret) << "Timed out while waiting for a decoded frame.";
// This becomes unsafe if there are multiple threads waiting for frames.
@ -135,7 +135,7 @@ bool VideoCodecTest::WaitForDecodedFrame(std::unique_ptr<VideoFrame>* frame,
}
}
void VideoCodecTest::InitCodecs() {
void VideoCodecUnitTest::InitCodecs() {
codec_settings_ = codec_settings();
codec_settings_.startBitrate = kStartBitrate;
codec_settings_.targetBitrate = kTargetBitrate;

View File

@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_VIDEO_CODING_CODECS_TEST_VIDEO_CODEC_TEST_H_
#define MODULES_VIDEO_CODING_CODECS_TEST_VIDEO_CODEC_TEST_H_
#ifndef MODULES_VIDEO_CODING_CODECS_TEST_VIDEO_CODEC_UNITTEST_H_
#define MODULES_VIDEO_CODING_CODECS_TEST_VIDEO_CODEC_UNITTEST_H_
#include <memory>
#include <vector>
@ -26,9 +26,9 @@
namespace webrtc {
class VideoCodecTest : public ::testing::Test {
class VideoCodecUnitTest : public ::testing::Test {
public:
VideoCodecTest()
VideoCodecUnitTest()
: encode_complete_callback_(this),
decode_complete_callback_(this),
encoded_frame_event_(false /* manual reset */,
@ -40,19 +40,21 @@ class VideoCodecTest : public ::testing::Test {
protected:
class FakeEncodeCompleteCallback : public webrtc::EncodedImageCallback {
public:
explicit FakeEncodeCompleteCallback(VideoCodecTest* test) : test_(test) {}
explicit FakeEncodeCompleteCallback(VideoCodecUnitTest* test)
: test_(test) {}
Result OnEncodedImage(const EncodedImage& frame,
const CodecSpecificInfo* codec_specific_info,
const RTPFragmentationHeader* fragmentation);
private:
VideoCodecTest* const test_;
VideoCodecUnitTest* const test_;
};
class FakeDecodeCompleteCallback : public webrtc::DecodedImageCallback {
public:
explicit FakeDecodeCompleteCallback(VideoCodecTest* test) : test_(test) {}
explicit FakeDecodeCompleteCallback(VideoCodecUnitTest* test)
: test_(test) {}
int32_t Decoded(VideoFrame& frame) override {
RTC_NOTREACHED();
@ -67,7 +69,7 @@ class VideoCodecTest : public ::testing::Test {
rtc::Optional<uint8_t> qp) override;
private:
VideoCodecTest* const test_;
VideoCodecUnitTest* const test_;
};
virtual std::unique_ptr<VideoEncoder> CreateEncoder() = 0;
@ -123,4 +125,4 @@ class VideoCodecTest : public ::testing::Test {
} // namespace webrtc
#endif // MODULES_VIDEO_CODING_CODECS_TEST_VIDEO_CODEC_TEST_H_
#endif // MODULES_VIDEO_CODING_CODECS_TEST_VIDEO_CODEC_UNITTEST_H_