Java 类android.media.MediaCodec.CodecException 实例源码

项目:airgram    文件:MediaCodecTrackRenderer.java   
@TargetApi(21)
private static String getDiagnosticInfoV21(Throwable cause) {
  if (cause instanceof CodecException) {
    return ((CodecException) cause).getDiagnosticInfo();
  }
  return null;
}
项目:PlusGram    文件:MediaCodecTrackRenderer.java   
@TargetApi(21)
private static String getDiagnosticInfoV21(Throwable cause) {
  if (cause instanceof CodecException) {
    return ((CodecException) cause).getDiagnosticInfo();
  }
  return null;
}
项目:Exoplayer2Radio    文件:MediaCodecRenderer.java   
@TargetApi(21)
private static String getDiagnosticInfoV21(Throwable cause) {
  if (cause instanceof CodecException) {
    return ((CodecException) cause).getDiagnosticInfo();
  }
  return null;
}
项目:miku    文件:MediaCodecTrackRenderer.java   
@TargetApi(21)
private static String getDiagnosticInfoV21(Throwable cause) {
  if (cause instanceof CodecException) {
    return ((CodecException) cause).getDiagnosticInfo();
  }
  return null;
}
项目:K-Sonic    文件:MediaCodecRenderer.java   
@TargetApi(21)
private static String getDiagnosticInfoV21(Throwable cause) {
  if (cause instanceof CodecException) {
    return ((CodecException) cause).getDiagnosticInfo();
  }
  return null;
}
项目:ExoPlayer-Demo    文件:MediaCodecTrackRenderer.java   
@TargetApi(21)
private static String getDiagnosticInfoV21(Throwable cause) {
  if (cause instanceof CodecException) {
    return ((CodecException) cause).getDiagnosticInfo();
  }
  return null;
}
项目:videoPickPlayer    文件:MediaCodecRenderer.java   
@TargetApi(21)
private static String getDiagnosticInfoV21(Throwable cause) {
  if (cause instanceof CodecException) {
    return ((CodecException) cause).getDiagnosticInfo();
  }
  return null;
}
项目:android-exoplayer    文件:MediaCodecTrackRenderer.java   
@TargetApi(21)
private static String getDiagnosticInfoV21(Throwable cause) {
  if (cause instanceof CodecException) {
    return ((CodecException) cause).getDiagnosticInfo();
  }
  return null;
}
项目:transistor    文件:MediaCodecRenderer.java   
@TargetApi(21)
private static String getDiagnosticInfoV21(Throwable cause) {
  if (cause instanceof CodecException) {
    return ((CodecException) cause).getDiagnosticInfo();
  }
  return null;
}
项目:ExoPlayer    文件:MediaCodecTrackRenderer.java   
@TargetApi(21)
private static String getDiagnosticInfoV21(Throwable cause) {
  if (cause instanceof CodecException) {
    return ((CodecException) cause).getDiagnosticInfo();
  }
  return null;
}
项目:Telegram    文件:MediaCodecRenderer.java   
@TargetApi(21)
private static String getDiagnosticInfoV21(Throwable cause) {
  if (cause instanceof CodecException) {
    return ((CodecException) cause).getDiagnosticInfo();
  }
  return null;
}
项目:moonlight-android    文件:MediaCodecDecoderRenderer.java   
private void handleDecoderException(Exception e, ByteBuffer buf, int codecFlags, boolean throwOnTransient) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        if (e instanceof CodecException) {
            CodecException codecExc = (CodecException) e;

            if (codecExc.isTransient() && !throwOnTransient) {
                // We'll let transient exceptions go
                LimeLog.warning(codecExc.getDiagnosticInfo());
                return;
            }

            LimeLog.severe(codecExc.getDiagnosticInfo());
        }
    }

    // Only throw if we're not stopping
    if (!stopping) {
        //
        // There seems to be a race condition with decoder/surface teardown causing some
        // decoders to to throw IllegalStateExceptions even before 'stopping' is set.
        // To workaround this while allowing real exceptions to propagate, we will eat the
        // first exception. If we are still receiving exceptions 3 seconds later, we will
        // throw the original exception again.
        //
        if (initialException != null) {
            // This isn't the first time we've had an exception processing video
            if (System.currentTimeMillis() - initialExceptionTimestamp >= EXCEPTION_REPORT_DELAY_MS) {
                // It's been over 3 seconds and we're still getting exceptions. Throw the original now.
                if (!reportedCrash) {
                    reportedCrash = true;
                    crashListener.notifyCrash(initialException);
                }
                throw initialException;
            }
        }
        else {
            // This is the first exception we've hit
            if (buf != null || codecFlags != 0) {
                initialException = new RendererException(this, e, buf, codecFlags);
            }
            else {
                initialException = new RendererException(this, e);
            }
            initialExceptionTimestamp = System.currentTimeMillis();
        }
    }
}