OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 rtc::scoped_refptr<VideoFrameBuffer> buffer = | 153 rtc::scoped_refptr<VideoFrameBuffer> buffer = |
154 new rtc::RefCountedObject<CoreVideoFrameBuffer>( | 154 new rtc::RefCountedObject<CoreVideoFrameBuffer>( |
155 image_buffer, | 155 image_buffer, |
156 adapted_width, adapted_height, | 156 adapted_width, adapted_height, |
157 crop_width, crop_height, | 157 crop_width, crop_height, |
158 crop_x, crop_y); | 158 crop_x, crop_y); |
159 | 159 |
160 // Applying rotation is only supported for legacy reasons and performance is | 160 // Applying rotation is only supported for legacy reasons and performance is |
161 // not critical here. | 161 // not critical here. |
162 if (apply_rotation() && rotation != kVideoRotation_0) { | 162 if (apply_rotation() && rotation != kVideoRotation_0) { |
163 buffer = I420Buffer::Rotate(*buffer->NativeToI420Buffer(), | 163 buffer = I420Buffer::Rotate(buffer->NativeToI420Buffer(), |
164 rotation); | 164 rotation); |
165 if (rotation == kVideoRotation_90 || rotation == kVideoRotation_270) { | 165 if (rotation == kVideoRotation_90 || rotation == kVideoRotation_270) { |
166 std::swap(captured_width, captured_height); | 166 std::swap(captured_width, captured_height); |
167 } | 167 } |
168 | 168 |
169 rotation = kVideoRotation_0; | 169 rotation = kVideoRotation_0; |
170 } | 170 } |
171 | 171 |
172 OnFrame(webrtc::VideoFrame(buffer, rotation, translated_camera_time_us), | 172 OnFrame(webrtc::VideoFrame(buffer, rotation, translated_camera_time_us), |
173 captured_width, captured_height); | 173 captured_width, captured_height); |
174 } | 174 } |
175 | 175 |
176 } // namespace webrtc | 176 } // namespace webrtc |
OLD | NEW |