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

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

Issue 1785713005: Use CopyOnWriteBuffer instead of Buffer to avoid unnecessary copies. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Feedback from tommi. 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
« no previous file with comments | « webrtc/media/base/fakenetworkinterface.h ('k') | webrtc/media/base/rtpdataengine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/base/mediachannel.h
diff --git a/webrtc/media/base/mediachannel.h b/webrtc/media/base/mediachannel.h
index d7aefe54ec4f238b0bb006a83968c69cdc0ab10b..6a8c0b296917cfee531fca4b3c9ffd0bb93b0636 100644
--- a/webrtc/media/base/mediachannel.h
+++ b/webrtc/media/base/mediachannel.h
@@ -16,7 +16,7 @@
#include <vector>
#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"
@@ -344,9 +344,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;
@@ -368,10 +368,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;
@@ -396,11 +396,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);
}
@@ -429,7 +431,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_);
@@ -1096,7 +1098,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&,
« no previous file with comments | « webrtc/media/base/fakenetworkinterface.h ('k') | webrtc/media/base/rtpdataengine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698