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

Unified Diff: webrtc/common_video/video_frame.cc

Issue 1304143003: VideoFrameBuffer: Make non-const data access explicit (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase Created 5 years, 4 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/common_video/interface/video_frame_buffer.h ('k') | webrtc/common_video/video_frame_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_video/video_frame.cc
diff --git a/webrtc/common_video/video_frame.cc b/webrtc/common_video/video_frame.cc
index 208a31b618f1b52f3d941c844246994d1432b106..0ebb9835d55f593be62dcf77cded48dd6402fb9c 100644
--- a/webrtc/common_video/video_frame.cc
+++ b/webrtc/common_video/video_frame.cc
@@ -152,13 +152,12 @@ void VideoFrame::Reset() {
}
uint8_t* VideoFrame::buffer(PlaneType type) {
- return video_frame_buffer_ ? video_frame_buffer_->data(type) : nullptr;
+ return video_frame_buffer_ ? video_frame_buffer_->MutableData(type)
+ : nullptr;
}
const uint8_t* VideoFrame::buffer(PlaneType type) const {
- // Const cast to call the correct const-version of data.
- const VideoFrameBuffer* const_buffer = video_frame_buffer_.get();
- return const_buffer ? const_buffer->data(type) : nullptr;
+ return video_frame_buffer_ ? video_frame_buffer_->data(type) : nullptr;
}
int VideoFrame::allocated_size(PlaneType type) const {
« no previous file with comments | « webrtc/common_video/interface/video_frame_buffer.h ('k') | webrtc/common_video/video_frame_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698