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

Side by Side Diff: webrtc/examples/androidapp/src/org/appspot/apprtc/ConnectActivity.java

Issue 2077663003: Camera2 in AppRTC Android Demo. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@camera2_only
Patch Set: Create peer connection factory with the target context in the test Created 4 years, 5 months 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 * 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 private static final int CONNECTION_REQUEST = 1; 48 private static final int CONNECTION_REQUEST = 1;
49 private static final int REMOVE_FAVORITE_INDEX = 0; 49 private static final int REMOVE_FAVORITE_INDEX = 0;
50 private static boolean commandLineRun = false; 50 private static boolean commandLineRun = false;
51 51
52 private ImageButton connectButton; 52 private ImageButton connectButton;
53 private ImageButton addFavoriteButton; 53 private ImageButton addFavoriteButton;
54 private EditText roomEditText; 54 private EditText roomEditText;
55 private ListView roomListView; 55 private ListView roomListView;
56 private SharedPreferences sharedPref; 56 private SharedPreferences sharedPref;
57 private String keyprefVideoCallEnabled; 57 private String keyprefVideoCallEnabled;
58 private String keyprefCamera2;
58 private String keyprefResolution; 59 private String keyprefResolution;
59 private String keyprefFps; 60 private String keyprefFps;
60 private String keyprefCaptureQualitySlider; 61 private String keyprefCaptureQualitySlider;
61 private String keyprefVideoBitrateType; 62 private String keyprefVideoBitrateType;
62 private String keyprefVideoBitrateValue; 63 private String keyprefVideoBitrateValue;
63 private String keyprefVideoCodec; 64 private String keyprefVideoCodec;
64 private String keyprefAudioBitrateType; 65 private String keyprefAudioBitrateType;
65 private String keyprefAudioBitrateValue; 66 private String keyprefAudioBitrateValue;
66 private String keyprefAudioCodec; 67 private String keyprefAudioCodec;
67 private String keyprefHwCodecAcceleration; 68 private String keyprefHwCodecAcceleration;
(...skipping 11 matching lines...) Expand all
79 private ArrayAdapter<String> adapter; 80 private ArrayAdapter<String> adapter;
80 81
81 @Override 82 @Override
82 public void onCreate(Bundle savedInstanceState) { 83 public void onCreate(Bundle savedInstanceState) {
83 super.onCreate(savedInstanceState); 84 super.onCreate(savedInstanceState);
84 85
85 // Get setting keys. 86 // Get setting keys.
86 PreferenceManager.setDefaultValues(this, R.xml.preferences, false); 87 PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
87 sharedPref = PreferenceManager.getDefaultSharedPreferences(this); 88 sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
88 keyprefVideoCallEnabled = getString(R.string.pref_videocall_key); 89 keyprefVideoCallEnabled = getString(R.string.pref_videocall_key);
90 keyprefCamera2 = getString(R.string.pref_camera2_key);
89 keyprefResolution = getString(R.string.pref_resolution_key); 91 keyprefResolution = getString(R.string.pref_resolution_key);
90 keyprefFps = getString(R.string.pref_fps_key); 92 keyprefFps = getString(R.string.pref_fps_key);
91 keyprefCaptureQualitySlider = getString(R.string.pref_capturequalityslider_k ey); 93 keyprefCaptureQualitySlider = getString(R.string.pref_capturequalityslider_k ey);
92 keyprefVideoBitrateType = getString(R.string.pref_startvideobitrate_key); 94 keyprefVideoBitrateType = getString(R.string.pref_startvideobitrate_key);
93 keyprefVideoBitrateValue = getString(R.string.pref_startvideobitratevalue_ke y); 95 keyprefVideoBitrateValue = getString(R.string.pref_startvideobitratevalue_ke y);
94 keyprefVideoCodec = getString(R.string.pref_videocodec_key); 96 keyprefVideoCodec = getString(R.string.pref_videocodec_key);
95 keyprefHwCodecAcceleration = getString(R.string.pref_hwcodec_key); 97 keyprefHwCodecAcceleration = getString(R.string.pref_hwcodec_key);
96 keyprefCaptureToTexture = getString(R.string.pref_capturetotexture_key); 98 keyprefCaptureToTexture = getString(R.string.pref_capturetotexture_key);
97 keyprefAudioBitrateType = getString(R.string.pref_startaudiobitrate_key); 99 keyprefAudioBitrateType = getString(R.string.pref_startaudiobitrate_key);
98 keyprefAudioBitrateValue = getString(R.string.pref_startaudiobitratevalue_ke y); 100 keyprefAudioBitrateValue = getString(R.string.pref_startaudiobitratevalue_ke y);
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 } 254 }
253 255
254 String roomUrl = sharedPref.getString( 256 String roomUrl = sharedPref.getString(
255 keyprefRoomServerUrl, 257 keyprefRoomServerUrl,
256 getString(R.string.pref_room_server_url_default)); 258 getString(R.string.pref_room_server_url_default));
257 259
258 // Video call enabled flag. 260 // Video call enabled flag.
259 boolean videoCallEnabled = sharedPref.getBoolean(keyprefVideoCallEnabled, 261 boolean videoCallEnabled = sharedPref.getBoolean(keyprefVideoCallEnabled,
260 Boolean.valueOf(getString(R.string.pref_videocall_default))); 262 Boolean.valueOf(getString(R.string.pref_videocall_default)));
261 263
264 // Use Camera2 option.
265 boolean useCamera2 = sharedPref.getBoolean(keyprefCamera2,
266 Boolean.valueOf(getString(R.string.pref_camera2_default)));
267
262 // Get default codecs. 268 // Get default codecs.
263 String videoCodec = sharedPref.getString(keyprefVideoCodec, 269 String videoCodec = sharedPref.getString(keyprefVideoCodec,
264 getString(R.string.pref_videocodec_default)); 270 getString(R.string.pref_videocodec_default));
265 String audioCodec = sharedPref.getString(keyprefAudioCodec, 271 String audioCodec = sharedPref.getString(keyprefAudioCodec,
266 getString(R.string.pref_audiocodec_default)); 272 getString(R.string.pref_audiocodec_default));
267 273
268 // Check HW codec flag. 274 // Check HW codec flag.
269 boolean hwCodec = sharedPref.getBoolean(keyprefHwCodecAcceleration, 275 boolean hwCodec = sharedPref.getBoolean(keyprefHwCodecAcceleration,
270 Boolean.valueOf(getString(R.string.pref_hwcodec_default))); 276 Boolean.valueOf(getString(R.string.pref_hwcodec_default)));
271 277
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 363
358 // Start AppRTCDemo activity. 364 // Start AppRTCDemo activity.
359 Log.d(TAG, "Connecting to room " + roomId + " at URL " + roomUrl); 365 Log.d(TAG, "Connecting to room " + roomId + " at URL " + roomUrl);
360 if (validateUrl(roomUrl)) { 366 if (validateUrl(roomUrl)) {
361 Uri uri = Uri.parse(roomUrl); 367 Uri uri = Uri.parse(roomUrl);
362 Intent intent = new Intent(this, CallActivity.class); 368 Intent intent = new Intent(this, CallActivity.class);
363 intent.setData(uri); 369 intent.setData(uri);
364 intent.putExtra(CallActivity.EXTRA_ROOMID, roomId); 370 intent.putExtra(CallActivity.EXTRA_ROOMID, roomId);
365 intent.putExtra(CallActivity.EXTRA_LOOPBACK, loopback); 371 intent.putExtra(CallActivity.EXTRA_LOOPBACK, loopback);
366 intent.putExtra(CallActivity.EXTRA_VIDEO_CALL, videoCallEnabled); 372 intent.putExtra(CallActivity.EXTRA_VIDEO_CALL, videoCallEnabled);
373 intent.putExtra(CallActivity.EXTRA_CAMERA2, useCamera2);
367 intent.putExtra(CallActivity.EXTRA_VIDEO_WIDTH, videoWidth); 374 intent.putExtra(CallActivity.EXTRA_VIDEO_WIDTH, videoWidth);
368 intent.putExtra(CallActivity.EXTRA_VIDEO_HEIGHT, videoHeight); 375 intent.putExtra(CallActivity.EXTRA_VIDEO_HEIGHT, videoHeight);
369 intent.putExtra(CallActivity.EXTRA_VIDEO_FPS, cameraFps); 376 intent.putExtra(CallActivity.EXTRA_VIDEO_FPS, cameraFps);
370 intent.putExtra(CallActivity.EXTRA_VIDEO_CAPTUREQUALITYSLIDER_ENABLED, 377 intent.putExtra(CallActivity.EXTRA_VIDEO_CAPTUREQUALITYSLIDER_ENABLED,
371 captureQualitySlider); 378 captureQualitySlider);
372 intent.putExtra(CallActivity.EXTRA_VIDEO_BITRATE, videoStartBitrate); 379 intent.putExtra(CallActivity.EXTRA_VIDEO_BITRATE, videoStartBitrate);
373 intent.putExtra(CallActivity.EXTRA_VIDEOCODEC, videoCodec); 380 intent.putExtra(CallActivity.EXTRA_VIDEOCODEC, videoCodec);
374 intent.putExtra(CallActivity.EXTRA_HWCODEC_ENABLED, hwCodec); 381 intent.putExtra(CallActivity.EXTRA_HWCODEC_ENABLED, hwCodec);
375 intent.putExtra(CallActivity.EXTRA_CAPTURETOTEXTURE_ENABLED, captureToText ure); 382 intent.putExtra(CallActivity.EXTRA_CAPTURETOTEXTURE_ENABLED, captureToText ure);
376 intent.putExtra(CallActivity.EXTRA_NOAUDIOPROCESSING_ENABLED, 383 intent.putExtra(CallActivity.EXTRA_NOAUDIOPROCESSING_ENABLED,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 } 433 }
427 }; 434 };
428 435
429 private final OnClickListener connectListener = new OnClickListener() { 436 private final OnClickListener connectListener = new OnClickListener() {
430 @Override 437 @Override
431 public void onClick(View view) { 438 public void onClick(View view) {
432 connectToRoom(roomEditText.getText().toString(), false, false, 0); 439 connectToRoom(roomEditText.getText().toString(), false, false, 0);
433 } 440 }
434 }; 441 };
435 } 442 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698