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

Unified Diff: webrtc/pc/channel.cc

Issue 2416023002: Introduce rtc::PacketTransportInterface and let cricket::TransportChannel inherit. (Closed)
Patch Set: Resolve unused variable issue in release build. Created 4 years, 2 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
« webrtc/pc/channel.h ('K') | « webrtc/pc/channel.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/channel.cc
diff --git a/webrtc/pc/channel.cc b/webrtc/pc/channel.cc
index f22bdc4ca41029155f2fe4fe511bb9c2765ee679..2f9447d3ce15a5ce907befd154fabd1e328a1534 100644
--- a/webrtc/pc/channel.cc
+++ b/webrtc/pc/channel.cc
@@ -24,6 +24,7 @@
#include "webrtc/base/trace_event.h"
#include "webrtc/media/base/mediaconstants.h"
#include "webrtc/media/base/rtputils.h"
+#include "webrtc/p2p/base/packettransport.h"
#include "webrtc/p2p/base/transportchannel.h"
#include "webrtc/pc/channelmanager.h"
@@ -527,17 +528,20 @@ bool BaseChannel::SetCryptoOptions(const rtc::CryptoOptions& crypto_options) {
return true;
}
-void BaseChannel::OnWritableState(TransportChannel* channel) {
+void BaseChannel::OnWritableState(rtc::PacketTransport* pt) {
+ TransportChannel* channel = static_cast<TransportChannel*>(pt);
RTC_DCHECK(channel == transport_channel_ ||
channel == rtcp_transport_channel_);
RTC_DCHECK(network_thread_->IsCurrent());
UpdateWritableState_n();
}
-void BaseChannel::OnChannelRead(TransportChannel* channel,
- const char* data, size_t len,
+void BaseChannel::OnChannelRead(rtc::PacketTransport* pt,
+ const char* data,
+ size_t len,
const rtc::PacketTime& packet_time,
int flags) {
+ TransportChannel* channel = static_cast<TransportChannel*>(pt);
TRACE_EVENT0("webrtc", "BaseChannel::OnChannelRead");
// OnChannelRead gets called from P2PSocket; now pass data to MediaEngine
RTC_DCHECK(network_thread_->IsCurrent());
@@ -549,7 +553,8 @@ void BaseChannel::OnChannelRead(TransportChannel* channel,
HandlePacket(rtcp, &packet, packet_time);
}
-void BaseChannel::OnReadyToSend(TransportChannel* channel) {
+void BaseChannel::OnReadyToSend(rtc::PacketTransport* pt) {
+ TransportChannel* channel = static_cast<TransportChannel*>(pt);
RTC_DCHECK(channel == transport_channel_ ||
channel == rtcp_transport_channel_);
SetTransportChannelReadyToSend(channel == rtcp_transport_channel_, true);
@@ -1445,7 +1450,7 @@ void BaseChannel::FlushRtcpMessages_n() {
}
}
-void BaseChannel::SignalSentPacket_n(TransportChannel* /* channel */,
+void BaseChannel::SignalSentPacket_n(rtc::PacketTransport* /* pt */,
const rtc::SentPacket& sent_packet) {
RTC_DCHECK(network_thread_->IsCurrent());
invoker_.AsyncInvoke<void>(
@@ -1641,12 +1646,13 @@ void VoiceChannel::GetActiveStreams_w(AudioInfo::StreamList* actives) {
media_channel()->GetActiveStreams(actives);
}
-void VoiceChannel::OnChannelRead(TransportChannel* channel,
- const char* data, size_t len,
+void VoiceChannel::OnChannelRead(rtc::PacketTransport* pt,
+ const char* data,
+ size_t len,
const rtc::PacketTime& packet_time,
- int flags) {
- BaseChannel::OnChannelRead(channel, data, len, packet_time, flags);
-
+ int flags) {
+ BaseChannel::OnChannelRead(pt, data, len, packet_time, flags);
+ TransportChannel* channel = static_cast<TransportChannel*>(pt);
// Set a flag when we've received an RTP packet. If we're waiting for early
// media, this will disable the timeout.
if (!received_media_ && !PacketIsRtcp(channel, data, len)) {
« webrtc/pc/channel.h ('K') | « webrtc/pc/channel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698