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

Unified Diff: webrtc/media/base/mediachannel.h

Issue 1823503002: Reland Use CopyOnWriteBuffer instead of Buffer to avoid unnecessary copies. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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/media/base/mediachannel.h
diff --git a/webrtc/media/base/mediachannel.h b/webrtc/media/base/mediachannel.h
index ed565ee5b9df876080beb2e4afd5ff2f17246683..95355c9576a1afd117a4a5e4af43065b1a2cd654 100644
--- a/webrtc/media/base/mediachannel.h
+++ b/webrtc/media/base/mediachannel.h
@@ -17,7 +17,7 @@
#include "webrtc/api/rtpparameters.h"
#include "webrtc/base/basictypes.h"
-#include "webrtc/base/buffer.h"
+#include "webrtc/base/copyonwritebuffer.h"
#include "webrtc/base/dscp.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/optional.h"
@@ -356,9 +356,9 @@ class MediaChannel : public sigslot::has_slots<> {
class NetworkInterface {
public:
enum SocketType { ST_RTP, ST_RTCP };
- virtual bool SendPacket(rtc::Buffer* packet,
+ virtual bool SendPacket(rtc::CopyOnWriteBuffer* packet,
const rtc::PacketOptions& options) = 0;
- virtual bool SendRtcp(rtc::Buffer* packet,
+ virtual bool SendRtcp(rtc::CopyOnWriteBuffer* packet,
const rtc::PacketOptions& options) = 0;
virtual int SetOption(SocketType type, rtc::Socket::Option opt,
int option) = 0;
@@ -380,10 +380,10 @@ class MediaChannel : public sigslot::has_slots<> {
return rtc::DSCP_DEFAULT;
}
// Called when a RTP packet is received.
- virtual void OnPacketReceived(rtc::Buffer* packet,
+ virtual void OnPacketReceived(rtc::CopyOnWriteBuffer* packet,
const rtc::PacketTime& packet_time) = 0;
// Called when a RTCP packet is received.
- virtual void OnRtcpReceived(rtc::Buffer* packet,
+ virtual void OnRtcpReceived(rtc::CopyOnWriteBuffer* packet,
const rtc::PacketTime& packet_time) = 0;
// Called when the socket's ability to send has changed.
virtual void OnReadyToSend(bool ready) = 0;
@@ -408,11 +408,13 @@ class MediaChannel : public sigslot::has_slots<> {
}
// Base method to send packet using NetworkInterface.
- bool SendPacket(rtc::Buffer* packet, const rtc::PacketOptions& options) {
+ bool SendPacket(rtc::CopyOnWriteBuffer* packet,
+ const rtc::PacketOptions& options) {
return DoSendPacket(packet, false, options);
}
- bool SendRtcp(rtc::Buffer* packet, const rtc::PacketOptions& options) {
+ bool SendRtcp(rtc::CopyOnWriteBuffer* packet,
+ const rtc::PacketOptions& options) {
return DoSendPacket(packet, true, options);
}
@@ -441,7 +443,7 @@ class MediaChannel : public sigslot::has_slots<> {
return ret;
}
- bool DoSendPacket(rtc::Buffer* packet,
+ bool DoSendPacket(rtc::CopyOnWriteBuffer* packet,
bool rtcp,
const rtc::PacketOptions& options) {
rtc::CritScope cs(&network_interface_crit_);
@@ -1104,7 +1106,7 @@ class DataMediaChannel : public MediaChannel {
virtual bool SendData(
const SendDataParams& params,
- const rtc::Buffer& payload,
+ const rtc::CopyOnWriteBuffer& payload,
SendDataResult* result = NULL) = 0;
// Signals when data is received (params, data, len)
sigslot::signal3<const ReceiveDataParams&,

Powered by Google App Engine
This is Rietveld 408576698