mirror of
https://github.com/androidx/media.git
synced 2025-05-16 20:19:57 +08:00
Decrease number of Vpx input buffers
I think they're excessively sized also, but changing that is a little more risky. And we should look at investigating the input buffer size for all our decoder extensions, rather than just this one. Issue: #3120 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=164234087
This commit is contained in:
parent
b664e92bb4
commit
40f3f1cb78
@ -30,7 +30,14 @@ import com.google.android.exoplayer2.util.MimeTypes;
|
||||
*/
|
||||
public final class FfmpegAudioRenderer extends SimpleDecoderAudioRenderer {
|
||||
|
||||
/**
|
||||
* The number of input and output buffers.
|
||||
*/
|
||||
private static final int NUM_BUFFERS = 16;
|
||||
/**
|
||||
* The initial input buffer size. Input buffers are reallocated dynamically if this value is
|
||||
* insufficient.
|
||||
*/
|
||||
private static final int INITIAL_INPUT_BUFFER_SIZE = 960 * 6;
|
||||
|
||||
private FfmpegDecoder decoder;
|
||||
|
@ -77,11 +77,18 @@ public final class LibvpxVideoRenderer extends BaseRenderer {
|
||||
public static final int MSG_SET_OUTPUT_BUFFER_RENDERER = C.MSG_CUSTOM_BASE;
|
||||
|
||||
/**
|
||||
* The number of input buffers and the number of output buffers. The renderer may limit the
|
||||
* minimum possible value due to requiring multiple output buffers to be dequeued at a time for it
|
||||
* to make progress.
|
||||
* The number of input buffers.
|
||||
*/
|
||||
private static final int NUM_INPUT_BUFFERS = 8;
|
||||
/**
|
||||
* The number of output buffers. The renderer may limit the minimum possible value due to
|
||||
* requiring multiple output buffers to be dequeued at a time for it to make progress.
|
||||
*/
|
||||
private static final int NUM_OUTPUT_BUFFERS = 16;
|
||||
/**
|
||||
* The initial input buffer size. Input buffers are reallocated dynamically if this value is
|
||||
* insufficient.
|
||||
*/
|
||||
private static final int NUM_BUFFERS = 16;
|
||||
private static final int INITIAL_INPUT_BUFFER_SIZE = 768 * 1024; // Value based on cs/SoftVpx.cpp.
|
||||
|
||||
private final boolean scaleToFit;
|
||||
@ -564,7 +571,8 @@ public final class LibvpxVideoRenderer extends BaseRenderer {
|
||||
try {
|
||||
long codecInitializingTimestamp = SystemClock.elapsedRealtime();
|
||||
TraceUtil.beginSection("createVpxDecoder");
|
||||
decoder = new VpxDecoder(NUM_BUFFERS, NUM_BUFFERS, INITIAL_INPUT_BUFFER_SIZE, mediaCrypto);
|
||||
decoder = new VpxDecoder(NUM_INPUT_BUFFERS, NUM_OUTPUT_BUFFERS, INITIAL_INPUT_BUFFER_SIZE,
|
||||
mediaCrypto);
|
||||
decoder.setOutputMode(outputMode);
|
||||
TraceUtil.endSection();
|
||||
long codecInitializedTimestamp = SystemClock.elapsedRealtime();
|
||||
|
Loading…
x
Reference in New Issue
Block a user