Index: webrtc/media/engine/webrtcvoiceengine.cc |
diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc |
index a496316b42149637757846ec3e20f89b32915f02..8e45fb0f38cd2db69c8d889ccfe82c7517bd9772 100644 |
--- a/webrtc/media/engine/webrtcvoiceengine.cc |
+++ b/webrtc/media/engine/webrtcvoiceengine.cc |
@@ -2230,11 +2230,11 @@ bool WebRtcVoiceMediaChannel::InsertDtmf(uint32_t ssrc, int event, |
} |
void WebRtcVoiceMediaChannel::OnPacketReceived( |
- rtc::Buffer* packet, const rtc::PacketTime& packet_time) { |
+ rtc::CopyOnWriteBuffer* packet, const rtc::PacketTime& packet_time) { |
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
uint32_t ssrc = 0; |
- if (!GetRtpSsrc(packet->data(), packet->size(), &ssrc)) { |
+ if (!GetRtpSsrc(packet->cdata(), packet->size(), &ssrc)) { |
return; |
} |
@@ -2262,8 +2262,7 @@ void WebRtcVoiceMediaChannel::OnPacketReceived( |
packet_time.not_before); |
webrtc::PacketReceiver::DeliveryStatus delivery_result = |
call_->Receiver()->DeliverPacket(webrtc::MediaType::AUDIO, |
- reinterpret_cast<const uint8_t*>(packet->data()), packet->size(), |
- webrtc_packet_time); |
+ packet->cdata(), packet->size(), webrtc_packet_time); |
if (webrtc::PacketReceiver::DELIVERY_OK != delivery_result) { |
// If the SSRC is unknown here, route it to the default channel, if we have |
// one. See: https://bugs.chromium.org/p/webrtc/issues/detail?id=5208 |
@@ -2281,26 +2280,25 @@ void WebRtcVoiceMediaChannel::OnPacketReceived( |
// Pass it off to the decoder. |
engine()->voe()->network()->ReceivedRTPPacket( |
- channel, packet->data(), packet->size(), webrtc_packet_time); |
+ channel, packet->cdata(), packet->size(), webrtc_packet_time); |
} |
void WebRtcVoiceMediaChannel::OnRtcpReceived( |
- rtc::Buffer* packet, const rtc::PacketTime& packet_time) { |
+ rtc::CopyOnWriteBuffer* packet, const rtc::PacketTime& packet_time) { |
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
// Forward packet to Call as well. |
const webrtc::PacketTime webrtc_packet_time(packet_time.timestamp, |
packet_time.not_before); |
call_->Receiver()->DeliverPacket(webrtc::MediaType::AUDIO, |
- reinterpret_cast<const uint8_t*>(packet->data()), packet->size(), |
- webrtc_packet_time); |
+ packet->cdata(), packet->size(), webrtc_packet_time); |
// Sending channels need all RTCP packets with feedback information. |
// Even sender reports can contain attached report blocks. |
// Receiving channels need sender reports in order to create |
// correct receiver reports. |
int type = 0; |
- if (!GetRtcpType(packet->data(), packet->size(), &type)) { |
+ if (!GetRtcpType(packet->cdata(), packet->size(), &type)) { |
LOG(LS_WARNING) << "Failed to parse type from received RTCP packet"; |
return; |
} |
@@ -2308,13 +2306,13 @@ void WebRtcVoiceMediaChannel::OnRtcpReceived( |
// If it is a sender report, find the receive channel that is listening. |
if (type == kRtcpTypeSR) { |
uint32_t ssrc = 0; |
- if (!GetRtcpSsrc(packet->data(), packet->size(), &ssrc)) { |
+ if (!GetRtcpSsrc(packet->cdata(), packet->size(), &ssrc)) { |
return; |
} |
int recv_channel_id = GetReceiveChannelId(ssrc); |
if (recv_channel_id != -1) { |
engine()->voe()->network()->ReceivedRTCPPacket( |
- recv_channel_id, packet->data(), packet->size()); |
+ recv_channel_id, packet->cdata(), packet->size()); |
} |
} |
@@ -2323,7 +2321,7 @@ void WebRtcVoiceMediaChannel::OnRtcpReceived( |
// will filter out RR internally. |
for (const auto& ch : send_streams_) { |
engine()->voe()->network()->ReceivedRTCPPacket( |
- ch.second->channel(), packet->data(), packet->size()); |
+ ch.second->channel(), packet->cdata(), packet->size()); |
} |
} |