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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 } | 56 } |
57 | 57 |
58 void FreeGlobalClassReferenceHolder() { | 58 void FreeGlobalClassReferenceHolder() { |
59 g_class_reference_holder->FreeReferences(AttachCurrentThreadIfNeeded()); | 59 g_class_reference_holder->FreeReferences(AttachCurrentThreadIfNeeded()); |
60 delete g_class_reference_holder; | 60 delete g_class_reference_holder; |
61 g_class_reference_holder = nullptr; | 61 g_class_reference_holder = nullptr; |
62 } | 62 } |
63 | 63 |
64 ClassReferenceHolder::ClassReferenceHolder(JNIEnv* jni) { | 64 ClassReferenceHolder::ClassReferenceHolder(JNIEnv* jni) { |
65 LoadClass(jni, "java/nio/ByteBuffer"); | 65 LoadClass(jni, "java/nio/ByteBuffer"); |
| 66 LoadClass(jni, "java/util/ArrayList"); |
66 LoadClass(jni, "org/webrtc/AudioTrack"); | 67 LoadClass(jni, "org/webrtc/AudioTrack"); |
67 LoadClass(jni, "org/webrtc/DataChannel"); | 68 LoadClass(jni, "org/webrtc/DataChannel"); |
68 LoadClass(jni, "org/webrtc/DataChannel$Buffer"); | 69 LoadClass(jni, "org/webrtc/DataChannel$Buffer"); |
69 LoadClass(jni, "org/webrtc/DataChannel$Init"); | 70 LoadClass(jni, "org/webrtc/DataChannel$Init"); |
70 LoadClass(jni, "org/webrtc/DataChannel$State"); | 71 LoadClass(jni, "org/webrtc/DataChannel$State"); |
71 LoadClass(jni, "org/webrtc/IceCandidate"); | 72 LoadClass(jni, "org/webrtc/IceCandidate"); |
72 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD) | 73 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD) |
73 LoadClass(jni, "android/graphics/SurfaceTexture"); | 74 LoadClass(jni, "android/graphics/SurfaceTexture"); |
74 LoadClass(jni, "org/webrtc/CameraEnumerator"); | 75 LoadClass(jni, "org/webrtc/CameraEnumerator"); |
75 LoadClass(jni, "org/webrtc/Camera2Enumerator"); | 76 LoadClass(jni, "org/webrtc/Camera2Enumerator"); |
(...skipping 23 matching lines...) Expand all Loading... |
99 LoadClass(jni, "org/webrtc/MediaStreamTrack$State"); | 100 LoadClass(jni, "org/webrtc/MediaStreamTrack$State"); |
100 LoadClass(jni, "org/webrtc/PeerConnection$BundlePolicy"); | 101 LoadClass(jni, "org/webrtc/PeerConnection$BundlePolicy"); |
101 LoadClass(jni, "org/webrtc/PeerConnection$ContinualGatheringPolicy"); | 102 LoadClass(jni, "org/webrtc/PeerConnection$ContinualGatheringPolicy"); |
102 LoadClass(jni, "org/webrtc/PeerConnection$RtcpMuxPolicy"); | 103 LoadClass(jni, "org/webrtc/PeerConnection$RtcpMuxPolicy"); |
103 LoadClass(jni, "org/webrtc/PeerConnection$IceConnectionState"); | 104 LoadClass(jni, "org/webrtc/PeerConnection$IceConnectionState"); |
104 LoadClass(jni, "org/webrtc/PeerConnection$IceGatheringState"); | 105 LoadClass(jni, "org/webrtc/PeerConnection$IceGatheringState"); |
105 LoadClass(jni, "org/webrtc/PeerConnection$IceTransportsType"); | 106 LoadClass(jni, "org/webrtc/PeerConnection$IceTransportsType"); |
106 LoadClass(jni, "org/webrtc/PeerConnection$TcpCandidatePolicy"); | 107 LoadClass(jni, "org/webrtc/PeerConnection$TcpCandidatePolicy"); |
107 LoadClass(jni, "org/webrtc/PeerConnection$KeyType"); | 108 LoadClass(jni, "org/webrtc/PeerConnection$KeyType"); |
108 LoadClass(jni, "org/webrtc/PeerConnection$SignalingState"); | 109 LoadClass(jni, "org/webrtc/PeerConnection$SignalingState"); |
| 110 LoadClass(jni, "org/webrtc/RtpReceiver"); |
| 111 LoadClass(jni, "org/webrtc/RtpSender"); |
109 LoadClass(jni, "org/webrtc/SessionDescription"); | 112 LoadClass(jni, "org/webrtc/SessionDescription"); |
110 LoadClass(jni, "org/webrtc/SessionDescription$Type"); | 113 LoadClass(jni, "org/webrtc/SessionDescription$Type"); |
111 LoadClass(jni, "org/webrtc/StatsReport"); | 114 LoadClass(jni, "org/webrtc/StatsReport"); |
112 LoadClass(jni, "org/webrtc/StatsReport$Value"); | 115 LoadClass(jni, "org/webrtc/StatsReport$Value"); |
113 LoadClass(jni, "org/webrtc/VideoRenderer$I420Frame"); | 116 LoadClass(jni, "org/webrtc/VideoRenderer$I420Frame"); |
114 LoadClass(jni, "org/webrtc/VideoCapturer"); | 117 LoadClass(jni, "org/webrtc/VideoCapturer"); |
115 LoadClass(jni, "org/webrtc/VideoTrack"); | 118 LoadClass(jni, "org/webrtc/VideoTrack"); |
116 } | 119 } |
117 | 120 |
118 ClassReferenceHolder::~ClassReferenceHolder() { | 121 ClassReferenceHolder::~ClassReferenceHolder() { |
(...skipping 25 matching lines...) Expand all Loading... |
144 RTC_CHECK(inserted) << "Duplicate class name: " << name; | 147 RTC_CHECK(inserted) << "Duplicate class name: " << name; |
145 } | 148 } |
146 | 149 |
147 // Returns a global reference guaranteed to be valid for the lifetime of the | 150 // Returns a global reference guaranteed to be valid for the lifetime of the |
148 // process. | 151 // process. |
149 jclass FindClass(JNIEnv* jni, const char* name) { | 152 jclass FindClass(JNIEnv* jni, const char* name) { |
150 return g_class_reference_holder->GetClass(name); | 153 return g_class_reference_holder->GetClass(name); |
151 } | 154 } |
152 | 155 |
153 } // namespace webrtc_jni | 156 } // namespace webrtc_jni |
OLD | NEW |