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

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

Issue 1409323009: Add JNI interface for functions to start and stop recording AEC dumps and RTC event logs. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added java documentation and changed first letter of function names to lowercase. 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 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 JNIEnv* jni, jclass, jlong native_factory, jstring id, 1244 JNIEnv* jni, jclass, jlong native_factory, jstring id,
1245 jlong native_source) { 1245 jlong native_source) {
1246 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory( 1246 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory(
1247 factoryFromJava(native_factory)); 1247 factoryFromJava(native_factory));
1248 rtc::scoped_refptr<AudioTrackInterface> track(factory->CreateAudioTrack( 1248 rtc::scoped_refptr<AudioTrackInterface> track(factory->CreateAudioTrack(
1249 JavaToStdString(jni, id), 1249 JavaToStdString(jni, id),
1250 reinterpret_cast<AudioSourceInterface*>(native_source))); 1250 reinterpret_cast<AudioSourceInterface*>(native_source)));
1251 return (jlong)track.release(); 1251 return (jlong)track.release();
1252 } 1252 }
1253 1253
1254 JOW(jboolean, PeerConnectionFactory_nativeStartAecDump)(
1255 JNIEnv* jni, jclass, jlong native_factory, jint file) {
1256 #if defined(ANDROID)
1257 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory(
1258 factoryFromJava(native_factory));
1259 return factory->StartAecDump(file);
1260 #else
1261 return false;
1262 #endif
1263 }
1264
1265 JOW(void, PeerConnectionFactory_nativeStopAecDump)(
1266 JNIEnv* jni, jclass, jlong native_factory) {
1267 #if defined(ANDROID)
1268 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory(
1269 factoryFromJava(native_factory));
1270 factory->StopAecDump();
1271 #endif
1272 }
1273
1274 JOW(jboolean, PeerConnectionFactory_nativeStartRtcEventLog)(
1275 JNIEnv* jni, jclass, jlong native_factory, jint file) {
1276 #if defined(ANDROID)
1277 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory(
1278 factoryFromJava(native_factory));
1279 return factory->StartRtcEventLog(file);
1280 #else
1281 return false;
1282 #endif
1283 }
1284
1285 JOW(void, PeerConnectionFactory_nativeStopRtcEventLog)(
1286 JNIEnv* jni, jclass, jlong native_factory) {
1287 #if defined(ANDROID)
1288 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory(
1289 factoryFromJava(native_factory));
1290 factory->StopRtcEventLog();
1291 #endif
1292 }
1293
1254 JOW(void, PeerConnectionFactory_nativeSetOptions)( 1294 JOW(void, PeerConnectionFactory_nativeSetOptions)(
1255 JNIEnv* jni, jclass, jlong native_factory, jobject options) { 1295 JNIEnv* jni, jclass, jlong native_factory, jobject options) {
1256 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory( 1296 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory(
1257 factoryFromJava(native_factory)); 1297 factoryFromJava(native_factory));
1258 jclass options_class = jni->GetObjectClass(options); 1298 jclass options_class = jni->GetObjectClass(options);
1259 jfieldID network_ignore_mask_field = 1299 jfieldID network_ignore_mask_field =
1260 jni->GetFieldID(options_class, "networkIgnoreMask", "I"); 1300 jni->GetFieldID(options_class, "networkIgnoreMask", "I");
1261 int network_ignore_mask = 1301 int network_ignore_mask =
1262 jni->GetIntField(options, network_ignore_mask_field); 1302 jni->GetIntField(options, network_ignore_mask_field);
1263 1303
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
2046 return JavaStringFromStdString( 2086 return JavaStringFromStdString(
2047 jni, 2087 jni,
2048 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); 2088 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id());
2049 } 2089 }
2050 2090
2051 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { 2091 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) {
2052 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); 2092 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release();
2053 } 2093 }
2054 2094
2055 } // namespace webrtc_jni 2095 } // namespace webrtc_jni
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698