Revert "Delete the non-const version of the EncodedImage::data() method."

This reverts commit f2969fa868f4913583e79f74ceced5cc6b7d6b7d.

Reason for revert: Breaks blink_platform_unittests; sample failure:
https://ci.chromium.org/p/chromium/builders/try/linux-rel/500046

Original change's description:
> Delete the non-const version of the EncodedImage::data() method.
>
> Bug: webrtc:9378
> Change-Id: I84ace3ca6a2eb4d0f7c3d4e62f815d77df581bfa
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185122
> Reviewed-by: Artem Titov <titovartem@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32197}

TBR=ilnik@webrtc.org,nisse@webrtc.org,philipel@webrtc.org,titovartem@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:9378
Change-Id: I6374d263e2ee10da318ab1e040ed18bed7a96edd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185507
Reviewed-by: Marina Ciocea <marinaciocea@webrtc.org>
Commit-Queue: Marina Ciocea <marinaciocea@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32205}
This commit is contained in:
Marina Ciocea
2020-09-27 06:26:30 +00:00
committed by Commit Bot
parent 9def3ff4a3
commit 111de34102
16 changed files with 83 additions and 97 deletions

View File

@ -147,6 +147,11 @@ class RTC_EXPORT EncodedImage {
return encoded_data_;
}
// TODO(nisse): Delete, provide only read-only access to the buffer.
uint8_t* data() {
return buffer_ ? buffer_
: (encoded_data_ ? encoded_data_->data() : nullptr);
}
const uint8_t* data() const {
return buffer_ ? buffer_
: (encoded_data_ ? encoded_data_->data() : nullptr);