Modifying MediaChannel to accept CopyOnWriteBuffer by value.
MediaChannel accepted the RtpPacket buffers through non-const pointer.
This is both unclear and introduces questions regarding if the buffer is
actually copied or not.
This change modifies the method to accept by value to reduce ambiguity.
Usage of the non-const data() method which could potentially copy the
buffer contents is also reduced in favor of cdata() which never copies.
Bug: None
Change-Id: I3b2daef0d31cb6aacceb46c86da3a40ce836242b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127340
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27090}
diff --git a/media/base/fake_media_engine.h b/media/base/fake_media_engine.h
index 3f1c28b..c26095d 100644
--- a/media/base/fake_media_engine.h
+++ b/media/base/fake_media_engine.h
@@ -267,13 +267,13 @@
void set_recv_rtcp_parameters(const RtcpParameters& params) {
recv_rtcp_parameters_ = params;
}
- virtual void OnPacketReceived(rtc::CopyOnWriteBuffer* packet,
+ virtual void OnPacketReceived(rtc::CopyOnWriteBuffer packet,
int64_t packet_time_us) {
- rtp_packets_.push_back(std::string(packet->data<char>(), packet->size()));
+ rtp_packets_.push_back(std::string(packet.cdata<char>(), packet.size()));
}
- virtual void OnRtcpReceived(rtc::CopyOnWriteBuffer* packet,
+ virtual void OnRtcpReceived(rtc::CopyOnWriteBuffer packet,
int64_t packet_time_us) {
- rtcp_packets_.push_back(std::string(packet->data<char>(), packet->size()));
+ rtcp_packets_.push_back(std::string(packet.cdata<char>(), packet.size()));
}
virtual void OnReadyToSend(bool ready) { ready_to_send_ = ready; }
diff --git a/media/base/fake_network_interface.h b/media/base/fake_network_interface.h
index e61202f..1609f7d 100644
--- a/media/base/fake_network_interface.h
+++ b/media/base/fake_network_interface.h
@@ -169,9 +169,9 @@
static_cast<rtc::TypedMessageData<rtc::CopyOnWriteBuffer>*>(msg->pdata);
if (dest_) {
if (msg->message_id == ST_RTP) {
- dest_->OnPacketReceived(&msg_data->data(), rtc::TimeMicros());
+ dest_->OnPacketReceived(msg_data->data(), rtc::TimeMicros());
} else {
- dest_->OnRtcpReceived(&msg_data->data(), rtc::TimeMicros());
+ dest_->OnRtcpReceived(msg_data->data(), rtc::TimeMicros());
}
}
delete msg_data;
diff --git a/media/base/media_channel.h b/media/base/media_channel.h
index 7891e55..617af32 100644
--- a/media/base/media_channel.h
+++ b/media/base/media_channel.h
@@ -196,10 +196,10 @@
virtual void SetInterface(NetworkInterface* iface,
webrtc::MediaTransportInterface* media_transport);
// Called when a RTP packet is received.
- virtual void OnPacketReceived(rtc::CopyOnWriteBuffer* packet,
+ virtual void OnPacketReceived(rtc::CopyOnWriteBuffer packet,
int64_t packet_time_us) = 0;
// Called when a RTCP packet is received.
- virtual void OnRtcpReceived(rtc::CopyOnWriteBuffer* packet,
+ virtual void OnRtcpReceived(rtc::CopyOnWriteBuffer packet,
int64_t packet_time_us) = 0;
// Called when the socket's ability to send has changed.
virtual void OnReadyToSend(bool ready) = 0;
diff --git a/media/base/rtp_data_engine.cc b/media/base/rtp_data_engine.cc
index be71f46..33c87cb 100644
--- a/media/base/rtp_data_engine.cc
+++ b/media/base/rtp_data_engine.cc
@@ -194,20 +194,20 @@
return true;
}
-void RtpDataMediaChannel::OnPacketReceived(rtc::CopyOnWriteBuffer* packet,
+void RtpDataMediaChannel::OnPacketReceived(rtc::CopyOnWriteBuffer packet,
int64_t /* packet_time_us */) {
RtpHeader header;
- if (!GetRtpHeader(packet->cdata(), packet->size(), &header)) {
+ if (!GetRtpHeader(packet.cdata(), packet.size(), &header)) {
return;
}
size_t header_length;
- if (!GetRtpHeaderLen(packet->cdata(), packet->size(), &header_length)) {
+ if (!GetRtpHeaderLen(packet.cdata(), packet.size(), &header_length)) {
return;
}
const char* data =
- packet->cdata<char>() + header_length + sizeof(kReservedSpace);
- size_t data_len = packet->size() - header_length - sizeof(kReservedSpace);
+ packet.cdata<char>() + header_length + sizeof(kReservedSpace);
+ size_t data_len = packet.size() - header_length - sizeof(kReservedSpace);
if (!receiving_) {
RTC_LOG(LS_WARNING) << "Not receiving packet " << header.ssrc << ":"
diff --git a/media/base/rtp_data_engine.h b/media/base/rtp_data_engine.h
index 6ac09aa..a4647ae 100644
--- a/media/base/rtp_data_engine.h
+++ b/media/base/rtp_data_engine.h
@@ -81,9 +81,9 @@
receiving_ = receive;
return true;
}
- virtual void OnPacketReceived(rtc::CopyOnWriteBuffer* packet,
+ virtual void OnPacketReceived(rtc::CopyOnWriteBuffer packet,
int64_t packet_time_us);
- virtual void OnRtcpReceived(rtc::CopyOnWriteBuffer* packet,
+ virtual void OnRtcpReceived(rtc::CopyOnWriteBuffer packet,
int64_t packet_time_us) {}
virtual void OnReadyToSend(bool ready) {}
virtual bool SendData(const SendDataParams& params,
diff --git a/media/base/rtp_data_engine_unittest.cc b/media/base/rtp_data_engine_unittest.cc
index d0e4e84..bcba9a4 100644
--- a/media/base/rtp_data_engine_unittest.cc
+++ b/media/base/rtp_data_engine_unittest.cc
@@ -319,13 +319,13 @@
std::unique_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel());
// SetReceived not called.
- dmc->OnPacketReceived(&packet, /* packet_time_us */ -1);
+ dmc->OnPacketReceived(packet, /* packet_time_us */ -1);
EXPECT_FALSE(HasReceivedData());
dmc->SetReceive(true);
// Unknown payload id
- dmc->OnPacketReceived(&packet, /* packet_time_us */ -1);
+ dmc->OnPacketReceived(packet, /* packet_time_us */ -1);
EXPECT_FALSE(HasReceivedData());
cricket::DataCodec codec;
@@ -336,7 +336,7 @@
ASSERT_TRUE(dmc->SetRecvParameters(parameters));
// Unknown stream
- dmc->OnPacketReceived(&packet, /* packet_time_us */ -1);
+ dmc->OnPacketReceived(packet, /* packet_time_us */ -1);
EXPECT_FALSE(HasReceivedData());
cricket::StreamParams stream;
@@ -344,7 +344,7 @@
ASSERT_TRUE(dmc->AddRecvStream(stream));
// Finally works!
- dmc->OnPacketReceived(&packet, /* packet_time_us */ -1);
+ dmc->OnPacketReceived(packet, /* packet_time_us */ -1);
EXPECT_TRUE(HasReceivedData());
EXPECT_EQ("abcde", GetReceivedData());
EXPECT_EQ(5U, GetReceivedDataLen());
@@ -357,6 +357,6 @@
std::unique_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel());
// Too short
- dmc->OnPacketReceived(&packet, /* packet_time_us */ -1);
+ dmc->OnPacketReceived(packet, /* packet_time_us */ -1);
EXPECT_FALSE(HasReceivedData());
}
diff --git a/media/engine/webrtc_video_engine.cc b/media/engine/webrtc_video_engine.cc
index c0848f6..7ee3084 100644
--- a/media/engine/webrtc_video_engine.cc
+++ b/media/engine/webrtc_video_engine.cc
@@ -1360,11 +1360,11 @@
}
}
-void WebRtcVideoChannel::OnPacketReceived(rtc::CopyOnWriteBuffer* packet,
+void WebRtcVideoChannel::OnPacketReceived(rtc::CopyOnWriteBuffer packet,
int64_t packet_time_us) {
RTC_DCHECK_RUN_ON(&thread_checker_);
const webrtc::PacketReceiver::DeliveryStatus delivery_result =
- call_->Receiver()->DeliverPacket(webrtc::MediaType::VIDEO, *packet,
+ call_->Receiver()->DeliverPacket(webrtc::MediaType::VIDEO, packet,
packet_time_us);
switch (delivery_result) {
case webrtc::PacketReceiver::DELIVERY_OK:
@@ -1380,12 +1380,12 @@
}
uint32_t ssrc = 0;
- if (!GetRtpSsrc(packet->cdata(), packet->size(), &ssrc)) {
+ if (!GetRtpSsrc(packet.cdata(), packet.size(), &ssrc)) {
return;
}
int payload_type = 0;
- if (!GetRtpPayloadType(packet->cdata(), packet->size(), &payload_type)) {
+ if (!GetRtpPayloadType(packet.cdata(), packet.size(), &payload_type)) {
return;
}
@@ -1412,7 +1412,7 @@
break;
}
- if (call_->Receiver()->DeliverPacket(webrtc::MediaType::VIDEO, *packet,
+ if (call_->Receiver()->DeliverPacket(webrtc::MediaType::VIDEO, packet,
packet_time_us) !=
webrtc::PacketReceiver::DELIVERY_OK) {
RTC_LOG(LS_WARNING) << "Failed to deliver RTP packet on re-delivery.";
@@ -1420,14 +1420,14 @@
}
}
-void WebRtcVideoChannel::OnRtcpReceived(rtc::CopyOnWriteBuffer* packet,
+void WebRtcVideoChannel::OnRtcpReceived(rtc::CopyOnWriteBuffer packet,
int64_t packet_time_us) {
RTC_DCHECK_RUN_ON(&thread_checker_);
// TODO(pbos): Check webrtc::PacketReceiver::DELIVERY_OK once we deliver
// for both audio and video on the same path. Since BundleFilter doesn't
// filter RTCP anymore incoming RTCP packets could've been going to audio (so
// logging failures spam the log).
- call_->Receiver()->DeliverPacket(webrtc::MediaType::VIDEO, *packet,
+ call_->Receiver()->DeliverPacket(webrtc::MediaType::VIDEO, packet,
packet_time_us);
}
diff --git a/media/engine/webrtc_video_engine.h b/media/engine/webrtc_video_engine.h
index 35e6b85..f3d4104 100644
--- a/media/engine/webrtc_video_engine.h
+++ b/media/engine/webrtc_video_engine.h
@@ -144,9 +144,9 @@
void FillBitrateInfo(BandwidthEstimationInfo* bwe_info) override;
bool GetStats(VideoMediaInfo* info) override;
- void OnPacketReceived(rtc::CopyOnWriteBuffer* packet,
+ void OnPacketReceived(rtc::CopyOnWriteBuffer packet,
int64_t packet_time_us) override;
- void OnRtcpReceived(rtc::CopyOnWriteBuffer* packet,
+ void OnRtcpReceived(rtc::CopyOnWriteBuffer packet,
int64_t packet_time_us) override;
void OnReadyToSend(bool ready) override;
void OnNetworkRouteChanged(const std::string& transport_name,
diff --git a/media/engine/webrtc_video_engine_unittest.cc b/media/engine/webrtc_video_engine_unittest.cc
index 3b14f27..1649244 100644
--- a/media/engine/webrtc_video_engine_unittest.cc
+++ b/media/engine/webrtc_video_engine_unittest.cc
@@ -1729,7 +1729,7 @@
EXPECT_TRUE(SetDefaultCodec());
EXPECT_TRUE(SetSend(true));
EXPECT_EQ(0, renderer_.num_rendered_frames());
- channel_->OnPacketReceived(&packet1, /* packet_time_us */ -1);
+ channel_->OnPacketReceived(packet1, /* packet_time_us */ -1);
EXPECT_TRUE(channel_->SetSink(kDefaultReceiveSsrc, &renderer_));
SendFrame();
EXPECT_FRAME_WAIT(1, kVideoWidth, kVideoHeight, kTimeout);
@@ -4835,7 +4835,7 @@
memset(data, 0, sizeof(data));
rtc::SetBE32(&data[8], ssrcs[0]);
rtc::CopyOnWriteBuffer packet(data, kDataLength);
- channel_->OnPacketReceived(&packet, /* packet_time_us */ -1);
+ channel_->OnPacketReceived(packet, /* packet_time_us */ -1);
ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size())
<< "No default receive stream created.";
@@ -4993,7 +4993,7 @@
memset(data, 0, sizeof(data));
rtc::SetBE32(&data[8], kIncomingUnsignalledSsrc);
rtc::CopyOnWriteBuffer packet(data, kDataLength);
- channel_->OnPacketReceived(&packet, /* packet_time_us */ -1);
+ channel_->OnPacketReceived(packet, /* packet_time_us */ -1);
// The stream should now be created with the appropriate sync label.
EXPECT_EQ(1u, fake_call_->GetVideoReceiveStreams().size());
@@ -5006,7 +5006,7 @@
ASSERT_TRUE(channel_->RemoveRecvStream(kIncomingUnsignalledSsrc));
EXPECT_EQ(0u, fake_call_->GetVideoReceiveStreams().size());
- channel_->OnPacketReceived(&packet, /* packet_time_us */ -1);
+ channel_->OnPacketReceived(packet, /* packet_time_us */ -1);
EXPECT_EQ(1u, fake_call_->GetVideoReceiveStreams().size());
EXPECT_TRUE(
fake_call_->GetVideoReceiveStreams()[0]->GetConfig().sync_group.empty());
@@ -5045,7 +5045,7 @@
memset(data, 0, sizeof(data));
rtc::SetBE32(&data[8], kIncomingUnsignalledSsrc);
rtc::CopyOnWriteBuffer packet(data, kDataLength);
- channel_->OnPacketReceived(&packet, /* packet_time_us */ -1);
+ channel_->OnPacketReceived(packet, /* packet_time_us */ -1);
recv_stream = fake_call_->GetVideoReceiveStream(kIncomingUnsignalledSsrc);
EXPECT_EQ(recv_stream->base_mininum_playout_delay_ms(), 200);
@@ -5082,7 +5082,7 @@
rtc::Set8(data, 1, payload_type);
rtc::SetBE32(&data[8], kIncomingUnsignalledSsrc);
rtc::CopyOnWriteBuffer packet(data, kDataLength);
- channel_->OnPacketReceived(&packet, /* packet_time_us */ -1);
+ channel_->OnPacketReceived(packet, /* packet_time_us */ -1);
if (expect_created_receive_stream) {
EXPECT_EQ(1u, fake_call_->GetVideoReceiveStreams().size())
@@ -5169,7 +5169,7 @@
rtpHeader.ssrc = kIncomingUnsignalledSsrc + 1;
cricket::SetRtpHeader(data, sizeof(data), rtpHeader);
rtc::CopyOnWriteBuffer packet(data, sizeof(data));
- channel_->OnPacketReceived(&packet, /* packet_time_us */ -1);
+ channel_->OnPacketReceived(packet, /* packet_time_us */ -1);
// VP8 packet should create default receive stream.
ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size());
FakeVideoReceiveStream* recv_stream = fake_call_->GetVideoReceiveStreams()[0];
@@ -5190,7 +5190,7 @@
rtpHeader.ssrc = kIncomingUnsignalledSsrc + 2;
cricket::SetRtpHeader(data, sizeof(data), rtpHeader);
rtc::CopyOnWriteBuffer packet2(data, sizeof(data));
- channel_->OnPacketReceived(&packet2, /* packet_time_us */ -1);
+ channel_->OnPacketReceived(packet2, /* packet_time_us */ -1);
// VP9 packet should replace the default receive SSRC.
ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size());
recv_stream = fake_call_->GetVideoReceiveStreams()[0];
@@ -5212,7 +5212,7 @@
rtpHeader.ssrc = kIncomingUnsignalledSsrc + 3;
cricket::SetRtpHeader(data, sizeof(data), rtpHeader);
rtc::CopyOnWriteBuffer packet3(data, sizeof(data));
- channel_->OnPacketReceived(&packet3, /* packet_time_us */ -1);
+ channel_->OnPacketReceived(packet3, /* packet_time_us */ -1);
// H264 packet should replace the default receive SSRC.
ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size());
recv_stream = fake_call_->GetVideoReceiveStreams()[0];
@@ -5251,7 +5251,7 @@
rtp_header.ssrc = kSsrcs3[0];
cricket::SetRtpHeader(data, sizeof(data), rtp_header);
rtc::CopyOnWriteBuffer packet(data, sizeof(data));
- channel_->OnPacketReceived(&packet, /* packet_time_us */ -1);
+ channel_->OnPacketReceived(packet, /* packet_time_us */ -1);
// Default receive stream should be created.
ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size());
FakeVideoReceiveStream* recv_stream0 =
@@ -5269,7 +5269,7 @@
rtp_header.ssrc = kSsrcs3[1];
cricket::SetRtpHeader(data, sizeof(data), rtp_header);
packet.SetData(data, sizeof(data));
- channel_->OnPacketReceived(&packet, /* packet_time_us */ -1);
+ channel_->OnPacketReceived(packet, /* packet_time_us */ -1);
// New default receive stream should be created, but old stream should remain.
ASSERT_EQ(2u, fake_call_->GetVideoReceiveStreams().size());
EXPECT_EQ(recv_stream0, fake_call_->GetVideoReceiveStreams()[0]);
@@ -6891,7 +6891,7 @@
rtpHeader.ssrc = kIncomingUnsignalledSsrc;
cricket::SetRtpHeader(data, sizeof(data), rtpHeader);
rtc::CopyOnWriteBuffer packet(data, sizeof(data));
- channel_->OnPacketReceived(&packet, /* packet_time_us */ -1);
+ channel_->OnPacketReceived(packet, /* packet_time_us */ -1);
// The |ssrc| member should still be unset.
rtp_parameters = channel_->GetRtpReceiveParameters(0);
@@ -7191,7 +7191,7 @@
EXPECT_TRUE(SetDefaultCodec());
EXPECT_TRUE(SetSend(true));
EXPECT_EQ(0, renderer_.num_rendered_frames());
- channel_->OnPacketReceived(&packet1, /*packet_time_us=*/-1);
+ channel_->OnPacketReceived(packet1, /*packet_time_us=*/-1);
std::vector<webrtc::RtpSource> sources = channel_->GetSources(kSsrc);
EXPECT_EQ(1u, sources.size());
@@ -7201,7 +7201,7 @@
// a new packet.
int64_t timeDeltaMs = 1;
fake_clock_.AdvanceTime(webrtc::TimeDelta::ms(timeDeltaMs));
- channel_->OnPacketReceived(&packet1, /*packet_time_us=*/-1);
+ channel_->OnPacketReceived(packet1, /*packet_time_us=*/-1);
int64_t timestamp2 = channel_->GetSources(kSsrc)[0].timestamp_ms();
EXPECT_EQ(timestamp2, timestamp1 + timeDeltaMs);
@@ -7226,7 +7226,7 @@
EXPECT_TRUE(SetDefaultCodec());
EXPECT_TRUE(SetSend(true));
EXPECT_EQ(0, renderer_.num_rendered_frames());
- channel_->OnPacketReceived(&packet1, /*packet_time_us=*/-1);
+ channel_->OnPacketReceived(packet1, /*packet_time_us=*/-1);
{
ASSERT_EQ(2u, channel_->GetSources(kSsrc).size());
@@ -7251,7 +7251,7 @@
int64_t timeDeltaMs = 1;
fake_clock_.AdvanceTime(webrtc::TimeDelta::ms(timeDeltaMs));
- channel_->OnPacketReceived(&packet2, /*packet_time_us=*/-1);
+ channel_->OnPacketReceived(packet2, /*packet_time_us=*/-1);
{
ASSERT_EQ(2u, channel_->GetSources(kSsrc).size());
diff --git a/media/engine/webrtc_voice_engine.cc b/media/engine/webrtc_voice_engine.cc
index b7128fa..1594849 100644
--- a/media/engine/webrtc_voice_engine.cc
+++ b/media/engine/webrtc_voice_engine.cc
@@ -2058,12 +2058,12 @@
event, duration);
}
-void WebRtcVoiceMediaChannel::OnPacketReceived(rtc::CopyOnWriteBuffer* packet,
+void WebRtcVoiceMediaChannel::OnPacketReceived(rtc::CopyOnWriteBuffer packet,
int64_t packet_time_us) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
webrtc::PacketReceiver::DeliveryStatus delivery_result =
- call_->Receiver()->DeliverPacket(webrtc::MediaType::AUDIO, *packet,
+ call_->Receiver()->DeliverPacket(webrtc::MediaType::AUDIO, packet,
packet_time_us);
if (delivery_result != webrtc::PacketReceiver::DELIVERY_UNKNOWN_SSRC) {
@@ -2074,7 +2074,7 @@
// If there already is N unsignaled receive streams, delete the oldest.
// See: https://bugs.chromium.org/p/webrtc/issues/detail?id=5208
uint32_t ssrc = 0;
- if (!GetRtpSsrc(packet->cdata(), packet->size(), &ssrc)) {
+ if (!GetRtpSsrc(packet.cdata(), packet.size(), &ssrc)) {
return;
}
RTC_DCHECK(!absl::c_linear_search(unsignaled_recv_ssrcs_, ssrc));
@@ -2117,16 +2117,16 @@
}
delivery_result = call_->Receiver()->DeliverPacket(webrtc::MediaType::AUDIO,
- *packet, packet_time_us);
+ packet, packet_time_us);
RTC_DCHECK_NE(webrtc::PacketReceiver::DELIVERY_UNKNOWN_SSRC, delivery_result);
}
-void WebRtcVoiceMediaChannel::OnRtcpReceived(rtc::CopyOnWriteBuffer* packet,
+void WebRtcVoiceMediaChannel::OnRtcpReceived(rtc::CopyOnWriteBuffer packet,
int64_t packet_time_us) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
// Forward packet to Call as well.
- call_->Receiver()->DeliverPacket(webrtc::MediaType::AUDIO, *packet,
+ call_->Receiver()->DeliverPacket(webrtc::MediaType::AUDIO, packet,
packet_time_us);
}
diff --git a/media/engine/webrtc_voice_engine.h b/media/engine/webrtc_voice_engine.h
index cbec003..5b3f864 100644
--- a/media/engine/webrtc_voice_engine.h
+++ b/media/engine/webrtc_voice_engine.h
@@ -201,9 +201,9 @@
bool CanInsertDtmf() override;
bool InsertDtmf(uint32_t ssrc, int event, int duration) override;
- void OnPacketReceived(rtc::CopyOnWriteBuffer* packet,
+ void OnPacketReceived(rtc::CopyOnWriteBuffer packet,
int64_t packet_time_us) override;
- void OnRtcpReceived(rtc::CopyOnWriteBuffer* packet,
+ void OnRtcpReceived(rtc::CopyOnWriteBuffer packet,
int64_t packet_time_us) override;
void OnNetworkRouteChanged(const std::string& transport_name,
const rtc::NetworkRoute& network_route) override;
diff --git a/media/engine/webrtc_voice_engine_unittest.cc b/media/engine/webrtc_voice_engine_unittest.cc
index 4b1a528..ebb2ec2 100644
--- a/media/engine/webrtc_voice_engine_unittest.cc
+++ b/media/engine/webrtc_voice_engine_unittest.cc
@@ -255,7 +255,7 @@
void DeliverPacket(const void* data, int len) {
rtc::CopyOnWriteBuffer packet(reinterpret_cast<const uint8_t*>(data), len);
- channel_->OnPacketReceived(&packet, /* packet_time_us */ -1);
+ channel_->OnPacketReceived(packet, /* packet_time_us */ -1);
}
void TearDown() override { delete channel_; }
@@ -3322,9 +3322,9 @@
const cricket::FakeAudioReceiveStream* s =
call_.GetAudioReceiveStream(kAudioSsrc);
EXPECT_EQ(0, s->received_packets());
- channel_->OnPacketReceived(&kPcmuPacket, /* packet_time_us */ -1);
+ channel_->OnPacketReceived(kPcmuPacket, /* packet_time_us */ -1);
EXPECT_EQ(1, s->received_packets());
- channel_->OnRtcpReceived(&kRtcpPacket, /* packet_time_us */ -1);
+ channel_->OnRtcpReceived(kRtcpPacket, /* packet_time_us */ -1);
EXPECT_EQ(2, s->received_packets());
}