package com.foxx.androidcast.media.codec;

/*********************************************************************
 * VideoDecoderSink.java
 * Created at: Sun 17 May 2026 22:49:49 +0200
 * Updated at: Wed 20 May 2026 15:17:13 +0200 by Anton Afanasyeu <a.afanasieff@gmail.com>
 * Commit: 5d8e82d2e60a21fff3138d2a394ee4e8b4c6dcb8
 * interface VideoDecoderSink
 * Contributors:
 *    - Anton Afanasyeu <a.afanasieff@gmail.com> (2 commits, 31 lines)
 *    - Cursor Agent (project assistant)
 * Digest: SHA256	82577d976f180dbe61110a21a61152a4481742085c5797e3c7e638e8fb0d3821
**********************************************************************/
import android.view.Surface;

import java.io.IOException;

/** Video decoder pipeline (MediaCodec today; libvpx fallback later). */
public interface VideoDecoderSink {

    interface Listener {
        void onFirstFrameRendered();

        default void onFrameRendered() {}

        default void onOutputSizeChanged(int width, int height) {}
    }

    void configure(String mime, int width, int height, byte[] csd0, byte[] csd1, Surface surface,
            Listener listener) throws IOException;

    void queueFrame(long ptsUs, boolean keyFrame, byte[] data);

    void release();
}
