if (isCancelled()) {
result.status = RESULT_STOPPED;
}
+ } catch (Exception exception) {
+ result.exception = exception;
+ result.status = RESULT_ERROR;
+ }
+ // Deactivate context.
+ try {
deactivateGlContext();
} catch (Exception exception) {
result.exception = exception;
result.status = RESULT_ERROR;
}
+
if (mLogVerbose) Log.v(TAG, "Done with background graph processing.");
return result;
}
return isProcessing;
}
+ @Override
synchronized public Exception getError() {
return mException;
}
/** Closes the filters in a graph. Can only be called if the graph is not running. */
public abstract void close();
+
+ /**
+ * Returns the last exception that happened during an asynchronous run. Returns null if
+ * there is nothing to report.
+ */
+ public abstract Exception getError();
}
throw new RuntimeException("SyncRunner does not support stopping a graph!");
}
+ @Override
+ synchronized public Exception getError() {
+ return null;
+ }
+
protected void waitUntilWake() {
mWakeCondition.block();
}
if (!lib_handle_) {
lib_handle_ = dlopen(lib_name.c_str(), RTLD_NOW);
if (!lib_handle_) {
- LOGE("NativeProgram: Could not find library: '%s'!", lib_name.c_str());
+ LOGE("NativeProgram: Error opening library: '%s': %s", lib_name.c_str(), dlerror());
return false;
}
return true;