当前位置: 首页>>代码示例>>Java>>正文


Java Process.THREAD_PRIORITY_AUDIO属性代码示例

本文整理汇总了Java中android.os.Process.THREAD_PRIORITY_AUDIO属性的典型用法代码示例。如果您正苦于以下问题:Java Process.THREAD_PRIORITY_AUDIO属性的具体用法?Java Process.THREAD_PRIORITY_AUDIO怎么用?Java Process.THREAD_PRIORITY_AUDIO使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.os.Process的用法示例。


在下文中一共展示了Process.THREAD_PRIORITY_AUDIO属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ExoPlayerImplInternal

public ExoPlayerImplInternal(Handler eventHandler, boolean playWhenReady,
    int[] selectedTrackIndices, int minBufferMs, int minRebufferMs) {
  this.eventHandler = eventHandler;
  this.playWhenReady = playWhenReady;
  this.minBufferUs = minBufferMs * 1000L;
  this.minRebufferUs = minRebufferMs * 1000L;
  this.selectedTrackIndices = Arrays.copyOf(selectedTrackIndices, selectedTrackIndices.length);
  this.state = ExoPlayer.STATE_IDLE;
  this.durationUs = TrackRenderer.UNKNOWN_TIME_US;
  this.bufferedPositionUs = TrackRenderer.UNKNOWN_TIME_US;

  standaloneMediaClock = new StandaloneMediaClock();
  pendingSeekCount = new AtomicInteger();
  enabledRenderers = new ArrayList<>(selectedTrackIndices.length);
  trackFormats = new MediaFormat[selectedTrackIndices.length][];
  // Note: The documentation for Process.THREAD_PRIORITY_AUDIO that states "Applications can
  // not normally change to this priority" is incorrect.
  internalPlaybackThread = new PriorityHandlerThread("ExoPlayerImplInternal:Handler",
      Process.THREAD_PRIORITY_AUDIO);
  internalPlaybackThread.start();
  handler = new Handler(internalPlaybackThread.getLooper(), this);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:22,代码来源:ExoPlayerImplInternal.java

示例2: ExoPlayerImplInternal

public ExoPlayerImplInternal(Renderer[] renderers, TrackSelector trackSelector,
    LoadControl loadControl, boolean playWhenReady, Handler eventHandler,
    PlaybackInfo playbackInfo, ExoPlayer player) {
  this.renderers = renderers;
  this.trackSelector = trackSelector;
  this.loadControl = loadControl;
  this.playWhenReady = playWhenReady;
  this.eventHandler = eventHandler;
  this.state = ExoPlayer.STATE_IDLE;
  this.playbackInfo = playbackInfo;
  this.player = player;

  rendererCapabilities = new RendererCapabilities[renderers.length];
  for (int i = 0; i < renderers.length; i++) {
    renderers[i].setIndex(i);
    rendererCapabilities[i] = renderers[i].getCapabilities();
  }
  standaloneMediaClock = new StandaloneMediaClock();
  enabledRenderers = new Renderer[0];
  window = new Timeline.Window();
  period = new Timeline.Period();
  trackSelector.init(this);
  playbackParameters = PlaybackParameters.DEFAULT;

  // Note: The documentation for Process.THREAD_PRIORITY_AUDIO that states "Applications can
  // not normally change to this priority" is incorrect.
  internalPlaybackThread = new HandlerThread("ExoPlayerImplInternal:Handler",
      Process.THREAD_PRIORITY_AUDIO);
  internalPlaybackThread.start();
  handler = new Handler(internalPlaybackThread.getLooper(), this);
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:31,代码来源:ExoPlayerImplInternal.java

示例3: isThreadPriorityAudio

/**
 * Checks whether Thread priority is THREAD_PRIORITY_AUDIO or not.
 * @param tid Thread id.
 * @return true for THREAD_PRIORITY_AUDIO and false otherwise.
 */
@CalledByNative
private static boolean isThreadPriorityAudio(int tid) {
    return Process.getThreadPriority(tid) == Process.THREAD_PRIORITY_AUDIO;
}
 
开发者ID:lizhangqu,项目名称:chromium-net-for-android,代码行数:9,代码来源:ThreadUtils.java


注:本文中的android.os.Process.THREAD_PRIORITY_AUDIO属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。