@Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); // Note that order matters - see the note in onPause(), the reverse applies here. mGLView.resume(); try { mOutputFile = createVideoOutputFile(); android.graphics.Point size = new android.graphics.Point(); getWindowManager().getDefaultDisplay().getRealSize(size); mGLView.initRecorder(mOutputFile, size.x, size.y, null, null); } catch (IOException ioex) { Log.e(TAG, "Couldn't re-init recording", ioex); } }
@Override protected void onResume() { super.onResume(); // The following call resumes a paused rendering thread. // If you de-allocated graphic objects for onPause() // this is a good place to re-allocate them. if (PermissionsHelper.hasPermissions(this)) { // Note that order matters - see the note in onPause(), the reverse applies here. mGLView.resume(); try { mOutputFile = createVideoOutputFile(); android.graphics.Point size = new android.graphics.Point(); getWindowManager().getDefaultDisplay().getRealSize(size); mGLView.initRecorder(mOutputFile, size.x, size.y, null, null); } catch (IOException ioex) { Log.e(TAG, "Couldn't re-init recording", ioex); } } else { PermissionsHelper.requestPermissions(this); } }
mRecordableSurfaceView.resume();
private void setReady() { getImage(getIntent()); android.graphics.Point size = new android.graphics.Point(); getWindowManager().getDefaultDisplay().getRealSize(size); //then setup our camera renderer mRenderer = new LipFlipRenderer(this, size.x, size.y); mBitmapHandler = new BitmapHandler(this); mRenderer.setBitmapHandler(mBitmapHandler); mRenderer.setInitialBitmap(mInitialBitmap); Bitmap theMap = mPaintView.getDrawingCopy(size.x, size.y); mRenderer.setPaintTexture(theMap); setupCameraFragment(mRenderer); //now that renderer is created and ready, await new bitmaps mPaintView.setOnNewBitmapReadyListener(this); mPaintView.hintSize(size.x, size.y); //initial config if needed mRecordableSurfaceView.resume(); try { mOutputFile = getFile("lipflip_"); mRecordableSurfaceView.initRecorder(mOutputFile, size.x, size.y, null, null); mVideoFragment.setVideoRenderer(mRenderer); } catch (IOException ioex) { Log.e(TAG, "Couldn't re-init recording", ioex); } }
mDataSamplerAdapter = new DataSamplerAdapter(getApplicationContext(), size.x, size.y); mRenderer.setSampler(mDataSamplerAdapter.next()); mRecordableSurfaceView.resume();