當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。