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/rtpreceiverinterface.h" | 67 #include "talk/app/webrtc/rtpreceiverinterface.h" |
68 #include "talk/app/webrtc/rtpsenderinterface.h" | 68 #include "talk/app/webrtc/rtpsenderinterface.h" |
69 #include "talk/app/webrtc/videosourceinterface.h" | 69 #include "talk/app/webrtc/videosourceinterface.h" |
70 #include "talk/media/base/videocapturer.h" | 70 #include "talk/media/base/videocapturer.h" |
71 #include "talk/media/base/videorenderer.h" | 71 #include "talk/media/base/videorenderer.h" |
72 #include "talk/media/devices/videorendererfactory.h" | 72 #include "talk/media/devices/videorendererfactory.h" |
73 #include "talk/media/webrtc/webrtcvideodecoderfactory.h" | 73 #include "talk/media/webrtc/webrtcvideodecoderfactory.h" |
74 #include "talk/media/webrtc/webrtcvideoencoderfactory.h" | 74 #include "talk/media/webrtc/webrtcvideoencoderfactory.h" |
75 #include "webrtc/base/bind.h" | 75 #include "webrtc/base/bind.h" |
76 #include "webrtc/base/checks.h" | 76 #include "webrtc/base/checks.h" |
| 77 #include "webrtc/base/event_tracer.h" |
77 #include "webrtc/base/logging.h" | 78 #include "webrtc/base/logging.h" |
78 #include "webrtc/base/logsinks.h" | 79 #include "webrtc/base/logsinks.h" |
| 80 #include "webrtc/base/messagequeue.h" |
79 #include "webrtc/base/networkmonitor.h" | 81 #include "webrtc/base/networkmonitor.h" |
80 #include "webrtc/base/messagequeue.h" | |
81 #include "webrtc/base/ssladapter.h" | 82 #include "webrtc/base/ssladapter.h" |
82 #include "webrtc/base/stringutils.h" | 83 #include "webrtc/base/stringutils.h" |
83 #include "webrtc/system_wrappers/include/field_trial_default.h" | 84 #include "webrtc/system_wrappers/include/field_trial_default.h" |
84 #include "webrtc/system_wrappers/include/trace.h" | 85 #include "webrtc/system_wrappers/include/trace.h" |
85 #include "webrtc/voice_engine/include/voe_base.h" | 86 #include "webrtc/voice_engine/include/voe_base.h" |
86 | 87 |
87 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD) | 88 #if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD) |
88 #include "talk/app/webrtc/androidvideocapturer.h" | 89 #include "talk/app/webrtc/androidvideocapturer.h" |
89 #include "talk/app/webrtc/java/jni/androidmediadecoder_jni.h" | 90 #include "talk/app/webrtc/java/jni/androidmediadecoder_jni.h" |
90 #include "talk/app/webrtc/java/jni/androidmediaencoder_jni.h" | 91 #include "talk/app/webrtc/java/jni/androidmediaencoder_jni.h" |
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1047 jni->GetStringUTFChars(j_trials_init_string, NULL); | 1048 jni->GetStringUTFChars(j_trials_init_string, NULL); |
1048 int init_string_length = jni->GetStringUTFLength(j_trials_init_string); | 1049 int init_string_length = jni->GetStringUTFLength(j_trials_init_string); |
1049 field_trials_init_string = new char[init_string_length + 1]; | 1050 field_trials_init_string = new char[init_string_length + 1]; |
1050 rtc::strcpyn(field_trials_init_string, init_string_length + 1, init_string); | 1051 rtc::strcpyn(field_trials_init_string, init_string_length + 1, init_string); |
1051 jni->ReleaseStringUTFChars(j_trials_init_string, init_string); | 1052 jni->ReleaseStringUTFChars(j_trials_init_string, init_string); |
1052 LOG(LS_INFO) << "initializeFieldTrials: " << field_trials_init_string; | 1053 LOG(LS_INFO) << "initializeFieldTrials: " << field_trials_init_string; |
1053 } | 1054 } |
1054 webrtc::field_trial::InitFieldTrialsFromString(field_trials_init_string); | 1055 webrtc::field_trial::InitFieldTrialsFromString(field_trials_init_string); |
1055 } | 1056 } |
1056 | 1057 |
| 1058 JOW(void, PeerConnectionFactory_initializeInternalTracer)(JNIEnv* jni, jclass) { |
| 1059 rtc::tracing::SetupInternalTracer(); |
| 1060 } |
| 1061 |
| 1062 JOW(jboolean, PeerConnectionFactory_startInternalTracingCapture)( |
| 1063 JNIEnv* jni, jclass, jstring j_event_tracing_filename) { |
| 1064 if (!j_event_tracing_filename) |
| 1065 return false; |
| 1066 |
| 1067 const char* init_string = |
| 1068 jni->GetStringUTFChars(j_event_tracing_filename, NULL); |
| 1069 LOG(LS_INFO) << "Starting internal tracing to: " << init_string; |
| 1070 bool ret = rtc::tracing::StartInternalCapture(init_string); |
| 1071 jni->ReleaseStringUTFChars(j_event_tracing_filename, init_string); |
| 1072 return ret; |
| 1073 } |
| 1074 |
| 1075 JOW(void, PeerConnectionFactory_stopInternalTracingCapture)( |
| 1076 JNIEnv* jni, jclass) { |
| 1077 rtc::tracing::StopInternalCapture(); |
| 1078 } |
| 1079 |
| 1080 JOW(void, PeerConnectionFactory_shutdownInternalTracer)(JNIEnv* jni, jclass) { |
| 1081 rtc::tracing::ShutdownInternalTracer(); |
| 1082 } |
| 1083 |
1057 // Helper struct for working around the fact that CreatePeerConnectionFactory() | 1084 // Helper struct for working around the fact that CreatePeerConnectionFactory() |
1058 // comes in two flavors: either entirely automagical (constructing its own | 1085 // comes in two flavors: either entirely automagical (constructing its own |
1059 // threads and deleting them on teardown, but no external codec factory support) | 1086 // threads and deleting them on teardown, but no external codec factory support) |
1060 // or entirely manual (requires caller to delete threads after factory | 1087 // or entirely manual (requires caller to delete threads after factory |
1061 // teardown). This struct takes ownership of its ctor's arguments to present a | 1088 // teardown). This struct takes ownership of its ctor's arguments to present a |
1062 // single thing for Java to hold and eventually free. | 1089 // single thing for Java to hold and eventually free. |
1063 class OwnedFactoryAndThreads { | 1090 class OwnedFactoryAndThreads { |
1064 public: | 1091 public: |
1065 OwnedFactoryAndThreads(Thread* worker_thread, | 1092 OwnedFactoryAndThreads(Thread* worker_thread, |
1066 Thread* signaling_thread, | 1093 Thread* signaling_thread, |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2151 return JavaStringFromStdString( | 2178 return JavaStringFromStdString( |
2152 jni, | 2179 jni, |
2153 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); | 2180 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); |
2154 } | 2181 } |
2155 | 2182 |
2156 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { | 2183 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { |
2157 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); | 2184 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); |
2158 } | 2185 } |
2159 | 2186 |
2160 } // namespace webrtc_jni | 2187 } // namespace webrtc_jni |
OLD | NEW |