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

Side by Side Diff: talk/app/webrtc/java/jni/androidvideocapturer_jni.h

Issue 1414703002: passing |buffer| by reference in AndroidVideoCapturer::OnIncomingFrame (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: fix for formatting Created 5 years, 2 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 * libjingle 2 * libjingle
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 const NativeTextureHandleImpl& handle); 64 const NativeTextureHandleImpl& handle);
65 void OnOutputFormatRequest(int width, int height, int fps); 65 void OnOutputFormatRequest(int width, int height, int fps);
66 66
67 protected: 67 protected:
68 ~AndroidVideoCapturerJni(); 68 ~AndroidVideoCapturerJni();
69 69
70 private: 70 private:
71 void ReturnBuffer(int64_t time_stamp); 71 void ReturnBuffer(int64_t time_stamp);
72 JNIEnv* jni(); 72 JNIEnv* jni();
73 73
74 // To avoid deducing Args from the 3rd parameter of AsyncCapturerInvoke
magjed_webrtc 2015/10/20 15:39:26 nit: You should have a dot '.' at the of the sente
75 template <typename T>
76 struct Identity {
77 typedef T type;
78 };
79
74 // Helper function to make safe asynchronous calls to |capturer_|. The calls 80 // Helper function to make safe asynchronous calls to |capturer_|. The calls
75 // are not guaranteed to be delivered. 81 // are not guaranteed to be delivered.
76 template <typename... Args> 82 template <typename... Args>
77 void AsyncCapturerInvoke( 83 void AsyncCapturerInvoke(
78 const char* method_name, 84 const char* method_name,
79 void (webrtc::AndroidVideoCapturer::*method)(Args...), 85 void (webrtc::AndroidVideoCapturer::*method)(Args...),
80 Args... args); 86 typename Identity<Args>::type... args);
81 87
82 const ScopedGlobalRef<jobject> j_capturer_global_; 88 const ScopedGlobalRef<jobject> j_capturer_global_;
83 const ScopedGlobalRef<jclass> j_video_capturer_class_; 89 const ScopedGlobalRef<jclass> j_video_capturer_class_;
84 const ScopedGlobalRef<jclass> j_observer_class_; 90 const ScopedGlobalRef<jclass> j_observer_class_;
85 91
86 rtc::ThreadChecker thread_checker_; 92 rtc::ThreadChecker thread_checker_;
87 93
88 // |capturer| is a guaranteed to be a valid pointer between a call to 94 // |capturer| is a guaranteed to be a valid pointer between a call to
89 // AndroidVideoCapturerDelegate::Start 95 // AndroidVideoCapturerDelegate::Start
90 // until AndroidVideoCapturerDelegate::Stop. 96 // until AndroidVideoCapturerDelegate::Stop.
91 rtc::CriticalSection capturer_lock_; 97 rtc::CriticalSection capturer_lock_;
92 webrtc::AndroidVideoCapturer* capturer_ GUARDED_BY(capturer_lock_); 98 webrtc::AndroidVideoCapturer* capturer_ GUARDED_BY(capturer_lock_);
93 // |invoker_| is used to communicate with |capturer_| on the thread Start() is 99 // |invoker_| is used to communicate with |capturer_| on the thread Start() is
94 // called on. 100 // called on.
95 rtc::scoped_ptr<rtc::GuardedAsyncInvoker> invoker_ GUARDED_BY(capturer_lock_); 101 rtc::scoped_ptr<rtc::GuardedAsyncInvoker> invoker_ GUARDED_BY(capturer_lock_);
96 102
97 static jobject application_context_; 103 static jobject application_context_;
98 104
99 RTC_DISALLOW_COPY_AND_ASSIGN(AndroidVideoCapturerJni); 105 RTC_DISALLOW_COPY_AND_ASSIGN(AndroidVideoCapturerJni);
100 }; 106 };
101 107
102 } // namespace webrtc_jni 108 } // namespace webrtc_jni
103 109
104 #endif // TALK_APP_WEBRTC_JAVA_JNI_ANDROIDVIDEOCAPTURER_JNI_H_ 110 #endif // TALK_APP_WEBRTC_JAVA_JNI_ANDROIDVIDEOCAPTURER_JNI_H_
OLDNEW
« no previous file with comments | « talk/app/webrtc/androidvideocapturer.cc ('k') | talk/app/webrtc/java/jni/androidvideocapturer_jni.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698