本文整理汇总了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();
}
}
}
示例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);
}
});
}
}
示例3: onAudioTrackInitializationError
import com.google.android.exoplayer.audio.AudioTrack; //导入方法依赖的package包/类
@Override
public void onAudioTrackInitializationError(AudioTrack.InitializationException e) {
if (internalErrorListener != null) {
internalErrorListener.onAudioTrackInitializationError(e);
}
}
示例4: onAudioTrackInitializationError
import com.google.android.exoplayer.audio.AudioTrack; //导入方法依赖的package包/类
@Override
public void onAudioTrackInitializationError(AudioTrack.InitializationException e) {
printInternalError("audioTrackInitializationError", e);
}
示例5: onAudioTrackInitializationError
import com.google.android.exoplayer.audio.AudioTrack; //导入方法依赖的package包/类
@Override
public void onAudioTrackInitializationError(AudioTrack.InitializationException e) {
if (internalErrorListener != null) {
internalErrorListener.onAudioTrackInitializationError(e);
}
}
示例6: onAudioTrackInitializationError
import com.google.android.exoplayer.audio.AudioTrack; //导入方法依赖的package包/类
@Override
public void onAudioTrackInitializationError(AudioTrack.InitializationException ex) {
if (internalErrorListener != null) {
internalErrorListener.onAudioTrackInitializationError(ex);
}
}
示例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;
}
}
示例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);
示例9: onAudioTrackInitializationError
import com.google.android.exoplayer.audio.AudioTrack; //导入方法依赖的package包/类
@Override
public void onAudioTrackInitializationError(AudioTrack.InitializationException e) {
}
示例10: onAudioTrackInitializationError
import com.google.android.exoplayer.audio.AudioTrack; //导入方法依赖的package包/类
void onAudioTrackInitializationError(AudioTrack.InitializationException e);