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

Unified Diff: webrtc/pc/channel.cc

Issue 2854123003: Build WebRTC with data channel only. (Closed)
Patch Set: More modular apporach. Proof of concept. Need more work. Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/pc/channel.cc
diff --git a/webrtc/pc/channel.cc b/webrtc/pc/channel.cc
index f5428a43effac7a93fce554e11946c220946337c..9e56d67d38860fe11da087ecdee2d2ef3cc1f027 100644
--- a/webrtc/pc/channel.cc
+++ b/webrtc/pc/channel.cc
@@ -30,6 +30,10 @@
namespace cricket {
using rtc::Bind;
+std::vector<webrtc::RtpSource> GetSourcesImpl(
+ WebRtcVoiceMediaChannel* media_channel,
+ uint32_t ssrc);
+
namespace {
// See comment below for why we need to use a pointer to a unique_ptr.
bool SetRawAudioSink_w(VoiceMediaChannel* channel,
@@ -1608,9 +1612,13 @@ bool VoiceChannel::GetStats(VoiceMediaInfo* stats) {
std::vector<webrtc::RtpSource> VoiceChannel::GetSources(uint32_t ssrc) const {
return worker_thread()->Invoke<std::vector<webrtc::RtpSource>>(
- RTC_FROM_HERE,
- Bind(&WebRtcVoiceMediaChannel::GetSources,
- static_cast<WebRtcVoiceMediaChannel*>(media_channel()), ssrc));
+ RTC_FROM_HERE, Bind(&VoiceChannel::GetSources_w, this, ssrc));
+}
+
+std::vector<webrtc::RtpSource> VoiceChannel::GetSources_w(uint32_t ssrc) const {
+ RTC_DCHECK(worker_thread()->IsCurrent());
+ return GetSourcesImpl(static_cast<WebRtcVoiceMediaChannel*>(media_channel()),
Taylor Brandstetter 2017/05/18 17:57:05 This wouldn't be necessary if GetSources was pure
Zhi Huang 2017/05/23 03:40:35 Yes. Once the circular dependency problem is solve
+ ssrc);
}
void VoiceChannel::StartMediaMonitor(int cms) {

Powered by Google App Engine
This is Rietveld 408576698