com.google.android.exoplayer2.util.EGLSurfaceTexture Java Examples

The following examples show how to use com.google.android.exoplayer2.util.EGLSurfaceTexture. 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: UnexpectedErrorMapper.java    From no-player with Apache License 2.0 6 votes vote down vote up
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);
}
 
Example #2
Source File: DummySurface.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
public DummySurface init(@SecureMode int secureMode) {
  start();
  handler = new Handler(getLooper(), /* callback= */ this);
  eglSurfaceTexture = new EGLSurfaceTexture(handler);
  boolean wasInterrupted = false;
  synchronized (this) {
    handler.obtainMessage(MSG_INIT, secureMode, 0).sendToTarget();
    while (surface == null && initException == null && initError == null) {
      try {
        wait();
      } catch (InterruptedException e) {
        wasInterrupted = true;
      }
    }
  }
  if (wasInterrupted) {
    // Restore the interrupted status.
    Thread.currentThread().interrupt();
  }
  if (initException != null) {
    throw initException;
  } else if (initError != null) {
    throw initError;
  } else {
    return Assertions.checkNotNull(surface);
  }
}
 
Example #3
Source File: DummySurface.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
public DummySurface init(@SecureMode int secureMode) {
  start();
  handler = new Handler(getLooper(), /* callback= */ this);
  eglSurfaceTexture = new EGLSurfaceTexture(handler);
  boolean wasInterrupted = false;
  synchronized (this) {
    handler.obtainMessage(MSG_INIT, secureMode, 0).sendToTarget();
    while (surface == null && initException == null && initError == null) {
      try {
        wait();
      } catch (InterruptedException e) {
        wasInterrupted = true;
      }
    }
  }
  if (wasInterrupted) {
    // Restore the interrupted status.
    Thread.currentThread().interrupt();
  }
  if (initException != null) {
    throw initException;
  } else if (initError != null) {
    throw initError;
  } else {
    return Assertions.checkNotNull(surface);
  }
}
 
Example #4
Source File: DummySurface.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
public DummySurface init(@SecureMode int secureMode) {
  start();
  handler = new Handler(getLooper(), /* callback= */ this);
  eglSurfaceTexture = new EGLSurfaceTexture(handler);
  boolean wasInterrupted = false;
  synchronized (this) {
    handler.obtainMessage(MSG_INIT, secureMode, 0).sendToTarget();
    while (surface == null && initException == null && initError == null) {
      try {
        wait();
      } catch (InterruptedException e) {
        wasInterrupted = true;
      }
    }
  }
  if (wasInterrupted) {
    // Restore the interrupted status.
    Thread.currentThread().interrupt();
  }
  if (initException != null) {
    throw initException;
  } else if (initError != null) {
    throw initError;
  } else {
    return Assertions.checkNotNull(surface);
  }
}
 
Example #5
Source File: DummySurface.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
public DummySurface init(@SecureMode int secureMode) {
  start();
  handler = new Handler(getLooper(), /* callback= */ this);
  eglSurfaceTexture = new EGLSurfaceTexture(handler);
  boolean wasInterrupted = false;
  synchronized (this) {
    handler.obtainMessage(MSG_INIT, secureMode, 0).sendToTarget();
    while (surface == null && initException == null && initError == null) {
      try {
        wait();
      } catch (InterruptedException e) {
        wasInterrupted = true;
      }
    }
  }
  if (wasInterrupted) {
    // Restore the interrupted status.
    Thread.currentThread().interrupt();
  }
  if (initException != null) {
    throw initException;
  } else if (initError != null) {
    throw initError;
  } else {
    return Assertions.checkNotNull(surface);
  }
}
 
Example #6
Source File: DummySurface.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
public DummySurface init(@SecureMode int secureMode) {
  start();
  handler = new Handler(getLooper(), /* callback= */ this);
  eglSurfaceTexture = new EGLSurfaceTexture(handler);
  boolean wasInterrupted = false;
  synchronized (this) {
    handler.obtainMessage(MSG_INIT, secureMode, 0).sendToTarget();
    while (surface == null && initException == null && initError == null) {
      try {
        wait();
      } catch (InterruptedException e) {
        wasInterrupted = true;
      }
    }
  }
  if (wasInterrupted) {
    // Restore the interrupted status.
    Thread.currentThread().interrupt();
  }
  if (initException != null) {
    throw initException;
  } else if (initError != null) {
    throw initError;
  } else {
    return Assertions.checkNotNull(surface);
  }
}