本文整理汇总了Java中com.google.android.exoplayer2.audio.AudioRendererEventListener类的典型用法代码示例。如果您正苦于以下问题:Java AudioRendererEventListener类的具体用法?Java AudioRendererEventListener怎么用?Java AudioRendererEventListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AudioRendererEventListener类属于com.google.android.exoplayer2.audio包,在下文中一共展示了AudioRendererEventListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRenderers
import com.google.android.exoplayer2.audio.AudioRendererEventListener; //导入依赖的package包/类
@Override
public Renderer[] createRenderers(Handler eventHandler,
VideoRendererEventListener videoRendererEventListener,
AudioRendererEventListener audioRendererEventListener,
TextRenderer.Output textRendererOutput, MetadataRenderer.Output metadataRendererOutput) {
ArrayList<Renderer> renderersList = new ArrayList<>();
buildVideoRenderers(context, drmSessionManager, allowedVideoJoiningTimeMs,
eventHandler, videoRendererEventListener, extensionRendererMode, renderersList);
buildAudioRenderers(context, drmSessionManager, buildAudioProcessors(),
eventHandler, audioRendererEventListener, extensionRendererMode, renderersList);
buildTextRenderers(context, textRendererOutput, eventHandler.getLooper(),
extensionRendererMode, renderersList);
buildMetadataRenderers(context, metadataRendererOutput, eventHandler.getLooper(),
extensionRendererMode, renderersList);
buildMiscellaneousRenderers(context, eventHandler, extensionRendererMode, renderersList);
return renderersList.toArray(new Renderer[renderersList.size()]);
}
示例2: createRenderers
import com.google.android.exoplayer2.audio.AudioRendererEventListener; //导入依赖的package包/类
@Override
public Renderer[] createRenderers(Handler eventHandler,
VideoRendererEventListener videoRendererEventListener,
AudioRendererEventListener audioRendererEventListener,
TextOutput textRendererOutput,
MetadataOutput metadataRendererOutput) {
ArrayList<Renderer> renderersList = new ArrayList<>();
buildVideoRenderers(context, drmSessionManager, allowedVideoJoiningTimeMs,
eventHandler, videoRendererEventListener, extensionRendererMode, renderersList);
buildAudioRenderers(context, drmSessionManager, buildAudioProcessors(),
eventHandler, audioRendererEventListener, extensionRendererMode, renderersList);
buildTextRenderers(textRendererOutput, eventHandler.getLooper(),
renderersList);
buildMetadataRenderers(metadataRendererOutput, eventHandler.getLooper(),
renderersList);
buildMiscellaneousRenderers();
return renderersList.toArray(new Renderer[renderersList.size()]);
}
示例3: buildAudioRenderers
import com.google.android.exoplayer2.audio.AudioRendererEventListener; //导入依赖的package包/类
@NonNull
protected List<Renderer> buildAudioRenderers() {
List<Renderer> renderers = new ArrayList<>();
renderers.add(new MediaCodecAudioRenderer(MediaCodecSelector.DEFAULT, drmSessionManager, true, handler, audioRendererEventListener, AudioCapabilities.getCapabilities(context)));
// Adds any registered classes
List<String> classNames = ExoMedia.Data.registeredRendererClasses.get(ExoMedia.RendererType.AUDIO);
if (classNames != null) {
for (String className: classNames) {
try {
Class<?> clazz = Class.forName(className);
Constructor<?> constructor = clazz.getConstructor(Handler.class, AudioRendererEventListener.class);
Renderer renderer = (Renderer) constructor.newInstance(handler, audioRendererEventListener);
renderers.add(renderer);
} catch (Exception e) {
// Purposefully left blank
}
}
}
return renderers;
}
示例4: createRenderers
import com.google.android.exoplayer2.audio.AudioRendererEventListener; //导入依赖的package包/类
@Override
public Renderer[] createRenderers(Handler eventHandler,
VideoRendererEventListener videoRendererEventListener,
AudioRendererEventListener audioRendererEventListener,
TextOutput textRendererOutput, MetadataOutput metadataRendererOutput) {
ArrayList<Renderer> renderersList = new ArrayList<>();
buildVideoRenderers(context, drmSessionManager, allowedVideoJoiningTimeMs,
eventHandler, videoRendererEventListener, extensionRendererMode, renderersList);
buildAudioRenderers(context, drmSessionManager, buildAudioProcessors(),
eventHandler, audioRendererEventListener, extensionRendererMode, renderersList);
buildTextRenderers(context, textRendererOutput, eventHandler.getLooper(),
extensionRendererMode, renderersList);
buildMetadataRenderers(context, metadataRendererOutput, eventHandler.getLooper(),
extensionRendererMode, renderersList);
buildMiscellaneousRenderers(context, eventHandler, extensionRendererMode, renderersList);
return renderersList.toArray(new Renderer[renderersList.size()]);
}
示例5: SonicMediaCodecAudioRenderer
import com.google.android.exoplayer2.audio.AudioRendererEventListener; //导入依赖的package包/类
public SonicMediaCodecAudioRenderer(MediaCodecSelector mediaCodecSelector,
DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
boolean playClearSamplesWithoutKeys, Handler eventHandler,
AudioRendererEventListener eventListener, AudioCapabilities audioCapabilities,
AudioProcessor... audioProcessors) {
super(mediaCodecSelector, drmSessionManager, playClearSamplesWithoutKeys, eventHandler, eventListener, audioCapabilities, audioProcessors);
//Init
bufferIndex = -1;
speed = 1.0f;
pitch = 1.0f;
rate = 1.0f;
}
示例6: RendererProvider
import com.google.android.exoplayer2.audio.AudioRendererEventListener; //导入依赖的package包/类
public RendererProvider(@NonNull Context context, @NonNull Handler handler, @NonNull TextOutput captionListener, @NonNull MetadataOutput metadataListener,
@NonNull AudioRendererEventListener audioRendererEventListener, @NonNull VideoRendererEventListener videoRendererEventListener) {
this.context = context;
this.handler = handler;
this.captionListener = captionListener;
this.metadataListener = metadataListener;
this.audioRendererEventListener = audioRendererEventListener;
this.videoRendererEventListener = videoRendererEventListener;
}
示例7: setAudioDebugListener
import com.google.android.exoplayer2.audio.AudioRendererEventListener; //导入依赖的package包/类
/**
* Sets an {@link AudioRendererEventListener} to listen for audio debug events during the test.
*/
public final void setAudioDebugListener(AudioRendererEventListener audioDebugListener) {
this.audioDebugListener = audioDebugListener;
if (player != null) {
player.addAudioDebugListener(audioDebugListener);
}
}
示例8: setAudioDebugListener
import com.google.android.exoplayer2.audio.AudioRendererEventListener; //导入依赖的package包/类
/**
* Sets a listener to receive debug events from the audio renderer.
*
* @param listener The listener.
* @deprecated Use {@link #addAudioDebugListener(AudioRendererEventListener)}.
*/
@Deprecated
public void setAudioDebugListener(AudioRendererEventListener listener) {
audioDebugListeners.clear();
if (listener != null) {
addAudioDebugListener(listener);
}
}
示例9: onAudioEnabled
import com.google.android.exoplayer2.audio.AudioRendererEventListener; //导入依赖的package包/类
@Override
public void onAudioEnabled(DecoderCounters counters) {
audioDecoderCounters = counters;
for (AudioRendererEventListener audioDebugListener : audioDebugListeners) {
audioDebugListener.onAudioEnabled(counters);
}
}
示例10: onAudioSessionId
import com.google.android.exoplayer2.audio.AudioRendererEventListener; //导入依赖的package包/类
@Override
public void onAudioSessionId(int sessionId) {
audioSessionId = sessionId;
for (AudioRendererEventListener audioDebugListener : audioDebugListeners) {
audioDebugListener.onAudioSessionId(sessionId);
}
}
示例11: onAudioDecoderInitialized
import com.google.android.exoplayer2.audio.AudioRendererEventListener; //导入依赖的package包/类
@Override
public void onAudioDecoderInitialized(String decoderName, long initializedTimestampMs,
long initializationDurationMs) {
for (AudioRendererEventListener audioDebugListener : audioDebugListeners) {
audioDebugListener.onAudioDecoderInitialized(decoderName, initializedTimestampMs,
initializationDurationMs);
}
}
示例12: onAudioInputFormatChanged
import com.google.android.exoplayer2.audio.AudioRendererEventListener; //导入依赖的package包/类
@Override
public void onAudioInputFormatChanged(Format format) {
audioFormat = format;
for (AudioRendererEventListener audioDebugListener : audioDebugListeners) {
audioDebugListener.onAudioInputFormatChanged(format);
}
}
示例13: onAudioSinkUnderrun
import com.google.android.exoplayer2.audio.AudioRendererEventListener; //导入依赖的package包/类
@Override
public void onAudioSinkUnderrun(int bufferSize, long bufferSizeMs,
long elapsedSinceLastFeedMs) {
for (AudioRendererEventListener audioDebugListener : audioDebugListeners) {
audioDebugListener.onAudioSinkUnderrun(bufferSize, bufferSizeMs, elapsedSinceLastFeedMs);
}
}
示例14: onAudioDisabled
import com.google.android.exoplayer2.audio.AudioRendererEventListener; //导入依赖的package包/类
@Override
public void onAudioDisabled(DecoderCounters counters) {
for (AudioRendererEventListener audioDebugListener : audioDebugListeners) {
audioDebugListener.onAudioDisabled(counters);
}
audioFormat = null;
audioDecoderCounters = null;
audioSessionId = C.AUDIO_SESSION_ID_UNSET;
}
示例15: LibopusAudioRenderer
import com.google.android.exoplayer2.audio.AudioRendererEventListener; //导入依赖的package包/类
/**
* @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
* null if delivery of events is not required.
* @param eventListener A listener of events. May be null if delivery of events is not required.
* @param audioCapabilities The audio capabilities for playback on this device. May be null if the
* default capabilities (no encoded audio passthrough support) should be assumed.
*/
public LibopusAudioRenderer(Handler eventHandler, AudioRendererEventListener eventListener,
AudioCapabilities audioCapabilities, DrmSessionManager<ExoMediaCrypto> drmSessionManager,
boolean playClearSamplesWithoutKeys) {
super(eventHandler, eventListener, audioCapabilities, drmSessionManager,
playClearSamplesWithoutKeys);
}