资源简介
vitamio开源源码,使用只做自己的视频播放器,接口都有。
代码片段和文件信息
/*
* Copyright (C) 2013 YIXIA.COM
*
* Licensed under the Apache License Version 2.0 (the “License“);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.vov.vitamio;
import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGL11;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLContext;
import javax.microedition.khronos.egl.EGLDisplay;
import javax.microedition.khronos.egl.EGLSurface;
import javax.microedition.khronos.opengles.GL;
import android.util.Log;
import android.view.Surface;
/**
* DON‘T MODIFY THIS FILE IF YOU‘RE NOT FAMILIAR WITH EGL IT‘S USED BY NATIVE CODE!!!
*/
public class EGL {
private EGL10 mEgl;
private EGLDisplay mEglDisplay;
private EGLSurface mEglSurface;
private EGLConfig mEglConfig;
private EGLContext mEglContext;
private EGLConfigChooser mEGLConfigChooser;
private EGLContextFactory mEGLContextFactory;
private EGLWindowSurfaceFactory mEGLWindowSurfaceFactory;
public EGL() {
mEGLConfigChooser = new SimpleEGLConfigChooser();
mEGLContextFactory = new EGLContextFactory();
mEGLWindowSurfaceFactory = new EGLWindowSurfaceFactory();
}
public boolean initialize(Surface surface) {
start();
return createSurface(surface) != null;
}
public void release() {
destroySurface();
finish();
}
public void start() {
mEgl = (EGL10) EGLContext.getEGL();
mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
if (mEglDisplay == EGL10.EGL_NO_DISPLAY) {
throw new RuntimeException(“eglGetDisplay failed“);
}
int[] version = new int[2];
if (!mEgl.eglInitialize(mEglDisplay version)) {
throw new RuntimeException(“eglInitialize failed“);
}
mEglConfig = mEGLConfigChooser.chooseConfig(mEgl mEglDisplay);
mEglContext = mEGLContextFactory.createContext(mEgl mEglDisplay mEglConfig);
if (mEglContext == null || mEglContext == EGL10.EGL_NO_CONTEXT) {
mEglContext = null;
throwEglException(“createContext“);
}
mEglSurface = null;
}
public GL createSurface(Surface surface) {
if (mEgl == null)
throw new RuntimeException(“egl not initialized“);
if (mEglDisplay == null)
throw new RuntimeException(“eglDisplay not initialized“);
if (mEglConfig == null)
throw new RuntimeException(“mEglConfig not initialized“);
if (mEglSurface != null && mEglSurface != EGL10.EGL_NO_SURFACE) {
mEgl.eglMakeCurrent(mEglDisplay EGL10.EGL_NO_SURFACE EGL10.EGL_NO_SURFACE EGL10.EGL_NO_CON
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-02-06 05:30 VitamioBundle-master\
文件 289 2015-02-06 05:30 VitamioBundle-master\.gitignore
文件 2874 2015-02-06 05:30 VitamioBundle-master\CHANGELOG.md
文件 1456 2015-02-06 05:30 VitamioBundle-master\LICENSE
文件 1527 2015-02-06 05:30 VitamioBundle-master\README.md
文件 259 2015-02-06 05:30 VitamioBundle-master\build.gradle
目录 0 2015-02-06 05:30 VitamioBundle-master\dist\
目录 0 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86\
目录 0 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86\libs\
目录 0 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86\libs\armeabi-v7a\
文件 70876 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86\libs\armeabi-v7a\libvinit.so
目录 0 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86\libs\armeabi\
文件 74968 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86\libs\armeabi\libvinit.so
目录 0 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86\libs\x86\
文件 83092 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86\libs\x86\libvinit.so
目录 0 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86\res\
目录 0 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86\res\raw\
文件 12720124 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86\res\raw\libarm.so
目录 0 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86_mips\
目录 0 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86_mips\libs\
目录 0 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86_mips\libs\armeabi-v7a\
文件 70876 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86_mips\libs\armeabi-v7a\libvinit.so
目录 0 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86_mips\libs\armeabi\
文件 74968 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86_mips\libs\armeabi\libvinit.so
目录 0 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86_mips\libs\mips\
文件 140876 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86_mips\libs\mips\libvinit.so
目录 0 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86_mips\libs\x86\
文件 83092 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86_mips\libs\x86\libvinit.so
目录 0 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86_mips\res\
目录 0 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86_mips\res\raw\
文件 17774133 2015-02-06 05:30 VitamioBundle-master\dist\arm_x86_mips\res\raw\libarm.so
............此处省略137个文件信息
评论
共有 条评论