OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2014 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 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 public static final String AUDIO_TRACK_ID = "ARDAMSa0"; | 66 public static final String AUDIO_TRACK_ID = "ARDAMSa0"; |
67 public static final String VIDEO_TRACK_TYPE = "video"; | 67 public static final String VIDEO_TRACK_TYPE = "video"; |
68 private static final String TAG = "PCRTCClient"; | 68 private static final String TAG = "PCRTCClient"; |
69 private static final String VIDEO_CODEC_VP8 = "VP8"; | 69 private static final String VIDEO_CODEC_VP8 = "VP8"; |
70 private static final String VIDEO_CODEC_VP9 = "VP9"; | 70 private static final String VIDEO_CODEC_VP9 = "VP9"; |
71 private static final String VIDEO_CODEC_H264 = "H264"; | 71 private static final String VIDEO_CODEC_H264 = "H264"; |
72 private static final String AUDIO_CODEC_OPUS = "opus"; | 72 private static final String AUDIO_CODEC_OPUS = "opus"; |
73 private static final String AUDIO_CODEC_ISAC = "ISAC"; | 73 private static final String AUDIO_CODEC_ISAC = "ISAC"; |
74 private static final String VIDEO_CODEC_PARAM_START_BITRATE = "x-google-start-
bitrate"; | 74 private static final String VIDEO_CODEC_PARAM_START_BITRATE = "x-google-start-
bitrate"; |
75 private static final String VIDEO_FLEXFEC_FIELDTRIAL = "WebRTC-FlexFEC-03/Enab
led/"; | 75 private static final String VIDEO_FLEXFEC_FIELDTRIAL = "WebRTC-FlexFEC-03/Enab
led/"; |
76 private static final String VIDEO_VP8_INTEL_HW_ENCODER_FIELDTRIAL = "WebRTC-In
telVP8/Enabled/"; | |
77 private static final String AUDIO_CODEC_PARAM_BITRATE = "maxaveragebitrate"; | 76 private static final String AUDIO_CODEC_PARAM_BITRATE = "maxaveragebitrate"; |
78 private static final String AUDIO_ECHO_CANCELLATION_CONSTRAINT = "googEchoCanc
ellation"; | 77 private static final String AUDIO_ECHO_CANCELLATION_CONSTRAINT = "googEchoCanc
ellation"; |
79 private static final String AUDIO_AUTO_GAIN_CONTROL_CONSTRAINT = "googAutoGain
Control"; | 78 private static final String AUDIO_AUTO_GAIN_CONTROL_CONSTRAINT = "googAutoGain
Control"; |
80 private static final String AUDIO_HIGH_PASS_FILTER_CONSTRAINT = "googHighpassF
ilter"; | 79 private static final String AUDIO_HIGH_PASS_FILTER_CONSTRAINT = "googHighpassF
ilter"; |
81 private static final String AUDIO_NOISE_SUPPRESSION_CONSTRAINT = "googNoiseSup
pression"; | 80 private static final String AUDIO_NOISE_SUPPRESSION_CONSTRAINT = "googNoiseSup
pression"; |
82 private static final String AUDIO_LEVEL_CONTROL_CONSTRAINT = "levelControl"; | 81 private static final String AUDIO_LEVEL_CONTROL_CONSTRAINT = "levelControl"; |
83 private static final String DTLS_SRTP_KEY_AGREEMENT_CONSTRAINT = "DtlsSrtpKeyA
greement"; | 82 private static final String DTLS_SRTP_KEY_AGREEMENT_CONSTRAINT = "DtlsSrtpKeyA
greement"; |
84 private static final int HD_VIDEO_WIDTH = 1280; | 83 private static final int HD_VIDEO_WIDTH = 1280; |
85 private static final int HD_VIDEO_HEIGHT = 720; | 84 private static final int HD_VIDEO_HEIGHT = 720; |
86 private static final int BPS_IN_KBPS = 1000; | 85 private static final int BPS_IN_KBPS = 1000; |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 if (peerConnectionParameters.tracing) { | 364 if (peerConnectionParameters.tracing) { |
366 PeerConnectionFactory.startInternalTracingCapture( | 365 PeerConnectionFactory.startInternalTracingCapture( |
367 Environment.getExternalStorageDirectory().getAbsolutePath() + File.sep
arator | 366 Environment.getExternalStorageDirectory().getAbsolutePath() + File.sep
arator |
368 + "webrtc-trace.txt"); | 367 + "webrtc-trace.txt"); |
369 } | 368 } |
370 Log.d(TAG, | 369 Log.d(TAG, |
371 "Create peer connection factory. Use video: " + peerConnectionParameters
.videoCallEnabled); | 370 "Create peer connection factory. Use video: " + peerConnectionParameters
.videoCallEnabled); |
372 isError = false; | 371 isError = false; |
373 | 372 |
374 // Initialize field trials. | 373 // Initialize field trials. |
375 String fieldTrials = ""; | |
376 if (peerConnectionParameters.videoFlexfecEnabled) { | 374 if (peerConnectionParameters.videoFlexfecEnabled) { |
377 fieldTrials += VIDEO_FLEXFEC_FIELDTRIAL; | 375 PeerConnectionFactory.initializeFieldTrials(VIDEO_FLEXFEC_FIELDTRIAL); |
378 Log.d(TAG, "Enable FlexFEC field trial."); | 376 Log.d(TAG, "Enable FlexFEC field trial."); |
| 377 } else { |
| 378 PeerConnectionFactory.initializeFieldTrials(""); |
379 } | 379 } |
380 fieldTrials += VIDEO_VP8_INTEL_HW_ENCODER_FIELDTRIAL; | |
381 PeerConnectionFactory.initializeFieldTrials(fieldTrials); | |
382 | 380 |
383 // Check preferred video codec. | 381 // Check preferred video codec. |
384 preferredVideoCodec = VIDEO_CODEC_VP8; | 382 preferredVideoCodec = VIDEO_CODEC_VP8; |
385 if (videoCallEnabled && peerConnectionParameters.videoCodec != null) { | 383 if (videoCallEnabled && peerConnectionParameters.videoCodec != null) { |
386 if (peerConnectionParameters.videoCodec.equals(VIDEO_CODEC_VP9)) { | 384 if (peerConnectionParameters.videoCodec.equals(VIDEO_CODEC_VP9)) { |
387 preferredVideoCodec = VIDEO_CODEC_VP9; | 385 preferredVideoCodec = VIDEO_CODEC_VP9; |
388 } else if (peerConnectionParameters.videoCodec.equals(VIDEO_CODEC_H264)) { | 386 } else if (peerConnectionParameters.videoCodec.equals(VIDEO_CODEC_H264)) { |
389 preferredVideoCodec = VIDEO_CODEC_H264; | 387 preferredVideoCodec = VIDEO_CODEC_H264; |
390 } | 388 } |
391 } | 389 } |
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1256 public void onCreateFailure(final String error) { | 1254 public void onCreateFailure(final String error) { |
1257 reportError("createSDP error: " + error); | 1255 reportError("createSDP error: " + error); |
1258 } | 1256 } |
1259 | 1257 |
1260 @Override | 1258 @Override |
1261 public void onSetFailure(final String error) { | 1259 public void onSetFailure(final String error) { |
1262 reportError("setSDP error: " + error); | 1260 reportError("setSDP error: " + error); |
1263 } | 1261 } |
1264 } | 1262 } |
1265 } | 1263 } |
OLD | NEW |