com.google.android.exoplayer.MediaCodecTrackRenderer.DecoderInitializationException Java Examples

The following examples show how to use com.google.android.exoplayer.MediaCodecTrackRenderer.DecoderInitializationException. 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: VLCNativeCrashHandler.java    From Exoplayer_VLC with Apache License 2.0 6 votes vote down vote up
@Override
public void onNativeCrash() {
	if (eventHandler != null && eventListener != null) {
		eventHandler.post(new Runnable() {

			@Override
			public void run() {

				eventListener.onDecoderInitializationError(new DecoderInitializationException(null, new Exception(
						"VLC Lib native crash occures."), 0));
				if (VLCNativeCrashHandler.this.surfacePlayer != null) {
					VLCNativeCrashHandler.this.surfacePlayer.release();
					VLCNativeCrashHandler.this.surfacePlayer = null;
				}
			}
		});
	}
}
 
Example #2
Source File: VLCNativeCrashHandler.java    From Exoplayer_VLC with Apache License 2.0 6 votes vote down vote up
@Override
public void onNativeCrash() {
	if (eventHandler != null && eventListener != null) {
		eventHandler.post(new Runnable() {

			@Override
			public void run() {

				eventListener.onDecoderInitializationError(new DecoderInitializationException(null, new Exception(
						"VLC Lib native crash occures."), 0));
				if (VLCNativeCrashHandler.this.surfacePlayer != null) {
					VLCNativeCrashHandler.this.surfacePlayer.release();
					VLCNativeCrashHandler.this.surfacePlayer = null;
				}
			}
		});
	}
}
 
Example #3
Source File: VideoPlayerActivity.java    From droidkaigi2016 with Apache License 2.0 5 votes vote down vote up
@Override
public void onError(Exception e) {
    String errorString = null;
    if (e instanceof UnsupportedDrmException) {
        // Special case DRM failures.
        UnsupportedDrmException unsupportedDrmException = (UnsupportedDrmException) e;
        errorString = getString(Util.SDK_INT < 18 ? R.string.video_error_drm_not_supported
                : unsupportedDrmException.reason == UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME
                ? R.string.video_error_drm_unsupported_scheme : R.string.video_error_drm_unknown);
    } else if (e instanceof ExoPlaybackException
            && e.getCause() instanceof DecoderInitializationException) {
        // Special case for decoder initialization failures.
        DecoderInitializationException decoderInitializationException =
                (DecoderInitializationException) e.getCause();
        if (decoderInitializationException.decoderName == null) {
            if (decoderInitializationException.getCause() instanceof DecoderQueryException) {
                errorString = getString(R.string.video_error_querying_decoders);
            } else if (decoderInitializationException.secureDecoderRequired) {
                errorString = getString(R.string.video_error_no_secure_decoder,
                        decoderInitializationException.mimeType);
            } else {
                errorString = getString(R.string.video_error_no_decoder,
                        decoderInitializationException.mimeType);
            }
        } else {
            errorString = getString(R.string.video_error_instantiating_decoder,
                    decoderInitializationException.decoderName);
        }
    }
    if (errorString != null) {
        Toast.makeText(getApplicationContext(), errorString, Toast.LENGTH_LONG).show();
    }
    playerNeedsPrepare = true;
    showControls();
}
 
Example #4
Source File: PlayerActivity.java    From Android-Example-HLS-ExoPlayer with Apache License 2.0 5 votes vote down vote up
@Override
public void onError(Exception e) {
    String errorString = null;
    if (e instanceof UnsupportedDrmException) {
        // Special case DRM failures.
        UnsupportedDrmException unsupportedDrmException = (UnsupportedDrmException) e;
        errorString = getString(Util.SDK_INT < 18 ? R.string.error_drm_not_supported
                : unsupportedDrmException.reason == UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME
                ? R.string.error_drm_unsupported_scheme : R.string.error_drm_unknown);
    } else if (e instanceof ExoPlaybackException
            && e.getCause() instanceof DecoderInitializationException) {
        // Special case for decoder initialization failures.
        DecoderInitializationException decoderInitializationException =
                (DecoderInitializationException) e.getCause();
        if (decoderInitializationException.decoderName == null) {
            if (decoderInitializationException.getCause() instanceof DecoderQueryException) {
                errorString = getString(R.string.error_querying_decoders);
            } else if (decoderInitializationException.secureDecoderRequired) {
                errorString = getString(R.string.error_no_secure_decoder,
                        decoderInitializationException.mimeType);
            } else {
                errorString = getString(R.string.error_no_decoder,
                        decoderInitializationException.mimeType);
            }
        } else {
            errorString = getString(R.string.error_instantiating_decoder,
                    decoderInitializationException.decoderName);
        }
    }
    if (errorString != null) {
        Toast.makeText(getApplicationContext(), errorString, Toast.LENGTH_LONG).show();
    }
    playerNeedsPrepare = true;
    updateButtonVisibilities();
    showControls();
}
 
Example #5
Source File: VLCVideoSurfaceHandler.java    From Exoplayer_VLC with Apache License 2.0 5 votes vote down vote up
private void notifyDecoderInitializationError(final DecoderInitializationException e) {
	handlerPost(new Runnable() {
		@Override
		public void run() {
			eventListener.onDecoderInitializationError(e);
		}
	});
}
 
Example #6
Source File: VideoPlayerActivity.java    From droidkaigi2016 with Apache License 2.0 5 votes vote down vote up
@Override
public void onError(Exception e) {
    String errorString = null;
    if (e instanceof UnsupportedDrmException) {
        // Special case DRM failures.
        UnsupportedDrmException unsupportedDrmException = (UnsupportedDrmException) e;
        errorString = getString(Util.SDK_INT < 18 ? R.string.video_error_drm_not_supported
                : unsupportedDrmException.reason == UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME
                ? R.string.video_error_drm_unsupported_scheme : R.string.video_error_drm_unknown);
    } else if (e instanceof ExoPlaybackException
            && e.getCause() instanceof DecoderInitializationException) {
        // Special case for decoder initialization failures.
        DecoderInitializationException decoderInitializationException =
                (DecoderInitializationException) e.getCause();
        if (decoderInitializationException.decoderName == null) {
            if (decoderInitializationException.getCause() instanceof DecoderQueryException) {
                errorString = getString(R.string.video_error_querying_decoders);
            } else if (decoderInitializationException.secureDecoderRequired) {
                errorString = getString(R.string.video_error_no_secure_decoder,
                        decoderInitializationException.mimeType);
            } else {
                errorString = getString(R.string.video_error_no_decoder,
                        decoderInitializationException.mimeType);
            }
        } else {
            errorString = getString(R.string.video_error_instantiating_decoder,
                    decoderInitializationException.decoderName);
        }
    }
    if (errorString != null) {
        Toast.makeText(getApplicationContext(), errorString, Toast.LENGTH_LONG).show();
    }
    playerNeedsPrepare = true;
    showControls();
}
 
Example #7
Source File: VLCVideoSurfaceHandler.java    From Exoplayer_VLC with Apache License 2.0 5 votes vote down vote up
@Override
public void eventHardwareAccelerationError() {
	// TODO Auto-generated method stub
	ExoVlcUtil.log(this, "Error with hardware acceleration");
	release();
	 
	notifyDecoderInitializationError(new DecoderInitializationException(null, new RuntimeException(
			"Error with hardware acceleration"), 0));
}
 
Example #8
Source File: VLCVideoSurfaceHandler.java    From Exoplayer_VLC with Apache License 2.0 5 votes vote down vote up
private void notifyDecoderInitializationError(final DecoderInitializationException e) {
	handlerPost(new Runnable() {
		@Override
		public void run() {
			eventListener.onDecoderInitializationError(e);
		}
	});
}
 
Example #9
Source File: VLCVideoSurfaceHandler.java    From Exoplayer_VLC with Apache License 2.0 5 votes vote down vote up
@Override
public void eventHardwareAccelerationError() {
	// TODO Auto-generated method stub
	ExoVlcUtil.log(this, "Error with hardware acceleration");
	release();
	 
	notifyDecoderInitializationError(new DecoderInitializationException(null, new RuntimeException(
			"Error with hardware acceleration"), 0));
}
 
Example #10
Source File: PlayerActivity.java    From android-tv-leanback with Apache License 2.0 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
    // This is for informational purposes only. Do nothing.
}
 
Example #11
Source File: PlayerActivity.java    From android-tv-leanback with Apache License 2.0 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
    // This is for informational purposes only. Do nothing.
}
 
Example #12
Source File: EventLogger.java    From AndroidTvDemo with Apache License 2.0 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
  printInternalError("decoderInitializationError", e);
}
 
Example #13
Source File: EventLogger.java    From iview-android-tv with MIT License 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
    printInternalError("decoderInitializationError", e);
}
 
Example #14
Source File: VideoPlayer.java    From iview-android-tv with MIT License 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
    if (internalErrorListener != null) {
        internalErrorListener.onDecoderInitializationError(e);
    }
}
 
Example #15
Source File: EventLogger.java    From Exoplayer_VLC with Apache License 2.0 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
  printInternalError("decoderInitializationError", e);
}
 
Example #16
Source File: DemoPlayer.java    From Exoplayer_VLC with Apache License 2.0 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
  if (internalErrorListener != null) {
    internalErrorListener.onDecoderInitializationError(e);
  }
}
 
Example #17
Source File: VLCTrackRenderer.java    From Exoplayer_VLC with Apache License 2.0 4 votes vote down vote up
protected void postError(DecoderInitializationException ex) {
	this.eventListener.onDecoderInitializationError(ex);
}
 
Example #18
Source File: VLCTrackRenderer.java    From Exoplayer_VLC with Apache License 2.0 4 votes vote down vote up
protected void postError(DecoderInitializationException ex) {
	this.eventListener.onDecoderInitializationError(ex);
}
 
Example #19
Source File: DemoPlayer.java    From droidkaigi2016 with Apache License 2.0 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
  if (internalErrorListener != null) {
    internalErrorListener.onDecoderInitializationError(e);
  }
}
 
Example #20
Source File: EventLogger.java    From Mobilyzer with Apache License 2.0 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
  printInternalError("decoderInitializationError", e);
}
 
Example #21
Source File: DemoPlayer.java    From Mobilyzer with Apache License 2.0 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
  if (internalErrorListener != null) {
    internalErrorListener.onDecoderInitializationError(e);
  }
}
 
Example #22
Source File: DemoPlayer.java    From androidtv-sample-inputs with Apache License 2.0 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
    if (internalErrorListener != null) {
        internalErrorListener.onDecoderInitializationError(e);
    }
}
 
Example #23
Source File: ExoplayerWrapper.java    From google-media-framework-android with Apache License 2.0 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
  if (internalErrorListener != null) {
    internalErrorListener.onDecoderInitializationError(e);
  }
}
 
Example #24
Source File: PlayerActivity.java    From android-tv-leanback with Apache License 2.0 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
    // This is for informational purposes only. Do nothing.
}
 
Example #25
Source File: DemoPlayer.java    From AndroidTvDemo with Apache License 2.0 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
  if (internalErrorListener != null) {
    internalErrorListener.onDecoderInitializationError(e);
  }
}
 
Example #26
Source File: EventLogger.java    From ShareBox with Apache License 2.0 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
  printInternalError("decoderInitializationError", e);
}
 
Example #27
Source File: DemoPlayer.java    From ShareBox with Apache License 2.0 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
  if (internalErrorListener != null) {
    internalErrorListener.onDecoderInitializationError(e);
  }
}
 
Example #28
Source File: DemoPlayer.java    From talk-android with MIT License 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
  if (internalErrorListener != null) {
    internalErrorListener.onDecoderInitializationError(e);
  }
}
 
Example #29
Source File: DemoPlayer.java    From droidkaigi2016 with Apache License 2.0 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
  if (internalErrorListener != null) {
    internalErrorListener.onDecoderInitializationError(e);
  }
}
 
Example #30
Source File: EventLogger.java    From WliveTV with Apache License 2.0 4 votes vote down vote up
@Override
public void onDecoderInitializationError(DecoderInitializationException e) {
  printInternalError("decoderInitializationError", e);
}