Search in sources :

Example 86 with Surface

use of android.view.Surface in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class GesturePreference method onBindViewHolder.

@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
    super.onBindViewHolder(holder);
    if (!mAnimationAvailable) {
        return;
    }
    final TextureView video = (TextureView) holder.findViewById(R.id.gesture_video);
    final ImageView imageView = (ImageView) holder.findViewById(R.id.gesture_image);
    imageView.setImageResource(mPreviewResource);
    final ImageView playButton = (ImageView) holder.findViewById(R.id.gesture_play_button);
    video.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (mMediaPlayer != null) {
                if (mMediaPlayer.isPlaying()) {
                    mMediaPlayer.pause();
                    playButton.setVisibility(View.VISIBLE);
                } else {
                    mMediaPlayer.start();
                    playButton.setVisibility(View.GONE);
                }
            }
        }
    });
    video.setSurfaceTextureListener(new TextureView.SurfaceTextureListener() {

        @Override
        public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int width, int height) {
            if (mMediaPlayer != null) {
                mMediaPlayer.setSurface(new Surface(surfaceTexture));
                mVideoReady = false;
                mMediaPlayer.seekTo(0);
            }
        }

        @Override
        public void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int width, int height) {
        }

        @Override
        public boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture) {
            imageView.setVisibility(View.VISIBLE);
            return false;
        }

        @Override
        public void onSurfaceTextureUpdated(SurfaceTexture surfaceTexture) {
            if (mVideoReady && imageView.getVisibility() == View.VISIBLE) {
                imageView.setVisibility(View.GONE);
            } else if (mScrolling) {
                mScrolling = false;
                if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {
                    mMediaPlayer.pause();
                    playButton.setVisibility(View.VISIBLE);
                }
            }
            if (mMediaPlayer != null && !mMediaPlayer.isPlaying() && playButton.getVisibility() != View.VISIBLE) {
                playButton.setVisibility(View.VISIBLE);
            }
        }
    });
}
Also used : SurfaceTexture(android.graphics.SurfaceTexture) TextureView(android.view.TextureView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextureView(android.view.TextureView) View(android.view.View) Surface(android.view.Surface)

Example 87 with Surface

use of android.view.Surface in project XobotOS by xamarin.

the class EGLImpl method eglCreateWindowSurface.

public EGLSurface eglCreateWindowSurface(EGLDisplay display, EGLConfig config, Object native_window, int[] attrib_list) {
    Surface sur = null;
    if (native_window instanceof SurfaceView) {
        SurfaceView surfaceView = (SurfaceView) native_window;
        sur = surfaceView.getHolder().getSurface();
    } else if (native_window instanceof SurfaceHolder) {
        SurfaceHolder holder = (SurfaceHolder) native_window;
        sur = holder.getSurface();
    }
    int eglSurfaceId;
    if (sur != null) {
        eglSurfaceId = _eglCreateWindowSurface(display, config, sur, attrib_list);
    } else if (native_window instanceof SurfaceTexture) {
        eglSurfaceId = _eglCreateWindowSurfaceTexture(display, config, (SurfaceTexture) native_window, attrib_list);
    } else {
        throw new java.lang.UnsupportedOperationException("eglCreateWindowSurface() can only be called with an instance of " + "SurfaceView, SurfaceHolder or SurfaceTexture at the moment, " + "this will be fixed later.");
    }
    if (eglSurfaceId == 0) {
        return EGL10.EGL_NO_SURFACE;
    }
    return new EGLSurfaceImpl(eglSurfaceId);
}
Also used : SurfaceHolder(android.view.SurfaceHolder) SurfaceTexture(android.graphics.SurfaceTexture) SurfaceView(android.view.SurfaceView) Surface(android.view.Surface)

Example 88 with Surface

use of android.view.Surface in project cornerstone by Onskreen.

the class WindowManagerService method relayoutWindow.

public int relayoutWindow(Session session, IWindow client, int seq, WindowManager.LayoutParams attrs, int requestedWidth, int requestedHeight, int viewVisibility, int flags, Rect outFrame, Rect outContentInsets, Rect outVisibleInsets, Configuration outConfig, Surface outSurface) {
    boolean toBeDisplayed = false;
    boolean inTouchMode;
    boolean configChanged;
    boolean surfaceChanged = false;
    boolean animating;
    // if they don't have this permission, mask out the status bar bits
    int systemUiVisibility = 0;
    if (attrs != null) {
        systemUiVisibility = (attrs.systemUiVisibility | attrs.subtreeSystemUiVisibility);
        if ((systemUiVisibility & StatusBarManager.DISABLE_MASK) != 0) {
            if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.STATUS_BAR) != PackageManager.PERMISSION_GRANTED) {
                systemUiVisibility &= ~StatusBarManager.DISABLE_MASK;
            }
        }
    }
    long origId = Binder.clearCallingIdentity();
    synchronized (mWindowMap) {
        // TODO(cmautner): synchronize on mAnimator or win.mWinAnimator.
        WindowState win = windowForClientLocked(session, client, false);
        if (win == null) {
            return 0;
        }
        WindowStateAnimator winAnimator = win.mWinAnimator;
        if (win.mRequestedWidth != requestedWidth || win.mRequestedHeight != requestedHeight) {
            win.mLayoutNeeded = true;
            win.mRequestedWidth = requestedWidth;
            win.mRequestedHeight = requestedHeight;
        }
        if (attrs != null && seq == win.mSeq) {
            win.mSystemUiVisibility = systemUiVisibility;
        }
        if (attrs != null) {
            mPolicy.adjustWindowParamsLw(attrs);
        }
        winAnimator.mSurfaceDestroyDeferred = (flags & WindowManagerImpl.RELAYOUT_DEFER_SURFACE_DESTROY) != 0;
        int attrChanges = 0;
        int flagChanges = 0;
        if (attrs != null) {
            if (win.mAttrs.type != attrs.type) {
                throw new IllegalArgumentException("Window type can not be changed after the window is added.");
            }
            flagChanges = win.mAttrs.flags ^= attrs.flags;
            attrChanges = win.mAttrs.copyFrom(attrs);
            if ((attrChanges & (WindowManager.LayoutParams.LAYOUT_CHANGED | WindowManager.LayoutParams.SYSTEM_UI_VISIBILITY_CHANGED)) != 0) {
                win.mLayoutNeeded = true;
            }
        }
        if (DEBUG_LAYOUT)
            Slog.v(TAG, "Relayout " + win + ": " + win.mAttrs);
        win.mEnforceSizeCompat = (win.mAttrs.flags & FLAG_COMPATIBLE_WINDOW) != 0;
        if ((attrChanges & WindowManager.LayoutParams.ALPHA_CHANGED) != 0) {
            winAnimator.mAlpha = attrs.alpha;
        }
        final boolean scaledWindow = ((win.mAttrs.flags & WindowManager.LayoutParams.FLAG_SCALED) != 0);
        if (scaledWindow) {
            // requested{Width|Height} Surface's physical size
            // attrs.{width|height} Size on screen
            win.mHScale = (attrs.width != requestedWidth) ? (attrs.width / (float) requestedWidth) : 1.0f;
            win.mVScale = (attrs.height != requestedHeight) ? (attrs.height / (float) requestedHeight) : 1.0f;
        } else {
            win.mHScale = win.mVScale = 1;
        }
        boolean imMayMove = (flagChanges & (WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)) != 0;
        boolean focusMayChange = win.mViewVisibility != viewVisibility || ((flagChanges & WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE) != 0) || (!win.mRelayoutCalled);
        boolean wallpaperMayMove = win.mViewVisibility != viewVisibility && (win.mAttrs.flags & FLAG_SHOW_WALLPAPER) != 0;
        wallpaperMayMove |= (flagChanges & FLAG_SHOW_WALLPAPER) != 0;
        win.mRelayoutCalled = true;
        final int oldVisibility = win.mViewVisibility;
        win.mViewVisibility = viewVisibility;
        if (DEBUG_SCREEN_ON) {
            RuntimeException stack = new RuntimeException();
            stack.fillInStackTrace();
            Slog.i(TAG, "Relayout " + win + ": oldVis=" + oldVisibility + " newVis=" + viewVisibility, stack);
        }
        if (viewVisibility == View.VISIBLE && (win.mAppToken == null || !win.mAppToken.clientHidden)) {
            toBeDisplayed = !win.isVisibleLw();
            if (win.mExiting) {
                winAnimator.cancelExitAnimationForNextAnimationLocked();
                win.mExiting = false;
            }
            if (win.mDestroying) {
                win.mDestroying = false;
                mDestroySurface.remove(win);
            }
            if (oldVisibility == View.GONE) {
                winAnimator.mEnterAnimationPending = true;
            }
            if (toBeDisplayed) {
                if (win.isDrawnLw() && okToDisplay()) {
                    winAnimator.applyEnterAnimationLocked();
                }
                if ((win.mAttrs.flags & WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON) != 0) {
                    if (DEBUG_VISIBILITY)
                        Slog.v(TAG, "Relayout window turning screen on: " + win);
                    win.mTurnOnScreen = true;
                }
                int diff = 0;
                /**
                     * Author: Onskreen
                     * Date: 26/12/2011
                     *
                     * Do not consider the config changed if the Win is in a window panel unless the orientation is different.
                     * TODO this could backfire when other non orientation values change. we might need a config compare method
                     * that compares a WP config and mCurConfiguration exluding the WP specific values?
                     */
                if (//Only do special layout when Cornerstone is on
                mCornerstoneState != Cornerstone_State.TERMINATED && win.mAppToken != null && (win.mAppToken.isCornerstone || win.mAppToken.isInCornerstonePanelWindowPanel() || win.mAppToken.isInMainPanelWindowPanel())) {
                    /**
                         * Make sure that window had its configuration set by its WindowPanel. It's possible that
                         * it didn't when added if this is the first Window in the Panel
                         */
                    WindowPanel wp = findWindowPanel(win.mAppToken.groupId);
                    wp.updateConfiguration(true);
                    outConfig.setTo(wp.getConfiguration());
                    Rect rect = this.computeWindowPanelRect(wp, wp.getConfiguration().orientation, mCornerstoneState);
                    if (DEBUG_CORNERSTONE) {
                        Slog.v(TAG, "Relayout: " + wp);
                        Slog.v(TAG, "mCornerstoneStateChangeAnimating: " + this.mCornerstoneStateChangeAnimating);
                        Slog.v(TAG, "mCornerstoneStateChangeProcessing: " + this.mCornerstoneStateChangeProcessing);
                        Slog.v(TAG, "to rect: " + rect);
                    }
                    if (!mCornerstoneStateChangeAnimating || !wp.isCornerstonePanel()) {
                        if (DEBUG_CORNERSTONE) {
                            Slog.v(TAG, "Cornerstone not animating, or non cornerstone panel - reposition window panel frame");
                        }
                        wp.setFrame(rect);
                    } else {
                        if (DEBUG_CORNERSTONE) {
                            Slog.v(TAG, "Cornerstone animating - do not reposition window panel frame");
                        }
                    }
                    if (DEBUG_WP_CONFIG) {
                        Slog.v(TAG, "Ignoring diff in configuration for WindowPanel: " + win);
                        Slog.v(TAG, "with config: " + win.mConfiguration);
                    }
                } else {
                    if (win.mConfiguration != mCurConfiguration && (win.mConfiguration == null || (diff = mCurConfiguration.diff(win.mConfiguration)) != 0)) {
                        win.mConfiguration = mCurConfiguration;
                        if (DEBUG_CONFIGURATION) {
                            Slog.i(TAG, "Window " + win + " visible with new config: " + win.mConfiguration + " / 0x" + Integer.toHexString(diff));
                        }
                        outConfig.setTo(mCurConfiguration);
                    }
                }
            /** ORIGINAL IMPLEMENTATION**/
            /*if (win.mConfiguration != mCurConfiguration
                            && (win.mConfiguration == null
                                    || (diff=mCurConfiguration.diff(win.mConfiguration)) != 0)) {
                        win.mConfiguration = mCurConfiguration;
                        if (DEBUG_CONFIGURATION) {
                            Slog.i(TAG, "Window " + win + " visible with new config: "
                                    + win.mConfiguration + " / 0x"
                                    + Integer.toHexString(diff));
                        }
                        outConfig.setTo(mCurConfiguration);
                    }*/
            }
            if ((attrChanges & WindowManager.LayoutParams.FORMAT_CHANGED) != 0) {
                // To change the format, we need to re-build the surface.
                winAnimator.destroySurfaceLocked();
                toBeDisplayed = true;
                surfaceChanged = true;
            }
            try {
                if (!win.mHasSurface) {
                    surfaceChanged = true;
                }
                Surface surface = winAnimator.createSurfaceLocked();
                if (surface != null) {
                    outSurface.copyFrom(surface);
                    if (SHOW_TRANSACTIONS)
                        Slog.i(TAG, "  OUT SURFACE " + outSurface + ": copied");
                } else {
                    // For some reason there isn't a surface.  Clear the
                    // caller's object so they see the same state.
                    outSurface.release();
                }
            } catch (Exception e) {
                mInputMonitor.updateInputWindowsLw(true);
                Slog.w(TAG, "Exception thrown when creating surface for client " + client + " (" + win.mAttrs.getTitle() + ")", e);
                Binder.restoreCallingIdentity(origId);
                return 0;
            }
            if (toBeDisplayed) {
                focusMayChange = true;
            }
            if (win.mAttrs.type == TYPE_INPUT_METHOD && mInputMethodWindow == null) {
                mInputMethodWindow = win;
                imMayMove = true;
            }
            if (win.mAttrs.type == TYPE_BASE_APPLICATION && win.mAppToken != null && win.mAppToken.startingWindow != null) {
                // Special handling of starting window over the base
                // window of the app: propagate lock screen flags to it,
                // to provide the correct semantics while starting.
                final int mask = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON;
                WindowManager.LayoutParams sa = win.mAppToken.startingWindow.mAttrs;
                sa.flags = (sa.flags & ~mask) | (win.mAttrs.flags & mask);
            }
        } else {
            winAnimator.mEnterAnimationPending = false;
            if (winAnimator.mSurface != null) {
                if (DEBUG_VISIBILITY)
                    Slog.i(TAG, "Relayout invis " + win + ": mExiting=" + win.mExiting);
                // need to see about starting one.
                if (!win.mExiting) {
                    surfaceChanged = true;
                    // Try starting an animation; if there isn't one, we
                    // can destroy the surface right away.
                    int transit = WindowManagerPolicy.TRANSIT_EXIT;
                    if (win.mAttrs.type == TYPE_APPLICATION_STARTING) {
                        transit = WindowManagerPolicy.TRANSIT_PREVIEW_DONE;
                    }
                    if (win.isWinVisibleLw() && winAnimator.applyAnimationLocked(transit, false)) {
                        focusMayChange = true;
                        win.mExiting = true;
                    } else if (win.mWinAnimator.isAnimating()) {
                        // Currently in a hide animation... turn this into
                        // an exit.
                        win.mExiting = true;
                    } else if (win == mWallpaperTarget) {
                        // If the wallpaper is currently behind this
                        // window, we need to change both of them inside
                        // of a transaction to avoid artifacts.
                        win.mExiting = true;
                        win.mWinAnimator.mAnimating = true;
                    } else {
                        if (mInputMethodWindow == win) {
                            mInputMethodWindow = null;
                        }
                        winAnimator.destroySurfaceLocked();
                    }
                }
            }
            outSurface.release();
            if (DEBUG_VISIBILITY)
                Slog.i(TAG, "Releasing surface in: " + win);
        }
        if (focusMayChange) {
            //System.out.println("Focus may change: " + win.mAttrs.getTitle());
            if (updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES, false)) {
                imMayMove = false;
            }
        //System.out.println("Relayout " + win + ": focus=" + mCurrentFocus);
        }
        // updateFocusedWindowLocked() already assigned layers so we only need to
        // reassign them at this point if the IM window state gets shuffled
        boolean assignLayers = false;
        if (imMayMove) {
            if (moveInputMethodWindowsIfNeededLocked(false) || toBeDisplayed) {
                // Little hack here -- we -should- be able to rely on the
                // function to return true if the IME has moved and needs
                // its layer recomputed.  However, if the IME was hidden
                // and isn't actually moved in the list, its layer may be
                // out of data so we make sure to recompute it.
                assignLayers = true;
            }
        }
        if (wallpaperMayMove) {
            if ((adjustWallpaperWindowsLocked() & ADJUST_WALLPAPER_LAYERS_CHANGED) != 0) {
                assignLayers = true;
            }
        }
        mLayoutNeeded = true;
        win.mGivenInsetsPending = (flags & WindowManagerImpl.RELAYOUT_INSETS_PENDING) != 0;
        if (assignLayers) {
            assignLayersLocked();
        }
        configChanged = updateOrientationFromAppTokensLocked(false);
        performLayoutAndPlaceSurfacesLocked();
        if (toBeDisplayed && win.mIsWallpaper) {
            updateWallpaperOffsetLocked(win, mAppDisplayWidth, mAppDisplayHeight, false);
        }
        if (win.mAppToken != null) {
            win.mAppToken.updateReportedVisibilityLocked();
        }
        outFrame.set(win.mCompatFrame);
        outContentInsets.set(win.mContentInsets);
        outVisibleInsets.set(win.mVisibleInsets);
        if (localLOGV)
            Slog.v(TAG, "Relayout given client " + client.asBinder() + ", requestedWidth=" + requestedWidth + ", requestedHeight=" + requestedHeight + ", viewVisibility=" + viewVisibility + "\nRelayout returning frame=" + outFrame + ", surface=" + outSurface);
        if (localLOGV || DEBUG_FOCUS)
            Slog.v(TAG, "Relayout of " + win + ": focusMayChange=" + focusMayChange);
        inTouchMode = mInTouchMode;
        animating = mAnimator.mAnimating;
        if (animating && !mRelayoutWhileAnimating.contains(win)) {
            mRelayoutWhileAnimating.add(win);
        }
        mInputMonitor.updateInputWindowsLw(true);
    }
    if (configChanged) {
        sendNewConfiguration();
    }
    Binder.restoreCallingIdentity(origId);
    return (inTouchMode ? WindowManagerImpl.RELAYOUT_RES_IN_TOUCH_MODE : 0) | (toBeDisplayed ? WindowManagerImpl.RELAYOUT_RES_FIRST_TIME : 0) | (surfaceChanged ? WindowManagerImpl.RELAYOUT_RES_SURFACE_CHANGED : 0) | (animating ? WindowManagerImpl.RELAYOUT_RES_ANIMATING : 0);
}
Also used : Rect(android.graphics.Rect) Point(android.graphics.Point) RemoteException(android.os.RemoteException) IOException(java.io.IOException) FileNotFoundException(java.io.FileNotFoundException) XmlPullParserException(org.xmlpull.v1.XmlPullParserException) Surface(android.view.Surface) PhoneWindowManager(com.android.internal.policy.impl.PhoneWindowManager) IWindowManager(android.view.IWindowManager) WindowManager(android.view.WindowManager) LayoutParams(android.view.WindowManager.LayoutParams)

Example 89 with Surface

use of android.view.Surface in project cornerstone by Onskreen.

the class Session method performDrag.

public boolean performDrag(IWindow window, IBinder dragToken, float touchX, float touchY, float thumbCenterX, float thumbCenterY, ClipData data) {
    if (WindowManagerService.DEBUG_DRAG) {
        Slog.d(WindowManagerService.TAG, "perform drag: win=" + window + " data=" + data);
    }
    synchronized (mService.mWindowMap) {
        if (mService.mDragState == null) {
            Slog.w(WindowManagerService.TAG, "No drag prepared");
            throw new IllegalStateException("performDrag() without prepareDrag()");
        }
        if (dragToken != mService.mDragState.mToken) {
            Slog.w(WindowManagerService.TAG, "Performing mismatched drag");
            throw new IllegalStateException("performDrag() does not match prepareDrag()");
        }
        WindowState callingWin = mService.windowForClientLocked(null, window, false);
        if (callingWin == null) {
            Slog.w(WindowManagerService.TAG, "Bad requesting window " + window);
            // !!! TODO: throw here?
            return false;
        }
        // !!! TODO: if input is not still focused on the initiating window, fail
        // the drag initiation (e.g. an alarm window popped up just as the application
        // called performDrag()
        mService.mH.removeMessages(H.DRAG_START_TIMEOUT, window.asBinder());
        // !!! TODO: extract the current touch (x, y) in screen coordinates.  That
        // will let us eliminate the (touchX,touchY) parameters from the API.
        // !!! FIXME: put all this heavy stuff onto the mH looper, as well as
        // the actual drag event dispatch stuff in the dragstate
        mService.mDragState.register();
        mService.mInputMonitor.updateInputWindowsLw(true);
        if (!mService.mInputManager.transferTouchFocus(callingWin.mInputChannel, mService.mDragState.mServerChannel)) {
            Slog.e(WindowManagerService.TAG, "Unable to transfer touch focus");
            mService.mDragState.unregister();
            mService.mDragState = null;
            mService.mInputMonitor.updateInputWindowsLw(true);
            return false;
        }
        mService.mDragState.mData = data;
        mService.mDragState.mCurrentX = touchX;
        mService.mDragState.mCurrentY = touchY;
        mService.mDragState.broadcastDragStartedLw(touchX, touchY);
        // remember the thumb offsets for later
        mService.mDragState.mThumbOffsetX = thumbCenterX;
        mService.mDragState.mThumbOffsetY = thumbCenterY;
        // Make the surface visible at the proper location
        final Surface surface = mService.mDragState.mSurface;
        if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS)
            Slog.i(WindowManagerService.TAG, ">>> OPEN TRANSACTION performDrag");
        Surface.openTransaction();
        try {
            surface.setPosition(touchX - thumbCenterX, touchY - thumbCenterY);
            surface.setAlpha(.7071f);
            surface.setLayer(mService.mDragState.getDragLayerLw());
            surface.show();
        } finally {
            Surface.closeTransaction();
            if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS)
                Slog.i(WindowManagerService.TAG, "<<< CLOSE TRANSACTION performDrag");
        }
    }
    // success!
    return true;
}
Also used : Surface(android.view.Surface)

Example 90 with Surface

use of android.view.Surface in project GSYVideoPlayer by CarGuo.

the class CustomGSYVideoPlayer method addTextureView.

@Override
protected void addTextureView() {
    super.addTextureView();
    if (mPreviewLayout.getChildCount() > 0) {
        mPreviewLayout.removeAllViews();
    }
    mPreviewTexture = null;
    mPreviewTexture = new GSYTextureView(getContext());
    mPreviewTexture.setSurfaceTextureListener(new TextureView.SurfaceTextureListener() {

        @Override
        public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
            GSYPreViewManager.instance().setDisplay(new Surface(surface));
        }

        @Override
        public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {
        }

        @Override
        public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
            GSYPreViewManager.instance().setDisplay(null);
            return true;
        }

        @Override
        public void onSurfaceTextureUpdated(SurfaceTexture surface) {
        }
    });
    mPreviewTexture.setRotation(mRotate);
    RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
    mPreviewLayout.addView(mPreviewTexture, layoutParams);
}
Also used : SurfaceTexture(android.graphics.SurfaceTexture) RelativeLayout(android.widget.RelativeLayout) GSYTextureView(com.shuyu.gsyvideoplayer.GSYTextureView) GSYTextureView(com.shuyu.gsyvideoplayer.GSYTextureView) TextureView(android.view.TextureView) Surface(android.view.Surface)

Aggregations

Surface (android.view.Surface)300 ArrayList (java.util.ArrayList)100 SurfaceTexture (android.graphics.SurfaceTexture)49 BlockingSessionCallback (com.android.ex.camera2.blocking.BlockingSessionCallback)44 Size (android.util.Size)35 CaptureRequest (android.hardware.camera2.CaptureRequest)34 OutputConfiguration (android.hardware.camera2.params.OutputConfiguration)30 IOException (java.io.IOException)27 EGLSurface (android.opengl.EGLSurface)19 Paint (android.graphics.Paint)16 StreamConfigurationMap (android.hardware.camera2.params.StreamConfigurationMap)15 SurfaceHolder (android.view.SurfaceHolder)15 Rect (android.graphics.Rect)13 SurfaceView (android.view.SurfaceView)13 Canvas (android.graphics.Canvas)12 CameraAccessException (android.hardware.camera2.CameraAccessException)12 WifiDisplay (android.hardware.display.WifiDisplay)12 MediaRecorder (android.media.MediaRecorder)11 SurfaceControl (android.view.SurfaceControl)11 Image (android.media.Image)10