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}
This commit is contained in:
@ -139,7 +139,7 @@ int64_t RtpFrameObject::RenderTime() const {
|
||||
}
|
||||
|
||||
void RtpFrameObject::SetSize(size_t size) {
|
||||
RTC_DCHECK_LE(size, _size);
|
||||
RTC_DCHECK_LE(size, capacity());
|
||||
_length = size;
|
||||
}
|
||||
|
||||
@ -182,10 +182,9 @@ void RtpFrameObject::AllocateBitstreamBuffer(size_t frame_size) {
|
||||
size_t new_size = frame_size + (codec_type_ == kVideoCodecH264
|
||||
? EncodedImage::kBufferPaddingBytesH264
|
||||
: 0);
|
||||
if (_size < new_size) {
|
||||
if (capacity() < new_size) {
|
||||
delete[] _buffer;
|
||||
_buffer = new uint8_t[new_size];
|
||||
_size = new_size;
|
||||
set_buffer(new uint8_t[new_size], new_size);
|
||||
}
|
||||
|
||||
_length = frame_size;
|
||||
|
Reference in New Issue
Block a user