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

Side by Side Diff: webrtc/media/engine/webrtcvideoframe.cc

Issue 1881933004: Introduce an IsMutable method on VideoFrameBuffer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « webrtc/common_video/video_frame_buffer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 int32_t WebRtcVideoFrame::GetUPitch() const { 113 int32_t WebRtcVideoFrame::GetUPitch() const {
114 return video_frame_buffer_ ? video_frame_buffer_->stride(kUPlane) : 0; 114 return video_frame_buffer_ ? video_frame_buffer_->stride(kUPlane) : 0;
115 } 115 }
116 116
117 int32_t WebRtcVideoFrame::GetVPitch() const { 117 int32_t WebRtcVideoFrame::GetVPitch() const {
118 return video_frame_buffer_ ? video_frame_buffer_->stride(kVPlane) : 0; 118 return video_frame_buffer_ ? video_frame_buffer_->stride(kVPlane) : 0;
119 } 119 }
120 120
121 bool WebRtcVideoFrame::IsExclusive() const { 121 bool WebRtcVideoFrame::IsExclusive() const {
122 return video_frame_buffer_->HasOneRef(); 122 return video_frame_buffer_->IsMutable();
123 } 123 }
124 124
125 void* WebRtcVideoFrame::GetNativeHandle() const { 125 void* WebRtcVideoFrame::GetNativeHandle() const {
126 return video_frame_buffer_ ? video_frame_buffer_->native_handle() : nullptr; 126 return video_frame_buffer_ ? video_frame_buffer_->native_handle() : nullptr;
127 } 127 }
128 128
129 rtc::scoped_refptr<webrtc::VideoFrameBuffer> 129 rtc::scoped_refptr<webrtc::VideoFrameBuffer>
130 WebRtcVideoFrame::video_frame_buffer() const { 130 WebRtcVideoFrame::video_frame_buffer() const {
131 return video_frame_buffer_; 131 return video_frame_buffer_;
132 } 132 }
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 rotated_frame_->GetVPlane(), rotated_frame_->GetVPitch(), 258 rotated_frame_->GetVPlane(), rotated_frame_->GetVPitch(),
259 orig_width, orig_height, 259 orig_width, orig_height,
260 static_cast<libyuv::RotationMode>(rotation())); 260 static_cast<libyuv::RotationMode>(rotation()));
261 if (ret == 0) { 261 if (ret == 0) {
262 return rotated_frame_.get(); 262 return rotated_frame_.get();
263 } 263 }
264 return nullptr; 264 return nullptr;
265 } 265 }
266 266
267 } // namespace cricket 267 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/common_video/video_frame_buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698