mirror of
https://github.com/samsonjs/media.git
synced 2026-03-28 09:55:48 +00:00
Move and rename PRIORITY_PLAYBACK to C constants class
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=148651265
This commit is contained in:
parent
98f4fb85c2
commit
2411d0fc76
2 changed files with 9 additions and 9 deletions
|
|
@ -548,6 +548,11 @@ public final class C {
|
|||
*/
|
||||
public static final int STEREO_MODE_STEREO_MESH = 3;
|
||||
|
||||
/**
|
||||
* Priority for media playback.
|
||||
*/
|
||||
public static final int PRIORITY_PLAYBACK = 0;
|
||||
|
||||
/**
|
||||
* Converts a time in microseconds to the corresponding time in milliseconds, preserving
|
||||
* {@link #TIME_UNSET} values.
|
||||
|
|
|
|||
|
|
@ -51,11 +51,6 @@ public final class DefaultLoadControl implements LoadControl {
|
|||
*/
|
||||
public static final int DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS = 5000;
|
||||
|
||||
/**
|
||||
* Priority for media loading.
|
||||
*/
|
||||
public static final int LOADING_PRIORITY = 0;
|
||||
|
||||
private static final int ABOVE_HIGH_WATERMARK = 0;
|
||||
private static final int BETWEEN_WATERMARKS = 1;
|
||||
private static final int BELOW_LOW_WATERMARK = 2;
|
||||
|
|
@ -122,7 +117,7 @@ public final class DefaultLoadControl implements LoadControl {
|
|||
* playback to resume after a rebuffer, in milliseconds. A rebuffer is defined to be caused by
|
||||
* buffer depletion rather than a user action.
|
||||
* @param priorityTaskManager If not null, registers itself as a task with priority
|
||||
* {@link #LOADING_PRIORITY} during loading periods, and unregisters itself during draining
|
||||
* {@link C#PRIORITY_PLAYBACK} during loading periods, and unregisters itself during draining
|
||||
* periods.
|
||||
*/
|
||||
public DefaultLoadControl(DefaultAllocator allocator, int minBufferMs, int maxBufferMs,
|
||||
|
|
@ -183,9 +178,9 @@ public final class DefaultLoadControl implements LoadControl {
|
|||
|| (bufferTimeState == BETWEEN_WATERMARKS && isBuffering && !targetBufferSizeReached);
|
||||
if (priorityTaskManager != null && isBuffering != wasBuffering) {
|
||||
if (isBuffering) {
|
||||
priorityTaskManager.add(LOADING_PRIORITY);
|
||||
priorityTaskManager.add(C.PRIORITY_PLAYBACK);
|
||||
} else {
|
||||
priorityTaskManager.remove(LOADING_PRIORITY);
|
||||
priorityTaskManager.remove(C.PRIORITY_PLAYBACK);
|
||||
}
|
||||
}
|
||||
return isBuffering;
|
||||
|
|
@ -199,7 +194,7 @@ public final class DefaultLoadControl implements LoadControl {
|
|||
private void reset(boolean resetAllocator) {
|
||||
targetBufferSize = 0;
|
||||
if (priorityTaskManager != null && isBuffering) {
|
||||
priorityTaskManager.remove(LOADING_PRIORITY);
|
||||
priorityTaskManager.remove(C.PRIORITY_PLAYBACK);
|
||||
}
|
||||
isBuffering = false;
|
||||
if (resetAllocator) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue