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

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

Issue 2861573002: Initial implementation of Android audio playback error handling. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 import org.webrtc.SdpObserver; 49 import org.webrtc.SdpObserver;
50 import org.webrtc.SessionDescription; 50 import org.webrtc.SessionDescription;
51 import org.webrtc.StatsObserver; 51 import org.webrtc.StatsObserver;
52 import org.webrtc.StatsReport; 52 import org.webrtc.StatsReport;
53 import org.webrtc.VideoCapturer; 53 import org.webrtc.VideoCapturer;
54 import org.webrtc.VideoRenderer; 54 import org.webrtc.VideoRenderer;
55 import org.webrtc.VideoSource; 55 import org.webrtc.VideoSource;
56 import org.webrtc.VideoTrack; 56 import org.webrtc.VideoTrack;
57 import org.webrtc.voiceengine.WebRtcAudioManager; 57 import org.webrtc.voiceengine.WebRtcAudioManager;
58 import org.webrtc.voiceengine.WebRtcAudioRecord; 58 import org.webrtc.voiceengine.WebRtcAudioRecord;
59 import org.webrtc.voiceengine.WebRtcAudioTrack;
59 import org.webrtc.voiceengine.WebRtcAudioRecord.AudioRecordStartErrorCode; 60 import org.webrtc.voiceengine.WebRtcAudioRecord.AudioRecordStartErrorCode;
60 import org.webrtc.voiceengine.WebRtcAudioRecord.WebRtcAudioRecordErrorCallback; 61 import org.webrtc.voiceengine.WebRtcAudioRecord.WebRtcAudioRecordErrorCallback;
62 import org.webrtc.voiceengine.WebRtcAudioTrack.WebRtcAudioTrackErrorCallback;
61 import org.webrtc.voiceengine.WebRtcAudioUtils; 63 import org.webrtc.voiceengine.WebRtcAudioUtils;
62 64
63 /** 65 /**
64 * Peer connection client implementation. 66 * Peer connection client implementation.
65 * 67 *
66 * <p>All public methods are routed to local looper thread. 68 * <p>All public methods are routed to local looper thread.
67 * All PeerConnectionEvents callbacks are invoked from the same looper thread. 69 * All PeerConnectionEvents callbacks are invoked from the same looper thread.
68 * This class is a singleton. 70 * This class is a singleton.
69 */ 71 */
70 public class PeerConnectionClient { 72 public class PeerConnectionClient {
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 reportError(errorMessage); 468 reportError(errorMessage);
467 } 469 }
468 470
469 @Override 471 @Override
470 public void onWebRtcAudioRecordError(String errorMessage) { 472 public void onWebRtcAudioRecordError(String errorMessage) {
471 Log.e(TAG, "onWebRtcAudioRecordError: " + errorMessage); 473 Log.e(TAG, "onWebRtcAudioRecordError: " + errorMessage);
472 reportError(errorMessage); 474 reportError(errorMessage);
473 } 475 }
474 }); 476 });
475 477
478 WebRtcAudioTrack.setErrorCallback(new WebRtcAudioTrackErrorCallback() {
479 @Override
480 public void onWebRtcAudioTrackInitError(String errorMessage) {
481 reportError(errorMessage);
482 }
483
484 @Override
485 public void onWebRtcAudioTrackStartError(String errorMessage) {
486 reportError(errorMessage);
487 }
488
489 @Override
490 public void onWebRtcAudioTrackError(String errorMessage) {
491 reportError(errorMessage);
492 }
493 });
494
476 // Create peer connection factory. 495 // Create peer connection factory.
477 PeerConnectionFactory.initializeAndroidGlobals( 496 PeerConnectionFactory.initializeAndroidGlobals(
478 context, peerConnectionParameters.videoCodecHwAcceleration); 497 context, peerConnectionParameters.videoCodecHwAcceleration);
479 if (options != null) { 498 if (options != null) {
480 Log.d(TAG, "Factory networkIgnoreMask option: " + options.networkIgnoreMas k); 499 Log.d(TAG, "Factory networkIgnoreMask option: " + options.networkIgnoreMas k);
481 } 500 }
482 factory = new PeerConnectionFactory(options); 501 factory = new PeerConnectionFactory(options);
483 Log.d(TAG, "Peer connection factory created."); 502 Log.d(TAG, "Peer connection factory created.");
484 } 503 }
485 504
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
1324 public void onCreateFailure(final String error) { 1343 public void onCreateFailure(final String error) {
1325 reportError("createSDP error: " + error); 1344 reportError("createSDP error: " + error);
1326 } 1345 }
1327 1346
1328 @Override 1347 @Override
1329 public void onSetFailure(final String error) { 1348 public void onSetFailure(final String error) {
1330 reportError("setSDP error: " + error); 1349 reportError("setSDP error: " + error);
1331 } 1350 }
1332 } 1351 }
1333 } 1352 }
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698