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

Unified Diff: webrtc/media/base/testutils.cc

Issue 1821083002: Split ByteBuffer into writer/reader objects. (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
« no previous file with comments | « webrtc/media/base/testutils.h ('k') | webrtc/media/base/videoengine_unittest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/base/testutils.cc
diff --git a/webrtc/media/base/testutils.cc b/webrtc/media/base/testutils.cc
index 33d0a9727dddc3b8ed8945802d9c58dd466b3cde..ec3828c9b83e9da16d07a61c691fb57bf90da142 100644
--- a/webrtc/media/base/testutils.cc
+++ b/webrtc/media/base/testutils.cc
@@ -32,7 +32,7 @@ namespace cricket {
// Implementation of RawRtpPacket
/////////////////////////////////////////////////////////////////////////
void RawRtpPacket::WriteToByteBuffer(uint32_t in_ssrc,
- rtc::ByteBuffer* buf) const {
+ rtc::ByteBufferWriter* buf) const {
if (!buf) return;
buf->WriteUInt8(ver_to_cc);
@@ -43,7 +43,7 @@ void RawRtpPacket::WriteToByteBuffer(uint32_t in_ssrc,
buf->WriteBytes(payload, sizeof(payload));
}
-bool RawRtpPacket::ReadFromByteBuffer(rtc::ByteBuffer* buf) {
+bool RawRtpPacket::ReadFromByteBuffer(rtc::ByteBufferReader* buf) {
if (!buf) return false;
bool ret = true;
@@ -71,7 +71,7 @@ bool RawRtpPacket::SameExceptSeqNumTimestampSsrc(const RawRtpPacket& packet,
/////////////////////////////////////////////////////////////////////////
// Implementation of RawRtcpPacket
/////////////////////////////////////////////////////////////////////////
-void RawRtcpPacket::WriteToByteBuffer(rtc::ByteBuffer *buf) const {
+void RawRtcpPacket::WriteToByteBuffer(rtc::ByteBufferWriter *buf) const {
if (!buf) return;
buf->WriteUInt8(ver_to_count);
@@ -80,7 +80,7 @@ void RawRtcpPacket::WriteToByteBuffer(rtc::ByteBuffer *buf) const {
buf->WriteBytes(payload, sizeof(payload));
}
-bool RawRtcpPacket::ReadFromByteBuffer(rtc::ByteBuffer* buf) {
+bool RawRtcpPacket::ReadFromByteBuffer(rtc::ByteBufferReader* buf) {
if (!buf) return false;
bool ret = true;
@@ -129,7 +129,7 @@ bool RtpTestUtility::WriteTestPackets(size_t count,
bool result = true;
uint32_t elapsed_time_ms = 0;
for (size_t i = 0; i < count && result; ++i) {
- rtc::ByteBuffer buf;
+ rtc::ByteBufferWriter buf;
if (rtcp) {
kTestRawRtcpPackets[i].WriteToByteBuffer(&buf);
} else {
@@ -164,7 +164,7 @@ bool RtpTestUtility::VerifyTestPacketsFromStream(size_t count,
prev_elapsed_time = packet.elapsed_time;
// Check the RTP or RTCP packet.
- rtc::ByteBuffer buf(reinterpret_cast<const char*>(&packet.data[0]),
+ rtc::ByteBufferReader buf(reinterpret_cast<const char*>(&packet.data[0]),
packet.data.size());
if (packet.is_rtcp()) {
// RTCP packet.
@@ -194,7 +194,7 @@ bool RtpTestUtility::VerifyPacket(const RtpDumpPacket* dump,
bool header_only) {
if (!dump || !raw) return false;
- rtc::ByteBuffer buf;
+ rtc::ByteBufferWriter buf;
raw->WriteToByteBuffer(RtpTestUtility::kDefaultSsrc, &buf);
if (header_only) {
« no previous file with comments | « webrtc/media/base/testutils.h ('k') | webrtc/media/base/videoengine_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698