Java Code Examples for org.videolan.libvlc.util.AndroidUtil#isJellyBeanOrLater()

The following examples show how to use org.videolan.libvlc.util.AndroidUtil#isJellyBeanOrLater() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AWindow.java    From libvlc-android-sdk with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Override
@MainThread
public void detachViews() {
    if (mSurfacesState.get() == SURFACE_STATE_INIT)
        return;

    mSurfacesState.set(SURFACE_STATE_INIT);
    mHandler.removeCallbacksAndMessages(null);
    synchronized (mNativeLock) {
        mOnNewVideoLayoutListener = null;
        mNativeLock.buffersGeometryAbort = true;
        mNativeLock.notifyAll();
    }
    for (int id = 0; id < ID_MAX; ++id) {
        final SurfaceHelper surfaceHelper = mSurfaceHelpers[id];
        if (surfaceHelper != null)
            surfaceHelper.release();
        mSurfaceHelpers[id] = null;
    }
    for (IVLCVout.Callback cb : mIVLCVoutCallbacks)
        cb.onSurfacesDestroyed(this);
    if (mSurfaceCallback != null)
        mSurfaceCallback.onSurfacesDestroyed(this);
    if (AndroidUtil.isJellyBeanOrLater)
        mSurfaceTextureThread.release();
}
 
Example 2
Source File: AWindow.java    From OTTLivePlayer_vlc with MIT License 6 votes vote down vote up
@Override
@MainThread
public void detachViews() {
    if (mSurfacesState.get() == SURFACE_STATE_INIT)
        return;

    mSurfacesState.set(SURFACE_STATE_INIT);
    mHandler.removeCallbacksAndMessages(null);
    synchronized (mNativeLock) {
        mOnNewVideoLayoutListener = null;
        mNativeLock.buffersGeometryAbort = true;
        mNativeLock.notifyAll();
    }
    for (int id = 0; id < ID_MAX; ++id) {
        final SurfaceHelper surfaceHelper = mSurfaceHelpers[id];
        if (surfaceHelper != null)
            surfaceHelper.release();
        mSurfaceHelpers[id] = null;
    }
    for (IVLCVout.Callback cb : mIVLCVoutCallbacks)
        cb.onSurfacesDestroyed(this);
    if (mSurfaceCallback != null)
        mSurfaceCallback.onSurfacesDestroyed(this);
    if (AndroidUtil.isJellyBeanOrLater)
        mSurfaceTextureThread.release();
}
 
Example 3
Source File: AWindow.java    From OTTLivePlayer_vlc with MIT License 6 votes vote down vote up
@Override
@MainThread
public void detachViews() {
    if (mSurfacesState.get() == SURFACE_STATE_INIT)
        return;

    mSurfacesState.set(SURFACE_STATE_INIT);
    mHandler.removeCallbacksAndMessages(null);
    synchronized (mNativeLock) {
        mOnNewVideoLayoutListener = null;
        mNativeLock.buffersGeometryAbort = true;
        mNativeLock.notifyAll();
    }
    for (int id = 0; id < ID_MAX; ++id) {
        final SurfaceHelper surfaceHelper = mSurfaceHelpers[id];
        if (surfaceHelper != null)
            surfaceHelper.release();
        mSurfaceHelpers[id] = null;
    }
    for (IVLCVout.Callback cb : mIVLCVoutCallbacks)
        cb.onSurfacesDestroyed(this);
    if (mSurfaceCallback != null)
        mSurfaceCallback.onSurfacesDestroyed(this);
    if (AndroidUtil.isJellyBeanOrLater)
        mSurfaceTextureThread.release();
}
 
Example 4
Source File: AWindow.java    From vlc-example-streamplayer with GNU General Public License v3.0 6 votes vote down vote up
@Override
@MainThread
public void detachViews() {
    if (mSurfacesState.get() == SURFACE_STATE_INIT)
        return;

    mSurfacesState.set(SURFACE_STATE_INIT);
    mHandler.removeCallbacksAndMessages(null);
    synchronized (mNativeLock) {
        mOnNewVideoLayoutListener = null;
        mNativeLock.buffersGeometryAbort = true;
        mNativeLock.notifyAll();
    }
    for (int id = 0; id < ID_MAX; ++id) {
        final SurfaceHelper surfaceHelper = mSurfaceHelpers[id];
        if (surfaceHelper != null)
            surfaceHelper.release();
        mSurfaceHelpers[id] = null;
    }
    for (IVLCVout.Callback cb : mIVLCVoutCallbacks)
        cb.onSurfacesDestroyed(this);
    if (mSurfaceCallback != null)
        mSurfaceCallback.onSurfacesDestroyed(this);
    if (AndroidUtil.isJellyBeanOrLater)
        mSurfaceTextureThread.release();
}
 
Example 5
Source File: VideoPlayerActivity.java    From VCL-Android with Apache License 2.0 5 votes vote down vote up
/**
 * Dim the status bar and/or navigation icons when needed on Android 3.x.
 * Hide it on Android 4.0 and later
 */
@TargetApi(Build.VERSION_CODES.KITKAT)
private void dimStatusBar(boolean dim) {
    if (!AndroidUtil.isHoneycombOrLater() || mIsNavMenu)
        return;
    int visibility = 0;
    int navbar = 0;

    if (!AndroidDevices.hasCombBar() && AndroidUtil.isJellyBeanOrLater()) {
        visibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
        navbar = View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
    }
    visibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
    if (dim || mIsLocked) {
        navbar |= View.SYSTEM_UI_FLAG_LOW_PROFILE;
        if (!AndroidDevices.hasCombBar()) {
            navbar |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
            if (AndroidUtil.isKitKatOrLater())
                visibility |= View.SYSTEM_UI_FLAG_IMMERSIVE;
            visibility |= View.SYSTEM_UI_FLAG_FULLSCREEN;
        }
    }
    if (!dim) {
        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        visibility |= View.SYSTEM_UI_FLAG_VISIBLE;
    }

    if (AndroidDevices.hasNavBar())
        visibility |= navbar;
    getWindow().getDecorView().setSystemUiVisibility(visibility);
}
 
Example 6
Source File: AWindow.java    From libvlc-android-sdk with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
 * Attach the SurfaceTexture to the OpenGL ES context that is current on the calling thread.
 *
 * @param texName the OpenGL texture object name (e.g. generated via glGenTextures)
 * @return true in case of success
 */
@SuppressWarnings("unused") /* used by JNI */
boolean SurfaceTexture_attachToGLContext(int texName) {
    return AndroidUtil.isJellyBeanOrLater && mSurfaceTextureThread.attachToGLContext(texName);
}
 
Example 7
Source File: AWindow.java    From OTTLivePlayer_vlc with MIT License 2 votes vote down vote up
/**
 * Attach the SurfaceTexture to the OpenGL ES context that is current on the calling thread.
 *
 * @param texName the OpenGL texture object name (e.g. generated via glGenTextures)
 * @return true in case of success
 */
@SuppressWarnings("unused") /* used by JNI */
boolean SurfaceTexture_attachToGLContext(int texName) {
    return AndroidUtil.isJellyBeanOrLater && mSurfaceTextureThread.attachToGLContext(texName);
}
 
Example 8
Source File: AWindow.java    From OTTLivePlayer_vlc with MIT License 2 votes vote down vote up
/**
 * Attach the SurfaceTexture to the OpenGL ES context that is current on the calling thread.
 *
 * @param texName the OpenGL texture object name (e.g. generated via glGenTextures)
 * @return true in case of success
 */
@SuppressWarnings("unused") /* used by JNI */
boolean SurfaceTexture_attachToGLContext(int texName) {
    return AndroidUtil.isJellyBeanOrLater && mSurfaceTextureThread.attachToGLContext(texName);
}
 
Example 9
Source File: AWindow.java    From vlc-example-streamplayer with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Attach the SurfaceTexture to the OpenGL ES context that is current on the calling thread.
 *
 * @param texName the OpenGL texture object name (e.g. generated via glGenTextures)
 * @return true in case of success
 */
@SuppressWarnings("unused") /* used by JNI */
boolean SurfaceTexture_attachToGLContext(int texName) {
    return AndroidUtil.isJellyBeanOrLater && mSurfaceTextureThread.attachToGLContext(texName);
}