OLD | NEW |
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 std::string GetSupportedFormats() override; | 60 std::string GetSupportedFormats() override; |
61 | 61 |
62 // Called from VideoCapturerAndroid::NativeObserver on a Java thread. | 62 // Called from VideoCapturerAndroid::NativeObserver on a Java thread. |
63 void OnCapturerStarted(bool success); | 63 void OnCapturerStarted(bool success); |
64 void OnIncomingFrame(void* video_frame, | 64 void OnIncomingFrame(void* video_frame, |
65 int length, | 65 int length, |
66 int width, | 66 int width, |
67 int height, | 67 int height, |
68 int rotation, | 68 int rotation, |
69 int64 time_stamp); | 69 int64_t time_stamp); |
70 void OnOutputFormatRequest(int width, int height, int fps); | 70 void OnOutputFormatRequest(int width, int height, int fps); |
71 protected: | 71 protected: |
72 AndroidVideoCapturerJni(JNIEnv* jni, jobject j_video_capturer); | 72 AndroidVideoCapturerJni(JNIEnv* jni, jobject j_video_capturer); |
73 ~AndroidVideoCapturerJni(); | 73 ~AndroidVideoCapturerJni(); |
74 | 74 |
75 private: | 75 private: |
76 bool Init(jstring device_name); | 76 bool Init(jstring device_name); |
77 void ReturnBuffer(int64 time_stamp); | 77 void ReturnBuffer(int64_t time_stamp); |
78 JNIEnv* jni(); | 78 JNIEnv* jni(); |
79 | 79 |
80 // Helper function to make safe asynchronous calls to |capturer_|. The calls | 80 // Helper function to make safe asynchronous calls to |capturer_|. The calls |
81 // are not guaranteed to be delivered. | 81 // are not guaranteed to be delivered. |
82 template <typename... Args> | 82 template <typename... Args> |
83 void AsyncCapturerInvoke( | 83 void AsyncCapturerInvoke( |
84 const char* method_name, | 84 const char* method_name, |
85 void (webrtc::AndroidVideoCapturer::*method)(Args...), | 85 void (webrtc::AndroidVideoCapturer::*method)(Args...), |
86 Args... args); | 86 Args... args); |
87 | 87 |
(...skipping 13 matching lines...) Expand all Loading... |
101 rtc::scoped_ptr<rtc::GuardedAsyncInvoker> invoker_ GUARDED_BY(capturer_lock_); | 101 rtc::scoped_ptr<rtc::GuardedAsyncInvoker> invoker_ GUARDED_BY(capturer_lock_); |
102 | 102 |
103 static jobject application_context_; | 103 static jobject application_context_; |
104 | 104 |
105 RTC_DISALLOW_COPY_AND_ASSIGN(AndroidVideoCapturerJni); | 105 RTC_DISALLOW_COPY_AND_ASSIGN(AndroidVideoCapturerJni); |
106 }; | 106 }; |
107 | 107 |
108 } // namespace webrtc_jni | 108 } // namespace webrtc_jni |
109 | 109 |
110 #endif // TALK_APP_WEBRTC_JAVA_JNI_ANDROIDVIDEOCAPTURER_JNI_H_ | 110 #endif // TALK_APP_WEBRTC_JAVA_JNI_ANDROIDVIDEOCAPTURER_JNI_H_ |
OLD | NEW |