26 lines
794 B
Java
26 lines
794 B
Java
|
|
package org.jcodec.common;
|
||
|
|
|
||
|
|
import java.nio.ByteBuffer;
|
||
|
|
import org.jcodec.common.model.Picture;
|
||
|
|
|
||
|
|
public abstract class VideoDecoder {
|
||
|
|
private byte[][] byteBuffer;
|
||
|
|
|
||
|
|
public abstract Picture decodeFrame(ByteBuffer paramByteBuffer, byte[][] paramArrayOfbyte);
|
||
|
|
|
||
|
|
public abstract VideoCodecMeta getCodecMeta(ByteBuffer paramByteBuffer);
|
||
|
|
|
||
|
|
protected byte[][] getSameSizeBuffer(int[][] buffer) {
|
||
|
|
if (this.byteBuffer == null || this.byteBuffer.length != buffer.length || (this.byteBuffer[0]).length != (buffer[0]).length)
|
||
|
|
this.byteBuffer = ArrayUtil.create2D((buffer[0]).length, buffer.length);
|
||
|
|
return this.byteBuffer;
|
||
|
|
}
|
||
|
|
|
||
|
|
public VideoDecoder downscaled(int ratio) {
|
||
|
|
if (ratio == 1)
|
||
|
|
return this;
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void shutdownThreadPool() {}
|
||
|
|
}
|