| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  *  Copyright 2015 The WebRTC Project Authors. All rights reserved. | 2  *  Copyright 2015 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 package org.appspot.apprtc; | 11 package org.appspot.apprtc; | 
| 12 | 12 | 
| 13 import org.appspot.apprtc.AppRTCClient.RoomConnectionParameters; | 13 import org.appspot.apprtc.AppRTCClient.RoomConnectionParameters; | 
| 14 import org.appspot.apprtc.AppRTCClient.SignalingParameters; | 14 import org.appspot.apprtc.AppRTCClient.SignalingParameters; | 
| 15 import org.appspot.apprtc.PeerConnectionClient.PeerConnectionParameters; | 15 import org.appspot.apprtc.PeerConnectionClient.PeerConnectionParameters; | 
|  | 16 import org.appspot.apprtc.PeerConnectionClient.DataChannelParameters; | 
| 16 | 17 | 
| 17 import android.app.Activity; | 18 import android.app.Activity; | 
| 18 import android.app.AlertDialog; | 19 import android.app.AlertDialog; | 
| 19 import android.app.FragmentTransaction; | 20 import android.app.FragmentTransaction; | 
| 20 import android.content.DialogInterface; | 21 import android.content.DialogInterface; | 
| 21 import android.content.Intent; | 22 import android.content.Intent; | 
| 22 import android.content.pm.PackageManager; | 23 import android.content.pm.PackageManager; | 
| 23 import android.net.Uri; | 24 import android.net.Uri; | 
| 24 import android.os.Bundle; | 25 import android.os.Bundle; | 
| 25 import android.os.Handler; | 26 import android.os.Handler; | 
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 86   public static final String EXTRA_RUNTIME = "org.appspot.apprtc.RUNTIME"; | 87   public static final String EXTRA_RUNTIME = "org.appspot.apprtc.RUNTIME"; | 
| 87   public static final String EXTRA_VIDEO_FILE_AS_CAMERA = "org.appspot.apprtc.VI
     DEO_FILE_AS_CAMERA"; | 88   public static final String EXTRA_VIDEO_FILE_AS_CAMERA = "org.appspot.apprtc.VI
     DEO_FILE_AS_CAMERA"; | 
| 88   public static final String EXTRA_SAVE_REMOTE_VIDEO_TO_FILE = | 89   public static final String EXTRA_SAVE_REMOTE_VIDEO_TO_FILE = | 
| 89       "org.appspot.apprtc.SAVE_REMOTE_VIDEO_TO_FILE"; | 90       "org.appspot.apprtc.SAVE_REMOTE_VIDEO_TO_FILE"; | 
| 90   public static final String EXTRA_SAVE_REMOTE_VIDEO_TO_FILE_WIDTH = | 91   public static final String EXTRA_SAVE_REMOTE_VIDEO_TO_FILE_WIDTH = | 
| 91       "org.appspot.apprtc.SAVE_REMOTE_VIDEO_TO_FILE_WIDTH"; | 92       "org.appspot.apprtc.SAVE_REMOTE_VIDEO_TO_FILE_WIDTH"; | 
| 92   public static final String EXTRA_SAVE_REMOTE_VIDEO_TO_FILE_HEIGHT = | 93   public static final String EXTRA_SAVE_REMOTE_VIDEO_TO_FILE_HEIGHT = | 
| 93       "org.appspot.apprtc.SAVE_REMOTE_VIDEO_TO_FILE_HEIGHT"; | 94       "org.appspot.apprtc.SAVE_REMOTE_VIDEO_TO_FILE_HEIGHT"; | 
| 94   public static final String EXTRA_USE_VALUES_FROM_INTENT = | 95   public static final String EXTRA_USE_VALUES_FROM_INTENT = | 
| 95       "org.appspot.apprtc.USE_VALUES_FROM_INTENT"; | 96       "org.appspot.apprtc.USE_VALUES_FROM_INTENT"; | 
|  | 97   public static final String EXTRA_DATA_CHANNEL_ENABLED = | 
|  | 98           "org.appspot.apprtc.DATA_CHANNEL_ENABLED"; | 
|  | 99   public static final String EXTRA_ORDERED = | 
|  | 100           "org.appspot.apprtc.ORDERED"; | 
|  | 101   public static final String EXTRA_MAX_RETRANSMITS_MS = | 
|  | 102           "org.appspot.apprtc.MAX_RETRANSMITS_MS"; | 
|  | 103   public static final String EXTRA_MAX_RETRANSMITS = | 
|  | 104           "org.appspot.apprtc.MAX_RETRANSMITS"; | 
|  | 105   public static final String EXTRA_PROTOCOL = | 
|  | 106           "org.appspot.apprtc.PROTOCOL"; | 
|  | 107   public static final String EXTRA_NEGOTIATED = | 
|  | 108           "org.appspot.apprtc.NEGOTIATED"; | 
|  | 109   public static final String EXTRA_ID = | 
|  | 110           "org.appspot.apprtc.ID"; | 
|  | 111 | 
| 96   private static final String TAG = "CallRTCClient"; | 112   private static final String TAG = "CallRTCClient"; | 
| 97 | 113 | 
| 98   // List of mandatory application permissions. | 114   // List of mandatory application permissions. | 
| 99   private static final String[] MANDATORY_PERMISSIONS = {"android.permission.MOD
     IFY_AUDIO_SETTINGS", | 115   private static final String[] MANDATORY_PERMISSIONS = {"android.permission.MOD
     IFY_AUDIO_SETTINGS", | 
| 100       "android.permission.RECORD_AUDIO", "android.permission.INTERNET"}; | 116       "android.permission.RECORD_AUDIO", "android.permission.INTERNET"}; | 
| 101 | 117 | 
| 102   // Peer connection statistics callback period in ms. | 118   // Peer connection statistics callback period in ms. | 
| 103   private static final int STAT_CALLBACK_PERIOD = 1000; | 119   private static final int STAT_CALLBACK_PERIOD = 1000; | 
| 104   // Local preview screen position before call is connected. | 120   // Local preview screen position before call is connected. | 
| 105   private static final int LOCAL_X_CONNECTING = 0; | 121   private static final int LOCAL_X_CONNECTING = 0; | 
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 235     if (roomId == null || roomId.length() == 0) { | 251     if (roomId == null || roomId.length() == 0) { | 
| 236       logAndToast(getString(R.string.missing_url)); | 252       logAndToast(getString(R.string.missing_url)); | 
| 237       Log.e(TAG, "Incorrect room ID in intent!"); | 253       Log.e(TAG, "Incorrect room ID in intent!"); | 
| 238       setResult(RESULT_CANCELED); | 254       setResult(RESULT_CANCELED); | 
| 239       finish(); | 255       finish(); | 
| 240       return; | 256       return; | 
| 241     } | 257     } | 
| 242 | 258 | 
| 243     boolean loopback = intent.getBooleanExtra(EXTRA_LOOPBACK, false); | 259     boolean loopback = intent.getBooleanExtra(EXTRA_LOOPBACK, false); | 
| 244     boolean tracing = intent.getBooleanExtra(EXTRA_TRACING, false); | 260     boolean tracing = intent.getBooleanExtra(EXTRA_TRACING, false); | 
| 245 | 261     DataChannelParameters dataChannelParameters = null; | 
|  | 262     if (intent.getBooleanExtra(EXTRA_DATA_CHANNEL_ENABLED, true)) { | 
|  | 263       dataChannelParameters = new DataChannelParameters( | 
|  | 264               intent.getBooleanExtra(EXTRA_ORDERED, true), | 
|  | 265               intent.getIntExtra(EXTRA_MAX_RETRANSMITS_MS, -1), | 
|  | 266               intent.getIntExtra(EXTRA_MAX_RETRANSMITS, -1), | 
|  | 267               intent.getStringExtra(EXTRA_PROTOCOL), | 
|  | 268               intent.getBooleanExtra(EXTRA_NEGOTIATED, false), | 
|  | 269               intent.getIntExtra(EXTRA_ID, -1)); | 
|  | 270     } | 
| 246     peerConnectionParameters = | 271     peerConnectionParameters = | 
| 247         new PeerConnectionParameters(intent.getBooleanExtra(EXTRA_VIDEO_CALL, tr
     ue), loopback, | 272         new PeerConnectionParameters(intent.getBooleanExtra(EXTRA_VIDEO_CALL, tr
     ue), loopback, | 
| 248             tracing, intent.getIntExtra(EXTRA_VIDEO_WIDTH, 0), | 273             tracing, intent.getIntExtra(EXTRA_VIDEO_WIDTH, 0), | 
| 249             intent.getIntExtra(EXTRA_VIDEO_HEIGHT, 0), intent.getIntExtra(EXTRA_
     VIDEO_FPS, 0), | 274             intent.getIntExtra(EXTRA_VIDEO_HEIGHT, 0), intent.getIntExtra(EXTRA_
     VIDEO_FPS, 0), | 
| 250             intent.getIntExtra(EXTRA_VIDEO_BITRATE, 0), intent.getStringExtra(EX
     TRA_VIDEOCODEC), | 275             intent.getIntExtra(EXTRA_VIDEO_BITRATE, 0), intent.getStringExtra(EX
     TRA_VIDEOCODEC), | 
| 251             intent.getBooleanExtra(EXTRA_HWCODEC_ENABLED, true), | 276             intent.getBooleanExtra(EXTRA_HWCODEC_ENABLED, true), | 
| 252             intent.getIntExtra(EXTRA_AUDIO_BITRATE, 0), intent.getStringExtra(EX
     TRA_AUDIOCODEC), | 277             intent.getIntExtra(EXTRA_AUDIO_BITRATE, 0), intent.getStringExtra(EX
     TRA_AUDIOCODEC), | 
| 253             intent.getBooleanExtra(EXTRA_NOAUDIOPROCESSING_ENABLED, false), | 278             intent.getBooleanExtra(EXTRA_NOAUDIOPROCESSING_ENABLED, false), | 
| 254             intent.getBooleanExtra(EXTRA_AECDUMP_ENABLED, false), | 279             intent.getBooleanExtra(EXTRA_AECDUMP_ENABLED, false), | 
| 255             intent.getBooleanExtra(EXTRA_OPENSLES_ENABLED, false), | 280             intent.getBooleanExtra(EXTRA_OPENSLES_ENABLED, false), | 
| 256             intent.getBooleanExtra(EXTRA_DISABLE_BUILT_IN_AEC, false), | 281             intent.getBooleanExtra(EXTRA_DISABLE_BUILT_IN_AEC, false), | 
| 257             intent.getBooleanExtra(EXTRA_DISABLE_BUILT_IN_AGC, false), | 282             intent.getBooleanExtra(EXTRA_DISABLE_BUILT_IN_AGC, false), | 
| 258             intent.getBooleanExtra(EXTRA_DISABLE_BUILT_IN_NS, false), | 283             intent.getBooleanExtra(EXTRA_DISABLE_BUILT_IN_NS, false), | 
| 259             intent.getBooleanExtra(EXTRA_ENABLE_LEVEL_CONTROL, false)); | 284             intent.getBooleanExtra(EXTRA_ENABLE_LEVEL_CONTROL, false), dataChann
     elParameters); | 
| 260     commandLineRun = intent.getBooleanExtra(EXTRA_CMDLINE, false); | 285     commandLineRun = intent.getBooleanExtra(EXTRA_CMDLINE, false); | 
| 261     runTimeMs = intent.getIntExtra(EXTRA_RUNTIME, 0); | 286     runTimeMs = intent.getIntExtra(EXTRA_RUNTIME, 0); | 
| 262 | 287 | 
| 263     Log.d(TAG, "VIDEO_FILE: '" + intent.getStringExtra(EXTRA_VIDEO_FILE_AS_CAMER
     A) + "'"); | 288     Log.d(TAG, "VIDEO_FILE: '" + intent.getStringExtra(EXTRA_VIDEO_FILE_AS_CAMER
     A) + "'"); | 
| 264 | 289 | 
| 265     // Create connection client. Use DirectRTCClient if room name is an IP other
     wise use the | 290     // Create connection client. Use DirectRTCClient if room name is an IP other
     wise use the | 
| 266     // standard WebSocketRTCClient. | 291     // standard WebSocketRTCClient. | 
| 267     if (loopback || !DirectRTCClient.IP_PATTERN.matcher(roomId).matches()) { | 292     if (loopback || !DirectRTCClient.IP_PATTERN.matcher(roomId).matches()) { | 
| 268       appRtcClient = new WebSocketRTCClient(this); | 293       appRtcClient = new WebSocketRTCClient(this); | 
| 269     } else { | 294     } else { | 
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 808         } | 833         } | 
| 809       } | 834       } | 
| 810     }); | 835     }); | 
| 811   } | 836   } | 
| 812 | 837 | 
| 813   @Override | 838   @Override | 
| 814   public void onPeerConnectionError(final String description) { | 839   public void onPeerConnectionError(final String description) { | 
| 815     reportError(description); | 840     reportError(description); | 
| 816   } | 841   } | 
| 817 } | 842 } | 
| OLD | NEW | 
|---|