aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/invalid/lena/scrcpy/AudioFrames.java
blob: eaf0db16c00b8113057c8059676b234302b75ecc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package invalid.lena.scrcpy;

// Sink for parsed audio frames. AudioSink is the only production
// implementation; tests use a recording stub. Kept android-free.
//
// start(fourcc) tells the sink which wire codec it should expect.
// ptsUs is the wire presentation timestamp with protocol flags removed.
// For raw payloads are interleaved s16le PCM. For opus the first
// frame has isConfig=true and payload is the OpusHead (the server
// pre-strips the AOPUSHDR/AOPUSDLY/AOPUSPRL container); subsequent
// frames are opus packets.
public interface AudioFrames {

    void start(int fourcc);

    void feed(byte[] data, int off, int len, long ptsUs, boolean isConfig);

    void release();
}