OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 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 |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "webrtc/pc/channel.h" | 13 #include "webrtc/pc/channel.h" |
14 | 14 |
15 #include "webrtc/api/call/audio_sink.h" | 15 #include "webrtc/api/call/audio_sink.h" |
16 #include "webrtc/base/bind.h" | 16 #include "webrtc/base/bind.h" |
17 #include "webrtc/base/byteorder.h" | 17 #include "webrtc/base/byteorder.h" |
18 #include "webrtc/base/checks.h" | 18 #include "webrtc/base/checks.h" |
19 #include "webrtc/base/copyonwritebuffer.h" | 19 #include "webrtc/base/copyonwritebuffer.h" |
20 #include "webrtc/base/dscp.h" | 20 #include "webrtc/base/dscp.h" |
21 #include "webrtc/base/logging.h" | 21 #include "webrtc/base/logging.h" |
22 #include "webrtc/base/networkroute.h" | 22 #include "webrtc/base/networkroute.h" |
23 #include "webrtc/base/trace_event.h" | 23 #include "webrtc/base/trace_event.h" |
24 #include "webrtc/media/base/mediaconstants.h" | 24 #include "webrtc/media/base/mediaconstants.h" |
25 #include "webrtc/media/base/rtputils.h" | 25 #include "webrtc/media/base/rtputils.h" |
26 #include "webrtc/media/engine/webrtcvoiceengine.h" | 26 // Adding 'nogncheck' to disable the gn include headers check to support modular |
| 27 // WebRTC build targets. |
| 28 #include "webrtc/media/engine/webrtcvoiceengine.h" // nogncheck |
27 #include "webrtc/p2p/base/packettransportinternal.h" | 29 #include "webrtc/p2p/base/packettransportinternal.h" |
28 #include "webrtc/pc/channelmanager.h" | 30 #include "webrtc/pc/channelmanager.h" |
29 | 31 |
30 namespace cricket { | 32 namespace cricket { |
31 using rtc::Bind; | 33 using rtc::Bind; |
32 | 34 |
33 namespace { | 35 namespace { |
34 // See comment below for why we need to use a pointer to a unique_ptr. | 36 // See comment below for why we need to use a pointer to a unique_ptr. |
35 bool SetRawAudioSink_w(VoiceMediaChannel* channel, | 37 bool SetRawAudioSink_w(VoiceMediaChannel* channel, |
36 uint32_t ssrc, | 38 uint32_t ssrc, |
(...skipping 1531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1568 return media_channel()->SetRtpReceiveParameters(ssrc, parameters); | 1570 return media_channel()->SetRtpReceiveParameters(ssrc, parameters); |
1569 } | 1571 } |
1570 | 1572 |
1571 bool VoiceChannel::GetStats(VoiceMediaInfo* stats) { | 1573 bool VoiceChannel::GetStats(VoiceMediaInfo* stats) { |
1572 return InvokeOnWorker<bool>(RTC_FROM_HERE, Bind(&VoiceMediaChannel::GetStats, | 1574 return InvokeOnWorker<bool>(RTC_FROM_HERE, Bind(&VoiceMediaChannel::GetStats, |
1573 media_channel(), stats)); | 1575 media_channel(), stats)); |
1574 } | 1576 } |
1575 | 1577 |
1576 std::vector<webrtc::RtpSource> VoiceChannel::GetSources(uint32_t ssrc) const { | 1578 std::vector<webrtc::RtpSource> VoiceChannel::GetSources(uint32_t ssrc) const { |
1577 return worker_thread()->Invoke<std::vector<webrtc::RtpSource>>( | 1579 return worker_thread()->Invoke<std::vector<webrtc::RtpSource>>( |
1578 RTC_FROM_HERE, | 1580 RTC_FROM_HERE, Bind(&VoiceChannel::GetSources_w, this, ssrc)); |
1579 Bind(&WebRtcVoiceMediaChannel::GetSources, | 1581 } |
1580 static_cast<WebRtcVoiceMediaChannel*>(media_channel()), ssrc)); | 1582 |
| 1583 std::vector<webrtc::RtpSource> VoiceChannel::GetSources_w(uint32_t ssrc) const { |
| 1584 RTC_DCHECK(worker_thread()->IsCurrent()); |
| 1585 return media_channel()->GetSources(ssrc); |
1581 } | 1586 } |
1582 | 1587 |
1583 void VoiceChannel::StartMediaMonitor(int cms) { | 1588 void VoiceChannel::StartMediaMonitor(int cms) { |
1584 media_monitor_.reset(new VoiceMediaMonitor(media_channel(), worker_thread(), | 1589 media_monitor_.reset(new VoiceMediaMonitor(media_channel(), worker_thread(), |
1585 rtc::Thread::Current())); | 1590 rtc::Thread::Current())); |
1586 media_monitor_->SignalUpdate.connect( | 1591 media_monitor_->SignalUpdate.connect( |
1587 this, &VoiceChannel::OnMediaMonitorUpdate); | 1592 this, &VoiceChannel::OnMediaMonitorUpdate); |
1588 media_monitor_->Start(cms); | 1593 media_monitor_->Start(cms); |
1589 } | 1594 } |
1590 | 1595 |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2370 | 2375 |
2371 void RtpDataChannel::OnDataChannelReadyToSend(bool writable) { | 2376 void RtpDataChannel::OnDataChannelReadyToSend(bool writable) { |
2372 // This is usded for congestion control to indicate that the stream is ready | 2377 // This is usded for congestion control to indicate that the stream is ready |
2373 // to send by the MediaChannel, as opposed to OnReadyToSend, which indicates | 2378 // to send by the MediaChannel, as opposed to OnReadyToSend, which indicates |
2374 // that the transport channel is ready. | 2379 // that the transport channel is ready. |
2375 signaling_thread()->Post(RTC_FROM_HERE, this, MSG_READYTOSENDDATA, | 2380 signaling_thread()->Post(RTC_FROM_HERE, this, MSG_READYTOSENDDATA, |
2376 new DataChannelReadyToSendMessageData(writable)); | 2381 new DataChannelReadyToSendMessageData(writable)); |
2377 } | 2382 } |
2378 | 2383 |
2379 } // namespace cricket | 2384 } // namespace cricket |
OLD | NEW |