Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: talk/app/webrtc/java/jni/peerconnection_jni.cc

Issue 1457383002: Implement standalone event tracing in AppRTCDemo. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: revert test_main.cc, it shouldn't be on for all tests either way Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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)(
1059 JNIEnv* jni, jclass) {
1060 webrtc::EventTracer::SetupInternalTracer();
1061 }
1062
1063 JOW(jboolean, PeerConnectionFactory_startInternalTracingCapture)(
1064 JNIEnv* jni, jclass, jstring j_event_tracing_filename) {
1065 if (j_event_tracing_filename == NULL)
tommi 2015/11/20 13:49:54 nit: use |if (!ptr)| or |if (ptr == nullptr)| I p
pbos-webrtc 2015/11/20 15:11:05 Done.
1066 return false;
1067
1068 const char* init_string =
1069 jni->GetStringUTFChars(j_event_tracing_filename, NULL);
1070 LOG(LS_INFO) << "Starting internal tracing to: " << init_string;
1071 bool ret = webrtc::EventTracer::StartInternalCapture(init_string);
1072 jni->ReleaseStringUTFChars(j_event_tracing_filename, init_string);
1073 return ret;
1074 }
1075
1076 JOW(void, PeerConnectionFactory_stopInternalTracingCapture)(
1077 JNIEnv* jni, jclass) {
1078 webrtc::EventTracer::StopInternalCapture();
1079 }
1080
1081 JOW(void, PeerConnectionFactory_shutdownInternalTracer)(
1082 JNIEnv* jni, jclass) {
1083 webrtc::EventTracer::ShutdownInternalTracer();
1084 }
1085
1057 // Helper struct for working around the fact that CreatePeerConnectionFactory() 1086 // Helper struct for working around the fact that CreatePeerConnectionFactory()
1058 // comes in two flavors: either entirely automagical (constructing its own 1087 // comes in two flavors: either entirely automagical (constructing its own
1059 // threads and deleting them on teardown, but no external codec factory support) 1088 // threads and deleting them on teardown, but no external codec factory support)
1060 // or entirely manual (requires caller to delete threads after factory 1089 // or entirely manual (requires caller to delete threads after factory
1061 // teardown). This struct takes ownership of its ctor's arguments to present a 1090 // teardown). This struct takes ownership of its ctor's arguments to present a
1062 // single thing for Java to hold and eventually free. 1091 // single thing for Java to hold and eventually free.
1063 class OwnedFactoryAndThreads { 1092 class OwnedFactoryAndThreads {
1064 public: 1093 public:
1065 OwnedFactoryAndThreads(Thread* worker_thread, 1094 OwnedFactoryAndThreads(Thread* worker_thread,
1066 Thread* signaling_thread, 1095 Thread* signaling_thread,
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
2046 return JavaStringFromStdString( 2075 return JavaStringFromStdString(
2047 jni, 2076 jni,
2048 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); 2077 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id());
2049 } 2078 }
2050 2079
2051 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { 2080 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) {
2052 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); 2081 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release();
2053 } 2082 }
2054 2083
2055 } // namespace webrtc_jni 2084 } // namespace webrtc_jni
OLDNEW
« no previous file with comments | « no previous file | talk/app/webrtc/java/src/org/webrtc/PeerConnectionFactory.java » ('j') | webrtc/base/event_tracer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698