FileDocCategorySizeDatePackage
GLTextureSource.javaAPI DocAndroid 5.1 API3304Thu Mar 12 22:22:30 GMT 2015android.filterpacks.base

GLTextureSource

public class GLTextureSource extends android.filterfw.core.Filter
hide

Fields Summary
private int
mTexId
private int
mWidth
private int
mHeight
private boolean
mRepeatFrame
private long
mTimestamp
private android.filterfw.core.Frame
mFrame
Constructors Summary
public GLTextureSource(String name)


       
        super(name);
    
Methods Summary
public voidfieldPortValueUpdated(java.lang.String name, android.filterfw.core.FilterContext context)

        // Release frame, so that it is recreated during the next process call
        if (mFrame != null) {
            mFrame.release();
            mFrame = null;
        }
    
public voidprocess(android.filterfw.core.FilterContext context)

        // Generate frame if not generated already
        if (mFrame == null) {
            FrameFormat outputFormat = ImageFormat.create(mWidth, mHeight,
                                                          ImageFormat.COLORSPACE_RGBA,
                                                          FrameFormat.TARGET_GPU);
            mFrame = context.getFrameManager().newBoundFrame(outputFormat,
                                                             GLFrame.EXISTING_TEXTURE_BINDING,
                                                             mTexId);
            mFrame.setTimestamp(mTimestamp);
        }

        // Push output
        pushOutput("frame", mFrame);

        if (!mRepeatFrame) {
            // Close output port as we are done here
            closeOutputPort("frame");
        }
    
public voidsetupPorts()

        addOutputPort("frame", ImageFormat.create(ImageFormat.COLORSPACE_RGBA,
                                                  FrameFormat.TARGET_GPU));
    
public voidtearDown(android.filterfw.core.FilterContext context)

        if (mFrame != null) {
            mFrame.release();
        }