OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_SDK_ANDROID_SRC_JNI_PC_OWNEDFACTORYANDTHREADS_H_ | 11 #ifndef WEBRTC_SDK_ANDROID_SRC_JNI_PC_OWNEDFACTORYANDTHREADS_H_ |
12 #define WEBRTC_SDK_ANDROID_SRC_JNI_PC_OWNEDFACTORYANDTHREADS_H_ | 12 #define WEBRTC_SDK_ANDROID_SRC_JNI_PC_OWNEDFACTORYANDTHREADS_H_ |
13 | 13 |
14 #include <jni.h> | 14 #include <jni.h> |
15 #include <memory> | 15 #include <memory> |
16 #include <utility> | 16 #include <utility> |
17 | 17 |
18 #include "webrtc/api/peerconnectioninterface.h" | 18 #include "webrtc/api/peerconnectioninterface.h" |
19 #include "webrtc/rtc_base/thread.h" | 19 #include "webrtc/rtc_base/thread.h" |
20 | 20 |
21 using cricket::WebRtcVideoDecoderFactory; | 21 using cricket::WebRtcVideoDecoderFactory; |
22 using cricket::WebRtcVideoEncoderFactory; | 22 using cricket::WebRtcVideoEncoderFactory; |
23 using rtc::Thread; | 23 using rtc::Thread; |
24 using webrtc::PeerConnectionFactoryInterface; | |
25 | 24 |
26 namespace webrtc_jni { | 25 namespace webrtc { |
| 26 namespace jni { |
27 | 27 |
28 PeerConnectionFactoryInterface* factoryFromJava(jlong j_p); | 28 PeerConnectionFactoryInterface* factoryFromJava(jlong j_p); |
29 | 29 |
30 // Helper struct for working around the fact that CreatePeerConnectionFactory() | 30 // Helper struct for working around the fact that CreatePeerConnectionFactory() |
31 // comes in two flavors: either entirely automagical (constructing its own | 31 // comes in two flavors: either entirely automagical (constructing its own |
32 // threads and deleting them on teardown, but no external codec factory support) | 32 // threads and deleting them on teardown, but no external codec factory support) |
33 // or entirely manual (requires caller to delete threads after factory | 33 // or entirely manual (requires caller to delete threads after factory |
34 // teardown). This struct takes ownership of its ctor's arguments to present a | 34 // teardown). This struct takes ownership of its ctor's arguments to present a |
35 // single thing for Java to hold and eventually free. | 35 // single thing for Java to hold and eventually free. |
36 class OwnedFactoryAndThreads { | 36 class OwnedFactoryAndThreads { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 const std::unique_ptr<Thread> network_thread_; | 69 const std::unique_ptr<Thread> network_thread_; |
70 const std::unique_ptr<Thread> worker_thread_; | 70 const std::unique_ptr<Thread> worker_thread_; |
71 const std::unique_ptr<Thread> signaling_thread_; | 71 const std::unique_ptr<Thread> signaling_thread_; |
72 WebRtcVideoEncoderFactory* encoder_factory_; | 72 WebRtcVideoEncoderFactory* encoder_factory_; |
73 WebRtcVideoDecoderFactory* decoder_factory_; | 73 WebRtcVideoDecoderFactory* decoder_factory_; |
74 rtc::NetworkMonitorFactory* network_monitor_factory_; | 74 rtc::NetworkMonitorFactory* network_monitor_factory_; |
75 PeerConnectionFactoryInterface* factory_; // Const after ctor except dtor. | 75 PeerConnectionFactoryInterface* factory_; // Const after ctor except dtor. |
76 }; | 76 }; |
77 | 77 |
78 } // namespace webrtc_jni | 78 } // namespace jni |
| 79 } // namespace webrtc |
79 | 80 |
80 #endif // WEBRTC_SDK_ANDROID_SRC_JNI_PC_OWNEDFACTORYANDTHREADS_H_ | 81 #endif // WEBRTC_SDK_ANDROID_SRC_JNI_PC_OWNEDFACTORYANDTHREADS_H_ |
OLD | NEW |