Class DefaultAudioTrackBufferSizeProvider.Builder
- java.lang.Object
-
- com.google.android.exoplayer2.audio.DefaultAudioTrackBufferSizeProvider.Builder
-
- Enclosing class:
- DefaultAudioTrackBufferSizeProvider
public static class DefaultAudioTrackBufferSizeProvider.Builder extends Object
A builder to createDefaultAudioTrackBufferSizeProvider
instances.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Creates a new builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultAudioTrackBufferSizeProvider
build()
Build theDefaultAudioTrackBufferSizeProvider
.DefaultAudioTrackBufferSizeProvider.Builder
setAc3BufferMultiplicationFactor(int ac3BufferMultiplicationFactor)
Sets the multiplication factor to apply to the passthrough buffer for AC3 to avoid underruns on some devices (e.g., Broadcom 7271).DefaultAudioTrackBufferSizeProvider.Builder
setMaxPcmBufferDurationUs(int maxPcmBufferDurationUs)
Sets the maximum length for PCMAudioTrack
buffers, in microseconds.DefaultAudioTrackBufferSizeProvider.Builder
setMinPcmBufferDurationUs(int minPcmBufferDurationUs)
Sets the minimum length for PCMAudioTrack
buffers, in microseconds.DefaultAudioTrackBufferSizeProvider.Builder
setOffloadBufferDurationUs(int offloadBufferDurationUs)
The length for offloadAudioTrack
buffers, in microseconds.DefaultAudioTrackBufferSizeProvider.Builder
setPassthroughBufferDurationUs(int passthroughBufferDurationUs)
Sets the length for passthroughAudioTrack
buffers, in microseconds.DefaultAudioTrackBufferSizeProvider.Builder
setPcmBufferMultiplicationFactor(int pcmBufferMultiplicationFactor)
Sets the multiplication factor to apply to the minimum buffer size requested.
-
-
-
Method Detail
-
setMinPcmBufferDurationUs
@CanIgnoreReturnValue public DefaultAudioTrackBufferSizeProvider.Builder setMinPcmBufferDurationUs(int minPcmBufferDurationUs)
Sets the minimum length for PCMAudioTrack
buffers, in microseconds. Default isDefaultAudioTrackBufferSizeProvider.MIN_PCM_BUFFER_DURATION_US
.
-
setMaxPcmBufferDurationUs
@CanIgnoreReturnValue public DefaultAudioTrackBufferSizeProvider.Builder setMaxPcmBufferDurationUs(int maxPcmBufferDurationUs)
Sets the maximum length for PCMAudioTrack
buffers, in microseconds. Default isDefaultAudioTrackBufferSizeProvider.MAX_PCM_BUFFER_DURATION_US
.
-
setPcmBufferMultiplicationFactor
@CanIgnoreReturnValue public DefaultAudioTrackBufferSizeProvider.Builder setPcmBufferMultiplicationFactor(int pcmBufferMultiplicationFactor)
Sets the multiplication factor to apply to the minimum buffer size requested. Default isDefaultAudioTrackBufferSizeProvider.PCM_BUFFER_MULTIPLICATION_FACTOR
.
-
setPassthroughBufferDurationUs
@CanIgnoreReturnValue public DefaultAudioTrackBufferSizeProvider.Builder setPassthroughBufferDurationUs(int passthroughBufferDurationUs)
Sets the length for passthroughAudioTrack
buffers, in microseconds. Default isDefaultAudioTrackBufferSizeProvider.PASSTHROUGH_BUFFER_DURATION_US
.
-
setOffloadBufferDurationUs
@CanIgnoreReturnValue public DefaultAudioTrackBufferSizeProvider.Builder setOffloadBufferDurationUs(int offloadBufferDurationUs)
The length for offloadAudioTrack
buffers, in microseconds. Default isDefaultAudioTrackBufferSizeProvider.OFFLOAD_BUFFER_DURATION_US
.
-
setAc3BufferMultiplicationFactor
@CanIgnoreReturnValue public DefaultAudioTrackBufferSizeProvider.Builder setAc3BufferMultiplicationFactor(int ac3BufferMultiplicationFactor)
Sets the multiplication factor to apply to the passthrough buffer for AC3 to avoid underruns on some devices (e.g., Broadcom 7271). Default isDefaultAudioTrackBufferSizeProvider.AC3_BUFFER_MULTIPLICATION_FACTOR
.
-
build
public DefaultAudioTrackBufferSizeProvider build()
Build theDefaultAudioTrackBufferSizeProvider
.
-
-