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

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

Issue 2854123003: Build WebRTC with data channel only. (Closed)
Patch Set: Rebase. Created 3 years, 6 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 // 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 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1563 return media_channel()->SetRtpReceiveParameters(ssrc, parameters); 1565 return media_channel()->SetRtpReceiveParameters(ssrc, parameters);
1564 } 1566 }
1565 1567
1566 bool VoiceChannel::GetStats(VoiceMediaInfo* stats) { 1568 bool VoiceChannel::GetStats(VoiceMediaInfo* stats) {
1567 return InvokeOnWorker(RTC_FROM_HERE, Bind(&VoiceMediaChannel::GetStats, 1569 return InvokeOnWorker(RTC_FROM_HERE, Bind(&VoiceMediaChannel::GetStats,
1568 media_channel(), stats)); 1570 media_channel(), stats));
1569 } 1571 }
1570 1572
1571 std::vector<webrtc::RtpSource> VoiceChannel::GetSources(uint32_t ssrc) const { 1573 std::vector<webrtc::RtpSource> VoiceChannel::GetSources(uint32_t ssrc) const {
1572 return worker_thread()->Invoke<std::vector<webrtc::RtpSource>>( 1574 return worker_thread()->Invoke<std::vector<webrtc::RtpSource>>(
1573 RTC_FROM_HERE, 1575 RTC_FROM_HERE, Bind(&VoiceChannel::GetSources_w, this, ssrc));
1574 Bind(&WebRtcVoiceMediaChannel::GetSources, 1576 }
1575 static_cast<WebRtcVoiceMediaChannel*>(media_channel()), ssrc)); 1577
1578 std::vector<webrtc::RtpSource> VoiceChannel::GetSources_w(uint32_t ssrc) const {
1579 RTC_DCHECK(worker_thread()->IsCurrent());
1580 return media_channel()->GetSources(ssrc);
1576 } 1581 }
1577 1582
1578 void VoiceChannel::StartMediaMonitor(int cms) { 1583 void VoiceChannel::StartMediaMonitor(int cms) {
1579 media_monitor_.reset(new VoiceMediaMonitor(media_channel(), worker_thread(), 1584 media_monitor_.reset(new VoiceMediaMonitor(media_channel(), worker_thread(),
1580 rtc::Thread::Current())); 1585 rtc::Thread::Current()));
1581 media_monitor_->SignalUpdate.connect( 1586 media_monitor_->SignalUpdate.connect(
1582 this, &VoiceChannel::OnMediaMonitorUpdate); 1587 this, &VoiceChannel::OnMediaMonitorUpdate);
1583 media_monitor_->Start(cms); 1588 media_monitor_->Start(cms);
1584 } 1589 }
1585 1590
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
2360 2365
2361 void RtpDataChannel::OnDataChannelReadyToSend(bool writable) { 2366 void RtpDataChannel::OnDataChannelReadyToSend(bool writable) {
2362 // This is usded for congestion control to indicate that the stream is ready 2367 // This is usded for congestion control to indicate that the stream is ready
2363 // to send by the MediaChannel, as opposed to OnReadyToSend, which indicates 2368 // to send by the MediaChannel, as opposed to OnReadyToSend, which indicates
2364 // that the transport channel is ready. 2369 // that the transport channel is ready.
2365 signaling_thread()->Post(RTC_FROM_HERE, this, MSG_READYTOSENDDATA, 2370 signaling_thread()->Post(RTC_FROM_HERE, this, MSG_READYTOSENDDATA,
2366 new DataChannelReadyToSendMessageData(writable)); 2371 new DataChannelReadyToSendMessageData(writable));
2367 } 2372 }
2368 2373
2369 } // namespace cricket 2374 } // namespace cricket
OLDNEW
« webrtc/pc/BUILD.gn ('K') | « webrtc/pc/channel.h ('k') | webrtc/pc/channelmanager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698