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

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

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

Powered by Google App Engine
This is Rietveld 408576698