• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DecoderQueryException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException的典型用法代码示例。如果您正苦于以下问题:Java DecoderQueryException类的具体用法?Java DecoderQueryException怎么用?Java DecoderQueryException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DecoderQueryException类属于com.google.android.exoplayer2.mediacodec.MediaCodecUtil包,在下文中一共展示了DecoderQueryException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: isL1WidevineAvailable

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
@TargetApi(18)
@SuppressWarnings("ResourceType")
private static boolean isL1WidevineAvailable(String videoMimeType) {
  try {
    // Force L3 if secure decoder is not available.
    if (MediaCodecUtil.getDecoderInfo(videoMimeType, true) == null) {
      return false;
    }

    MediaDrm mediaDrm = new MediaDrm(WIDEVINE_UUID);
    String securityProperty = mediaDrm.getPropertyString(SECURITY_LEVEL_PROPERTY);
    mediaDrm.release();
    return WIDEVINE_SECURITY_LEVEL_1.equals(securityProperty);
  } catch (DecoderQueryException | UnsupportedSchemeException e) {
    throw new IllegalStateException(e);
  }
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:18,代码来源:DashTest.java


示例2: supportsFormat

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
@Override
protected int supportsFormat(MediaCodecSelector mediaCodecSelector, Format format)
    throws DecoderQueryException {
  String mimeType = format.sampleMimeType;
  if (!MimeTypes.isAudio(mimeType)) {
    return FORMAT_UNSUPPORTED_TYPE;
  }
  int tunnelingSupport = Util.SDK_INT >= 21 ? TUNNELING_SUPPORTED : TUNNELING_NOT_SUPPORTED;
  if (allowPassthrough(mimeType) && mediaCodecSelector.getPassthroughDecoderInfo() != null) {
    return ADAPTIVE_NOT_SEAMLESS | tunnelingSupport | FORMAT_HANDLED;
  }
  MediaCodecInfo decoderInfo = mediaCodecSelector.getDecoderInfo(mimeType, false);
  if (decoderInfo == null) {
    return FORMAT_UNSUPPORTED_SUBTYPE;
  }
  // Note: We assume support for unknown sampleRate and channelCount.
  boolean decoderCapable = Util.SDK_INT < 21
      || ((format.sampleRate == Format.NO_VALUE
      || decoderInfo.isAudioSampleRateSupportedV21(format.sampleRate))
      && (format.channelCount == Format.NO_VALUE
      ||  decoderInfo.isAudioChannelCountSupportedV21(format.channelCount)));
  int formatSupport = decoderCapable ? FORMAT_HANDLED : FORMAT_EXCEEDS_CAPABILITIES;
  return ADAPTIVE_NOT_SEAMLESS | tunnelingSupport | formatSupport;
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:25,代码来源:MediaCodecAudioRenderer.java


示例3: supportsFormat

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
@Override
protected int supportsFormat(MediaCodecSelector mediaCodecSelector, Format format)
    throws DecoderQueryException {
  String mimeType = format.sampleMimeType;
  if (!MimeTypes.isAudio(mimeType)) {
    return FORMAT_UNSUPPORTED_TYPE;
  }
  if (allowPassthrough(mimeType) && mediaCodecSelector.getPassthroughDecoderInfo() != null) {
    return ADAPTIVE_NOT_SEAMLESS | FORMAT_HANDLED;
  }
  MediaCodecInfo decoderInfo = mediaCodecSelector.getDecoderInfo(mimeType, false);
  if (decoderInfo == null) {
    return FORMAT_UNSUPPORTED_SUBTYPE;
  }
  // Note: We assume support for unknown sampleRate and channelCount.
  boolean decoderCapable = Util.SDK_INT < 21
      || ((format.sampleRate == Format.NO_VALUE
      || decoderInfo.isAudioSampleRateSupportedV21(format.sampleRate))
      && (format.channelCount == Format.NO_VALUE
      ||  decoderInfo.isAudioChannelCountSupportedV21(format.channelCount)));
  int formatSupport = decoderCapable ? FORMAT_HANDLED : FORMAT_EXCEEDS_CAPABILITIES;
  return ADAPTIVE_NOT_SEAMLESS | formatSupport;
}
 
开发者ID:zhanglibin123488,项目名称:videoPickPlayer,代码行数:24,代码来源:MediaCodecAudioRenderer.java


示例4: testH264AdaptiveWithSeeking

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
public void testH264AdaptiveWithSeeking() throws DecoderQueryException {
  if (Util.SDK_INT < 16 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) {
    // Pass.
    return;
  }
  final String streamName = "test_h264_adaptive_with_seeking";
  testRunner
      .setStreamName(streamName)
      .setManifestUrl(DashTestData.H264_MANIFEST)
      .setFullPlaybackNoSeeking(false)
      .setCanIncludeAdditionalVideoFormats(true)
      .setActionSchedule(SEEKING_SCHEDULE)
      .setAudioVideoFormats(DashTestData.AAC_AUDIO_REPRESENTATION_ID,
          DashTestData.H264_CDD_ADAPTIVE)
      .run();
}
 
开发者ID:y20k,项目名称:transistor,代码行数:17,代码来源:DashStreamingTest.java


示例5: testH264AdaptiveWithRendererDisabling

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
public void testH264AdaptiveWithRendererDisabling() throws DecoderQueryException {
  if (Util.SDK_INT < 16 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) {
    // Pass.
    return;
  }
  final String streamName = "test_h264_adaptive_with_renderer_disabling";
  testRunner
      .setStreamName(streamName)
      .setManifestUrl(DashTestData.H264_MANIFEST)
      .setFullPlaybackNoSeeking(false)
      .setCanIncludeAdditionalVideoFormats(true)
      .setActionSchedule(RENDERER_DISABLING_SCHEDULE)
      .setAudioVideoFormats(DashTestData.AAC_AUDIO_REPRESENTATION_ID,
          DashTestData.H264_CDD_ADAPTIVE)
      .run();
}
 
开发者ID:y20k,项目名称:transistor,代码行数:17,代码来源:DashStreamingTest.java


示例6: testWidevineH264AdaptiveWithSeekingV18

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
public void testWidevineH264AdaptiveWithSeekingV18() throws DecoderQueryException {
  if (Util.SDK_INT < 18 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) {
    // Pass.
    return;
  }
  testRunner
      .setStreamName("test_widevine_h264_adaptive_with_seeking")
      .setManifestUrl(DashTestData.WIDEVINE_H264_MANIFEST)
      .setWidevineInfo(MimeTypes.VIDEO_H264, true)
      .setFullPlaybackNoSeeking(false)
      .setCanIncludeAdditionalVideoFormats(true)
      .setActionSchedule(SEEKING_SCHEDULE)
      .setAudioVideoFormats(DashTestData.WIDEVINE_AAC_AUDIO_REPRESENTATION_ID,
          DashTestData.WIDEVINE_H264_CDD_ADAPTIVE)
      .run();
}
 
开发者ID:y20k,项目名称:transistor,代码行数:17,代码来源:DashStreamingTest.java


示例7: testWidevineH264AdaptiveWithRendererDisablingV18

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
public void testWidevineH264AdaptiveWithRendererDisablingV18() throws DecoderQueryException {
  if (Util.SDK_INT < 18 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) {
    // Pass.
    return;
  }
  testRunner
      .setStreamName("test_widevine_h264_adaptive_with_renderer_disabling")
      .setManifestUrl(DashTestData.WIDEVINE_H264_MANIFEST)
      .setWidevineInfo(MimeTypes.VIDEO_H264, true)
      .setFullPlaybackNoSeeking(false)
      .setCanIncludeAdditionalVideoFormats(true)
      .setActionSchedule(RENDERER_DISABLING_SCHEDULE)
      .setAudioVideoFormats(DashTestData.WIDEVINE_AAC_AUDIO_REPRESENTATION_ID,
          DashTestData.WIDEVINE_H264_CDD_ADAPTIVE)
      .run();
}
 
开发者ID:y20k,项目名称:transistor,代码行数:17,代码来源:DashStreamingTest.java


示例8: testWidevineH265AdaptiveWithSeekingV24

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
public void testWidevineH265AdaptiveWithSeekingV24() throws DecoderQueryException {
  if (Util.SDK_INT < 24) {
    // Pass.
    return;
  }
  testRunner
      .setStreamName("test_widevine_h265_adaptive_with_seeking")
      .setManifestUrl(DashTestData.WIDEVINE_H265_MANIFEST)
      .setWidevineInfo(MimeTypes.VIDEO_H265, true)
      .setFullPlaybackNoSeeking(false)
      .setCanIncludeAdditionalVideoFormats(true)
      .setActionSchedule(SEEKING_SCHEDULE)
      .setAudioVideoFormats(DashTestData.WIDEVINE_AAC_AUDIO_REPRESENTATION_ID,
          DashTestData.WIDEVINE_H265_CDD_ADAPTIVE)
      .run();
}
 
开发者ID:y20k,项目名称:transistor,代码行数:17,代码来源:DashStreamingTest.java


示例9: testWidevineH265AdaptiveWithRendererDisablingV24

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
public void testWidevineH265AdaptiveWithRendererDisablingV24() throws DecoderQueryException {
  if (Util.SDK_INT < 24) {
    // Pass.
    return;
  }
  testRunner
      .setStreamName("test_widevine_h265_adaptive_with_renderer_disabling")
      .setManifestUrl(DashTestData.WIDEVINE_H265_MANIFEST)
      .setWidevineInfo(MimeTypes.VIDEO_H265, true)
      .setFullPlaybackNoSeeking(false)
      .setCanIncludeAdditionalVideoFormats(true)
      .setActionSchedule(RENDERER_DISABLING_SCHEDULE)
      .setAudioVideoFormats(DashTestData.WIDEVINE_AAC_AUDIO_REPRESENTATION_ID,
          DashTestData.WIDEVINE_H265_CDD_ADAPTIVE)
      .run();
}
 
开发者ID:y20k,项目名称:transistor,代码行数:17,代码来源:DashStreamingTest.java


示例10: testWidevineVp9AdaptiveWithSeekingV24

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
public void testWidevineVp9AdaptiveWithSeekingV24() throws DecoderQueryException {
  if (Util.SDK_INT < 24) {
    // Pass.
    return;
  }
  testRunner
      .setStreamName("test_widevine_vp9_adaptive_with_seeking")
      .setManifestUrl(DashTestData.WIDEVINE_VP9_MANIFEST)
      .setWidevineInfo(MimeTypes.VIDEO_VP9, true)
      .setFullPlaybackNoSeeking(false)
      .setCanIncludeAdditionalVideoFormats(true)
      .setActionSchedule(SEEKING_SCHEDULE)
      .setAudioVideoFormats(DashTestData.WIDEVINE_VP9_AAC_AUDIO_REPRESENTATION_ID,
          DashTestData.WIDEVINE_VP9_CDD_ADAPTIVE)
      .run();
}
 
开发者ID:y20k,项目名称:transistor,代码行数:17,代码来源:DashStreamingTest.java


示例11: testWidevineVp9AdaptiveWithRendererDisablingV24

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
public void testWidevineVp9AdaptiveWithRendererDisablingV24() throws DecoderQueryException {
  if (Util.SDK_INT < 24) {
    // Pass.
    return;
  }
  testRunner
      .setStreamName("test_widevine_vp9_adaptive_with_renderer_disabling")
      .setManifestUrl(DashTestData.WIDEVINE_VP9_MANIFEST)
      .setWidevineInfo(MimeTypes.VIDEO_VP9, true)
      .setFullPlaybackNoSeeking(false)
      .setCanIncludeAdditionalVideoFormats(true)
      .setActionSchedule(RENDERER_DISABLING_SCHEDULE)
      .setAudioVideoFormats(DashTestData.WIDEVINE_VP9_AAC_AUDIO_REPRESENTATION_ID,
          DashTestData.WIDEVINE_VP9_CDD_ADAPTIVE)
      .run();
}
 
开发者ID:y20k,项目名称:transistor,代码行数:17,代码来源:DashStreamingTest.java


示例12: configureCodec

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
@Override
protected void configureCodec(MediaCodecInfo codecInfo, MediaCodec codec, Format format,
    MediaCrypto crypto) throws DecoderQueryException {
  codecMaxValues = getCodecMaxValues(codecInfo, format, streamFormats);
  MediaFormat mediaFormat = getMediaFormat(format, codecMaxValues, deviceNeedsAutoFrcWorkaround,
      tunnelingAudioSessionId);
  if (surface == null) {
    Assertions.checkState(shouldUseDummySurface(codecInfo.secure));
    if (dummySurface == null) {
      dummySurface = DummySurface.newInstanceV17(context, codecInfo.secure);
    }
    surface = dummySurface;
  }
  codec.configure(mediaFormat, surface, crypto, 0);
  if (Util.SDK_INT >= 23 && tunneling) {
    tunnelingOnFrameRenderedListener = new OnFrameRenderedListenerV23(codec);
  }
}
 
开发者ID:y20k,项目名称:transistor,代码行数:19,代码来源:MediaCodecVideoRenderer.java


示例13: onPlayerError

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
@Override
public void onPlayerError(ExoPlaybackException e) {
    String errorString = null;
    if (e.type == ExoPlaybackException.TYPE_RENDERER) {
        Exception cause = e.getRendererException();
        if (cause instanceof DecoderInitializationException) {
            // Special case for decoder initialization failures.
            DecoderInitializationException decoderInitializationException =
                    (DecoderInitializationException) cause;
            if (decoderInitializationException.decoderName == null) {
                if (decoderInitializationException.getCause() instanceof DecoderQueryException) {
                    errorString = getString(R.string.error_querying_decoders);
                } else if (decoderInitializationException.secureDecoderRequired) {
                    errorString = getString(R.string.error_no_secure_decoder,
                            decoderInitializationException.mimeType);
                } else {
                    errorString = getString(R.string.error_no_decoder,
                            decoderInitializationException.mimeType);
                }
            } else {
                errorString = getString(R.string.error_instantiating_decoder,
                        decoderInitializationException.decoderName);
            }
        }
    }
    if (errorString != null) {
        showToast(errorString);
    }
    playerNeedsSource = true;
    if (isBehindLiveWindow(e)) {
        clearResumePosition();
        initializePlayer();
    } else {
        updateResumePosition();
        updateButtonVisibilities();
        showControls();
    }
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:39,代码来源:PlayerActivity.java


示例14: testH264Adaptive

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
public void testH264Adaptive() throws DecoderQueryException {
  if (Util.SDK_INT < 16 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) {
    // Pass.
    return;
  }
  String streamName = "test_h264_adaptive";
  testDashPlayback(getActivity(), streamName, H264_MANIFEST, AAC_AUDIO_REPRESENTATION_ID, false,
      MimeTypes.VIDEO_H264, ALLOW_ADDITIONAL_VIDEO_FORMATS, H264_CDD_ADAPTIVE);
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:10,代码来源:DashTest.java


示例15: testH264AdaptiveWithSeeking

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
public void testH264AdaptiveWithSeeking() throws DecoderQueryException {
  if (Util.SDK_INT < 16 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) {
    // Pass.
    return;
  }
  String streamName = "test_h264_adaptive_with_seeking";
  testDashPlayback(getActivity(), streamName, SEEKING_SCHEDULE, false, H264_MANIFEST,
      AAC_AUDIO_REPRESENTATION_ID, false, MimeTypes.VIDEO_H264, ALLOW_ADDITIONAL_VIDEO_FORMATS,
      H264_CDD_ADAPTIVE);
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:11,代码来源:DashTest.java


示例16: testH264AdaptiveWithRendererDisabling

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
public void testH264AdaptiveWithRendererDisabling() throws DecoderQueryException {
  if (Util.SDK_INT < 16 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) {
    // Pass.
    return;
  }
  String streamName = "test_h264_adaptive_with_renderer_disabling";
  testDashPlayback(getActivity(), streamName, RENDERER_DISABLING_SCHEDULE, false, H264_MANIFEST,
      AAC_AUDIO_REPRESENTATION_ID, false, MimeTypes.VIDEO_H264, ALLOW_ADDITIONAL_VIDEO_FORMATS,
      H264_CDD_ADAPTIVE);
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:11,代码来源:DashTest.java


示例17: testH265Adaptive

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
public void testH265Adaptive() throws DecoderQueryException {
  if (Util.SDK_INT < 24 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H265)) {
    // Pass.
    return;
  }
  String streamName = "test_h265_adaptive";
  testDashPlayback(getActivity(), streamName, H265_MANIFEST, AAC_AUDIO_REPRESENTATION_ID, false,
      MimeTypes.VIDEO_H265, ALLOW_ADDITIONAL_VIDEO_FORMATS, H265_CDD_ADAPTIVE);
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:10,代码来源:DashTest.java


示例18: testH265AdaptiveWithSeeking

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
public void testH265AdaptiveWithSeeking() throws DecoderQueryException {
  if (Util.SDK_INT < 24 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H265)) {
    // Pass.
    return;
  }
  String streamName = "test_h265_adaptive_with_seeking";
  testDashPlayback(getActivity(), streamName, SEEKING_SCHEDULE, false, H265_MANIFEST,
      AAC_AUDIO_REPRESENTATION_ID, false, MimeTypes.VIDEO_H265, ALLOW_ADDITIONAL_VIDEO_FORMATS,
      H265_CDD_ADAPTIVE);
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:11,代码来源:DashTest.java


示例19: testH265AdaptiveWithRendererDisabling

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
public void testH265AdaptiveWithRendererDisabling() throws DecoderQueryException {
  if (Util.SDK_INT < 24 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H265)) {
    // Pass.
    return;
  }
  String streamName = "test_h265_adaptive_with_renderer_disabling";
  testDashPlayback(getActivity(), streamName, RENDERER_DISABLING_SCHEDULE, false,
      H265_MANIFEST, AAC_AUDIO_REPRESENTATION_ID, false, MimeTypes.VIDEO_H265,
      ALLOW_ADDITIONAL_VIDEO_FORMATS, H265_CDD_ADAPTIVE);
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:11,代码来源:DashTest.java


示例20: testVp9Adaptive

import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; //导入依赖的package包/类
public void testVp9Adaptive() throws DecoderQueryException {
  if (Util.SDK_INT < 24 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_VP9)) {
    // Pass.
    return;
  }
  String streamName = "test_vp9_adaptive";
  testDashPlayback(getActivity(), streamName, VP9_MANIFEST, VORBIS_AUDIO_REPRESENTATION_ID, false,
      MimeTypes.VIDEO_VP9, ALLOW_ADDITIONAL_VIDEO_FORMATS, VP9_CDD_ADAPTIVE);
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:10,代码来源:DashTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Panel类代码示例发布时间:2022-05-23
下一篇:
Java Group类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap