| OLD | NEW |
| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 VideoSinkWants wants1; | 128 VideoSinkWants wants1; |
| 129 wants1.black_frames = true; | 129 wants1.black_frames = true; |
| 130 broadcaster.AddOrUpdateSink(&sink1, wants1); | 130 broadcaster.AddOrUpdateSink(&sink1, wants1); |
| 131 | 131 |
| 132 FakeVideoRenderer sink2; | 132 FakeVideoRenderer sink2; |
| 133 VideoSinkWants wants2; | 133 VideoSinkWants wants2; |
| 134 wants1.black_frames = false; | 134 wants1.black_frames = false; |
| 135 broadcaster.AddOrUpdateSink(&sink2, wants2); | 135 broadcaster.AddOrUpdateSink(&sink2, wants2); |
| 136 | 136 |
| 137 cricket::WebRtcVideoFrame frame1; | 137 cricket::WebRtcVideoFrame frame1; |
| 138 frame1.InitToBlack(100, 200, 10000 /*ts*/); | 138 frame1.InitToBlack(100, 200, 10 /*ts*/); |
| 139 // Make it not all-black | 139 // Make it not all-black |
| 140 frame1.GetUPlane()[0] = 0; | 140 frame1.GetUPlane()[0] = 0; |
| 141 broadcaster.OnFrame(frame1); | 141 broadcaster.OnFrame(frame1); |
| 142 EXPECT_TRUE(sink1.black_frame()); | 142 EXPECT_TRUE(sink1.black_frame()); |
| 143 EXPECT_EQ(10000, sink1.timestamp()); | 143 EXPECT_EQ(10, sink1.timestamp()); |
| 144 EXPECT_FALSE(sink2.black_frame()); | 144 EXPECT_FALSE(sink2.black_frame()); |
| 145 EXPECT_EQ(10000, sink2.timestamp()); | 145 EXPECT_EQ(10, sink2.timestamp()); |
| 146 | 146 |
| 147 // Switch the sink wants. | 147 // Switch the sink wants. |
| 148 wants1.black_frames = false; | 148 wants1.black_frames = false; |
| 149 broadcaster.AddOrUpdateSink(&sink1, wants1); | 149 broadcaster.AddOrUpdateSink(&sink1, wants1); |
| 150 wants2.black_frames = true; | 150 wants2.black_frames = true; |
| 151 broadcaster.AddOrUpdateSink(&sink2, wants2); | 151 broadcaster.AddOrUpdateSink(&sink2, wants2); |
| 152 | 152 |
| 153 cricket::WebRtcVideoFrame frame2; | 153 cricket::WebRtcVideoFrame frame2; |
| 154 frame2.InitToBlack(100, 200, 30000 /*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(30000, sink1.timestamp()); | 159 EXPECT_EQ(30, sink1.timestamp()); |
| 160 EXPECT_TRUE(sink2.black_frame()); | 160 EXPECT_TRUE(sink2.black_frame()); |
| 161 EXPECT_EQ(30000, sink2.timestamp()); | 161 EXPECT_EQ(30, sink2.timestamp()); |
| 162 } | 162 } |
| OLD | NEW |