FileDocCategorySizeDatePackage
FilterContext.javaAPI DocAndroid 5.1 API3688Thu Mar 12 22:22:30 GMT 2015android.filterfw.core

FilterContext

public class FilterContext extends Object
hide

Fields Summary
private android.filterfw.core.FrameManager
mFrameManager
private android.filterfw.core.GLEnvironment
mGLEnvironment
private HashMap
mStoredFrames
private Set
mGraphs
Constructors Summary
Methods Summary
final voidaddGraph(FilterGraph graph)

        mGraphs.add(graph);
    
public synchronized android.filterfw.core.FramefetchFrame(java.lang.String key)

        Frame frame = mStoredFrames.get(key);
        if (frame != null) {
            frame.onFrameFetch();
        }
        return frame;
    
public android.filterfw.core.FrameManagergetFrameManager()


       
        return mFrameManager;
    
public android.filterfw.core.GLEnvironmentgetGLEnvironment()

        return mGLEnvironment;
    
public voidinitGLEnvironment(android.filterfw.core.GLEnvironment environment)

        if (mGLEnvironment == null) {
            mGLEnvironment = environment;
        } else {
            throw new RuntimeException("Attempting to re-initialize GL Environment for " +
                "FilterContext!");
        }
    
public synchronized voidremoveFrame(java.lang.String key)

        Frame frame = mStoredFrames.get(key);
        if (frame != null) {
            mStoredFrames.remove(key);
            frame.release();
        }
    
public voidsetFrameManager(android.filterfw.core.FrameManager manager)

        if (manager == null) {
            throw new NullPointerException("Attempting to set null FrameManager!");
        } else if (manager.getContext() != null) {
            throw new IllegalArgumentException("Attempting to set FrameManager which is already "
                + "bound to another FilterContext!");
        } else {
            mFrameManager = manager;
            mFrameManager.setContext(this);
        }
    
public synchronized voidstoreFrame(java.lang.String key, android.filterfw.core.Frame frame)

        Frame storedFrame = fetchFrame(key);
        if (storedFrame != null) {
            storedFrame.release();
        }
        frame.onFrameStore();
        mStoredFrames.put(key, frame.retain());
    
public synchronized voidtearDown()

        // Release stored frames
        for (Frame frame : mStoredFrames.values()) {
            frame.release();
        }
        mStoredFrames.clear();

        // Release graphs
        for (FilterGraph graph : mGraphs) {
            graph.tearDown(this);
        }
        mGraphs.clear();

        // Release frame manager
        if (mFrameManager != null) {
            mFrameManager.tearDown();
            mFrameManager = null;
        }

        // Release GL context
        if (mGLEnvironment != null) {
            mGLEnvironment.tearDown();
            mGLEnvironment = null;
        }