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

Side by Side Diff: webrtc/pc/peerconnectioninterface_unittest.cc

Issue 2989113002: Reland of Change VideoTrack implementation to invoke VideoTrackSourceInterface::AddOrUpdateSink on … (Closed)
Patch Set: Readd default implementation of AddSink and RemoveSink. Created 3 years, 4 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 | « webrtc/pc/peerconnectionfactory.cc ('k') | webrtc/pc/rtcstatscollector_unittest.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 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 for (int j = 0; j < tracks_per_stream; ++j) { 453 for (int j = 0; j < tracks_per_stream; ++j) {
454 // Add a local audio track. 454 // Add a local audio track.
455 rtc::scoped_refptr<webrtc::AudioTrackInterface> audio_track( 455 rtc::scoped_refptr<webrtc::AudioTrackInterface> audio_track(
456 webrtc::AudioTrack::Create(kAudioTracks[i * tracks_per_stream + j], 456 webrtc::AudioTrack::Create(kAudioTracks[i * tracks_per_stream + j],
457 nullptr)); 457 nullptr));
458 stream->AddTrack(audio_track); 458 stream->AddTrack(audio_track);
459 459
460 // Add a local video track. 460 // Add a local video track.
461 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track( 461 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track(
462 webrtc::VideoTrack::Create(kVideoTracks[i * tracks_per_stream + j], 462 webrtc::VideoTrack::Create(kVideoTracks[i * tracks_per_stream + j],
463 webrtc::FakeVideoTrackSource::Create())); 463 webrtc::FakeVideoTrackSource::Create(),
464 rtc::Thread::Current()));
464 stream->AddTrack(video_track); 465 stream->AddTrack(video_track);
465 } 466 }
466 467
467 local_collection->AddStream(stream); 468 local_collection->AddStream(stream);
468 } 469 }
469 return local_collection; 470 return local_collection;
470 } 471 }
471 472
472 // Check equality of StreamCollections. 473 // Check equality of StreamCollections.
473 bool CompareStreamCollections(StreamCollectionInterface* s1, 474 bool CompareStreamCollections(StreamCollectionInterface* s1,
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 MediaStreamInterface* stream) { 1144 MediaStreamInterface* stream) {
1144 rtc::scoped_refptr<webrtc::AudioTrackInterface> audio_track( 1145 rtc::scoped_refptr<webrtc::AudioTrackInterface> audio_track(
1145 webrtc::AudioTrack::Create(track_id, nullptr)); 1146 webrtc::AudioTrack::Create(track_id, nullptr));
1146 ASSERT_TRUE(stream->AddTrack(audio_track)); 1147 ASSERT_TRUE(stream->AddTrack(audio_track));
1147 } 1148 }
1148 1149
1149 void AddVideoTrack(const std::string& track_id, 1150 void AddVideoTrack(const std::string& track_id,
1150 MediaStreamInterface* stream) { 1151 MediaStreamInterface* stream) {
1151 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track( 1152 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track(
1152 webrtc::VideoTrack::Create(track_id, 1153 webrtc::VideoTrack::Create(track_id,
1153 webrtc::FakeVideoTrackSource::Create())); 1154 webrtc::FakeVideoTrackSource::Create(),
1155 rtc::Thread::Current()));
1154 ASSERT_TRUE(stream->AddTrack(video_track)); 1156 ASSERT_TRUE(stream->AddTrack(video_track));
1155 } 1157 }
1156 1158
1157 std::unique_ptr<SessionDescriptionInterface> CreateOfferWithOneAudioStream() { 1159 std::unique_ptr<SessionDescriptionInterface> CreateOfferWithOneAudioStream() {
1158 CreatePeerConnectionWithoutDtls(); 1160 CreatePeerConnectionWithoutDtls();
1159 AddVoiceStream(kStreamLabel1); 1161 AddVoiceStream(kStreamLabel1);
1160 std::unique_ptr<SessionDescriptionInterface> offer; 1162 std::unique_ptr<SessionDescriptionInterface> offer;
1161 EXPECT_TRUE(DoCreateOffer(&offer, nullptr)); 1163 EXPECT_TRUE(DoCreateOffer(&offer, nullptr));
1162 return offer; 1164 return offer;
1163 } 1165 }
(...skipping 2647 matching lines...) Expand 10 before | Expand all | Expand 10 after
3811 observer_.renegotiation_needed_ = false; 3813 observer_.renegotiation_needed_ = false;
3812 3814
3813 stream->RemoveTrack(audio_track); 3815 stream->RemoveTrack(audio_track);
3814 EXPECT_TRUE_WAIT(observer_.renegotiation_needed_, kTimeout); 3816 EXPECT_TRUE_WAIT(observer_.renegotiation_needed_, kTimeout);
3815 observer_.renegotiation_needed_ = false; 3817 observer_.renegotiation_needed_ = false;
3816 3818
3817 stream->RemoveTrack(video_track); 3819 stream->RemoveTrack(video_track);
3818 EXPECT_TRUE_WAIT(observer_.renegotiation_needed_, kTimeout); 3820 EXPECT_TRUE_WAIT(observer_.renegotiation_needed_, kTimeout);
3819 observer_.renegotiation_needed_ = false; 3821 observer_.renegotiation_needed_ = false;
3820 } 3822 }
OLDNEW
« no previous file with comments | « webrtc/pc/peerconnectionfactory.cc ('k') | webrtc/pc/rtcstatscollector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698