OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 buffer_pool_.CreateBuffer(adapted_width, adapted_height); | 92 buffer_pool_.CreateBuffer(adapted_width, adapted_height); |
93 | 93 |
94 nv12toi420_scaler_.NV12ToI420Scale( | 94 nv12toi420_scaler_.NV12ToI420Scale( |
95 y_plane, width, uv_plane, uv_width * 2, crop_width, crop_height, | 95 y_plane, width, uv_plane, uv_width * 2, crop_width, crop_height, |
96 buffer->MutableDataY(), buffer->StrideY(), | 96 buffer->MutableDataY(), buffer->StrideY(), |
97 // Swap U and V, since we have NV21, not NV12. | 97 // Swap U and V, since we have NV21, not NV12. |
98 buffer->MutableDataV(), buffer->StrideV(), buffer->MutableDataU(), | 98 buffer->MutableDataV(), buffer->StrideV(), buffer->MutableDataU(), |
99 buffer->StrideU(), buffer->width(), buffer->height()); | 99 buffer->StrideU(), buffer->width(), buffer->height()); |
100 | 100 |
101 OnFrame(VideoFrame(buffer, static_cast<webrtc::VideoRotation>(rotation), | 101 OnFrame(VideoFrame(buffer, static_cast<webrtc::VideoRotation>(rotation), |
102 translated_camera_time_us)); | 102 webrtc::kVideoContent_Default, translated_camera_time_us)); |
103 } | 103 } |
104 | 104 |
105 void AndroidVideoTrackSource::OnTextureFrameCaptured( | 105 void AndroidVideoTrackSource::OnTextureFrameCaptured( |
106 int width, | 106 int width, |
107 int height, | 107 int height, |
108 int rotation, | 108 int rotation, |
109 int64_t timestamp_ns, | 109 int64_t timestamp_ns, |
110 const webrtc_jni::NativeHandleImpl& handle) { | 110 const webrtc_jni::NativeHandleImpl& handle) { |
111 RTC_DCHECK(camera_thread_checker_.CalledOnValidThread()); | 111 RTC_DCHECK(camera_thread_checker_.CalledOnValidThread()); |
112 RTC_DCHECK(rotation == 0 || rotation == 90 || rotation == 180 || | 112 RTC_DCHECK(rotation == 0 || rotation == 90 || rotation == 180 || |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 } | 148 } |
149 matrix.Rotate(static_cast<webrtc::VideoRotation>(rotation)); | 149 matrix.Rotate(static_cast<webrtc::VideoRotation>(rotation)); |
150 } | 150 } |
151 | 151 |
152 OnFrame(VideoFrame( | 152 OnFrame(VideoFrame( |
153 surface_texture_helper_->CreateTextureFrame( | 153 surface_texture_helper_->CreateTextureFrame( |
154 adapted_width, adapted_height, | 154 adapted_width, adapted_height, |
155 webrtc_jni::NativeHandleImpl(handle.oes_texture_id, matrix)), | 155 webrtc_jni::NativeHandleImpl(handle.oes_texture_id, matrix)), |
156 do_rotate ? webrtc::kVideoRotation_0 | 156 do_rotate ? webrtc::kVideoRotation_0 |
157 : static_cast<webrtc::VideoRotation>(rotation), | 157 : static_cast<webrtc::VideoRotation>(rotation), |
158 translated_camera_time_us)); | 158 webrtc::kVideoContent_Default, translated_camera_time_us)); |
159 } | 159 } |
160 | 160 |
161 void AndroidVideoTrackSource::OnOutputFormatRequest(int width, | 161 void AndroidVideoTrackSource::OnOutputFormatRequest(int width, |
162 int height, | 162 int height, |
163 int fps) { | 163 int fps) { |
164 cricket::VideoFormat format(width, height, | 164 cricket::VideoFormat format(width, height, |
165 cricket::VideoFormat::FpsToInterval(fps), 0); | 165 cricket::VideoFormat::FpsToInterval(fps), 0); |
166 video_adapter()->OnOutputFormatRequest(format); | 166 video_adapter()->OnOutputFormatRequest(format); |
167 } | 167 } |
168 | 168 |
169 } // namespace webrtc | 169 } // namespace webrtc |
OLD | NEW |