Java Code Examples for org.webrtc.Logging#e()

The following examples show how to use org.webrtc.Logging#e() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TrackWindowMgr.java    From QNRTC-Android with Apache License 2.0 6 votes vote down vote up
public void addTrackInfo(String userId, List<QNTrackInfo> trackInfoList) {
    if (mTrackCandidateWins.size() == 0) {
        Logging.e(TAG, "There were more than 9 published users in the room, with no unUsedWindow to draw.");
        return;
    }
    UserTrackView userTrackView = mUserWindowMap.get(userId);
    if (userTrackView != null) {
        // user has already displayed in screen
        userTrackView.onAddTrackInfo(trackInfoList);
    } else {
        // allocate new track windows
        userTrackView = mTrackCandidateWins.remove(0);
        mUserWindowMap.put(userId, userTrackView, userId.equals(mCurrentUserId));
        userTrackView.setUserTrackInfo(mEngine, userId, trackInfoList);
        userTrackView.changeViewBackgroundByPos(mUserWindowMap.size());

        userTrackView.setVisibility(View.VISIBLE);

        // update whole layout
        updateTrackWindowsLayout();
    }
}
 
Example 2
Source File: WebRtcAudioTrack.java    From webrtc_android with MIT License 6 votes vote down vote up
@CalledByNative
private boolean stopPlayout() {
  threadChecker.checkIsOnValidThread();
  volumeLogger.stop();
  Logging.d(TAG, "stopPlayout");
  assertTrue(audioThread != null);
  logUnderrunCount();
  audioThread.stopThread();

  Logging.d(TAG, "Stopping the AudioTrackThread...");
  audioThread.interrupt();
  if (!ThreadUtils.joinUninterruptibly(audioThread, AUDIO_TRACK_THREAD_JOIN_TIMEOUT_MS)) {
    Logging.e(TAG, "Join of AudioTrackThread timed out.");
    WebRtcAudioUtils.logAudioState(TAG, context, audioManager);
  }
  Logging.d(TAG, "AudioTrackThread has now been stopped.");
  audioThread = null;
  releaseAudioResources();
  return true;
}
 
Example 3
Source File: WebRtcAudioRecord.java    From webrtc_android with MIT License 5 votes vote down vote up
@CalledByNative
private boolean stopRecording() {
  Logging.d(TAG, "stopRecording");
  assertTrue(audioThread != null);
  audioThread.stopThread();
  if (!ThreadUtils.joinUninterruptibly(audioThread, AUDIO_RECORD_THREAD_JOIN_TIMEOUT_MS)) {
    Logging.e(TAG, "Join of AudioRecordJavaThread timed out");
    WebRtcAudioUtils.logAudioState(TAG, context, audioManager);
  }
  audioThread = null;
  effects.release();
  releaseAudioResources();
  return true;
}
 
Example 4
Source File: WebRtcAudioTrack.java    From webrtc_android with MIT License 5 votes vote down vote up
private void reportWebRtcAudioTrackError(String errorMessage) {
  Logging.e(TAG, "Run-time playback error: " + errorMessage);
  WebRtcAudioUtils.logAudioState(TAG, context, audioManager);
  if (errorCallback != null) {
    errorCallback.onWebRtcAudioTrackError(errorMessage);
  }
}
 
Example 5
Source File: WebRtcAudioTrack.java    From webrtc_android with MIT License 5 votes vote down vote up
private void reportWebRtcAudioTrackStartError(
    AudioTrackStartErrorCode errorCode, String errorMessage) {
  Logging.e(TAG, "Start playout error: " + errorCode + ". " + errorMessage);
  WebRtcAudioUtils.logAudioState(TAG, context, audioManager);
  if (errorCallback != null) {
    errorCallback.onWebRtcAudioTrackStartError(errorCode, errorMessage);
  }
}
 
Example 6
Source File: WebRtcAudioTrack.java    From webrtc_android with MIT License 5 votes vote down vote up
private void reportWebRtcAudioTrackInitError(String errorMessage) {
  Logging.e(TAG, "Init playout error: " + errorMessage);
  WebRtcAudioUtils.logAudioState(TAG, context, audioManager);
  if (errorCallback != null) {
    errorCallback.onWebRtcAudioTrackInitError(errorMessage);
  }
}
 
Example 7
Source File: WebRtcAudioTrack.java    From webrtc_android with MIT License 5 votes vote down vote up
@CalledByNative
private boolean setStreamVolume(int volume) {
  threadChecker.checkIsOnValidThread();
  Logging.d(TAG, "setStreamVolume(" + volume + ")");
  if (isVolumeFixed()) {
    Logging.e(TAG, "The device implements a fixed volume policy.");
    return false;
  }
  audioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL, volume, 0);
  return true;
}
 
Example 8
Source File: JavaAudioDeviceModule.java    From webrtc_android with MIT License 5 votes vote down vote up
/**
 * Control if the built-in HW acoustic echo canceler should be used or not. The default is on if
 * it is supported. It is possible to query support by calling
 * isBuiltInAcousticEchoCancelerSupported().
 */
// 设置是否开启内置回声消除,如果支持,默认打开
public Builder setUseHardwareAcousticEchoCanceler(boolean useHardwareAcousticEchoCanceler) {
    if (useHardwareAcousticEchoCanceler && !isBuiltInAcousticEchoCancelerSupported()) {
        Logging.e(TAG, "HW AEC not supported");
        useHardwareAcousticEchoCanceler = false;
    }
    this.useHardwareAcousticEchoCanceler = useHardwareAcousticEchoCanceler;
    return this;
}
 
Example 9
Source File: JavaAudioDeviceModule.java    From webrtc_android with MIT License 5 votes vote down vote up
/**
 * Control if the built-in HW noise suppressor should be used or not. The default is on if it is
 * supported. It is possible to query support by calling isBuiltInNoiseSuppressorSupported().
 */

// 设置是否开启硬件噪声抑制器,默认如果支持就打开
public Builder setUseHardwareNoiseSuppressor(boolean useHardwareNoiseSuppressor) {
    if (useHardwareNoiseSuppressor && !isBuiltInNoiseSuppressorSupported()) {
        Logging.e(TAG, "HW NS not supported");
        useHardwareNoiseSuppressor = false;
    }
    this.useHardwareNoiseSuppressor = useHardwareNoiseSuppressor;
    return this;
}
 
Example 10
Source File: WebRtcAudioRecord.java    From webrtc_android with MIT License 5 votes vote down vote up
private void reportWebRtcAudioRecordError(String errorMessage) {
  Logging.e(TAG, "Run-time recording error: " + errorMessage);
  WebRtcAudioUtils.logAudioState(TAG);
  if (errorCallback != null) {
    errorCallback.onWebRtcAudioRecordError(errorMessage);
  }
}
 
Example 11
Source File: WebRtcAudioRecord.java    From webrtc_android with MIT License 5 votes vote down vote up
private void reportWebRtcAudioRecordStartError(
    AudioRecordStartErrorCode errorCode, String errorMessage) {
  Logging.e(TAG, "Start recording error: " + errorCode + ". " + errorMessage);
  WebRtcAudioUtils.logAudioState(TAG);
  if (errorCallback != null) {
    errorCallback.onWebRtcAudioRecordStartError(errorCode, errorMessage);
  }
}
 
Example 12
Source File: WebRtcAudioEffects.java    From webrtc_android with MIT License 5 votes vote down vote up
public boolean setAEC(boolean enable) {
  Logging.d(TAG, "setAEC(" + enable + ")");
  if (!isAcousticEchoCancelerSupported()) {
    Logging.w(TAG, "Platform AEC is not supported");
    shouldEnableAec = false;
    return false;
  }
  if (aec != null && (enable != shouldEnableAec)) {
    Logging.e(TAG, "Platform AEC state can't be modified while recording");
    return false;
  }
  shouldEnableAec = enable;
  return true;
}
 
Example 13
Source File: WebRtcAudioRecord.java    From webrtc_android with MIT License 5 votes vote down vote up
private boolean stopRecording() {
  Logging.d(TAG, "stopRecording");
  assertTrue(audioThread != null);
  audioThread.stopThread();
  if (!ThreadUtils.joinUninterruptibly(audioThread, AUDIO_RECORD_THREAD_JOIN_TIMEOUT_MS)) {
    Logging.e(TAG, "Join of AudioRecordJavaThread timed out");
    WebRtcAudioUtils.logAudioState(TAG);
  }
  audioThread = null;
  if (effects != null) {
    effects.release();
  }
  releaseAudioResources();
  return true;
}
 
Example 14
Source File: VideoSource.java    From VideoCRE with MIT License 5 votes vote down vote up
public void stop() {
    if (mVideoCapturer != null && !mVideoCapturerStopped) {
        Logging.d(TAG, "Stop video source.");
        try {
            mVideoCapturer.stopCapture();
        } catch (InterruptedException e) {
            Logging.e(TAG, "stop", e);
        }
        mVideoCapturerStopped = true;
    }
}
 
Example 15
Source File: WebRtcAudioRecord.java    From webrtc_android with MIT License 5 votes vote down vote up
private boolean enableBuiltInAEC(boolean enable) {
  Logging.d(TAG, "enableBuiltInAEC(" + enable + ')');
  if (effects == null) {
    Logging.e(TAG, "Built-in AEC is not supported on this platform");
    return false;
  }
  return effects.setAEC(enable);
}
 
Example 16
Source File: WebRtcAudioEffects.java    From webrtc_android with MIT License 5 votes vote down vote up
public boolean setNS(boolean enable) {
  Logging.d(TAG, "setNS(" + enable + ")");
  if (!canUseNoiseSuppressor()) {
    Logging.w(TAG, "Platform NS is not supported");
    shouldEnableNs = false;
    return false;
  }
  if (ns != null && (enable != shouldEnableNs)) {
    Logging.e(TAG, "Platform NS state can't be modified while recording");
    return false;
  }
  shouldEnableNs = enable;
  return true;
}
 
Example 17
Source File: WebRtcAudioTrack.java    From webrtc_android with MIT License 5 votes vote down vote up
private void reportWebRtcAudioTrackError(String errorMessage) {
  Logging.e(TAG, "Run-time playback error: " + errorMessage);
  WebRtcAudioUtils.logAudioState(TAG);
  if (errorCallbackOld != null) {
    errorCallbackOld.onWebRtcAudioTrackError(errorMessage);
  }
  if (errorCallback != null) {
    errorCallback.onWebRtcAudioTrackError(errorMessage);
  }
}
 
Example 18
Source File: WebRtcAudioTrack.java    From webrtc_android with MIT License 5 votes vote down vote up
private void reportWebRtcAudioTrackStartError(
    AudioTrackStartErrorCode errorCode, String errorMessage) {
  Logging.e(TAG, "Start playout error: "  + errorCode + ". " + errorMessage);
  WebRtcAudioUtils.logAudioState(TAG);
  if (errorCallbackOld != null) {
    errorCallbackOld.onWebRtcAudioTrackStartError(errorMessage);
  }
  if (errorCallback != null) {
    errorCallback.onWebRtcAudioTrackStartError(errorCode, errorMessage);
  }
}
 
Example 19
Source File: WebRtcAudioRecord.java    From webrtc_android with MIT License 5 votes vote down vote up
private void reportWebRtcAudioRecordError(String errorMessage) {
  Logging.e(TAG, "Run-time recording error: " + errorMessage);
  WebRtcAudioUtils.logAudioState(TAG, context, audioManager);
  if (errorCallback != null) {
    errorCallback.onWebRtcAudioRecordError(errorMessage);
  }
}
 
Example 20
Source File: WebRtcAudioTrack.java    From webrtc_android with MIT License 5 votes vote down vote up
private boolean setStreamVolume(int volume) {
  threadChecker.checkIsOnValidThread();
  Logging.d(TAG, "setStreamVolume(" + volume + ")");
  assertTrue(audioManager != null);
  if (isVolumeFixed()) {
    Logging.e(TAG, "The device implements a fixed volume policy.");
    return false;
  }
  audioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL, volume, 0);
  return true;
}