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

Side by Side Diff: webrtc/media/base/videoengine_unittest.h

Issue 2469993003: Remove WebRtcVideoSendStream2::VideoSink inheritance. Remove sending black frame on source remova… (Closed)
Patch Set: Rebased Created 3 years, 11 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/engine/webrtcvideoengine2.h » ('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 (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 EXPECT_TRUE(SetSend(true)); 823 EXPECT_TRUE(SetSend(true));
824 EXPECT_TRUE(channel_->SetSink(kDefaultReceiveSsrc, &renderer_)); 824 EXPECT_TRUE(channel_->SetSink(kDefaultReceiveSsrc, &renderer_));
825 EXPECT_EQ(0, renderer_.num_rendered_frames()); 825 EXPECT_EQ(0, renderer_.num_rendered_frames());
826 EXPECT_TRUE(SendFrame()); 826 EXPECT_TRUE(SendFrame());
827 EXPECT_FRAME_WAIT(1, kVideoWidth, kVideoHeight, kTimeout); 827 EXPECT_FRAME_WAIT(1, kVideoWidth, kVideoHeight, kTimeout);
828 // Wait for one frame so they don't get dropped because we send frames too 828 // Wait for one frame so they don't get dropped because we send frames too
829 // tightly. 829 // tightly.
830 rtc::Thread::Current()->ProcessMessages(30); 830 rtc::Thread::Current()->ProcessMessages(30);
831 // Remove the capturer. 831 // Remove the capturer.
832 EXPECT_TRUE(channel_->SetVideoSend(kSsrc, true, nullptr, nullptr)); 832 EXPECT_TRUE(channel_->SetVideoSend(kSsrc, true, nullptr, nullptr));
833 // Wait for one black frame for removing the capturer.
834 EXPECT_FRAME_WAIT(2, kVideoWidth, kVideoHeight, kTimeout);
835 833
836 // No capturer was added, so this SetVideoSend shouldn't do anything. 834 // No capturer was added, so this SetVideoSend shouldn't do anything.
837 EXPECT_TRUE(channel_->SetVideoSend(kSsrc, true, nullptr, nullptr)); 835 EXPECT_TRUE(channel_->SetVideoSend(kSsrc, true, nullptr, nullptr));
838 rtc::Thread::Current()->ProcessMessages(300); 836 rtc::Thread::Current()->ProcessMessages(300);
839 // Verify no more frames were sent. 837 // Verify no more frames were sent.
840 EXPECT_EQ(2, renderer_.num_rendered_frames()); 838 EXPECT_EQ(1, renderer_.num_rendered_frames());
841 } 839 }
842 840
843 // Tests that we can add and remove capturer as unique sources. 841 // Tests that we can add and remove capturer as unique sources.
844 void AddRemoveCapturerMultipleSources() { 842 void AddRemoveCapturerMultipleSources() {
845 // WebRTC implementation will drop frames if pushed to quickly. Wait the 843 // WebRTC implementation will drop frames if pushed to quickly. Wait the
846 // interval time to avoid that. 844 // interval time to avoid that.
847 // WebRTC implementation will drop frames if pushed to quickly. Wait the 845 // WebRTC implementation will drop frames if pushed to quickly. Wait the
848 // interval time to avoid that. 846 // interval time to avoid that.
849 // Set up the stream associated with the engine. 847 // Set up the stream associated with the engine.
850 EXPECT_TRUE(channel_->AddRecvStream( 848 EXPECT_TRUE(channel_->AddRecvStream(
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 std::unique_ptr<C> channel_; 938 std::unique_ptr<C> channel_;
941 cricket::FakeNetworkInterface network_interface_; 939 cricket::FakeNetworkInterface network_interface_;
942 cricket::FakeVideoRenderer renderer_; 940 cricket::FakeVideoRenderer renderer_;
943 cricket::VideoMediaChannel::Error media_error_; 941 cricket::VideoMediaChannel::Error media_error_;
944 942
945 // Used by test cases where 2 streams are run on the same channel. 943 // Used by test cases where 2 streams are run on the same channel.
946 cricket::FakeVideoRenderer renderer2_; 944 cricket::FakeVideoRenderer renderer2_;
947 }; 945 };
948 946
949 #endif // WEBRTC_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_ NOLINT 947 #endif // WEBRTC_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_ NOLINT
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvideoengine2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698