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

Unified Diff: webrtc/api/java/jni/androidvideocapturer_jni.cc

Issue 2017443003: Implement timestamp translation/filter in VideoCapturer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix offset update equation, and nits. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/media/base/videocapturer.h » ('j') | webrtc/media/base/videocapturer.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/java/jni/androidvideocapturer_jni.cc
diff --git a/webrtc/api/java/jni/androidvideocapturer_jni.cc b/webrtc/api/java/jni/androidvideocapturer_jni.cc
index 0e8e8677ab54955ae27a341a8492d83de64d1063..b90a96f53f8633f401a73584718848f4416fea7b 100644
--- a/webrtc/api/java/jni/androidvideocapturer_jni.cc
+++ b/webrtc/api/java/jni/androidvideocapturer_jni.cc
@@ -180,10 +180,12 @@ void AndroidVideoCapturerJni::OnMemoryBufferFrame(void* video_frame,
int crop_height;
int crop_x;
int crop_y;
+ int64_t time_us;
pthatcher1 2016/05/27 22:47:43 Can you be a little more specific about what the t
nisse-webrtc 2016/05/30 08:57:29 I changed it to translated_capture_time_us. Better
if (!capturer_->AdaptFrame(width, height, timestamp_ns,
&adapted_width, &adapted_height,
- &crop_width, &crop_height, &crop_x, &crop_y)) {
+ &crop_width, &crop_height, &crop_x, &crop_y,
+ &time_us)) {
return;
}
@@ -236,12 +238,12 @@ void AndroidVideoCapturerJni::OnMemoryBufferFrame(void* video_frame,
}
buffer = scaled;
}
- // TODO(nisse): Use microsecond time instead.
capturer_->OnFrame(cricket::WebRtcVideoFrame(
- buffer, timestamp_ns,
+ buffer,
capturer_->apply_rotation()
? webrtc::kVideoRotation_0
- : static_cast<webrtc::VideoRotation>(rotation)),
+ : static_cast<webrtc::VideoRotation>(rotation),
+ time_us),
width, height);
}
@@ -260,10 +262,12 @@ void AndroidVideoCapturerJni::OnTextureFrame(int width,
int crop_height;
int crop_x;
int crop_y;
+ int64_t time_us;
if (!capturer_->AdaptFrame(width, height, timestamp_ns,
&adapted_width, &adapted_height,
- &crop_width, &crop_height, &crop_x, &crop_y)) {
+ &crop_width, &crop_height, &crop_x, &crop_y,
+ &time_us)) {
return;
}
@@ -282,15 +286,15 @@ void AndroidVideoCapturerJni::OnTextureFrame(int width,
matrix.Rotate(static_cast<webrtc::VideoRotation>(rotation));
}
- // TODO(nisse): Use microsecond time instead.
capturer_->OnFrame(
cricket::WebRtcVideoFrame(
surface_texture_helper_->CreateTextureFrame(
adapted_width, adapted_height,
NativeHandleImpl(handle.oes_texture_id, matrix)),
- timestamp_ns, capturer_->apply_rotation()
- ? webrtc::kVideoRotation_0
- : static_cast<webrtc::VideoRotation>(rotation)),
+ capturer_->apply_rotation()
+ ? webrtc::kVideoRotation_0
+ : static_cast<webrtc::VideoRotation>(rotation),
+ time_us),
width, height);
}
« no previous file with comments | « no previous file | webrtc/media/base/videocapturer.h » ('j') | webrtc/media/base/videocapturer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698