question

NilToNil avatar image
NilToNil asked

takePicture raw returning null

Hi, I am trying to get the raw camera data and I am getting null in the data buffer. This is what I am doing 1. I am using the SampleCameraAcitivity example provided. 2. I modified the code to add a callbackbuffer in the startcamerapreview method mCamera.setDisplayOrientation(displayOrientation); [u][b] mCamera.addCallbackBuffer(mVideoSource);[/b][/u] mCamera.setPreviewDisplay(surfaceHolder); mCamera.startPreview(); 3. [b]byte[] mVideoSource = new byte[1024*1024*5]; [/b][u][/u] 4. Modified the takePicture method [u][b]mCamera.takePicture(null, mJPEGCallback, null, null ); [/b][/u] 5. On picture complete I am releasing the buffer private void onPictureComplete() { mCaptureInProgress = false; if (mCamera != null) { [u][b]mCamera.addCallbackBuffer(mVideoSource);[/b][/u] mCamera.startPreview(); } Toast.makeText(this, R.string.picture_saved, Toast.LENGTH_SHORT).show(); } Please let me know what I am doing wrong.
fire tablet
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi NiliToNil, Thank you for raising this. Yes, your observation is correct. But it seems like framework issue. Found below reported issues in Android framework. http://code.google.com/p/android/issues/detail?id=13007 http://code.google.com/p/android/issues/detail?id=10910 The same issue is confirmed in other Android phones. Please note the below comment of a developer in this Android framework issue : http://code.google.com/p/android/issues/detail?id=10910 Comment : ------------- The Raw data Android Camera spews is controlled by Camera manufacturer, if you have array output full of zeros, or rawCallback is not even triggered, it is bug. I have tested on Intel Android devices with Android 4.2(or could be 4.3), I can get Raw data correctly, and the format and size of Raw data is defined by manufacturer too. ------------- For Kindle Fires, I have forwarded the issue to the concerned team, I will post back after hearing from them.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.