package com.foxx.androidcast.media.codec;

/*********************************************************************
 * AudioEncoderSink.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 AudioEncoderSink
 * Contributors:
 *    - Anton Afanasyeu <a.afanasieff@gmail.com> (2 commits, 28 lines)
 *    - Cursor Agent (project assistant)
 * Digest: SHA256	2b9ef2dff0c165e31aff3b14ba6933df12b4cbfd5b29e81b76f13874c7cfa1ce
**********************************************************************/
import java.io.IOException;

/** Audio encoder pipeline (AAC via MediaCodec today; Speex/Opus later). */
public interface AudioEncoderSink {

    interface Callback {
        void onConfig(int sampleRate, int channels, byte[] csd0);

        void onEncodedFrame(long ptsUs, byte[] data);
    }

    void prepare(Callback callback) throws IOException;

    void queuePcm(byte[] pcm, int length, long ptsUs);

    long getDroppedPcmFrames();

    void stop();
}
