本文整理汇总了Java中com.google.android.exoplayer2.upstream.DefaultAllocator类的典型用法代码示例。如果您正苦于以下问题:Java DefaultAllocator类的具体用法?Java DefaultAllocator怎么用?Java DefaultAllocator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DefaultAllocator类属于com.google.android.exoplayer2.upstream包,在下文中一共展示了DefaultAllocator类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DefaultLoadControl
import com.google.android.exoplayer2.upstream.DefaultAllocator; //导入依赖的package包/类
/**
* Constructs a new instance.
*
* @param allocator The {@link DefaultAllocator} used by the loader.
* @param minBufferMs The minimum duration of media that the player will attempt to ensure is
* buffered at all times, in milliseconds.
* @param maxBufferMs The maximum duration of media that the player will attempt buffer, in
* milliseconds.
* @param bufferForPlaybackMs The duration of media that must be buffered for playback to start or
* resume following a user action such as a seek, in milliseconds.
* @param bufferForPlaybackAfterRebufferMs The default duration of media that must be buffered for
* playback to resume after a rebuffer, in milliseconds. A rebuffer is defined to be caused by
* buffer depletion rather than a user action.
* @param targetBufferBytes The target buffer size in bytes. If set to {@link C#LENGTH_UNSET}, the
* target buffer size will be calculated using {@link #calculateTargetBufferSize(Renderer[],
* TrackSelectionArray)}.
* @param prioritizeTimeOverSizeThresholds Whether the load control prioritizes buffer time
*/
public DefaultLoadControl(
DefaultAllocator allocator,
int minBufferMs,
int maxBufferMs,
int bufferForPlaybackMs,
int bufferForPlaybackAfterRebufferMs,
int targetBufferBytes,
boolean prioritizeTimeOverSizeThresholds) {
this(
allocator,
minBufferMs,
maxBufferMs,
bufferForPlaybackMs,
bufferForPlaybackAfterRebufferMs,
targetBufferBytes,
prioritizeTimeOverSizeThresholds,
null);
}
示例2: createExoPlayer
import com.google.android.exoplayer2.upstream.DefaultAllocator; //导入依赖的package包/类
private void createExoPlayer() {
if (mExoPlayer != null) {
releaseExoPlayer();
}
// create default TrackSelector
TrackSelector trackSelector = new DefaultTrackSelector();
// create default LoadControl - double the buffer
LoadControl loadControl = new DefaultLoadControl(new DefaultAllocator(true, C.DEFAULT_BUFFER_SEGMENT_SIZE * 2));
// create the player
mExoPlayer = ExoPlayerFactory.newSimpleInstance(new DefaultRenderersFactory(getApplicationContext()), trackSelector, loadControl);
}
示例3: getNewLoadControl
import com.google.android.exoplayer2.upstream.DefaultAllocator; //导入依赖的package包/类
private static LoadControl getNewLoadControl() {
return new DefaultLoadControl(
new DefaultAllocator(false, C.DEFAULT_BUFFER_SEGMENT_SIZE),
DefaultLoadControl.DEFAULT_MIN_BUFFER_MS,
maxBufferMs.getObject(),
DefaultLoadControl.DEFAULT_BUFFER_FOR_PLAYBACK_MS,
DefaultLoadControl.DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS,
DefaultLoadControl.DEFAULT_TARGET_BUFFER_BYTES,
DefaultLoadControl.DEFAULT_PRIORITIZE_TIME_OVER_SIZE_THRESHOLDS);
}
示例4: setUp
import com.google.android.exoplayer2.upstream.DefaultAllocator; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
allocator = new DefaultAllocator(false, ALLOCATION_SIZE);
sampleQueue = new SampleQueue(allocator);
formatHolder = new FormatHolder();
inputBuffer = new DecoderInputBuffer(DecoderInputBuffer.BUFFER_REPLACEMENT_MODE_NORMAL);
}
示例5: createPlayer
import com.google.android.exoplayer2.upstream.DefaultAllocator; //导入依赖的package包/类
private void createPlayer() {
if (mPlayer != null) {
releasePlayer();
}
// create default TrackSelector
TrackSelector trackSelector = new DefaultTrackSelector();
// create default LoadControl - double the buffer
LoadControl loadControl = new DefaultLoadControl(new DefaultAllocator(true, C.DEFAULT_BUFFER_SEGMENT_SIZE * 2));
// create the player
mPlayer = ExoPlayerFactory.newSimpleInstance(new DefaultRenderersFactory(getApplicationContext()), trackSelector, loadControl);
}
示例6: BufferingLoadControl
import com.google.android.exoplayer2.upstream.DefaultAllocator; //导入依赖的package包/类
/**
* Instantiates a new Buffering load control.
*/
public BufferingLoadControl() {
this(new DefaultAllocator(true, C.DEFAULT_BUFFER_SEGMENT_SIZE));
}
示例7: PreviewLoadControl
import com.google.android.exoplayer2.upstream.DefaultAllocator; //导入依赖的package包/类
public PreviewLoadControl() {
allocator = new DefaultAllocator(true, C.DEFAULT_BUFFER_SEGMENT_SIZE);
}
示例8: DefaultLoadControl
import com.google.android.exoplayer2.upstream.DefaultAllocator; //导入依赖的package包/类
/**
* Constructs a new instance, using the {@code DEFAULT_*} constants defined in this class.
*/
public DefaultLoadControl() {
this(new DefaultAllocator(true, C.DEFAULT_BUFFER_SEGMENT_SIZE));
}
示例9: createExoPlayer
import com.google.android.exoplayer2.upstream.DefaultAllocator; //导入依赖的package包/类
private void createExoPlayer() {
if (mExoPlayer != null) {
releaseExoPlayer();
}
DefaultRenderersFactory renderersFactory = new DefaultRenderersFactory(this, null, DefaultRenderersFactory.EXTENSION_RENDERER_MODE_OFF);
TrackSelector trackSelector = new DefaultTrackSelector();
LoadControl loadControl = new DefaultLoadControl(new DefaultAllocator(true, C.DEFAULT_BUFFER_SEGMENT_SIZE * 2));
mExoPlayer = ExoPlayerFactory.newSimpleInstance(renderersFactory, trackSelector, loadControl);
}