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" | |
27 #include "webrtc/p2p/base/packettransportinternal.h" | 26 #include "webrtc/p2p/base/packettransportinternal.h" |
28 #include "webrtc/pc/channelmanager.h" | 27 #include "webrtc/pc/channelmanager.h" |
29 | 28 |
30 namespace cricket { | 29 namespace cricket { |
31 using rtc::Bind; | 30 using rtc::Bind; |
32 | 31 |
33 namespace { | 32 namespace { |
34 // See comment below for why we need to use a pointer to a unique_ptr. | 33 // See comment below for why we need to use a pointer to a unique_ptr. |
35 bool SetRawAudioSink_w(VoiceMediaChannel* channel, | 34 bool SetRawAudioSink_w(VoiceMediaChannel* channel, |
36 uint32_t ssrc, | 35 uint32_t ssrc, |
(...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1657 bool VoiceChannel::SetRtpReceiveParameters_w(uint32_t ssrc, | 1656 bool VoiceChannel::SetRtpReceiveParameters_w(uint32_t ssrc, |
1658 webrtc::RtpParameters parameters) { | 1657 webrtc::RtpParameters parameters) { |
1659 return media_channel()->SetRtpReceiveParameters(ssrc, parameters); | 1658 return media_channel()->SetRtpReceiveParameters(ssrc, parameters); |
1660 } | 1659 } |
1661 | 1660 |
1662 bool VoiceChannel::GetStats(VoiceMediaInfo* stats) { | 1661 bool VoiceChannel::GetStats(VoiceMediaInfo* stats) { |
1663 return InvokeOnWorker(RTC_FROM_HERE, Bind(&VoiceMediaChannel::GetStats, | 1662 return InvokeOnWorker(RTC_FROM_HERE, Bind(&VoiceMediaChannel::GetStats, |
1664 media_channel(), stats)); | 1663 media_channel(), stats)); |
1665 } | 1664 } |
1666 | 1665 |
1667 std::vector<webrtc::RtpSource> VoiceChannel::GetSources(uint32_t ssrc) const { | |
1668 return worker_thread()->Invoke<std::vector<webrtc::RtpSource>>( | |
1669 RTC_FROM_HERE, | |
1670 Bind(&WebRtcVoiceMediaChannel::GetSources, | |
1671 static_cast<WebRtcVoiceMediaChannel*>(media_channel()), ssrc)); | |
1672 } | |
1673 | |
1674 void VoiceChannel::StartMediaMonitor(int cms) { | 1666 void VoiceChannel::StartMediaMonitor(int cms) { |
1675 media_monitor_.reset(new VoiceMediaMonitor(media_channel(), worker_thread(), | 1667 media_monitor_.reset(new VoiceMediaMonitor(media_channel(), worker_thread(), |
1676 rtc::Thread::Current())); | 1668 rtc::Thread::Current())); |
1677 media_monitor_->SignalUpdate.connect( | 1669 media_monitor_->SignalUpdate.connect( |
1678 this, &VoiceChannel::OnMediaMonitorUpdate); | 1670 this, &VoiceChannel::OnMediaMonitorUpdate); |
1679 media_monitor_->Start(cms); | 1671 media_monitor_->Start(cms); |
1680 } | 1672 } |
1681 | 1673 |
1682 void VoiceChannel::StopMediaMonitor() { | 1674 void VoiceChannel::StopMediaMonitor() { |
1683 if (media_monitor_) { | 1675 if (media_monitor_) { |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2473 signaling_thread()->Post(RTC_FROM_HERE, this, MSG_READYTOSENDDATA, | 2465 signaling_thread()->Post(RTC_FROM_HERE, this, MSG_READYTOSENDDATA, |
2474 new DataChannelReadyToSendMessageData(writable)); | 2466 new DataChannelReadyToSendMessageData(writable)); |
2475 } | 2467 } |
2476 | 2468 |
2477 void RtpDataChannel::GetSrtpCryptoSuites_n( | 2469 void RtpDataChannel::GetSrtpCryptoSuites_n( |
2478 std::vector<int>* crypto_suites) const { | 2470 std::vector<int>* crypto_suites) const { |
2479 GetSupportedDataCryptoSuites(crypto_options(), crypto_suites); | 2471 GetSupportedDataCryptoSuites(crypto_options(), crypto_suites); |
2480 } | 2472 } |
2481 | 2473 |
2482 } // namespace cricket | 2474 } // namespace cricket |
OLD | NEW |