Example usage for android.media.effect EffectContext createWithCurrentGlContext

List of usage examples for android.media.effect EffectContext createWithCurrentGlContext

Introduction

In this page you can find the example usage for android.media.effect EffectContext createWithCurrentGlContext.

Prototype

public static EffectContext createWithCurrentGlContext() 

Source Link

Document

Creates a context within the current GL context.

Usage

From source file:com.example.android.mediaeffects.MediaEffectsFragment.java

@Override
public void onDrawFrame(GL10 gl) {
    if (!mInitialized) {
        //Only need to do this once
        mEffectContext = EffectContext.createWithCurrentGlContext();
        mTexRenderer.init();//from  w ww  .j a va  2 s .c o m
        loadTextures();
        mInitialized = true;
    }
    if (mCurrentEffect != R.id.none) {
        //if an effect is chosen initialize it and apply it to the texture
        initEffect();
        applyEffect();
    }
    renderResult();
}

From source file:com.example.vendrisample.HelloEffects.java

License:asdf

@Override
public void onDrawFrame(final GL10 gl) {
    if (!mInitialized) {
        // Only need to do this once
        mEffectContext = EffectContext.createWithCurrentGlContext();
        mTexRenderer.init();//from w ww . j a v a 2 s . co m
        loadTextures();
        mInitialized = true;
    }
    if (mCurrentEffect != R.id.none) {
        // if an effect is chosen initialize it and apply it to the texture
        initEffect();
        applyEffect();

        // manual play request (bypasses or works in addition to triggers)
        //            String json = "{\"adTags\":[\"http://ad3.liverail.com/?LR_PUBLISHER_ID=1331&LR_CAMPAIGN_ID=229&LR_SCHEMA=vast2\"],\"width\":640,\"height\":480,\"minWidth\":300,\"minHeight\":34,\"retry\":0,\"theme\":\"light\",\"autoplay\":true,\"volume\":0.7,\"controls\":{\"play\":true,\"volume\":true,\"mute\":true,\"progress\":true},\"map\":[{\"name\":\"asdf\",\"callback\":\"{vendriVar}\"}],\"events\":[{\"name\":\"adFinished\",\"callback\":\"helloWorld\"}],\"preferredType\":\"html5\",\"constraints\":{\"startTime\":3,\"playTime\":false},\"bitrate\":{\"check\":true,\"default\":600,\"async\":false},\"audioClickthrough\":false,\"debug\":false}";
        String json = "{}";
        try {

            JSONObject obj = new JSONObject(json);

            Vendri.play(obj, 6);
            Log.d("My App", obj.toString());

        } catch (Throwable t) {
            Log.e("My App", "Could not parse malformed JSON: " + json + "");
        }

    }
    renderResult();
}