mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2024-12-28 18:12:31 -06:00
40 lines
1.2 KiB
Java
40 lines
1.2 KiB
Java
package androidx.media3.decoder;
|
|
|
|
import androidx.media3.decoder.DecoderOutputBuffer;
|
|
import java.nio.ByteBuffer;
|
|
import java.nio.ByteOrder;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class SimpleDecoderOutputBuffer extends DecoderOutputBuffer {
|
|
public ByteBuffer data;
|
|
private final DecoderOutputBuffer.Owner<SimpleDecoderOutputBuffer> owner;
|
|
|
|
public SimpleDecoderOutputBuffer(DecoderOutputBuffer.Owner<SimpleDecoderOutputBuffer> owner) {
|
|
this.owner = owner;
|
|
}
|
|
|
|
public ByteBuffer init(long j, int i) {
|
|
this.timeUs = j;
|
|
ByteBuffer byteBuffer = this.data;
|
|
if (byteBuffer == null || byteBuffer.capacity() < i) {
|
|
this.data = ByteBuffer.allocateDirect(i).order(ByteOrder.nativeOrder());
|
|
}
|
|
this.data.position(0);
|
|
this.data.limit(i);
|
|
return this.data;
|
|
}
|
|
|
|
@Override // androidx.media3.decoder.Buffer
|
|
public void clear() {
|
|
super.clear();
|
|
ByteBuffer byteBuffer = this.data;
|
|
if (byteBuffer != null) {
|
|
byteBuffer.clear();
|
|
}
|
|
}
|
|
|
|
@Override // androidx.media3.decoder.DecoderOutputBuffer
|
|
public void release() {
|
|
this.owner.releaseOutputBuffer(this);
|
|
}
|
|
}
|