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}
This commit is contained in:
Amit Hilbuch
2019-03-12 11:10:27 -07:00
committed by Commit Bot
parent dfaea9dd98
commit e7a5f7bfae
15 changed files with 61 additions and 65 deletions

View File

@ -144,9 +144,9 @@ class WebRtcVideoChannel : public VideoMediaChannel, public webrtc::Transport {
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,