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


Java AudioTrack.InitializationException方法代码示例

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


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

示例1: ensureAudioTrackInitialized

import com.google.android.exoplayer.audio.AudioTrack; //导入方法依赖的package包/类
private void ensureAudioTrackInitialized() {
    if (!AUDIO_TRACK.isInitialized()) {
        try {
            if (DEBUG) {
                Log.d(TAG, "AudioTrack initialized");
            }
            AUDIO_TRACK.initialize();
        } catch (AudioTrack.InitializationException e) {
            Log.e(TAG, "Error on AudioTrack initialization", e);
            notifyAudioTrackInitializationError(e);

            // Do not throw exception here but just disabling audioTrack to keep playing
            // video without audio.
            AUDIO_TRACK.setStatus(false);
        }
        if (getState() == TrackRenderer.STATE_STARTED) {
            if (DEBUG) {
                Log.d(TAG, "AudioTrack played");
            }
            AUDIO_TRACK.play();
        }
    }
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:24,代码来源:Ac3PassthroughTrackRenderer.java

示例2: notifyAudioTrackInitializationError

import com.google.android.exoplayer.audio.AudioTrack; //导入方法依赖的package包/类
private void notifyAudioTrackInitializationError(final AudioTrack.InitializationException e) {
  if (eventHandler != null && eventListener != null) {
    eventHandler.post(new Runnable() {
      @Override
      public void run() {
        eventListener.onAudioTrackInitializationError(e);
      }
    });
  }
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:11,代码来源:LibflacAudioTrackRenderer.java

示例3: onAudioTrackInitializationError

import com.google.android.exoplayer.audio.AudioTrack; //导入方法依赖的package包/类
@Override
public void onAudioTrackInitializationError(AudioTrack.InitializationException e) {
    if (internalErrorListener != null) {
        internalErrorListener.onAudioTrackInitializationError(e);
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:7,代码来源:DemoPlayer.java

示例4: onAudioTrackInitializationError

import com.google.android.exoplayer.audio.AudioTrack; //导入方法依赖的package包/类
@Override
public void onAudioTrackInitializationError(AudioTrack.InitializationException e) {
  printInternalError("audioTrackInitializationError", e);
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:5,代码来源:EventLogger.java

示例5: onAudioTrackInitializationError

import com.google.android.exoplayer.audio.AudioTrack; //导入方法依赖的package包/类
@Override
public void onAudioTrackInitializationError(AudioTrack.InitializationException e) {
  if (internalErrorListener != null) {
    internalErrorListener.onAudioTrackInitializationError(e);
  }
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:7,代码来源:DemoPlayer.java

示例6: onAudioTrackInitializationError

import com.google.android.exoplayer.audio.AudioTrack; //导入方法依赖的package包/类
@Override
public void onAudioTrackInitializationError(AudioTrack.InitializationException ex) {
  if (internalErrorListener != null) {
    internalErrorListener.onAudioTrackInitializationError(ex);
  }
}
 
开发者ID:mkjensen,项目名称:danish-media-license,代码行数:7,代码来源:DemoPlayer.java

示例7: renderBuffer

import com.google.android.exoplayer.audio.AudioTrack; //导入方法依赖的package包/类
private void renderBuffer() throws OpusDecoderException, AudioTrack.InitializationException,
    AudioTrack.WriteException {
  if (outputStreamEnded) {
    return;
  }

  if (outputBuffer == null) {
    outputBuffer = decoder.dequeueOutputBuffer();
    if (outputBuffer == null) {
      return;
    }
  }

  if (outputBuffer.getFlag(Buffer.FLAG_END_OF_STREAM)) {
    outputStreamEnded = true;
    audioTrack.handleEndOfStream();
    outputBuffer.release();
    outputBuffer = null;
    return;
  }

  if (!audioTrack.isInitialized()) {
    if (audioSessionId != AudioTrack.SESSION_ID_NOT_SET) {
      audioTrack.initialize(audioSessionId);
    } else {
      audioSessionId = audioTrack.initialize();
    }
    if (getState() == TrackRenderer.STATE_STARTED) {
      audioTrack.play();
    }
  }

  int handleBufferResult;
  handleBufferResult = audioTrack.handleBuffer(outputBuffer.data, outputBuffer.data.position(),
      outputBuffer.data.remaining(), outputBuffer.timestampUs);

  // If we are out of sync, allow currentPositionUs to jump backwards.
  if ((handleBufferResult & AudioTrack.RESULT_POSITION_DISCONTINUITY) != 0) {
    allowPositionDiscontinuity = true;
  }

  // Release the buffer if it was consumed.
  if ((handleBufferResult & AudioTrack.RESULT_BUFFER_CONSUMED) != 0) {
    codecCounters.renderedOutputBufferCount++;
    outputBuffer.release();
    outputBuffer = null;
  }
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:49,代码来源:LibopusAudioTrackRenderer.java

示例8: onAudioTrackInitializationError

import com.google.android.exoplayer.audio.AudioTrack; //导入方法依赖的package包/类
/**
 * Invoked when the {@link AudioTrack} fails to initialize.
 *
 * @param e The corresponding exception.
 */
void onAudioTrackInitializationError(AudioTrack.InitializationException e);
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:7,代码来源:LibopusAudioTrackRenderer.java

示例9: onAudioTrackInitializationError

import com.google.android.exoplayer.audio.AudioTrack; //导入方法依赖的package包/类
@Override
public void onAudioTrackInitializationError(AudioTrack.InitializationException e) {

}
 
开发者ID:quanhua92,项目名称:GLMediaPlayer,代码行数:5,代码来源:CustomExoPlayer.java

示例10: onAudioTrackInitializationError

import com.google.android.exoplayer.audio.AudioTrack; //导入方法依赖的package包/类
void onAudioTrackInitializationError(AudioTrack.InitializationException e); 
开发者ID:ayaseruri,项目名称:luxunPro,代码行数:2,代码来源:InternalErrorListener.java


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