OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 #include "talk/app/webrtc/videosourceinterface.h" | 67 #include "talk/app/webrtc/videosourceinterface.h" |
68 #include "talk/media/base/videocapturer.h" | 68 #include "talk/media/base/videocapturer.h" |
69 #include "talk/media/base/videorenderer.h" | 69 #include "talk/media/base/videorenderer.h" |
70 #include "talk/media/devices/videorendererfactory.h" | 70 #include "talk/media/devices/videorendererfactory.h" |
71 #include "talk/media/webrtc/webrtcvideodecoderfactory.h" | 71 #include "talk/media/webrtc/webrtcvideodecoderfactory.h" |
72 #include "talk/media/webrtc/webrtcvideoencoderfactory.h" | 72 #include "talk/media/webrtc/webrtcvideoencoderfactory.h" |
73 #include "webrtc/base/bind.h" | 73 #include "webrtc/base/bind.h" |
74 #include "webrtc/base/checks.h" | 74 #include "webrtc/base/checks.h" |
75 #include "webrtc/base/logging.h" | 75 #include "webrtc/base/logging.h" |
76 #include "webrtc/base/logsinks.h" | 76 #include "webrtc/base/logsinks.h" |
| 77 #include "webrtc/base/networkchangenotifier.h" |
77 #include "webrtc/base/messagequeue.h" | 78 #include "webrtc/base/messagequeue.h" |
78 #include "webrtc/base/ssladapter.h" | 79 #include "webrtc/base/ssladapter.h" |
79 #include "webrtc/base/stringutils.h" | 80 #include "webrtc/base/stringutils.h" |
80 #include "webrtc/system_wrappers/interface/field_trial_default.h" | 81 #include "webrtc/system_wrappers/interface/field_trial_default.h" |
81 #include "webrtc/system_wrappers/interface/trace.h" | 82 #include "webrtc/system_wrappers/interface/trace.h" |
82 #include "webrtc/voice_engine/include/voe_base.h" | 83 #include "webrtc/voice_engine/include/voe_base.h" |
83 | 84 |
84 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD) | 85 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD) |
85 #include "talk/app/webrtc/androidvideocapturer.h" | 86 #include "talk/app/webrtc/androidvideocapturer.h" |
86 #include "talk/app/webrtc/java/jni/androidmediadecoder_jni.h" | 87 #include "talk/app/webrtc/java/jni/androidmediadecoder_jni.h" |
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 signaling_thread->SetName("signaling_thread", NULL); | 1096 signaling_thread->SetName("signaling_thread", NULL); |
1096 RTC_CHECK(worker_thread->Start() && signaling_thread->Start()) | 1097 RTC_CHECK(worker_thread->Start() && signaling_thread->Start()) |
1097 << "Failed to start threads"; | 1098 << "Failed to start threads"; |
1098 WebRtcVideoEncoderFactory* encoder_factory = nullptr; | 1099 WebRtcVideoEncoderFactory* encoder_factory = nullptr; |
1099 WebRtcVideoDecoderFactory* decoder_factory = nullptr; | 1100 WebRtcVideoDecoderFactory* decoder_factory = nullptr; |
1100 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD) | 1101 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD) |
1101 if (video_hw_acceleration_enabled) { | 1102 if (video_hw_acceleration_enabled) { |
1102 encoder_factory = new MediaCodecVideoEncoderFactory(); | 1103 encoder_factory = new MediaCodecVideoEncoderFactory(); |
1103 decoder_factory = new MediaCodecVideoDecoderFactory(); | 1104 decoder_factory = new MediaCodecVideoDecoderFactory(); |
1104 } | 1105 } |
| 1106 rtc::NetworkChangeNotifierFactory* network_change_notifier_factory = |
| 1107 rtc::NetworkChangeNotifierFactory::CreateFactory(); |
| 1108 rtc::NetworkChangeNotifier::SetFactory(network_change_notifier_factory); |
1105 #endif | 1109 #endif |
1106 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory( | 1110 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory( |
1107 webrtc::CreatePeerConnectionFactory(worker_thread, | 1111 webrtc::CreatePeerConnectionFactory(worker_thread, |
1108 signaling_thread, | 1112 signaling_thread, |
1109 NULL, | 1113 NULL, |
1110 encoder_factory, | 1114 encoder_factory, |
1111 decoder_factory)); | 1115 decoder_factory)); |
1112 RTC_CHECK(factory) << "Failed to create the peer connection factory; " | 1116 RTC_CHECK(factory) << "Failed to create the peer connection factory; " |
1113 << "WebRTC/libjingle init likely failed on this device"; | 1117 << "WebRTC/libjingle init likely failed on this device"; |
1114 OwnedFactoryAndThreads* owned_factory = new OwnedFactoryAndThreads( | 1118 OwnedFactoryAndThreads* owned_factory = new OwnedFactoryAndThreads( |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1864 size_t read = 0; | 1868 size_t read = 0; |
1865 rtc::scoped_ptr<jbyte> buffer(static_cast<jbyte*>(malloc(log_size))); | 1869 rtc::scoped_ptr<jbyte> buffer(static_cast<jbyte*>(malloc(log_size))); |
1866 stream->ReadAll(buffer.get(), log_size, &read, nullptr); | 1870 stream->ReadAll(buffer.get(), log_size, &read, nullptr); |
1867 | 1871 |
1868 jbyteArray result = jni->NewByteArray(read); | 1872 jbyteArray result = jni->NewByteArray(read); |
1869 jni->SetByteArrayRegion(result, 0, read, buffer.get()); | 1873 jni->SetByteArrayRegion(result, 0, read, buffer.get()); |
1870 | 1874 |
1871 return result; | 1875 return result; |
1872 } | 1876 } |
1873 | 1877 |
| 1878 JOW(jlong, NetworkChangeNotifier_nativeCreateNetworkChangeNotifier)( |
| 1879 JNIEnv* jni, jobject j_notifier) { |
| 1880 rtc::NetworkChangeNotifierFactory* factory = |
| 1881 rtc::NetworkChangeNotifier::GetFactory(); |
| 1882 if (factory == nullptr) { |
| 1883 return 0L; |
| 1884 } |
| 1885 rtc::NetworkChangeNotifierDelegate* delegate = factory->CreateDelegate(); |
| 1886 return jlongFromPointer(delegate); |
| 1887 } |
| 1888 |
| 1889 JOW(void, NetworkChangeNotifier_nativeNotifyConnectionTypeChanged)( |
| 1890 JNIEnv* jni, jobject j_notifier, jlong j_native_notifier) { |
| 1891 rtc::NetworkChangeNotifierDelegate* delegate = |
| 1892 reinterpret_cast<rtc::NetworkChangeNotifierDelegate*>(j_native_notifier); |
| 1893 if (delegate != nullptr) { |
| 1894 delegate->OnNetworkChangeNotified(); |
| 1895 } |
| 1896 } |
| 1897 |
1874 } // namespace webrtc_jni | 1898 } // namespace webrtc_jni |
OLD | NEW |