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

Side by Side Diff: webrtc/media/base/videobroadcaster_unittest.cc

Issue 1807673008: Revert of Change VideoCapture_apply_rotation default to false (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/media/base/videocapturer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 EXPECT_EQ(2, sink2.num_rendered_frames()); 51 EXPECT_EQ(2, sink2.num_rendered_frames());
52 52
53 broadcaster.AddOrUpdateSink(&sink1, rtc::VideoSinkWants()); 53 broadcaster.AddOrUpdateSink(&sink1, rtc::VideoSinkWants());
54 broadcaster.OnFrame(frame); 54 broadcaster.OnFrame(frame);
55 EXPECT_EQ(2, sink1.num_rendered_frames()); 55 EXPECT_EQ(2, sink1.num_rendered_frames());
56 EXPECT_EQ(3, sink2.num_rendered_frames()); 56 EXPECT_EQ(3, sink2.num_rendered_frames());
57 } 57 }
58 58
59 TEST(VideoBroadcasterTest, AppliesRotationIfAnySinkWantsRotationApplied) { 59 TEST(VideoBroadcasterTest, AppliesRotationIfAnySinkWantsRotationApplied) {
60 VideoBroadcaster broadcaster; 60 VideoBroadcaster broadcaster;
61 EXPECT_FALSE(broadcaster.wants().rotation_applied); 61 EXPECT_TRUE(broadcaster.wants().rotation_applied);
62 62
63 FakeVideoRenderer sink1; 63 FakeVideoRenderer sink1;
64 VideoSinkWants wants1; 64 VideoSinkWants wants1;
65 wants1.rotation_applied = false; 65 wants1.rotation_applied = false;
66 66
67 broadcaster.AddOrUpdateSink(&sink1, wants1); 67 broadcaster.AddOrUpdateSink(&sink1, wants1);
68 EXPECT_FALSE(broadcaster.wants().rotation_applied); 68 EXPECT_FALSE(broadcaster.wants().rotation_applied);
69 69
70 FakeVideoRenderer sink2; 70 FakeVideoRenderer sink2;
71 VideoSinkWants wants2; 71 VideoSinkWants wants2;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 cricket::WebRtcVideoFrame frame2; 153 cricket::WebRtcVideoFrame frame2;
154 frame2.InitToBlack(100, 200, 30 /*ts*/); 154 frame2.InitToBlack(100, 200, 30 /*ts*/);
155 // Make it not all-black 155 // Make it not all-black
156 frame2.GetUPlane()[0] = 0; 156 frame2.GetUPlane()[0] = 0;
157 broadcaster.OnFrame(frame2); 157 broadcaster.OnFrame(frame2);
158 EXPECT_FALSE(sink1.black_frame()); 158 EXPECT_FALSE(sink1.black_frame());
159 EXPECT_EQ(30, sink1.timestamp()); 159 EXPECT_EQ(30, sink1.timestamp());
160 EXPECT_TRUE(sink2.black_frame()); 160 EXPECT_TRUE(sink2.black_frame());
161 EXPECT_EQ(30, sink2.timestamp()); 161 EXPECT_EQ(30, sink2.timestamp());
162 } 162 }
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/base/videocapturer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698