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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 void Stop() override; | 57 void Stop() override; |
58 | 58 |
59 void ReturnBuffer(int64 time_stamp) override; | 59 void ReturnBuffer(int64 time_stamp) override; |
60 | 60 |
61 std::string GetSupportedFormats() override; | 61 std::string GetSupportedFormats() override; |
62 | 62 |
63 // Called from VideoCapturerAndroid::NativeObserver on a Java thread. | 63 // Called from VideoCapturerAndroid::NativeObserver on a Java thread. |
64 void OnCapturerStarted(bool success); | 64 void OnCapturerStarted(bool success); |
65 void OnIncomingFrame(void* video_frame, | 65 void OnIncomingFrame(void* video_frame, |
66 int length, | 66 int length, |
| 67 int width, |
| 68 int height, |
67 int rotation, | 69 int rotation, |
68 int64 time_stamp); | 70 int64 time_stamp); |
69 protected: | 71 protected: |
70 AndroidVideoCapturerJni(JNIEnv* jni, jobject j_video_capturer); | 72 AndroidVideoCapturerJni(JNIEnv* jni, jobject j_video_capturer); |
71 ~AndroidVideoCapturerJni(); | 73 ~AndroidVideoCapturerJni(); |
72 | 74 |
73 private: | 75 private: |
74 bool Init(jstring device_name); | 76 bool Init(jstring device_name); |
75 | 77 |
76 void OnCapturerStarted_w(bool success); | 78 void OnCapturerStarted_w(bool success); |
77 void OnCapturerStopped_w(); | 79 void OnCapturerStopped_w(); |
78 void OnIncomingFrame_w(void* video_frame, | 80 void OnIncomingFrame_w(void* video_frame, |
79 int length, | 81 int length, |
| 82 int width, |
| 83 int height, |
80 int rotation, | 84 int rotation, |
81 int64 time_stamp); | 85 int64 time_stamp); |
82 void ReturnBuffer_w(int64 time_stamp); | 86 void ReturnBuffer_w(int64 time_stamp); |
83 | 87 |
84 JNIEnv* jni(); | 88 JNIEnv* jni(); |
85 | 89 |
86 const ScopedGlobalRef<jobject> j_capturer_global_; | 90 const ScopedGlobalRef<jobject> j_capturer_global_; |
87 const ScopedGlobalRef<jclass> j_video_capturer_class_; | 91 const ScopedGlobalRef<jclass> j_video_capturer_class_; |
88 const ScopedGlobalRef<jclass> j_observer_class_; | 92 const ScopedGlobalRef<jclass> j_observer_class_; |
89 volatile bool valid_global_refs_; | 93 volatile bool valid_global_refs_; |
90 jobject j_frame_observer_; | 94 jobject j_frame_observer_; |
91 | 95 |
92 rtc::ThreadChecker thread_checker_; | 96 rtc::ThreadChecker thread_checker_; |
93 | 97 |
94 rtc::Thread* thread_; // The thread where Start is called on. | 98 rtc::Thread* thread_; // The thread where Start is called on. |
95 // |capturer| is a guaranteed to be a valid pointer between a call to | 99 // |capturer| is a guaranteed to be a valid pointer between a call to |
96 // AndroidVideoCapturerDelegate::Start | 100 // AndroidVideoCapturerDelegate::Start |
97 // until AndroidVideoCapturerDelegate::Stop. | 101 // until AndroidVideoCapturerDelegate::Stop. |
98 webrtc::AndroidVideoCapturer* capturer_; | 102 webrtc::AndroidVideoCapturer* capturer_; |
99 rtc::AsyncInvoker invoker_; | 103 rtc::AsyncInvoker invoker_; |
100 | 104 |
101 static jobject application_context_; | 105 static jobject application_context_; |
102 | 106 |
103 DISALLOW_COPY_AND_ASSIGN(AndroidVideoCapturerJni); | 107 DISALLOW_COPY_AND_ASSIGN(AndroidVideoCapturerJni); |
104 }; | 108 }; |
105 | 109 |
106 } // namespace webrtc_jni | 110 } // namespace webrtc_jni |
107 | 111 |
108 #endif // TALK_APP_WEBRTC_JAVA_JNI_ANDROIDVIDEOCAPTURER_JNI_H_ | 112 #endif // TALK_APP_WEBRTC_JAVA_JNI_ANDROIDVIDEOCAPTURER_JNI_H_ |
OLD | NEW |