Do not copy data to output frame in libvpx unless necessary.
In out libvpx extension, currently we always call vpxGetFrame and copy the data from the native decoder to output frame. However, if the inputBuffer has isDecoderOnly set, we can avoid populating the output buffer, but only setting BUFFER_FLAG_DECODE_ONLY. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=170318527
This commit is contained in:
parent
60de157410
commit
7665571ff9
@ -120,6 +120,7 @@ import java.nio.ByteBuffer;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!inputBuffer.isDecodeOnly()) {
|
||||||
outputBuffer.init(inputBuffer.timeUs, outputMode);
|
outputBuffer.init(inputBuffer.timeUs, outputMode);
|
||||||
int getFrameResult = vpxGetFrame(vpxDecContext, outputBuffer);
|
int getFrameResult = vpxGetFrame(vpxDecContext, outputBuffer);
|
||||||
if (getFrameResult == 1) {
|
if (getFrameResult == 1) {
|
||||||
@ -128,6 +129,7 @@ import java.nio.ByteBuffer;
|
|||||||
return new VpxDecoderException("Buffer initialization failed.");
|
return new VpxDecoderException("Buffer initialization failed.");
|
||||||
}
|
}
|
||||||
outputBuffer.colorInfo = inputBuffer.colorInfo;
|
outputBuffer.colorInfo = inputBuffer.colorInfo;
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user