0

I was looking at the two examples in order to take advantage of the camera. Camera2Basic viewing a sample test device put on my nexus 5x I think there is a problem I added a line in the example ImageSaver class.

           @Override
            public void run() {
                ByteBuffer buffer = mImage.getPlanes()[0].getBuffer();
                byte[] bytes = new byte[buffer.remaining()];
                buffer.get(bytes);
                FileOutputStream output = null;
                try {

                    //just put one line
                    Log.e(Camera2BasicFragment.class.getName(), "Take pciture!");

                    output = new FileOutputStream(mFile);
                    output.write(bytes);
                } catch (IOException e) {
            e.printStackTrace();
        } finally {
            mImage.close();
            if (null != output) {
                try {
                    output.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

Press the photo button once results are as follows:

code result

This does not happen on the other devices. What to do Processing to occur only nexus5x?

user3833569
  • 31
  • 1
  • 2

0 Answers0