Android: Add more info for createPbufferSurface() exceptions
This CL adds the width and height to the createPbufferSurface exception message. Also, when a Callable.call() fails in ThreadUtils.invokeUninterruptibly() we rethrow a new exception, but that excludes the callstack from Callable.call(). This CL adds the callstack from Callable.call() to make debugging easier. BUG=b/27581640,b/27516991 Review URL: https://codereview.webrtc.org/1780183005 Cr-Commit-Position: refs/heads/master@{#11996}
This commit is contained in:
@ -158,7 +158,8 @@ final class EglBase10 extends EglBase {
|
||||
int[] surfaceAttribs = {EGL10.EGL_WIDTH, width, EGL10.EGL_HEIGHT, height, EGL10.EGL_NONE};
|
||||
eglSurface = egl.eglCreatePbufferSurface(eglDisplay, eglConfig, surfaceAttribs);
|
||||
if (eglSurface == EGL10.EGL_NO_SURFACE) {
|
||||
throw new RuntimeException("Failed to create pixel buffer surface");
|
||||
throw new RuntimeException(
|
||||
"Failed to create pixel buffer surface with size: " + width + "x" + height);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -102,7 +102,8 @@ public final class EglBase14 extends EglBase {
|
||||
int[] surfaceAttribs = {EGL14.EGL_WIDTH, width, EGL14.EGL_HEIGHT, height, EGL14.EGL_NONE};
|
||||
eglSurface = EGL14.eglCreatePbufferSurface(eglDisplay, eglConfig, surfaceAttribs, 0);
|
||||
if (eglSurface == EGL14.EGL_NO_SURFACE) {
|
||||
throw new RuntimeException("Failed to create pixel buffer surface");
|
||||
throw new RuntimeException(
|
||||
"Failed to create pixel buffer surface with size: " + width + "x" + height);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -150,7 +150,10 @@ public class ThreadUtils {
|
||||
try {
|
||||
result.value = callable.call();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Callable threw exception: " + e);
|
||||
final RuntimeException runtimeException =
|
||||
new RuntimeException("Callable threw exception: " + e);
|
||||
runtimeException.setStackTrace(e.getStackTrace());
|
||||
throw runtimeException;
|
||||
}
|
||||
barrier.countDown();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user