Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(551)

Unified Diff: webrtc/video/video_send_stream_tests.cc

Issue 2304363002: Let ViEEncoder express resolution requests as Sinkwants (Closed)
Patch Set: Add test for VideoSendStream video orientation extension Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/video/video_send_stream_tests.cc
diff --git a/webrtc/video/video_send_stream_tests.cc b/webrtc/video/video_send_stream_tests.cc
index f729654cc7adac4792202af04476cafb6dba36d8..d80507aa010827f53905597a7f535794f8a2858e 100644
--- a/webrtc/video/video_send_stream_tests.cc
+++ b/webrtc/video/video_send_stream_tests.cc
@@ -57,6 +57,8 @@ class VideoSendStreamTest : public test::CallTest {
void TestVp9NonFlexMode(uint8_t num_temporal_layers,
uint8_t num_spatial_layers);
+
+ void TestRequestSourceRotateVideo(bool support_orientation_ext);
};
TEST_F(VideoSendStreamTest, CanStartStartedStream) {
@@ -1656,7 +1658,8 @@ TEST_F(VideoSendStreamTest, CapturesTextureAndVideoFrames) {
video_send_stream_->Start();
test::FrameForwarder forwarder;
- video_send_stream_->SetSource(&forwarder);
+ video_send_stream_->SetSource(
+ &forwarder, VideoSendStream::DegradationPreference::kBalanced);
for (size_t i = 0; i < input_frames.size(); i++) {
forwarder.IncomingCapturedFrame(input_frames[i]);
// Wait until the output frame is received before sending the next input
@@ -1664,7 +1667,8 @@ TEST_F(VideoSendStreamTest, CapturesTextureAndVideoFrames) {
observer.WaitOutputFrame();
}
video_send_stream_->Stop();
- video_send_stream_->SetSource(nullptr);
+ video_send_stream_->SetSource(
+ nullptr, VideoSendStream::DegradationPreference::kBalanced);
// Test if the input and output frames are the same. render_time_ms and
// timestamp are not compared because capturer sets those values.
@@ -2879,4 +2883,37 @@ TEST_F(VideoSendStreamTest, Vp9FlexModeRefCount) {
}
#endif // !defined(RTC_DISABLE_VP9)
+void VideoSendStreamTest::TestRequestSourceRotateVideo(
+ bool support_orientation_ext) {
+ CreateSenderCall(Call::Config(&event_log_));
+
+ test::NullTransport transport;
+ CreateSendConfig(1, 0, &transport);
+ video_send_config_.rtp.extensions.clear();
+ if (support_orientation_ext) {
+ video_send_config_.rtp.extensions.push_back(
+ RtpExtension(RtpExtension::kVideoRotationUri, 1));
+ }
+
+ CreateVideoStreams();
+ test::FrameForwarder forwarder;
+ video_send_stream_->SetSource(
+ &forwarder, VideoSendStream::DegradationPreference::kBalanced);
+
+ EXPECT_TRUE(forwarder.sink_wants().rotation_applied !=
+ support_orientation_ext);
+
+ DestroyStreams();
+}
+
+TEST_F(VideoSendStreamTest,
+ RequestSourceRotateIfVideoOrientationExtensionNotSupported) {
+ TestRequestSourceRotateVideo(false);
+}
+
+TEST_F(VideoSendStreamTest,
+ DoNotRequestsRotationIfVideoOrientationExtensionSupported) {
+ TestRequestSourceRotateVideo(true);
+}
åsapersson 2016/11/01 08:04:55 Maybe also add a test that verifies the rtp header
perkj_webrtc 2016/11/01 18:00:41 ok, I did not add VideoRotation but I guess it doe
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698