资源简介
详见http://blog.csdn.net/huaxun66/article/details/53367079
代码片段和文件信息
/*
* 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 android.util.Log;
import android.view.Surface;
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;
/**
* 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_CO
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 9128524 2016-11-29 14:43 Vitamio\vitamio\build\outputs\aar\vitamio-release.aar
文件 491 2016-11-28 11:24 Vitamio\vitamio\build.gradle
文件 74968 2015-02-06 13:30 Vitamio\vitamio\libs\armeabi\libvinit.so
文件 70876 2015-02-06 13:30 Vitamio\vitamio\libs\armeabi-v7a\libvinit.so
文件 140876 2015-02-06 13:30 Vitamio\vitamio\libs\mips\libvinit.so
文件 83092 2015-02-06 13:30 Vitamio\vitamio\libs\x86\libvinit.so
文件 1202 2015-02-06 13:30 Vitamio\vitamio\proguard-project.txt
文件 584 2015-02-06 13:30 Vitamio\vitamio\project.properties
文件 145 2015-02-06 13:30 Vitamio\vitamio\README.md
文件 441 2015-02-06 13:30 Vitamio\vitamio\res\drawable\mediacontroller_button.xm
文件 1091 2015-02-06 13:30 Vitamio\vitamio\res\drawable\scrubber_control_selector_holo.xm
文件 1203 2015-02-06 13:30 Vitamio\vitamio\res\drawable\scrubber_progress_horizontal_holo_dark.xm
文件 1162 2015-02-06 13:30 Vitamio\vitamio\res\drawable-xhdpi\mediacontroller_pause.png
文件 1622 2015-02-06 13:30 Vitamio\vitamio\res\drawable-xhdpi\mediacontroller_play.png
文件 1941 2015-02-06 13:30 Vitamio\vitamio\res\drawable-xhdpi\scrubber_control_disabled_holo.png
文件 2355 2015-02-06 13:30 Vitamio\vitamio\res\drawable-xhdpi\scrubber_control_focused_holo.png
文件 2634 2015-02-06 13:30 Vitamio\vitamio\res\drawable-xhdpi\scrubber_control_normal_holo.png
文件 3198 2015-02-06 13:30 Vitamio\vitamio\res\drawable-xhdpi\scrubber_control_pressed_holo.png
文件 1001 2015-02-06 13:30 Vitamio\vitamio\res\drawable-xhdpi\scrubber_primary_holo.9.png
文件 995 2015-02-06 13:30 Vitamio\vitamio\res\drawable-xhdpi\scrubber_secondary_holo.9.png
文件 184 2015-02-06 13:30 Vitamio\vitamio\res\drawable-xhdpi\scrubber_track_holo_dark.9.png
文件 2488 2015-02-06 13:30 Vitamio\vitamio\res\layout\mediacontroller.xm
文件 8823431 2015-02-06 13:30 Vitamio\vitamio\res\raw\libarm.so
文件 231 2015-02-06 13:30 Vitamio\vitamio\res\values\colors.xm
文件 1227 2015-02-06 13:30 Vitamio\vitamio\res\values\strings.xm
文件 928 2015-02-06 13:30 Vitamio\vitamio\res\values\st
文件 2800 2016-01-13 17:13 Vitamio\vitamio\src\io\vov\vitamio\activity\InitActivity.java
文件 10034 2016-01-13 17:13 Vitamio\vitamio\src\io\vov\vitamio\EGL.java
文件 1690 2015-02-06 13:30 Vitamio\vitamio\src\io\vov\vitamio\LibsChecker.java
文件 7200 2015-02-06 13:30 Vitamio\vitamio\src\io\vov\vitamio\MediaFile.java
............此处省略1041个文件信息
评论
共有 条评论