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

Unified Diff: webrtc/media/base/fakemediaengine.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/fakemediaengine.h
diff --git a/webrtc/media/base/fakemediaengine.h b/webrtc/media/base/fakemediaengine.h
index 7f9561d25e319e4e26b4abb0c261e3d686f1d69f..af05144b529e0424a4a8b89f618470f69a26e01e 100644
--- a/webrtc/media/base/fakemediaengine.h
+++ b/webrtc/media/base/fakemediaengine.h
@@ -19,7 +19,7 @@
#include <vector>
#include "webrtc/audio_sink.h"
-#include "webrtc/base/buffer.h"
+#include "webrtc/base/copyonwritebuffer.h"
#include "webrtc/base/stringutils.h"
#include "webrtc/media/base/audiosource.h"
#include "webrtc/media/base/mediaengine.h"
@@ -58,13 +58,13 @@ template <class Base> class RtpHelper : public Base {
if (!sending_) {
return false;
}
- rtc::Buffer packet(reinterpret_cast<const uint8_t*>(data), len,
- kMaxRtpPacketLen);
+ rtc::CopyOnWriteBuffer packet(reinterpret_cast<const uint8_t*>(data), len,
+ kMaxRtpPacketLen);
return Base::SendPacket(&packet, options);
}
bool SendRtcp(const void* data, int len) {
- rtc::Buffer packet(reinterpret_cast<const uint8_t*>(data), len,
- kMaxRtpPacketLen);
+ rtc::CopyOnWriteBuffer packet(reinterpret_cast<const uint8_t*>(data), len,
+ kMaxRtpPacketLen);
return Base::SendRtcp(&packet, rtc::PacketOptions());
}
@@ -205,11 +205,11 @@ template <class Base> class RtpHelper : public Base {
send_extensions_ = extensions;
return true;
}
- virtual void OnPacketReceived(rtc::Buffer* packet,
+ virtual void OnPacketReceived(rtc::CopyOnWriteBuffer* packet,
const rtc::PacketTime& packet_time) {
rtp_packets_.push_back(std::string(packet->data<char>(), packet->size()));
}
- virtual void OnRtcpReceived(rtc::Buffer* packet,
+ virtual void OnRtcpReceived(rtc::CopyOnWriteBuffer* packet,
const rtc::PacketTime& packet_time) {
rtcp_packets_.push_back(std::string(packet->data<char>(), packet->size()));
}
@@ -609,7 +609,7 @@ class FakeDataMediaChannel : public RtpHelper<DataMediaChannel> {
}
virtual bool SendData(const SendDataParams& params,
- const rtc::Buffer& payload,
+ const rtc::CopyOnWriteBuffer& payload,
SendDataResult* result) {
if (send_blocked_) {
*result = SDR_BLOCK;

Powered by Google App Engine
This is Rietveld 408576698