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

Unified Diff: webrtc/media/engine/webrtcvideoengine2_unittest.cc

Issue 1757853002: Make sure rotation is not applied by the capturer if the CVO exenstion is set before the send strea… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 months 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
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvideoengine2_unittest.cc
diff --git a/webrtc/media/engine/webrtcvideoengine2_unittest.cc b/webrtc/media/engine/webrtcvideoengine2_unittest.cc
index ea8a300395121671af007f2dbdd74b41187114aa..3879a4002b741dd7a4deb60e4fe28bd2599db0a1 100644
--- a/webrtc/media/engine/webrtcvideoengine2_unittest.cc
+++ b/webrtc/media/engine/webrtcvideoengine2_unittest.cc
@@ -8,8 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifdef HAVE_WEBRTC_VIDEO
-
#include <algorithm>
#include <map>
#include <memory>
@@ -253,6 +251,32 @@ TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionBeforeCapturer) {
EXPECT_TRUE(capturer.GetApplyRotation());
}
+TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionBeforeAddSendStream) {
+ // Allocate the capturer first to prevent early destruction before channel's
+ // dtor is called.
+ cricket::FakeVideoCapturer capturer;
+
+ cricket::FakeWebRtcVideoEncoderFactory encoder_factory;
+ encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8, "VP8");
+ cricket::VideoSendParameters parameters;
+ parameters.codecs.push_back(kVp8Codec);
+
+ std::unique_ptr<VideoMediaChannel> channel(
+ SetUpForExternalEncoderFactory(&encoder_factory, parameters.codecs));
+ // Add CVO extension.
+ const int id = 1;
+ parameters.extensions.push_back(
+ cricket::RtpHeaderExtension(kRtpVideoRotationHeaderExtension, id));
+ EXPECT_TRUE(channel->SetSendParameters(parameters));
+ EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(kSsrc)));
+
+ // Set capturer.
+ EXPECT_TRUE(channel->SetCapturer(kSsrc, &capturer));
+
+ // Verify capturer has turned off applying rotation.
+ EXPECT_FALSE(capturer.GetApplyRotation());
+}
+
TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionAfterCapturer) {
cricket::FakeVideoCapturer capturer;
@@ -3188,4 +3212,3 @@ TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
}
} // namespace cricket
-#endif // HAVE_WEBRTC_VIDEO
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698