Vitamio视频播放器(二)

大概的流程:

Vitamio视频播放器(二)_第1张图片


在Activity的oncreate()方法中,有:

if (!LibsChecker.checkVitamioLibs(this))
			return;
就是执行检测初始化的过程了。


在Vitamio类中:

private static final String[] LIBS_ARM_CODECS = {"libvvo.7.so", "libvvo.8.so", "libffmpeg.so", "libOMX.9.so", "libOMX.11.so", "libOMX.14.so", "libOMX.18.so"};
  private static final String[] LIBS_X86_CODECS = {"libffmpeg.so", "libOMX.9.so", "libOMX.14.so", "libOMX.18.so"};
  private static final String[] LIBS_MIPS_CODECS = {"libffmpeg.so", "libOMX.14.so"};
  private static final String[] LIBS_PLAYER = {"libvplayer.so"};
  private static final String[] LIBS_SCANNER = {"libvscanner.so"};
  private static final String[] LIBS_AV = {"libvao.0.so", "libvvo.0.so", "libvvo.9.so", "libvvo.j.so"};
虽然引用的解码文件挺多的,作者还是提供了给我们自己添加三方解码的接口 :

 private native static boolean native_initializeLibs(String libPath, String destDir, String prefix);


在setVideoLayout()中:

 if (VIDEO_LAYOUT_ORIGIN == layout && mSurfaceWidth < windowWidth && mSurfaceHeight < windowHeight) {
      lp.width = (int) (mSurfaceHeight * videoRatio);
      lp.height = mSurfaceHeight;
    } else if (layout == VIDEO_LAYOUT_ZOOM) {
      lp.width = windowRatio > videoRatio ? windowWidth : (int) (videoRatio * windowHeight);
      lp.height = windowRatio < videoRatio ? windowHeight : (int) (windowWidth / videoRatio);
    } else {
      boolean full = layout == VIDEO_LAYOUT_STRETCH;
      lp.width = (full || windowRatio < videoRatio) ? windowWidth : (int) (videoRatio * windowHeight);
      lp.height = (full || windowRatio > videoRatio) ? windowHeight : (int) (windowWidth / videoRatio);
    }
根据宽高比,来计算屏幕,了解下。


关于硬件那部分:

Vitamio视频播放器(二)_第2张图片

不在行,有兴趣的童鞋可以去仔细看看。


好吧。大概就说到这吧。

你可能感兴趣的:(Vitamio)