Convert all webrtc code to not access EncodedImage::_size directly.
Read using capacity() method, write using set_buffer() method. This is
a preparation for making the member private, and renaming it to
capacity_.
Bug: webrtc:9378
Change-Id: I2f96679d052a83fe81be40301bd9863c87074640
Reviewed-on: https://webrtc-review.googlesource.com/c/113520
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25934}
diff --git a/modules/video_coding/frame_buffer.cc b/modules/video_coding/frame_buffer.cc
index e1abb64..9be2ef0 100644
--- a/modules/video_coding/frame_buffer.cc
+++ b/modules/video_coding/frame_buffer.cc
@@ -105,12 +105,12 @@
size() + packet.sizeBytes +
(packet.insertStartCode ? kH264StartCodeLengthBytes : 0) +
EncodedImage::GetBufferPaddingBytes(packet.codec);
- if (requiredSizeBytes >= _size) {
+ if (requiredSizeBytes >= capacity()) {
const uint8_t* prevBuffer = _buffer;
const uint32_t increments =
requiredSizeBytes / kBufferIncStepSizeBytes +
(requiredSizeBytes % kBufferIncStepSizeBytes > 0);
- const uint32_t newSize = _size + increments * kBufferIncStepSizeBytes;
+ const uint32_t newSize = capacity() + increments * kBufferIncStepSizeBytes;
if (newSize > kMaxJBFrameSizeBytes) {
RTC_LOG(LS_ERROR) << "Failed to insert packet due to frame being too "
"big.";