Methods Summary |
---|
public void | close()
mFilter.performClose(mFilterContext);
|
private void | connectFilterOutputs()
int i = 0;
mResultHolders = new FrameHolderPort[mFilter.getNumberOfOutputs()];
for (OutputPort outputPort : mFilter.getOutputPorts()) {
mResultHolders[i] = new FrameHolderPort();
outputPort.connectTo(mResultHolders[i]);
++i;
}
|
public Frame | execute(KeyValueMap inputMap)
int filterOutCount = mFilter.getNumberOfOutputs();
// Sanity checks
if (filterOutCount > 1) {
throw new RuntimeException("Calling execute on filter " + mFilter + " with multiple "
+ "outputs! Use executeMulti() instead!");
}
// Setup filter
if (!mFilterIsSetup) {
connectFilterOutputs();
mFilterIsSetup = true;
}
// Make sure GL environment is active
boolean didActivateGLEnv = false;
GLEnvironment glEnv = mFilterContext.getGLEnvironment();
if (glEnv != null && !glEnv.isActive()) {
glEnv.activate();
didActivateGLEnv = true;
}
// Setup the inputs
for (Entry<String, Object> entry : inputMap.entrySet()) {
if (entry.getValue() instanceof Frame) {
mFilter.pushInputFrame(entry.getKey(), (Frame)entry.getValue());
} else {
mFilter.pushInputValue(entry.getKey(), entry.getValue());
}
}
// Process the filter
if (mFilter.getStatus() != Filter.STATUS_PROCESSING) {
mFilter.openOutputs();
}
mFilter.performProcess(mFilterContext);
// Create result handle
Frame result = null;
if (filterOutCount == 1 && mResultHolders[0].hasFrame()) {
result = mResultHolders[0].pullFrame();
}
// Deactivate GL environment if activated
if (didActivateGLEnv) {
glEnv.deactivate();
}
return result;
|
public Frame | executeWithArgList(java.lang.Object inputs)
return execute(KeyValueMap.fromKeyValues(inputs));
|
public FilterContext | getContext()
return mFilterContext;
|
public Filter | getFilter()
return mFilter;
|
public void | setInputFrame(java.lang.String input, Frame frame)
mFilter.setInputFrame(input, frame);
|
public void | setInputValue(java.lang.String input, java.lang.Object value)
mFilter.setInputValue(input, value);
|
public void | tearDown()
mFilter.performTearDown(mFilterContext);
mFilter = null;
|
public java.lang.String | toString()
return mFilter.getName();
|