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

Unified Diff: webrtc/modules/video_coding/encoded_frame.cc

Issue 1602523004: Added EncodedImage::GetBufferPaddingBytes. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Constant inside EncodedImage instead Created 4 years, 11 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/modules/video_coding/codecs/h264/h264.gypi ('k') | webrtc/modules/video_coding/frame_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/encoded_frame.cc
diff --git a/webrtc/modules/video_coding/encoded_frame.cc b/webrtc/modules/video_coding/encoded_frame.cc
index 261074ae73c365a4502a0c1c057d5a82b592803a..cc3a91eeacdb9d41dcbd0a5839ab057104918402 100644
--- a/webrtc/modules/video_coding/encoded_frame.cc
+++ b/webrtc/modules/video_coding/encoded_frame.cc
@@ -41,7 +41,8 @@ VCMEncodedFrame::VCMEncodedFrame(const webrtc::EncodedImage& rhs)
_size = 0;
_length = 0;
if (rhs._buffer != NULL) {
- VerifyAndAllocate(rhs._length);
+ VerifyAndAllocate(rhs._length +
+ EncodedImage::GetBufferPaddingBytes(_codec));
memcpy(_buffer, rhs._buffer, rhs._length);
}
}
@@ -60,7 +61,8 @@ VCMEncodedFrame::VCMEncodedFrame(const VCMEncodedFrame& rhs)
_size = 0;
_length = 0;
if (rhs._buffer != NULL) {
- VerifyAndAllocate(rhs._length);
+ VerifyAndAllocate(rhs._length +
+ EncodedImage::GetBufferPaddingBytes(_codec));
memcpy(_buffer, rhs._buffer, rhs._length);
_length = rhs._length;
}
« no previous file with comments | « webrtc/modules/video_coding/codecs/h264/h264.gypi ('k') | webrtc/modules/video_coding/frame_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698