@Override public void process(FilterContext context) { // Get input frame Frame input = pullInput("image"); FrameFormat inputFormat = input.getFormat(); // Create program if not created already if (mProgram == null || inputFormat.getTarget() != mTarget) { initProgram(context, inputFormat.getTarget()); } // Check if the frame size has changed if (inputFormat.getWidth() != mWidth || inputFormat.getHeight() != mHeight) { mWidth = inputFormat.getWidth(); mHeight = inputFormat.getHeight(); initParameters(); } // Create output frame Frame output = context.getFrameManager().newFrame(inputFormat); // Process mProgram.process(input, output); // Push output pushOutput("image", output); // Release pushed frame output.release(); }