Delete VCMEncodedFrame methods Buffer and MutableBuffer
Replaced by inherited method EncodedImage::data().
Bug: webrtc:9378
Change-Id: I4ec75148f578c72ffb407f9cbf6b4232cc9cfcf6
Reviewed-on: https://webrtc-review.googlesource.com/c/116962
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26212}
diff --git a/modules/video_coding/encoded_frame.h b/modules/video_coding/encoded_frame.h
index 978ee5c..2cdcff9 100644
--- a/modules/video_coding/encoded_frame.h
+++ b/modules/video_coding/encoded_frame.h
@@ -56,17 +56,8 @@
const webrtc::EncodedImage& EncodedImage() const {
return static_cast<const webrtc::EncodedImage&>(*this);
}
- /**
- * Get pointer to frame buffer
- */
- const uint8_t* Buffer() const { return _buffer; }
- /**
- * Get pointer to frame buffer that can be mutated.
- */
- uint8_t* MutableBuffer() { return _buffer; }
- /**
- * Frame RTP timestamp (90kHz)
- */
+
+ using EncodedImage::data;
using EncodedImage::set_size;
using EncodedImage::SetSpatialIndex;
using EncodedImage::SetTimestamp;
diff --git a/modules/video_coding/frame_buffer2.cc b/modules/video_coding/frame_buffer2.cc
index af093c5..4c0a3bb 100644
--- a/modules/video_coding/frame_buffer2.cc
+++ b/modules/video_coding/frame_buffer2.cc
@@ -645,10 +645,10 @@
last_frame->video_timing().receive_finish_ms;
// Append all remaining frames to the first one.
- uint8_t* buffer = first_frame->MutableBuffer() + first_frame->size();
+ uint8_t* buffer = first_frame->data() + first_frame->size();
for (size_t i = 1; i < frames.size(); ++i) {
EncodedFrame* next_frame = frames[i];
- memcpy(buffer, next_frame->Buffer(), next_frame->size());
+ memcpy(buffer, next_frame->data(), next_frame->size());
buffer += next_frame->size();
delete next_frame;
}
diff --git a/modules/video_coding/jitter_buffer_unittest.cc b/modules/video_coding/jitter_buffer_unittest.cc
index e95a312..c2f5ed3 100644
--- a/modules/video_coding/jitter_buffer_unittest.cc
+++ b/modules/video_coding/jitter_buffer_unittest.cc
@@ -272,7 +272,7 @@
bool startCode) {
ASSERT_TRUE(frame_out);
- const uint8_t* outData = frame_out->Buffer();
+ const uint8_t* outData = frame_out->data();
unsigned int i = 0;
if (startCode) {
diff --git a/modules/video_coding/video_packet_buffer_unittest.cc b/modules/video_coding/video_packet_buffer_unittest.cc
index c546d72..49b1c26 100644
--- a/modules/video_coding/video_packet_buffer_unittest.cc
+++ b/modules/video_coding/video_packet_buffer_unittest.cc
@@ -451,7 +451,7 @@
ASSERT_EQ(1UL, frames_from_callback_.size());
CheckFrame(seq_num);
EXPECT_EQ(frames_from_callback_[seq_num]->size(), result_length);
- EXPECT_EQ(memcmp(frames_from_callback_[seq_num]->Buffer(),
+ EXPECT_EQ(memcmp(frames_from_callback_[seq_num]->data(),
"many bitstream, such data", result_length),
0);
}
@@ -468,7 +468,7 @@
CheckFrame(0);
EXPECT_EQ(frames_from_callback_[0]->size(), sizeof(bitstream_data));
EXPECT_EQ(
- memcmp(frames_from_callback_[0]->Buffer(), data, sizeof(bitstream_data)),
+ memcmp(frames_from_callback_[0]->data(), data, sizeof(bitstream_data)),
0);
}
@@ -491,8 +491,7 @@
ASSERT_EQ(1UL, frames_from_callback_.size());
CheckFrame(0);
EXPECT_EQ(frames_from_callback_[0]->size(), static_cast<size_t>(kStartSize));
- EXPECT_EQ(memcmp(frames_from_callback_[0]->Buffer(), expected, kStartSize),
- 0);
+ EXPECT_EQ(memcmp(frames_from_callback_[0]->data(), expected, kStartSize), 0);
}
TEST_F(TestPacketBuffer, InsertPacketAfterOldFrameObjectIsRemoved) {
@@ -619,8 +618,7 @@
ASSERT_EQ(1UL, frames_from_callback_.size());
CheckFrame(0);
EXPECT_EQ(frames_from_callback_[0]->size(), static_cast<size_t>(kStartSize));
- EXPECT_EQ(memcmp(frames_from_callback_[0]->Buffer(), expected, kStartSize),
- 0);
+ EXPECT_EQ(memcmp(frames_from_callback_[0]->data(), expected, kStartSize), 0);
}
TEST_P(TestPacketBufferH264Parameterized, GetBitstreamBufferPadding) {
@@ -650,7 +648,7 @@
EXPECT_EQ(frames_from_callback_[seq_num]->EncodedImage().capacity(),
sizeof(data_data) + EncodedImage::kBufferPaddingBytesH264);
EXPECT_EQ(
- memcmp(frames_from_callback_[seq_num]->Buffer(), data, sizeof(data_data)),
+ memcmp(frames_from_callback_[seq_num]->data(), data, sizeof(data_data)),
0);
}