OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 1837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1848 playout_ = playout; | 1848 playout_ = playout; |
1849 return true; | 1849 return true; |
1850 } | 1850 } |
1851 | 1851 |
1852 void WebRtcVoiceMediaChannel::SetSend(bool send) { | 1852 void WebRtcVoiceMediaChannel::SetSend(bool send) { |
1853 TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::SetSend"); | 1853 TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::SetSend"); |
1854 if (send_ == send) { | 1854 if (send_ == send) { |
1855 return; | 1855 return; |
1856 } | 1856 } |
1857 | 1857 |
1858 // Apply channel specific options when channel is enabled for sending. | 1858 // Apply channel specific options, and initialize the ADM for recording (this |
| 1859 // may take time on some platforms, e.g. Android). |
1859 if (send) { | 1860 if (send) { |
1860 engine()->ApplyOptions(options_); | 1861 engine()->ApplyOptions(options_); |
| 1862 |
| 1863 // InitRecording() may return an error if the ADM is already recording. |
| 1864 if (!engine()->adm()->RecordingIsInitialized() && |
| 1865 !engine()->adm()->Recording()) { |
| 1866 if (engine()->adm()->InitRecording() != 0) { |
| 1867 LOG(LS_WARNING) << "Failed to initialize recording"; |
| 1868 } |
| 1869 } |
1861 } | 1870 } |
1862 | 1871 |
1863 // Change the settings on each send channel. | 1872 // Change the settings on each send channel. |
1864 for (auto& kv : send_streams_) { | 1873 for (auto& kv : send_streams_) { |
1865 kv.second->SetSend(send); | 1874 kv.second->SetSend(send); |
1866 } | 1875 } |
1867 | 1876 |
1868 send_ = send; | 1877 send_ = send; |
1869 } | 1878 } |
1870 | 1879 |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2556 } | 2565 } |
2557 } else { | 2566 } else { |
2558 LOG(LS_INFO) << "Stopping playout for channel #" << channel; | 2567 LOG(LS_INFO) << "Stopping playout for channel #" << channel; |
2559 engine()->voe()->base()->StopPlayout(channel); | 2568 engine()->voe()->base()->StopPlayout(channel); |
2560 } | 2569 } |
2561 return true; | 2570 return true; |
2562 } | 2571 } |
2563 } // namespace cricket | 2572 } // namespace cricket |
2564 | 2573 |
2565 #endif // HAVE_WEBRTC_VOICE | 2574 #endif // HAVE_WEBRTC_VOICE |
OLD | NEW |