diff --git a/talk/app/webrtc/androidvideocapturer.cc b/talk/app/webrtc/androidvideocapturer.cc index 2d5a1afea9..afcfb5bb7c 100644 --- a/talk/app/webrtc/androidvideocapturer.cc +++ b/talk/app/webrtc/androidvideocapturer.cc @@ -211,7 +211,7 @@ void AndroidVideoCapturer::OnCapturerStarted(bool success) { } void AndroidVideoCapturer::OnIncomingFrame( - rtc::scoped_refptr buffer, + const rtc::scoped_refptr& buffer, int rotation, int64_t time_stamp) { RTC_CHECK(thread_checker_.CalledOnValidThread()); diff --git a/talk/app/webrtc/androidvideocapturer.h b/talk/app/webrtc/androidvideocapturer.h index fdc86290bb..df783bdf6f 100644 --- a/talk/app/webrtc/androidvideocapturer.h +++ b/talk/app/webrtc/androidvideocapturer.h @@ -67,9 +67,10 @@ class AndroidVideoCapturer : public cricket::VideoCapturer { // Called from JNI when a new frame has been captured. // Argument |buffer| is intentionally by value, for use with rtc::Bind. - void OnIncomingFrame(rtc::scoped_refptr buffer, - int rotation, - int64_t time_stamp); + void OnIncomingFrame( + const rtc::scoped_refptr& buffer, + int rotation, + int64_t time_stamp); // Called from JNI to request a new video format. void OnOutputFormatRequest(int width, int height, int fps); diff --git a/talk/app/webrtc/java/jni/androidvideocapturer_jni.cc b/talk/app/webrtc/java/jni/androidvideocapturer_jni.cc index cd6cfc0fed..02b9f22015 100644 --- a/talk/app/webrtc/java/jni/androidvideocapturer_jni.cc +++ b/talk/app/webrtc/java/jni/androidvideocapturer_jni.cc @@ -118,7 +118,7 @@ template void AndroidVideoCapturerJni::AsyncCapturerInvoke( const char* method_name, void (webrtc::AndroidVideoCapturer::*method)(Args...), - Args... args) { + typename Identity::type... args) { rtc::CritScope cs(&capturer_lock_); if (!invoker_) { LOG(LS_WARNING) << method_name << "() called for closed capturer."; diff --git a/talk/app/webrtc/java/jni/androidvideocapturer_jni.h b/talk/app/webrtc/java/jni/androidvideocapturer_jni.h index 360674bb70..d1eb3a0ad0 100644 --- a/talk/app/webrtc/java/jni/androidvideocapturer_jni.h +++ b/talk/app/webrtc/java/jni/androidvideocapturer_jni.h @@ -71,13 +71,19 @@ class AndroidVideoCapturerJni : public webrtc::AndroidVideoCapturerDelegate { void ReturnBuffer(int64_t time_stamp); JNIEnv* jni(); + // To avoid deducing Args from the 3rd parameter of AsyncCapturerInvoke. + template + struct Identity { + typedef T type; + }; + // Helper function to make safe asynchronous calls to |capturer_|. The calls // are not guaranteed to be delivered. template void AsyncCapturerInvoke( const char* method_name, void (webrtc::AndroidVideoCapturer::*method)(Args...), - Args... args); + typename Identity::type... args); const ScopedGlobalRef j_capturer_global_; const ScopedGlobalRef j_video_capturer_class_;