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

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

Issue 2009193002: Delete IsMutable and IsExclusive methods. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Address tommi's comments. Created 4 years, 7 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
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 } 72 }
73 73
74 int WebRtcVideoFrame::width() const { 74 int WebRtcVideoFrame::width() const {
75 return video_frame_buffer_ ? video_frame_buffer_->width() : 0; 75 return video_frame_buffer_ ? video_frame_buffer_->width() : 0;
76 } 76 }
77 77
78 int WebRtcVideoFrame::height() const { 78 int WebRtcVideoFrame::height() const {
79 return video_frame_buffer_ ? video_frame_buffer_->height() : 0; 79 return video_frame_buffer_ ? video_frame_buffer_->height() : 0;
80 } 80 }
81 81
82 bool WebRtcVideoFrame::IsExclusive() const {
83 return video_frame_buffer_->IsMutable();
84 }
85
86 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& 82 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>&
87 WebRtcVideoFrame::video_frame_buffer() const { 83 WebRtcVideoFrame::video_frame_buffer() const {
88 return video_frame_buffer_; 84 return video_frame_buffer_;
89 } 85 }
90 86
87 std::unique_ptr<VideoFrame> WebRtcVideoFrame::CreateWithBuffer(
88 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer,
89 webrtc::VideoRotation rotation,
90 int64_t timestamp_us) const {
91 return std::unique_ptr<VideoFrame>(
92 new WebRtcVideoFrame(buffer, rotation, timestamp_us));
93 }
94
91 VideoFrame* WebRtcVideoFrame::Copy() const { 95 VideoFrame* WebRtcVideoFrame::Copy() const {
92 return new WebRtcVideoFrame(video_frame_buffer_, rotation_, timestamp_us_); 96 return new WebRtcVideoFrame(video_frame_buffer_, rotation_, timestamp_us_);
93 } 97 }
94 98
95 size_t WebRtcVideoFrame::ConvertToRgbBuffer(uint32_t to_fourcc, 99 size_t WebRtcVideoFrame::ConvertToRgbBuffer(uint32_t to_fourcc,
96 uint8_t* buffer, 100 uint8_t* buffer,
97 size_t size, 101 size_t size,
98 int stride_rgb) const { 102 int stride_rgb) const {
99 RTC_CHECK(video_frame_buffer_); 103 RTC_CHECK(video_frame_buffer_);
100 RTC_CHECK(video_frame_buffer_->native_handle() == nullptr); 104 RTC_CHECK(video_frame_buffer_->native_handle() == nullptr);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 rotated_frame_->video_frame_buffer()->StrideV(), 227 rotated_frame_->video_frame_buffer()->StrideV(),
224 orig_width, orig_height, 228 orig_width, orig_height,
225 static_cast<libyuv::RotationMode>(rotation())); 229 static_cast<libyuv::RotationMode>(rotation()));
226 if (ret == 0) { 230 if (ret == 0) {
227 return rotated_frame_.get(); 231 return rotated_frame_.get();
228 } 232 }
229 return nullptr; 233 return nullptr;
230 } 234 }
231 235
232 } // namespace cricket 236 } // namespace cricket
OLDNEW
« webrtc/media/base/videoframefactory.cc ('K') | « webrtc/media/engine/webrtcvideoframe.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698