Package com.castlabs.android.player
Class BufferConfiguration.Builder
java.lang.Object
com.castlabs.android.player.BufferConfiguration.Builder
- Enclosing class:
BufferConfiguration
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBuilder()
Create a new builder with default valuesCreate a new builder starting with the value from the given configuration -
Method Summary
Modifier and TypeMethodDescriptionaudioFeedYield
(boolean audioFeedYieldEnabled) Whether to enable audio renderer stop feeding decoder when other renderers (video) are ready to start new render cycle.backBufferDuration
(long backBufferDuration, TimeUnit timeUnit) Maximum duration of the back buffer.bufferSegmentSize
(int bufferSegmentSize) The internal buffer is divided into segment and this specifies the size of a single buffer segment.bufferSizeBytes
(int bufferSizeBytes) The buffer size in bytesdrainWhileCharging
(boolean drainWhileCharging) Whether to enter drain state when the device is charging.get()
highMediaTime
(int highMediaTime, TimeUnit timeUnit) Time in milliseconds that will be used by the buffer controls to determine if the buffer can be drained.lowMediaTime
(int lowMediaTime, TimeUnit timeUnit) Time in milliseconds that will be used by the buffer controls to determine if the buffer needs to be filled.minPlaybackStart
(int minPlaybackStart, TimeUnit timeUnit) The minimum duration of data that must be buffered for playback to start or resume following a user action such as a seek.minRebufferStart
(int minRebufferStart, TimeUnit timeUnit) The minimum duration of data that must be buffered for playback to resume after a player invoked rebuffer (i.e.prioritizeInstreamOverManifestDuration
(boolean prioritizeInstreamOverManifestDuration) Prioritization of buffered duration calculation based on audio/video segments over the playlist (manifest)prioritizeTimeOverSizeThresholds
(boolean prioritizeTimeOverSizeThresholds) Prioritization of buffer time constraints over size constraintsvideoFeedYield
(boolean videoFeedYieldEnabled) Whether to enable video renderer stop feeding decoder when other renderers (audio) are ready to start new render cycle.
-
Field Details
-
audioFeedYieldEnabled
public boolean audioFeedYieldEnabled -
videoFeedYieldEnabled
public boolean videoFeedYieldEnabled
-
-
Constructor Details
-
Builder
public Builder()Create a new builder with default values -
Builder
Create a new builder starting with the value from the given configuration- Parameters:
cfg
- The configuration
-
-
Method Details
-
bufferSizeBytes
The buffer size in bytes- Parameters:
bufferSizeBytes
- The buffer size in bytes. Must be >= 0- Returns:
- The builder
-
lowMediaTime
Time in milliseconds that will be used by the buffer controls to determine if the buffer needs to be filled. If the buffer contains data that accumulate to less than this time, the buffer can be put in "fill" state.- Parameters:
lowMediaTime
- time in ms to determine if the buffer needs to be filledtimeUnit
- The time unit- Returns:
- The builder
-
highMediaTime
Time in milliseconds that will be used by the buffer controls to determine if the buffer can be drained. If the buffer contains data that accumulate to more than this time, the buffer can be put in "drain" state.- Parameters:
highMediaTime
- time in ms to determine if the buffer can be drainedtimeUnit
- The time unit- Returns:
- The builder
-
bufferSegmentSize
The internal buffer is divided into segment and this specifies the size of a single buffer segment.- Parameters:
bufferSegmentSize
- The buffer segment size in bytes- Returns:
- The builder
-
minPlaybackStart
The minimum duration of data that must be buffered for playback to start or resume following a user action such as a seek.- Parameters:
minPlaybackStart
- minimum duration of data that must be buffered for playback to start- Returns:
- The builder
-
minRebufferStart
The minimum duration of data that must be buffered for playback to resume after a player invoked rebuffer (i.e. a rebuffer that occurs due to buffer depletion, and not due to a user action such as starting playback or seeking).- Parameters:
minRebufferStart
- minimum duration of data that must be buffered for playback to resume after a rebuffering eventtimeUnit
- The time unit- Returns:
- The builder
-
prioritizeTimeOverSizeThresholds
public BufferConfiguration.Builder prioritizeTimeOverSizeThresholds(boolean prioritizeTimeOverSizeThresholds) Prioritization of buffer time constraints over size constraints- Parameters:
prioritizeTimeOverSizeThresholds
- whether the buffer time constraints are prioritized over buffer size constraints- Returns:
- The builder
-
prioritizeInstreamOverManifestDuration
public BufferConfiguration.Builder prioritizeInstreamOverManifestDuration(boolean prioritizeInstreamOverManifestDuration) Prioritization of buffered duration calculation based on audio/video segments over the playlist (manifest)- Parameters:
prioritizeInstreamOverManifestDuration
- whether audio/video segments are prioritized over playlist- Returns:
- The builder
-
audioFeedYield
Whether to enable audio renderer stop feeding decoder when other renderers (video) are ready to start new render cycle. Enable it to play high-frame rate content.- Parameters:
audioFeedYieldEnabled
-true
to enable- Returns:
- The builder
-
videoFeedYield
Whether to enable video renderer stop feeding decoder when other renderers (audio) are ready to start new render cycle. Enable it to play high-frame rate content.- Parameters:
videoFeedYieldEnabled
-true
to enable- Returns:
- The builder
-
drainWhileCharging
Whether to enter drain state when the device is charging.- Parameters:
drainWhileCharging
- whether to enter drain state when the device is charging.- Returns:
- The builder
-
backBufferDuration
Maximum duration of the back buffer. In other words, how much time are already played segments to remain in the buffer.Note that this value is independent and does not take into account other "forward" buffer parameters such as
bufferSizeBytes
. If this value is too high, it can lead to memory exhaustion.- Parameters:
backBufferDuration
- the back buffer duration to settimeUnit
- The time unit- Returns:
- The builder
- Since:
- 4.2.0
-
get
-