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

Unified Diff: talk/app/webrtc/java/jni/androidvideocapturer_jni.cc

Issue 1178703009: VideoCapturerAndroid: Add function to change capture format while camera is running (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase and addressing comments Created 5 years, 5 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
Index: talk/app/webrtc/java/jni/androidvideocapturer_jni.cc
diff --git a/talk/app/webrtc/java/jni/androidvideocapturer_jni.cc b/talk/app/webrtc/java/jni/androidvideocapturer_jni.cc
index 3f3b7a6caddc4b446e4271dd824fcd5f537c195c..0b7a2efb2194fa3c88ddc74634adbb73a22e1369 100644
--- a/talk/app/webrtc/java/jni/androidvideocapturer_jni.cc
+++ b/talk/app/webrtc/java/jni/androidvideocapturer_jni.cc
@@ -174,12 +174,14 @@ void AndroidVideoCapturerJni::OnCapturerStarted(bool success) {
void AndroidVideoCapturerJni::OnIncomingFrame(void* video_frame,
int length,
+ int width,
+ int height,
int rotation,
int64 time_stamp) {
invoker_.AsyncInvoke<void>(
thread_,
- rtc::Bind(&AndroidVideoCapturerJni::OnIncomingFrame_w,
- this, video_frame, length, rotation, time_stamp));
+ rtc::Bind(&AndroidVideoCapturerJni::OnIncomingFrame_w, this, video_frame,
+ length, width, height, rotation, time_stamp));
}
void AndroidVideoCapturerJni::OnOutputFormatRequest(int width,
@@ -202,11 +204,14 @@ void AndroidVideoCapturerJni::OnCapturerStarted_w(bool success) {
void AndroidVideoCapturerJni::OnIncomingFrame_w(void* video_frame,
int length,
+ int width,
+ int height,
int rotation,
int64 time_stamp) {
CHECK(thread_checker_.CalledOnValidThread());
if (capturer_) {
- capturer_->OnIncomingFrame(video_frame, length, rotation, time_stamp);
+ capturer_->OnIncomingFrame(video_frame, length, width, height, rotation,
+ time_stamp);
} else {
LOG(LS_INFO) <<
"Frame arrived after camera has been stopped: " << time_stamp <<
@@ -230,13 +235,13 @@ JNIEnv* AndroidVideoCapturerJni::jni() { return AttachCurrentThreadIfNeeded(); }
JOW(void, VideoCapturerAndroid_00024NativeObserver_nativeOnFrameCaptured)
(JNIEnv* jni, jclass, jlong j_capturer, jbyteArray j_frame, jint length,
- jint rotation, jlong ts) {
+ jint width, jint height, jint rotation, jlong ts) {
jboolean is_copy = true;
jbyte* bytes = jni->GetByteArrayElements(j_frame, &is_copy);
if (!is_copy) {
- reinterpret_cast<AndroidVideoCapturerJni*>(
- j_capturer)->OnIncomingFrame(bytes, length, rotation, ts);
- } else {
+ reinterpret_cast<AndroidVideoCapturerJni*>(j_capturer)
+ ->OnIncomingFrame(bytes, length, width, height, rotation, ts);
+ } else {
// If this is a copy of the original frame, it means that the memory
// is not direct memory and thus VideoCapturerAndroid does not guarantee
// that the memory is valid when we have released |j_frame|.
« no previous file with comments | « talk/app/webrtc/java/jni/androidvideocapturer_jni.h ('k') | talk/app/webrtc/java/src/org/webrtc/VideoCapturerAndroid.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698