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

Unified Diff: webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc

Issue 1603643006: Reallocate encoded buffer size if needed. Initially set to the input image size. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase 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 | « no previous file | webrtc/video/video_send_stream_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
diff --git a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
index e55479551970e60e144e43e1a6e8a18c2087f579..106d14b986e4826434d1b31945da190fdb3d6828 100644
--- a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
+++ b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
@@ -660,6 +660,12 @@ int VP9EncoderImpl::GetEncodedLayerFrame(const vpx_codec_cx_pkt* pkt) {
int part_idx = 0;
CodecSpecificInfo codec_specific;
+ if (pkt->data.frame.sz > encoded_image_._size) {
+ delete[] encoded_image_._buffer;
+ encoded_image_._size = pkt->data.frame.sz;
+ encoded_image_._buffer = new uint8_t[encoded_image_._size];
stefan-webrtc 2016/01/20 12:39:07 Don't you have to copy the existing content of the
åsapersson 2016/01/20 13:32:00 It is only copied once right (line 670). encoded_
stefan-webrtc 2016/01/20 14:11:02 Sure, if you prefer. Although it should as far as
+ }
+
assert(pkt->kind == VPX_CODEC_CX_FRAME_PKT);
memcpy(&encoded_image_._buffer[encoded_image_._length], pkt->data.frame.buf,
pkt->data.frame.sz);
« no previous file with comments | « no previous file | webrtc/video/video_send_stream_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698