package com.foxx.androidcast.receiver.av;

import android.content.Context;

/** GLES post-decode path for immersive / HDR experimental presets. */
public final class GlExperimentalVideoPipeline implements ReceiverVideoPipeline {
    private final Context appContext;
    private final ReceiverVideoPreset preset;

    public GlExperimentalVideoPipeline(Context context, ReceiverVideoPreset preset) {
        this.appContext = context.getApplicationContext();
        this.preset = preset;
    }

    @Override
    public void onFrameDecoded(long ptsUs) {
        ReceiverVideoGlHub.onFrameDecoded(appContext);
    }

    @Override
    public void onConfigured(int width, int height) {
        ReceiverVideoGlHub.refreshPreset(appContext);
    }

    @Override
    public void onReleased() {
        ReceiverVideoGlHub.release(appContext);
    }

    public ReceiverVideoPreset getPreset() {
        return preset;
    }
}
