Search in sources :

Example 31 with GLEnvironment

use of android.filterfw.core.GLEnvironment in project android_frameworks_base by AOSPA.

the class EffectContext method initInCurrentGlContext.

private void initInCurrentGlContext() {
    if (!GLEnvironment.isAnyContextActive()) {
        throw new RuntimeException("Attempting to initialize EffectContext with no active " + "GL context!");
    }
    GLEnvironment glEnvironment = new GLEnvironment();
    glEnvironment.initWithCurrentContext();
    mFilterContext.initGLEnvironment(glEnvironment);
}
Also used : GLEnvironment(android.filterfw.core.GLEnvironment)

Example 32 with GLEnvironment

use of android.filterfw.core.GLEnvironment in project android_frameworks_base by AOSPA.

the class MffEnvironment method createGLEnvironment.

/**
     * Create and activate a new GL environment for use in this filter context.
     */
public void createGLEnvironment() {
    GLEnvironment glEnvironment = new GLEnvironment();
    glEnvironment.initWithNewContext();
    setGLEnvironment(glEnvironment);
}
Also used : GLEnvironment(android.filterfw.core.GLEnvironment)

Example 33 with GLEnvironment

use of android.filterfw.core.GLEnvironment in project android_frameworks_base by ResurrectionRemix.

the class MffEnvironment method createGLEnvironment.

/**
     * Create and activate a new GL environment for use in this filter context.
     */
public void createGLEnvironment() {
    GLEnvironment glEnvironment = new GLEnvironment();
    glEnvironment.initWithNewContext();
    setGLEnvironment(glEnvironment);
}
Also used : GLEnvironment(android.filterfw.core.GLEnvironment)

Example 34 with GLEnvironment

use of android.filterfw.core.GLEnvironment in project android_frameworks_base by DirtyUnicorns.

the class MffEnvironment method createGLEnvironment.

/**
     * Create and activate a new GL environment for use in this filter context.
     */
public void createGLEnvironment() {
    GLEnvironment glEnvironment = new GLEnvironment();
    glEnvironment.initWithNewContext();
    setGLEnvironment(glEnvironment);
}
Also used : GLEnvironment(android.filterfw.core.GLEnvironment)

Example 35 with GLEnvironment

use of android.filterfw.core.GLEnvironment in project android_frameworks_base by DirtyUnicorns.

the class MediaEncoderFilter method process.

@Override
public void process(FilterContext context) {
    GLEnvironment glEnv = context.getGLEnvironment();
    // Get input frame
    Frame input = pullInput("videoframe");
    // Check if recording needs to start
    if (!mRecordingActive && mRecording) {
        startRecording(context);
    }
    // Check if recording needs to stop
    if (mRecordingActive && !mRecording) {
        stopRecording(context);
    }
    if (!mRecordingActive)
        return;
    if (mCaptureTimeLapse) {
        if (skipFrameAndModifyTimestamp(input.getTimestamp())) {
            return;
        }
    } else {
        mTimestampNs = input.getTimestamp();
    }
    // Activate our surface
    glEnv.activateSurfaceWithId(mSurfaceId);
    // Process
    mProgram.process(input, mScreen);
    // Set timestamp from input
    glEnv.setSurfaceTimestamp(mTimestampNs);
    // And swap buffers
    glEnv.swapBuffers();
    mNumFramesEncoded++;
}
Also used : GLEnvironment(android.filterfw.core.GLEnvironment) Frame(android.filterfw.core.Frame) GLFrame(android.filterfw.core.GLFrame)

Aggregations

GLEnvironment (android.filterfw.core.GLEnvironment)36 Frame (android.filterfw.core.Frame)18 GLFrame (android.filterfw.core.GLFrame)18 Point (android.filterfw.geometry.Point)6 NativeFrame (android.filterfw.core.NativeFrame)3