Commit 2411d0fc by eguven Committed by Oliver Woodman

Move and rename PRIORITY_PLAYBACK to C constants class

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=148651265
parent 98f4fb85
......@@ -549,6 +549,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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment