cameraview icon indicating copy to clipboard operation
cameraview copied to clipboard

Added preview callback

Open Sumsar opened this issue 8 years ago • 5 comments

Callback to get preview byte data

Sumsar avatar Mar 22 '17 21:03 Sumsar

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

googlebot avatar Mar 22 '17 21:03 googlebot

I signed it!

Sumsar avatar Mar 22 '17 21:03 Sumsar

Camera1 on device HTC Butterfly 4.3 API 18 not call
mCamera.setPreviewCallback(new Camera.PreviewCallback() { @Override public void onPreviewFrame(byte[] data, Camera camera) { Timber.e("onPreviewFrame"); final Camera.Parameters parameters = camera.getParameters(); final int width = parameters.getPreviewSize().width; final int height = parameters.getPreviewSize().height; mCallback.onPreviewFrame(data, parameters.getPreviewFormat(), width, height); } });

jackyhieu1211 avatar May 17 '17 12:05 jackyhieu1211

I fix it

@Override public void onSurfaceChanged() { if (mCamera != null) { setUpPreview(); adjustCameraParameters(); mCamera.setPreviewCallback(Camera1.this); } }

jackyhieu1211 avatar May 18 '17 02:05 jackyhieu1211

Any progress on this? I'm trying to get ML Kit to work but the example code uses Camera 1 API and lags terribly and this here seems like the perfect match but is not yet included 😭.

hardysim avatar Dec 14 '18 10:12 hardysim