How to get Android camera preview data?

后端 未结 3 881
故里飘歌
故里飘歌 2021-01-31 06:13

My camera app displays a camera preview on the screen and also processes it in the background. Here is the relevant code, condensed as much as possible (e.g. no error handling

3条回答
  •  佛祖请我去吃肉
    2021-01-31 06:24

    From working on Barcode Scanner, which relies heavily on preview data, I feel like I've seen every bug under the sun. My suggestion is simply to not call setPreviewFormat() and let it use the default. The default is what you want here fortunately. There seem to be fewer devices that fail to get the default right, than device that balls up the call to setPreviewFormat(). Try that at least, may or may not be it.

提交回复
热议问题