// Get frame and forward to listener
final Frame input = pullInput("frame");
if (mListener != null) {
if (mCallbacksOnUiThread) {
input.retain();
CallbackRunnable uiRunnable = new CallbackRunnable(mListener, this, input, mUserData);
if (!mUiThreadHandler.post(uiRunnable)) {
throw new RuntimeException("Unable to send callback to UI thread!");
}
} else {
mListener.onFrameReceived(this, input, mUserData);
}
} else {
throw new RuntimeException("CallbackFilter received frame, but no listener set!");
}