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

Side by Side Diff: webrtc/api/androidvideotracksource.cc

Issue 2088953002: Add cricket::VideoFrame::frame_id() and set it to RTP timestamp. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: . Created 4 years, 4 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) 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 rtc::scoped_refptr<webrtc::I420Buffer> scaled_buffer( 139 rtc::scoped_refptr<webrtc::I420Buffer> scaled_buffer(
140 post_scale_pool_.CreateBuffer(adapted_width, adapted_height)); 140 post_scale_pool_.CreateBuffer(adapted_width, adapted_height));
141 scaled_buffer->ScaleFrom(buffer); 141 scaled_buffer->ScaleFrom(buffer);
142 buffer = scaled_buffer; 142 buffer = scaled_buffer;
143 } 143 }
144 144
145 OnFrame(cricket::WebRtcVideoFrame( 145 OnFrame(cricket::WebRtcVideoFrame(
146 buffer, 146 buffer,
147 apply_rotation_ ? webrtc::kVideoRotation_0 147 apply_rotation_ ? webrtc::kVideoRotation_0
148 : static_cast<webrtc::VideoRotation>(rotation), 148 : static_cast<webrtc::VideoRotation>(rotation),
149 translated_camera_time_us), 149 translated_camera_time_us, 0),
150 width, height); 150 width, height);
151 } 151 }
152 152
153 void AndroidVideoTrackSource::OnTextureFrameCaptured( 153 void AndroidVideoTrackSource::OnTextureFrameCaptured(
154 int width, 154 int width,
155 int height, 155 int height,
156 int rotation, 156 int rotation,
157 int64_t timestamp_ns, 157 int64_t timestamp_ns,
158 const webrtc_jni::NativeHandleImpl& handle) { 158 const webrtc_jni::NativeHandleImpl& handle) {
159 RTC_DCHECK(camera_thread_checker_.CalledOnValidThread()); 159 RTC_DCHECK(camera_thread_checker_.CalledOnValidThread());
(...skipping 30 matching lines...) Expand all
190 } 190 }
191 matrix.Rotate(static_cast<webrtc::VideoRotation>(rotation)); 191 matrix.Rotate(static_cast<webrtc::VideoRotation>(rotation));
192 } 192 }
193 193
194 OnFrame(cricket::WebRtcVideoFrame( 194 OnFrame(cricket::WebRtcVideoFrame(
195 surface_texture_helper_->CreateTextureFrame( 195 surface_texture_helper_->CreateTextureFrame(
196 adapted_width, adapted_height, 196 adapted_width, adapted_height,
197 webrtc_jni::NativeHandleImpl(handle.oes_texture_id, matrix)), 197 webrtc_jni::NativeHandleImpl(handle.oes_texture_id, matrix)),
198 apply_rotation_ ? webrtc::kVideoRotation_0 198 apply_rotation_ ? webrtc::kVideoRotation_0
199 : static_cast<webrtc::VideoRotation>(rotation), 199 : static_cast<webrtc::VideoRotation>(rotation),
200 translated_camera_time_us), 200 translated_camera_time_us, 0),
201 width, height); 201 width, height);
202 } 202 }
203 203
204 void AndroidVideoTrackSource::OnFrame(const cricket::VideoFrame& frame, 204 void AndroidVideoTrackSource::OnFrame(const cricket::VideoFrame& frame,
205 int width, 205 int width,
206 int height) { 206 int height) {
207 { 207 {
208 rtc::CritScope lock(&stats_crit_); 208 rtc::CritScope lock(&stats_crit_);
209 stats_ = rtc::Optional<AndroidVideoTrackSource::Stats>({width, height}); 209 stats_ = rtc::Optional<AndroidVideoTrackSource::Stats>({width, height});
210 } 210 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 } 251 }
252 *crop_x = (width - *crop_width) / 2; 252 *crop_x = (width - *crop_width) / 2;
253 *crop_y = (height - *crop_height) / 2; 253 *crop_y = (height - *crop_height) / 2;
254 254
255 *translated_camera_time_us = timestamp_aligner_.ClipTimestamp( 255 *translated_camera_time_us = timestamp_aligner_.ClipTimestamp(
256 camera_time_us + offset_us, system_time_us); 256 camera_time_us + offset_us, system_time_us);
257 return true; 257 return true;
258 } 258 }
259 259
260 } // namespace webrtc 260 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/android/jni/androidvideocapturer_jni.cc ('k') | webrtc/media/base/videobroadcaster.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698