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

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

Issue 2275243002: Reland of Delete method cricket::VideoFrame::Copy. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Update peerconnection_jni.cc (file moved since the revert). Created 4 years, 3 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } 96 }
97 97
98 void WebRtcVideoFrame::set_timestamp_us(int64_t time_us) { 98 void WebRtcVideoFrame::set_timestamp_us(int64_t time_us) {
99 timestamp_us_ = time_us; 99 timestamp_us_ = time_us;
100 } 100 }
101 101
102 webrtc::VideoRotation WebRtcVideoFrame::rotation() const { 102 webrtc::VideoRotation WebRtcVideoFrame::rotation() const {
103 return rotation_; 103 return rotation_;
104 } 104 }
105 105
106 VideoFrame* WebRtcVideoFrame::Copy() const {
107 return new WebRtcVideoFrame(video_frame_buffer_, rotation_, timestamp_us_,
108 transport_frame_id_);
109 }
110
111 size_t WebRtcVideoFrame::ConvertToRgbBuffer(uint32_t to_fourcc, 106 size_t WebRtcVideoFrame::ConvertToRgbBuffer(uint32_t to_fourcc,
112 uint8_t* buffer, 107 uint8_t* buffer,
113 size_t size, 108 size_t size,
114 int stride_rgb) const { 109 int stride_rgb) const {
115 RTC_CHECK(video_frame_buffer_); 110 RTC_CHECK(video_frame_buffer_);
116 RTC_CHECK(video_frame_buffer_->native_handle() == nullptr); 111 RTC_CHECK(video_frame_buffer_->native_handle() == nullptr);
117 return VideoFrame::ConvertToRgbBuffer(to_fourcc, buffer, size, stride_rgb); 112 return VideoFrame::ConvertToRgbBuffer(to_fourcc, buffer, size, stride_rgb);
118 } 113 }
119 114
120 bool WebRtcVideoFrame::Reset(uint32_t format, 115 bool WebRtcVideoFrame::Reset(uint32_t format,
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 static_cast<libyuv::RotationMode>(rotation())); 217 static_cast<libyuv::RotationMode>(rotation()));
223 if (ret == 0) { 218 if (ret == 0) {
224 rotated_frame_.reset(new WebRtcVideoFrame( 219 rotated_frame_.reset(new WebRtcVideoFrame(
225 buffer, webrtc::kVideoRotation_0, timestamp_us_, transport_frame_id_)); 220 buffer, webrtc::kVideoRotation_0, timestamp_us_, transport_frame_id_));
226 } 221 }
227 222
228 return rotated_frame_.get(); 223 return rotated_frame_.get();
229 } 224 }
230 225
231 } // namespace cricket 226 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvideoframe.h ('k') | webrtc/media/engine/webrtcvideoframe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698