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

Side by Side Diff: talk/app/webrtc/test/peerconnectiontestwrapper.cc

Issue 1236023010: In PeerConnectionTestWrapper, put audio input on a separate thread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing potential deadlock in FakeAudioCaptureModule, caused by unnecessary call to Thread::Send Created 5 years, 5 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 | « talk/app/webrtc/test/peerconnectiontestwrapper.h ('k') | no next file » | 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 * libjingle 2 * libjingle
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 PeerConnectionTestWrapper::~PeerConnectionTestWrapper() {} 69 PeerConnectionTestWrapper::~PeerConnectionTestWrapper() {}
70 70
71 bool PeerConnectionTestWrapper::CreatePc( 71 bool PeerConnectionTestWrapper::CreatePc(
72 const MediaConstraintsInterface* constraints) { 72 const MediaConstraintsInterface* constraints) {
73 allocator_factory_ = webrtc::FakePortAllocatorFactory::Create(); 73 allocator_factory_ = webrtc::FakePortAllocatorFactory::Create();
74 if (!allocator_factory_) { 74 if (!allocator_factory_) {
75 return false; 75 return false;
76 } 76 }
77 77
78 media_input_thread_.reset(new rtc::Thread());
79 if (!media_input_thread_->Start()) {
80 return false;
81 }
82
78 fake_audio_capture_module_ = FakeAudioCaptureModule::Create( 83 fake_audio_capture_module_ = FakeAudioCaptureModule::Create(
79 rtc::Thread::Current()); 84 media_input_thread_.get());
pthatcher1 2015/07/23 17:13:18 I'd call it audio_capture_thread_ until we do some
80 if (fake_audio_capture_module_ == NULL) { 85 if (fake_audio_capture_module_ == NULL) {
81 return false; 86 return false;
82 } 87 }
83 88
84 peer_connection_factory_ = webrtc::CreatePeerConnectionFactory( 89 peer_connection_factory_ = webrtc::CreatePeerConnectionFactory(
85 rtc::Thread::Current(), rtc::Thread::Current(), 90 rtc::Thread::Current(), rtc::Thread::Current(),
86 fake_audio_capture_module_, NULL, NULL); 91 fake_audio_capture_module_, NULL, NULL);
87 if (!peer_connection_factory_) { 92 if (!peer_connection_factory_) {
88 return false; 93 return false;
89 } 94 }
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 peer_connection_factory_->CreateVideoSource( 293 peer_connection_factory_->CreateVideoSource(
289 new webrtc::FakePeriodicVideoCapturer(), &constraints); 294 new webrtc::FakePeriodicVideoCapturer(), &constraints);
290 std::string videotrack_label = label + kVideoTrackLabelBase; 295 std::string videotrack_label = label + kVideoTrackLabelBase;
291 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track( 296 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track(
292 peer_connection_factory_->CreateVideoTrack(videotrack_label, source)); 297 peer_connection_factory_->CreateVideoTrack(videotrack_label, source));
293 298
294 stream->AddTrack(video_track); 299 stream->AddTrack(video_track);
295 } 300 }
296 return stream; 301 return stream;
297 } 302 }
OLDNEW
« no previous file with comments | « talk/app/webrtc/test/peerconnectiontestwrapper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698