Java Code Examples for android.graphics.SurfaceTexture

The following are top voted examples for showing how to use android.graphics.SurfaceTexture. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: ListVideoPlayer   File: MediaManager.java   Source Code and License 7 votes vote down vote up
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int i, int i1) {
    Log.i(TAG, "onSurfaceTextureAvailable [" + this.hashCode() + "] ");
    if (savedSurfaceTexture == null) {
        savedSurfaceTexture = surfaceTexture;
        prepare();
    } else {
        textureView.setSurfaceTexture(savedSurfaceTexture);
    }
}
 
Example 2
Project: TK_1701   File: Camera2.java   Source Code and License 6 votes vote down vote up
public void open() {
    try {
        CameraManager manager = (CameraManager) mActivity.getSystemService(Context.CAMERA_SERVICE);
        for (String cameraId : manager.getCameraIdList()) {
            CameraCharacteristics characteristics = manager.getCameraCharacteristics(cameraId);
            if (characteristics.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_BACK) {
                StreamConfigurationMap map = characteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
                mCameraSize = map.getOutputSizes(SurfaceTexture.class)[0];

                HandlerThread thread = new HandlerThread("OpenCamera");
                thread.start();
                Handler backgroundHandler = new Handler(thread.getLooper());

                manager.openCamera(cameraId, mCameraDeviceCallback, null);

                // カメラの物理的な情報を得る
                mCameraCharacteristics = manager.getCameraCharacteristics( cameraId );
                return;
            }
        }
    } catch (CameraAccessException e) {
        e.printStackTrace();
    }
}
 
Example 3
Project: VideoCRE   File: Camera2Session.java   Source Code and License 6 votes vote down vote up
@Override
public void onOpened(CameraDevice camera) {
  checkIsOnCameraThread();

  Logging.d(TAG, "Camera opened.");
  cameraDevice = camera;

  final SurfaceTexture surfaceTexture = surfaceTextureHelper.getSurfaceTexture();
  surfaceTexture.setDefaultBufferSize(captureFormat.width, captureFormat.height);
  surface = new Surface(surfaceTexture);
  List<Surface> surfaces = new ArrayList<Surface>();
  surfaces.add(surface);
  if (mediaRecorderSurface != null) {
    Logging.d(TAG, "Add MediaRecorder surface to capture session.");
    surfaces.add(mediaRecorderSurface);
  }
  try {
    camera.createCaptureSession(surfaces, new CaptureSessionCallback(), cameraThreadHandler);
  } catch (CameraAccessException e) {
    reportError("Failed to create capture session. " + e);
    return;
  }
}
 
Example 4
Project: AAVT   File: Mp4Provider.java   Source Code and License 6 votes vote down vote up
@Override
public Point open(SurfaceTexture surface) {
    try {
        if(!extractMedia()){
            return new Point(0,0);
        }
        mFrameSem=new Semaphore(0);
        mDecodeSem=new Semaphore(1);
        videoProvideEndFlag=false;
        isUserWantToStop=false;
        mAudioEncodeTrack=mStore.addTrack(mExtractor.getTrackFormat(mAudioDecodeTrack));
        MediaFormat format=mExtractor.getTrackFormat(mVideoDecodeTrack);
        mVideoDecoder = MediaCodec.createDecoderByType(format.getString(MediaFormat.KEY_MIME));
        mVideoDecoder.configure(format,new Surface(surface),null,0);
        mVideoDecoder.start();
        startDecodeThread();
    } catch (IOException e) {
        e.printStackTrace();
    }
    return mVideoSize;
}
 
Example 5
Project: GestureVideoView   File: TextureRenderView.java   Source Code and License 6 votes vote down vote up
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public void bindToMediaPlayer(IMediaPlayer mp) {
    if (mp == null)
        return;

    if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) &&
            (mp instanceof ISurfaceTextureHolder)) {
        ISurfaceTextureHolder textureHolder = (ISurfaceTextureHolder) mp;
        mTextureView.mSurfaceCallback.setOwnSurfaceTexture(false);

        SurfaceTexture surfaceTexture = textureHolder.getSurfaceTexture();
        if (surfaceTexture != null) {
            mTextureView.setSurfaceTexture(surfaceTexture);
        } else {
            textureHolder.setSurfaceTexture(mSurfaceTexture);
            textureHolder.setSurfaceTextureHost(mTextureView.mSurfaceCallback);
        }
    } else {
        mp.setSurface(openSurface());
    }
}
 
Example 6
Project: ShaddockVideoPlayer   File: TextureRenderView.java   Source Code and License 6 votes vote down vote up
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public void bindToMediaPlayer(IMediaPlayer mp) {
    if (mp == null)
        return;

    if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) &&
            (mp instanceof ISurfaceTextureHolder)) {
        ISurfaceTextureHolder textureHolder = (ISurfaceTextureHolder) mp;
        mTextureView.mSurfaceCallback.setOwnSurfaceTexture(false);

        SurfaceTexture surfaceTexture = textureHolder.getSurfaceTexture();
        if (surfaceTexture != null) {
            mTextureView.setSurfaceTexture(surfaceTexture);
        } else {
            textureHolder.setSurfaceTexture(mSurfaceTexture);
            textureHolder.setSurfaceTextureHost(mTextureView.mSurfaceCallback);
        }
    } else {
        mp.setSurface(openSurface());
    }
}
 
Example 7
Project: EZFilter   File: EGLEnvironment.java   Source Code and License 5 votes vote down vote up
EglSurface(final EGLEnvironment egl, final Object surface) {
    if (!(surface instanceof SurfaceView)
            && !(surface instanceof Surface)
            && !(surface instanceof SurfaceHolder)
            && !(surface instanceof SurfaceTexture))
        throw new IllegalArgumentException("unsupported surface");
    mEgl = egl;
    mEglSurface = mEgl.createWindowSurface(surface);
    mWidth = mEgl.querySurface(mEglSurface, EGL14.EGL_WIDTH);
    mHeight = mEgl.querySurface(mEglSurface, EGL14.EGL_HEIGHT);
}
 
Example 8
Project: NSMPlayer-Android   File: TextureRenderView.java   Source Code and License 5 votes vote down vote up
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
    mSurfaceTexture = surface;
    mIsFormatChanged = false;
    mWidth = 0;
    mHeight = 0;

    ISurfaceHolder surfaceHolder = new InternalSurfaceHolder(mWeakRenderView.get(), surface);
    for (IRenderCallback renderCallback : mRenderCallbackMap.keySet()) {
        renderCallback.onSurfaceCreated(surfaceHolder, 0, 0);
    }
}
 
Example 9
Project: OkayCamera-Android   File: Camera2RawFragment.java   Source Code and License 5 votes vote down vote up
@Override
public boolean onSurfaceTextureDestroyed(SurfaceTexture texture) {
    synchronized (mCameraStateLock) {
        mPreviewSize = null;
    }
    return true;
}
 
Example 10
Project: react-native-scan-doc   File: CameraGLRendererBase.java   Source Code and License 5 votes vote down vote up
private void initSurfaceTexture() {
    Log.d(LOGTAG, "initSurfaceTexture");
    deleteSurfaceTexture();
    initTexOES(texCamera);
    mSTexture = new SurfaceTexture(texCamera[0]);
    mSTexture.setOnFrameAvailableListener(this);
}
 
Example 11
Project: BLPlayer   File: TextureRenderView.java   Source Code and License 5 votes vote down vote up
public InternalSurfaceHolder(@NonNull TextureRenderView textureView,
                             @Nullable SurfaceTexture surfaceTexture,
                             @NonNull ISurfaceTextureHost surfaceTextureHost) {
    mTextureView = textureView;
    mSurfaceTexture = surfaceTexture;
    mSurfaceTextureHost = surfaceTextureHost;
}
 
Example 12
Project: EyeShopping   File: CameraGLRendererBase.java   Source Code and License 5 votes vote down vote up
private void initSurfaceTexture() {
    Log.d(LOGTAG, "initSurfaceTexture");
    deleteSurfaceTexture();
    initTexOES(texCamera);
    mSTexture = new SurfaceTexture(texCamera[0]);
    mSTexture.setOnFrameAvailableListener(this);
}
 
Example 13
Project: Exoplayer2Radio   File: SimpleExoPlayer.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the {@link TextureView} onto which video will be rendered. The player will track the
 * lifecycle of the surface automatically.
 *
 * @param textureView The texture view.
 */
public void setVideoTextureView(TextureView textureView) {
  removeSurfaceCallbacks();
  this.textureView = textureView;
  if (textureView == null) {
    setVideoSurfaceInternal(null, true);
  } else {
    if (textureView.getSurfaceTextureListener() != null) {
      Log.w(TAG, "Replacing existing SurfaceTextureListener.");
    }
    SurfaceTexture surfaceTexture = textureView.getSurfaceTexture();
    setVideoSurfaceInternal(surfaceTexture == null ? null : new Surface(surfaceTexture), true);
    textureView.setSurfaceTextureListener(componentListener);
  }
}
 
Example 14
Project: MediaCodecRecorder   File: RecordingActivity.java   Source Code and License 5 votes vote down vote up
@Override
public void onCameraSurfaceDestroy(SurfaceTexture surfaceTexture) {
    Log.d(TAG, "onCameraSurfaceDestroy");
    isSurfaceReady = false;
    mCamera.stopPreview();
    mCamera.release();
    if (mVideoRecorder.isRecording()) {
        mVideoRecorder.stop();
    }
}
 
Example 15
Project: Team9261-2017-2018   File: CameraGLRendererBase.java   Source Code and License 5 votes vote down vote up
private void initSurfaceTexture() {
    Log.d(LOGTAG, "initSurfaceTexture");
    deleteSurfaceTexture();
    initTexOES(texCamera);
    mSTexture = new SurfaceTexture(texCamera[0]);
    mSTexture.setOnFrameAvailableListener(this);
}
 
Example 16
Project: GitHub   File: TextureRenderView.java   Source Code and License 5 votes vote down vote up
@Override
public void releaseSurfaceTexture(SurfaceTexture surfaceTexture) {
    if (surfaceTexture == null) {
        Log.d(TAG, "releaseSurfaceTexture: null");
    } else if (mDidDetachFromWindow) {
        if (surfaceTexture != mSurfaceTexture) {
            Log.d(TAG, "releaseSurfaceTexture: didDetachFromWindow(): release different SurfaceTexture");
            surfaceTexture.release();
        } else if (!mOwnSurfaceTexture) {
            Log.d(TAG, "releaseSurfaceTexture: didDetachFromWindow(): release detached SurfaceTexture");
            surfaceTexture.release();
        } else {
            Log.d(TAG, "releaseSurfaceTexture: didDetachFromWindow(): already released by TextureView");
        }
    } else if (mWillDetachFromWindow) {
        if (surfaceTexture != mSurfaceTexture) {
            Log.d(TAG, "releaseSurfaceTexture: willDetachFromWindow(): release different SurfaceTexture");
            surfaceTexture.release();
        } else if (!mOwnSurfaceTexture) {
            Log.d(TAG, "releaseSurfaceTexture: willDetachFromWindow(): re-attach SurfaceTexture to TextureView");
            setOwnSurfaceTexture(true);
        } else {
            Log.d(TAG, "releaseSurfaceTexture: willDetachFromWindow(): will released by TextureView");
        }
    } else {
        if (surfaceTexture != mSurfaceTexture) {
            Log.d(TAG, "releaseSurfaceTexture: alive: release different SurfaceTexture");
            surfaceTexture.release();
        } else if (!mOwnSurfaceTexture) {
            Log.d(TAG, "releaseSurfaceTexture: alive: re-attach SurfaceTexture to TextureView");
            setOwnSurfaceTexture(true);
        } else {
            Log.d(TAG, "releaseSurfaceTexture: alive: will released by TextureView");
        }
    }
}
 
Example 17
Project: PaoMovie   File: CameraEngine.java   Source Code and License 5 votes vote down vote up
public static void startPreview(SurfaceTexture surfaceTexture){
	try {
		mCamera.setPreviewTexture(surfaceTexture);
		mCamera.startPreview();
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}	
}
 
Example 18
Project: real_time_circle_detection_android   File: CameraGLRendererBase.java   Source Code and License 5 votes vote down vote up
private void initSurfaceTexture() {
    Log.d(LOGTAG, "initSurfaceTexture");
    deleteSurfaceTexture();
    initTexOES(texCamera);
    mSTexture = new SurfaceTexture(texCamera[0]);
    mSTexture.setOnFrameAvailableListener(this);
}
 
Example 19
Project: mao-android   File: VideoPlayFragment.java   Source Code and License 5 votes vote down vote up
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
    GLES20.glClearColor(0.0f, 1.0f, 0.0f, 0.0f);
    GLES20.glDisable(GLES20.GL_DEPTH_TEST);
    mTexture = OpenGLUtils.genOesTexture();
    mGLImageView.setImageTexture(mTexture);

    mSurfaceTexture = new SurfaceTexture(mTexture);
    mSurfaceTexture.setOnFrameAvailableListener(this);
    mVideoPlayer.setOutSurface(new Surface(mSurfaceTexture));
}
 
Example 20
Project: airgram   File: VideoEditorActivity.java   Source Code and License 5 votes vote down vote up
@Override
public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
    if (videoPlayer == null) {
        return true;
    }
    videoPlayer.setDisplay(null);
    return true;
}
 
Example 21
Project: BLPlayer   File: TextureRenderView.java   Source Code and License 5 votes vote down vote up
@Override
public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
    mSurfaceTexture = surface;
    mIsFormatChanged = false;
    mWidth = 0;
    mHeight = 0;

    ISurfaceHolder surfaceHolder = new InternalSurfaceHolder(mWeakRenderView.get(), surface, this);
    for (IRenderCallback renderCallback : mRenderCallbackMap.keySet()) {
        renderCallback.onSurfaceDestroyed(surfaceHolder);
    }

    Log.d(TAG, "onSurfaceTextureDestroyed: destroy: " + mOwnSurfaceTexture);
    return mOwnSurfaceTexture;
}
 
Example 22
Project: PlayerBase   File: TextureRenderView.java   Source Code and License 5 votes vote down vote up
@Override
public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
    mSurfaceTexture = surface;
    mIsFormatChanged = false;
    mWidth = 0;
    mHeight = 0;

    ISurfaceHolder surfaceHolder = new InternalSurfaceHolder(mWeakRenderView.get(), surface, this);
    for (IRenderCallback renderCallback : mRenderCallbackMap.keySet()) {
        renderCallback.onSurfaceDestroyed(surfaceHolder);
    }

    Log.d(TAG, "onSurfaceTextureDestroyed: destroy: " + mOwnSurfaceTexture);
    return mOwnSurfaceTexture;
}
 
Example 23
Project: AndroidTvDemo   File: TextureRenderView.java   Source Code and License 5 votes vote down vote up
@Override
public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height)
{
    mSurfaceTexture = surface;
    mIsFormatChanged = true;
    mWidth = width;
    mHeight = height;
    
    ISurfaceHolder surfaceHolder = new InternalSurfaceHolder(mWeakRenderView.get(), surface, this);
    for (IRenderCallback renderCallback : mRenderCallbackMap.keySet())
    {
        renderCallback.onSurfaceChanged(surfaceHolder, 0, width, height);
    }
}
 
Example 24
Project: boohee_v5.6   File: TextureRenderView.java   Source Code and License 5 votes vote down vote up
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
    this.mSurfaceTexture = surface;
    this.mIsFormatChanged = false;
    this.mWidth = 0;
    this.mHeight = 0;
    ISurfaceHolder surfaceHolder = new InternalSurfaceHolder((TextureRenderView) this
            .mWeakRenderView.get(), surface, this);
    for (IRenderCallback renderCallback : this.mRenderCallbackMap.keySet()) {
        renderCallback.onSurfaceCreated(surfaceHolder, 0, 0);
    }
}
 
Example 25
Project: MOAAP   File: CameraGLRendererBase.java   Source Code and License 5 votes vote down vote up
private void initSurfaceTexture() {
    Log.d(LOGTAG, "initSurfaceTexture");
    deleteSurfaceTexture();
    initTexOES(texCamera);
    mSTexture = new SurfaceTexture(texCamera[0]);
    mSTexture.setOnFrameAvailableListener(this);
}
 
Example 26
Project: trust-wallet-android   File: CameraSource.java   Source Code and License 5 votes vote down vote up
/**
 * Opens the camera and starts sending preview frames to the underlying detector.  The preview
 * frames are not displayed.
 *
 * @throws IOException if the camera's preview texture or display could not be initialized
 */
@RequiresPermission(Manifest.permission.CAMERA)
public CameraSource start() throws IOException {
    synchronized (mCameraLock) {
        if (mCamera != null) {
            return this;
        }

        mCamera = createCamera();

        // SurfaceTexture was introduced in Honeycomb (11), so if we are running and
        // old version of Android. fall back to use SurfaceView.
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            mDummySurfaceTexture = new SurfaceTexture(DUMMY_TEXTURE_NAME);
            mCamera.setPreviewTexture(mDummySurfaceTexture);
        } else {
            mDummySurfaceView = new SurfaceView(mContext);
            mCamera.setPreviewDisplay(mDummySurfaceView.getHolder());
        }
        mCamera.startPreview();

        mProcessingThread = new Thread(mFrameProcessor);
        mFrameProcessor.setActive(true);
        mProcessingThread.start();
    }
    return this;
}
 
Example 27
Project: Agora-Screen-Sharing-Android   File: GLRender.java   Source Code and License 5 votes vote down vote up
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
    Log.d(TAG, "onSurfaceTextureAvailable " + surface + " " + width + " " + height);
    initHandlerThread();

    Message msg = Message.obtain(mGLHandler, MSG_TYPE_SURFACE_CREATED, surface);
    mGLHandler.sendMessage(msg);
    msg = Message.obtain(mGLHandler, MSG_TYPE_SURFACE_CHANGED, width, height);
    mGLHandler.sendMessage(msg);
}
 
Example 28
Project: Hitalk   File: TextureVideoView.java   Source Code and License 5 votes vote down vote up
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
    mSurface = new Surface(surface);
    if(mTargetState == STATE_PLAYING) {
        if(SHOW_LOGS) Log.i(TAG, "onSurfaceTextureAvailable start");
        start();
    }
}
 
Example 29
Project: Aurora   File: SampleVideo.java   Source Code and License 5 votes vote down vote up
/**
 * 处理显示逻辑
 */
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
    super.onSurfaceTextureAvailable(surface, width, height);
    resolveRotateUI();
    resolveTransform();
}
 
Example 30
Project: Android-Code-Demos   File: CameraGLRendererBase.java   Source Code and License 5 votes vote down vote up
private void initSurfaceTexture() {
    Log.d(LOGTAG, "initSurfaceTexture");
    deleteSurfaceTexture();
    initTexOES(texCamera);
    mSTexture = new SurfaceTexture(texCamera[0]);
    mSTexture.setOnFrameAvailableListener(this);
}
 
Example 31
Project: grafika   File: TextureViewCanvasActivity.java   Source Code and License 5 votes vote down vote up
@Override   // will be called on UI thread
public boolean onSurfaceTextureDestroyed(SurfaceTexture st) {
    Log.d(TAG, "onSurfaceTextureDestroyed");

    synchronized (mLock) {
        mSurfaceTexture = null;
    }
    return true;
}
 
Example 32
Project: rtmp-rtsp-stream-client-java   File: Camera2ApiManager.java   Source Code and License 5 votes vote down vote up
public Size[] getCameraResolutionsFront() {
  try {
    CameraCharacteristics cameraCharacteristics = cameraManager.getCameraCharacteristics("0");
    if (cameraCharacteristics.get(CameraCharacteristics.LENS_FACING)
        != CameraCharacteristics.LENS_FACING_FRONT) {
      cameraCharacteristics = cameraManager.getCameraCharacteristics("1");
    }
    StreamConfigurationMap streamConfigurationMap =
        cameraCharacteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
    return streamConfigurationMap.getOutputSizes(SurfaceTexture.class);
  } catch (CameraAccessException e) {
    Log.e(TAG, e.getMessage());
    return new Size[0];
  }
}
 
Example 33
Project: BLPlayer   File: TextureRenderView.java   Source Code and License 5 votes vote down vote up
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
    mSurfaceTexture = surface;
    mIsFormatChanged = false;
    mWidth = 0;
    mHeight = 0;

    ISurfaceHolder surfaceHolder = new InternalSurfaceHolder(mWeakRenderView.get(), surface, this);
    for (IRenderCallback renderCallback : mRenderCallbackMap.keySet()) {
        renderCallback.onSurfaceCreated(surfaceHolder, 0, 0);
    }
}
 
Example 34
Project: phonk   File: CustomVideoTextureView.java   Source Code and License 5 votes vote down vote up
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
    if (mOnEvent != null) mOnEvent.surfaceTextureAvailable(surface);

    mWidth = width;
    mHeight = height;
}
 
Example 35
Project: Idea-ijkplayer   File: TextureRenderView.java   Source Code and License 5 votes vote down vote up
public InternalSurfaceHolder(@NonNull TextureRenderView textureView,
                             @Nullable SurfaceTexture surfaceTexture,
                             @NonNull ISurfaceTextureHost surfaceTextureHost) {
    mTextureView = textureView;
    mSurfaceTexture = surfaceTexture;
    mSurfaceTextureHost = surfaceTextureHost;
}
 
Example 36
Project: airgram   File: OutputSurface.java   Source Code and License 5 votes vote down vote up
@Override
public void onFrameAvailable(SurfaceTexture st) {
    synchronized (mFrameSyncObject) {
        if (mFrameAvailable) {
            throw new RuntimeException("mFrameAvailable already set, frame could be dropped");
        }
        mFrameAvailable = true;
        mFrameSyncObject.notifyAll();
    }
}
 
Example 37
Project: MOAAP   File: CameraGLRendererBase.java   Source Code and License 5 votes vote down vote up
private void initSurfaceTexture() {
    Log.d(LOGTAG, "initSurfaceTexture");
    deleteSurfaceTexture();
    initTexOES(texCamera);
    mSTexture = new SurfaceTexture(texCamera[0]);
    mSTexture.setOnFrameAvailableListener(this);
}
 
Example 38
Project: live_master   File: TextureMediaPlayer.java   Source Code and License 5 votes vote down vote up
@Override
public void setSurfaceTexture(SurfaceTexture surfaceTexture) {
    if (mSurfaceTexture == surfaceTexture)
        return;

    releaseSurfaceTexture();
    mSurfaceTexture = surfaceTexture;
    if (surfaceTexture == null) {
        super.setSurface(null);
    } else {
        super.setSurface(new Surface(surfaceTexture));
    }
}
 
Example 39
Project: PlusGram   File: OutputSurface.java   Source Code and License 5 votes vote down vote up
private void setup() {
    mTextureRender = new TextureRenderer(rotateRender);
    mTextureRender.surfaceCreated();
    mSurfaceTexture = new SurfaceTexture(mTextureRender.getTextureId());
    mSurfaceTexture.setOnFrameAvailableListener(this);
    mSurface = new Surface(mSurfaceTexture);
}
 
Example 40
Project: CameraKitView   File: Camera2.java   Source Code and License 5 votes vote down vote up
@Override
public boolean onSurfaceTextureDestroyed(SurfaceTexture texture) {
    if (mTextureView != null) {
        mTextureView.setSurfaceTextureListener(null);
    }
    return true;
}