GN: Add video_engine_tests
Adds separate source_sets for the video_engine_tests subtargets inside audio, call and video and merges them together into video_engine_tests. BUG=webrtc:5949 R=kjellander@webrtc.org TBR=mflodman@webrtc.org Review URL: https://codereview.webrtc.org/2064523002 . Cr-Commit-Position: refs/heads/master@{#13127}
This commit is contained in:
@ -593,4 +593,22 @@ if (rtc_include_tests) {
|
|||||||
ldflags = [ "-ObjC" ]
|
ldflags = [ "-ObjC" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# TODO(pbos): Rename test suite, this is no longer "just" for video targets.
|
||||||
|
test("video_engine_tests") {
|
||||||
|
testonly = true
|
||||||
|
deps = [
|
||||||
|
"audio:audio_tests",
|
||||||
|
"call:call_tests",
|
||||||
|
"modules/video_capture",
|
||||||
|
"test:test_common",
|
||||||
|
"test:test_main",
|
||||||
|
"video:video_tests",
|
||||||
|
]
|
||||||
|
if (is_clang) {
|
||||||
|
# Suppress warnings from the Chromium Clang plugin.
|
||||||
|
# See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
|
||||||
|
configs -= [ "//build/config/clang:find_bad_constructs" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,3 +35,23 @@ source_set("audio") {
|
|||||||
"../voice_engine",
|
"../voice_engine",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
if (rtc_include_tests) {
|
||||||
|
source_set("audio_tests") {
|
||||||
|
testonly = true
|
||||||
|
sources = [
|
||||||
|
"audio_receive_stream_unittest.cc",
|
||||||
|
"audio_send_stream_unittest.cc",
|
||||||
|
"audio_state_unittest.cc",
|
||||||
|
]
|
||||||
|
deps = [
|
||||||
|
":audio",
|
||||||
|
"//testing/gmock",
|
||||||
|
"//testing/gtest",
|
||||||
|
]
|
||||||
|
if (is_clang) {
|
||||||
|
# Suppress warnings from the Chromium Clang plugin.
|
||||||
|
# See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
|
||||||
|
configs -= [ "//build/config/clang:find_bad_constructs" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -187,7 +187,7 @@ void BuildOneByteExtension(std::vector<uint8_t>::iterator it,
|
|||||||
const size_t kExtensionDataLength = kOneByteExtensionLength - 1;
|
const size_t kExtensionDataLength = kOneByteExtensionLength - 1;
|
||||||
uint32_t shifted_value = extension_value
|
uint32_t shifted_value = extension_value
|
||||||
<< (8 * (kExtensionDataLength - value_length));
|
<< (8 * (kExtensionDataLength - value_length));
|
||||||
*it = (id << 4) + (value_length - 1);
|
*it = (id << 4) + (static_cast<uint8_t>(value_length) - 1);
|
||||||
++it;
|
++it;
|
||||||
ByteWriter<uint32_t, kExtensionDataLength>::WriteBigEndian(&(*it),
|
ByteWriter<uint32_t, kExtensionDataLength>::WriteBigEndian(&(*it),
|
||||||
shifted_value);
|
shifted_value);
|
||||||
|
|||||||
@ -35,3 +35,26 @@ source_set("call") {
|
|||||||
"../video",
|
"../video",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rtc_include_tests) {
|
||||||
|
source_set("call_tests") {
|
||||||
|
testonly = true
|
||||||
|
sources = [
|
||||||
|
"bitrate_allocator_unittest.cc",
|
||||||
|
"bitrate_estimator_tests.cc",
|
||||||
|
"call_unittest.cc",
|
||||||
|
"packet_injection_tests.cc",
|
||||||
|
"ringbuffer_unittest.cc",
|
||||||
|
]
|
||||||
|
deps = [
|
||||||
|
":call",
|
||||||
|
"//testing/gmock",
|
||||||
|
"//testing/gtest",
|
||||||
|
]
|
||||||
|
if (is_clang) {
|
||||||
|
# Suppress warnings from the Chromium Clang plugin.
|
||||||
|
# See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
|
||||||
|
configs -= [ "//build/config/clang:find_bad_constructs" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -416,8 +416,7 @@ class RtpRtcp : public Module {
|
|||||||
/*
|
/*
|
||||||
* Good state of RTP receiver inform sender
|
* Good state of RTP receiver inform sender
|
||||||
*/
|
*/
|
||||||
virtual int32_t SendRTCPReferencePictureSelection(
|
virtual int32_t SendRTCPReferencePictureSelection(uint64_t pictureID) = 0;
|
||||||
const uint64_t pictureID) = 0;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Send a RTCP Slice Loss Indication (SLI)
|
* Send a RTCP Slice Loss Indication (SLI)
|
||||||
|
|||||||
@ -189,7 +189,7 @@ class RtpData {
|
|||||||
virtual ~RtpData() {}
|
virtual ~RtpData() {}
|
||||||
|
|
||||||
virtual int32_t OnReceivedPayloadData(const uint8_t* payloadData,
|
virtual int32_t OnReceivedPayloadData(const uint8_t* payloadData,
|
||||||
const size_t payloadSize,
|
size_t payloadSize,
|
||||||
const WebRtcRTPHeader* rtpHeader) = 0;
|
const WebRtcRTPHeader* rtpHeader) = 0;
|
||||||
|
|
||||||
virtual bool OnRecoveredPacket(const uint8_t* packet,
|
virtual bool OnRecoveredPacket(const uint8_t* packet,
|
||||||
@ -351,7 +351,7 @@ class NullRtpData : public RtpData {
|
|||||||
virtual ~NullRtpData() {}
|
virtual ~NullRtpData() {}
|
||||||
|
|
||||||
int32_t OnReceivedPayloadData(const uint8_t* payloadData,
|
int32_t OnReceivedPayloadData(const uint8_t* payloadData,
|
||||||
const size_t payloadSize,
|
size_t payloadSize,
|
||||||
const WebRtcRTPHeader* rtpHeader) override {
|
const WebRtcRTPHeader* rtpHeader) override {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class MockRtpData : public RtpData {
|
|||||||
public:
|
public:
|
||||||
MOCK_METHOD3(OnReceivedPayloadData,
|
MOCK_METHOD3(OnReceivedPayloadData,
|
||||||
int32_t(const uint8_t* payloadData,
|
int32_t(const uint8_t* payloadData,
|
||||||
const size_t payloadSize,
|
size_t payloadSize,
|
||||||
const WebRtcRTPHeader* rtpHeader));
|
const WebRtcRTPHeader* rtpHeader));
|
||||||
|
|
||||||
MOCK_METHOD2(OnRecoveredPacket,
|
MOCK_METHOD2(OnRecoveredPacket,
|
||||||
@ -168,8 +168,7 @@ class MockRtpRtcp : public RtpRtcp {
|
|||||||
MOCK_METHOD1(SendRTCP, int32_t(RTCPPacketType packetType));
|
MOCK_METHOD1(SendRTCP, int32_t(RTCPPacketType packetType));
|
||||||
MOCK_METHOD1(SendCompoundRTCP,
|
MOCK_METHOD1(SendCompoundRTCP,
|
||||||
int32_t(const std::set<RTCPPacketType>& packetTypes));
|
int32_t(const std::set<RTCPPacketType>& packetTypes));
|
||||||
MOCK_METHOD1(SendRTCPReferencePictureSelection,
|
MOCK_METHOD1(SendRTCPReferencePictureSelection, int32_t(uint64_t pictureID));
|
||||||
int32_t(const uint64_t pictureID));
|
|
||||||
MOCK_METHOD1(SendRTCPSliceLossIndication,
|
MOCK_METHOD1(SendRTCPSliceLossIndication,
|
||||||
int32_t(const uint8_t pictureID));
|
int32_t(const uint8_t pictureID));
|
||||||
MOCK_CONST_METHOD2(DataCountersRTP,
|
MOCK_CONST_METHOD2(DataCountersRTP,
|
||||||
|
|||||||
@ -41,7 +41,7 @@ class VerifyingRtxReceiver : public NullRtpData {
|
|||||||
|
|
||||||
int32_t OnReceivedPayloadData(
|
int32_t OnReceivedPayloadData(
|
||||||
const uint8_t* data,
|
const uint8_t* data,
|
||||||
const size_t size,
|
size_t size,
|
||||||
const webrtc::WebRtcRTPHeader* rtp_header) override {
|
const webrtc::WebRtcRTPHeader* rtp_header) override {
|
||||||
if (!sequence_numbers_.empty())
|
if (!sequence_numbers_.empty())
|
||||||
EXPECT_EQ(kTestSsrc, rtp_header->header.ssrc);
|
EXPECT_EQ(kTestSsrc, rtp_header->header.ssrc);
|
||||||
|
|||||||
@ -69,7 +69,7 @@ bool LoopBackTransport::SendRtcp(const uint8_t* data, size_t len) {
|
|||||||
|
|
||||||
int32_t TestRtpReceiver::OnReceivedPayloadData(
|
int32_t TestRtpReceiver::OnReceivedPayloadData(
|
||||||
const uint8_t* payload_data,
|
const uint8_t* payload_data,
|
||||||
const size_t payload_size,
|
size_t payload_size,
|
||||||
const webrtc::WebRtcRTPHeader* rtp_header) {
|
const webrtc::WebRtcRTPHeader* rtp_header) {
|
||||||
EXPECT_LE(payload_size, sizeof(payload_data_));
|
EXPECT_LE(payload_size, sizeof(payload_data_));
|
||||||
memcpy(payload_data_, payload_data, payload_size);
|
memcpy(payload_data_, payload_data, payload_size);
|
||||||
|
|||||||
@ -55,7 +55,7 @@ class TestRtpReceiver : public NullRtpData {
|
|||||||
public:
|
public:
|
||||||
int32_t OnReceivedPayloadData(
|
int32_t OnReceivedPayloadData(
|
||||||
const uint8_t* payload_data,
|
const uint8_t* payload_data,
|
||||||
const size_t payload_size,
|
size_t payload_size,
|
||||||
const webrtc::WebRtcRTPHeader* rtp_header) override;
|
const webrtc::WebRtcRTPHeader* rtp_header) override;
|
||||||
|
|
||||||
const uint8_t* payload_data() const { return payload_data_; }
|
const uint8_t* payload_data() const { return payload_data_; }
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class VerifyingAudioReceiver : public NullRtpData {
|
|||||||
public:
|
public:
|
||||||
int32_t OnReceivedPayloadData(
|
int32_t OnReceivedPayloadData(
|
||||||
const uint8_t* payloadData,
|
const uint8_t* payloadData,
|
||||||
const size_t payloadSize,
|
size_t payloadSize,
|
||||||
const webrtc::WebRtcRTPHeader* rtpHeader) override {
|
const webrtc::WebRtcRTPHeader* rtpHeader) override {
|
||||||
if (rtpHeader->header.payloadType == 98 ||
|
if (rtpHeader->header.payloadType == 98 ||
|
||||||
rtpHeader->header.payloadType == 99) {
|
rtpHeader->header.payloadType == 99) {
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class RtpDataCallback : public webrtc::NullRtpData {
|
|||||||
|
|
||||||
int32_t OnReceivedPayloadData(
|
int32_t OnReceivedPayloadData(
|
||||||
const uint8_t* payload_data,
|
const uint8_t* payload_data,
|
||||||
const size_t payload_size,
|
size_t payload_size,
|
||||||
const webrtc::WebRtcRTPHeader* rtp_header) override {
|
const webrtc::WebRtcRTPHeader* rtp_header) override {
|
||||||
return vcm_->IncomingPacket(payload_data, payload_size, *rtp_header);
|
return vcm_->IncomingPacket(payload_data, payload_size, *rtp_header);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class VcmPayloadSinkFactory::VcmPayloadSink : public PayloadSinkInterface,
|
|||||||
|
|
||||||
// PayloadSinkInterface
|
// PayloadSinkInterface
|
||||||
int32_t OnReceivedPayloadData(const uint8_t* payload_data,
|
int32_t OnReceivedPayloadData(const uint8_t* payload_data,
|
||||||
const size_t payload_size,
|
size_t payload_size,
|
||||||
const WebRtcRTPHeader* rtp_header) override {
|
const WebRtcRTPHeader* rtp_header) override {
|
||||||
return vcm_->IncomingPacket(payload_data, payload_size, *rtp_header);
|
return vcm_->IncomingPacket(payload_data, payload_size, *rtp_header);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -187,6 +187,8 @@ source_set("test_support") {
|
|||||||
"testsupport/frame_writer.cc",
|
"testsupport/frame_writer.cc",
|
||||||
"testsupport/frame_writer.h",
|
"testsupport/frame_writer.h",
|
||||||
"testsupport/iosfileutils.mm",
|
"testsupport/iosfileutils.mm",
|
||||||
|
"testsupport/metrics/video_metrics.cc",
|
||||||
|
"testsupport/metrics/video_metrics.h",
|
||||||
"testsupport/mock/mock_frame_reader.h",
|
"testsupport/mock/mock_frame_reader.h",
|
||||||
"testsupport/mock/mock_frame_writer.h",
|
"testsupport/mock/mock_frame_writer.h",
|
||||||
"testsupport/packet_reader.cc",
|
"testsupport/packet_reader.cc",
|
||||||
@ -199,11 +201,18 @@ source_set("test_support") {
|
|||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
"../base:gtest_prod",
|
"../base:gtest_prod",
|
||||||
|
"../common_video",
|
||||||
"../system_wrappers",
|
"../system_wrappers",
|
||||||
"//testing/gmock",
|
"//testing/gmock",
|
||||||
"//testing/gtest",
|
"//testing/gtest",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (is_clang) {
|
||||||
|
# Suppress warnings from the Chromium Clang plugin.
|
||||||
|
# See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
|
||||||
|
configs -= [ "//build/config/clang:find_bad_constructs" ]
|
||||||
|
}
|
||||||
|
|
||||||
if (is_ios) {
|
if (is_ios) {
|
||||||
configs += [ "//build/config/compiler:enable_arc" ]
|
configs += [ "//build/config/compiler:enable_arc" ]
|
||||||
}
|
}
|
||||||
@ -272,6 +281,7 @@ test("test_support_unittests") {
|
|||||||
"channel_transport/udp_socket_manager_unittest.cc",
|
"channel_transport/udp_socket_manager_unittest.cc",
|
||||||
"channel_transport/udp_socket_wrapper_unittest.cc",
|
"channel_transport/udp_socket_wrapper_unittest.cc",
|
||||||
"channel_transport/udp_transport_unittest.cc",
|
"channel_transport/udp_transport_unittest.cc",
|
||||||
|
"common_unittest.cc",
|
||||||
"fake_network_pipe_unittest.cc",
|
"fake_network_pipe_unittest.cc",
|
||||||
"frame_generator_unittest.cc",
|
"frame_generator_unittest.cc",
|
||||||
"rtp_file_reader_unittest.cc",
|
"rtp_file_reader_unittest.cc",
|
||||||
@ -280,6 +290,7 @@ test("test_support_unittests") {
|
|||||||
"testsupport/fileutils_unittest.cc",
|
"testsupport/fileutils_unittest.cc",
|
||||||
"testsupport/frame_reader_unittest.cc",
|
"testsupport/frame_reader_unittest.cc",
|
||||||
"testsupport/frame_writer_unittest.cc",
|
"testsupport/frame_writer_unittest.cc",
|
||||||
|
"testsupport/metrics/video_metrics_unittest.cc",
|
||||||
"testsupport/packet_reader_unittest.cc",
|
"testsupport/packet_reader_unittest.cc",
|
||||||
"testsupport/perf_test_unittest.cc",
|
"testsupport/perf_test_unittest.cc",
|
||||||
"testsupport/unittest_utils.h",
|
"testsupport/unittest_utils.h",
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
# be found in the AUTHORS file in the root of the source tree.
|
# be found in the AUTHORS file in the root of the source tree.
|
||||||
|
|
||||||
import("../build/webrtc.gni")
|
import("../build/webrtc.gni")
|
||||||
|
import("//testing/test.gni")
|
||||||
|
|
||||||
source_set("video") {
|
source_set("video") {
|
||||||
sources = [
|
sources = [
|
||||||
@ -79,3 +80,37 @@ source_set("video") {
|
|||||||
"../voice_engine",
|
"../voice_engine",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rtc_include_tests) {
|
||||||
|
# TODO(pbos): Rename test suite.
|
||||||
|
source_set("video_tests") {
|
||||||
|
testonly = true
|
||||||
|
sources = [
|
||||||
|
"call_stats_unittest.cc",
|
||||||
|
"encoder_state_feedback_unittest.cc",
|
||||||
|
"end_to_end_tests.cc",
|
||||||
|
"overuse_frame_detector_unittest.cc",
|
||||||
|
"payload_router_unittest.cc",
|
||||||
|
"report_block_stats_unittest.cc",
|
||||||
|
"send_delay_stats_unittest.cc",
|
||||||
|
"send_statistics_proxy_unittest.cc",
|
||||||
|
"stats_counter_unittest.cc",
|
||||||
|
"stream_synchronization_unittest.cc",
|
||||||
|
"video_capture_input_unittest.cc",
|
||||||
|
"video_decoder_unittest.cc",
|
||||||
|
"video_encoder_unittest.cc",
|
||||||
|
"video_send_stream_tests.cc",
|
||||||
|
"vie_remb_unittest.cc",
|
||||||
|
]
|
||||||
|
deps = [
|
||||||
|
":video",
|
||||||
|
"//testing/gmock",
|
||||||
|
"//testing/gtest",
|
||||||
|
]
|
||||||
|
if (is_clang) {
|
||||||
|
# Suppress warnings from the Chromium Clang plugin.
|
||||||
|
# See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
|
||||||
|
configs -= [ "//build/config/clang:find_bad_constructs" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -226,7 +226,7 @@ RtpReceiver* RtpStreamReceiver::GetRtpReceiver() const {
|
|||||||
|
|
||||||
int32_t RtpStreamReceiver::OnReceivedPayloadData(
|
int32_t RtpStreamReceiver::OnReceivedPayloadData(
|
||||||
const uint8_t* payload_data,
|
const uint8_t* payload_data,
|
||||||
const size_t payload_size,
|
size_t payload_size,
|
||||||
const WebRtcRTPHeader* rtp_header) {
|
const WebRtcRTPHeader* rtp_header) {
|
||||||
RTC_DCHECK(video_receiver_);
|
RTC_DCHECK(video_receiver_);
|
||||||
WebRtcRTPHeader rtp_header_with_ntp = *rtp_header;
|
WebRtcRTPHeader rtp_header_with_ntp = *rtp_header;
|
||||||
|
|||||||
@ -85,7 +85,7 @@ class RtpStreamReceiver : public RtpData, public RtpFeedback,
|
|||||||
|
|
||||||
// Implements RtpData.
|
// Implements RtpData.
|
||||||
int32_t OnReceivedPayloadData(const uint8_t* payload_data,
|
int32_t OnReceivedPayloadData(const uint8_t* payload_data,
|
||||||
const size_t payload_size,
|
size_t payload_size,
|
||||||
const WebRtcRTPHeader* rtp_header) override;
|
const WebRtcRTPHeader* rtp_header) override;
|
||||||
bool OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override;
|
bool OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override;
|
||||||
|
|
||||||
|
|||||||
@ -2118,7 +2118,7 @@ class Vp9HeaderObserver : public test::SendTest {
|
|||||||
EXPECT_TRUE(vp9.spatial_layer_resolution_present); // Y:1
|
EXPECT_TRUE(vp9.spatial_layer_resolution_present); // Y:1
|
||||||
size_t expected_width = encoder_config_.streams[0].width;
|
size_t expected_width = encoder_config_.streams[0].width;
|
||||||
size_t expected_height = encoder_config_.streams[0].height;
|
size_t expected_height = encoder_config_.streams[0].height;
|
||||||
for (int i = vp9.num_spatial_layers - 1; i >= 0; --i) {
|
for (int i = static_cast<int>(vp9.num_spatial_layers) - 1; i >= 0; --i) {
|
||||||
EXPECT_EQ(expected_width, vp9.width[i]); // WIDTH
|
EXPECT_EQ(expected_width, vp9.width[i]); // WIDTH
|
||||||
EXPECT_EQ(expected_height, vp9.height[i]); // HEIGHT
|
EXPECT_EQ(expected_height, vp9.height[i]); // HEIGHT
|
||||||
expected_width /= 2;
|
expected_width /= 2;
|
||||||
|
|||||||
Reference in New Issue
Block a user