Tabnine Logo
ErrorFormatter.formatCodecException
Code IndexAdd Tabnine to your IDE (free)

How to use
formatCodecException
method
in
com.novoda.noplayer.internal.exoplayer.error.ErrorFormatter

Best Java code snippets using com.novoda.noplayer.internal.exoplayer.error.ErrorFormatter.formatCodecException (Showing top 2 results out of 315)

origin: novoda/no-player

  static NoPlayer.PlayerError map(RuntimeException unexpectedException, String message) {
    if (unexpectedException instanceof EGLSurfaceTexture.GlException) {
      return new NoPlayerError(PlayerErrorType.UNEXPECTED, DetailErrorType.EGL_OPERATION_ERROR, message);
    }

    if (unexpectedException instanceof DefaultAudioSink.InvalidAudioTrackTimestampException) {
      return new NoPlayerError(PlayerErrorType.UNEXPECTED, DetailErrorType.SPURIOUS_AUDIO_TRACK_TIMESTAMP_ERROR, message);
    }

    if (unexpectedException instanceof IllegalStateException && message.contains("Multiple renderer media clocks")) {
      return new NoPlayerError(PlayerErrorType.UNEXPECTED, DetailErrorType.MULTIPLE_RENDERER_MEDIA_CLOCK_ENABLED_ERROR, message);
    }

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && unexpectedException instanceof MediaCodec.CodecException) {
      String errorMessage = ErrorFormatter.formatCodecException((MediaCodec.CodecException) unexpectedException);
      return new NoPlayerError(PlayerErrorType.UNEXPECTED, DetailErrorType.UNEXPECTED_CODEC_ERROR, errorMessage);
    }

    return new NoPlayerError(PlayerErrorType.UNKNOWN, DetailErrorType.UNKNOWN, message);
  }
}
origin: novoda/no-player

@Test
public void givenMediaCodecException_whenFormattingMessage_thenReturnsExpectedMessageFormat() {
  MediaCodec.CodecException codecException = mock(MediaCodec.CodecException.class);
  given(codecException.getDiagnosticInfo()).willReturn("android.media.MediaCodec.error_+1234");
  given(codecException.isTransient()).willReturn(true);
  given(codecException.isRecoverable()).willReturn(false);
  String expectedFormat = "diagnosticInformation=android.media.MediaCodec.error_+1234 : isTransient=true : isRecoverable=false";
  String actualFormat = ErrorFormatter.formatCodecException(codecException);
  assertThat(actualFormat).isEqualTo(expectedFormat);
}
com.novoda.noplayer.internal.exoplayer.errorErrorFormatterformatCodecException

Popular methods of ErrorFormatter

  • formatMessage

Popular in Java

  • Start an intent from android
  • getExternalFilesDir (Context)
  • getApplicationContext (Context)
  • startActivity (Activity)
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now