[android-developers] can not set preview buffer format to nv21 on nexus 4

2013-03-15 Thread Qianqian Fang
Based on the help for getSupportedPreviewFormats [1], NV21 should be always supported. However, when I run camParam = mCamera.getParameters(); camParam.setPictureFormat(ImageFormat.NV21); mCamera.setParameters(camParam); on my nexus 4, I get an error setParameters failed. The only way to get

[android-developers] Re: setAutoExposureLock method is not found in ICS

2013-03-07 Thread Qianqian Fang
found online. I wasn't aware of Build.VERSION.SDK_INT. It is definitely the better way to go. thanks a lot Qianqian On Wed, Mar 6, 2013 at 7:21 PM, Qianqian Fang fan...@gmail.com wrote: hi list I am working on a camera program where I want to call setAutoExposureLock() is supported

[android-developers] setAutoExposureLock method is not found in ICS

2013-03-06 Thread Qianqian Fang
hi list I am working on a camera program where I want to call setAutoExposureLock() is supported. To make this backward compatible, I used some sample code I found online to check the presence of this method first. The code snippet is below: ... try{ Class c =

[android-developers] disabling camera automatic intensity adjustment

2012-12-20 Thread Qianqian Fang
hi developers I am working on a camera program with my android phone. The camera takes images through preview buffer. The scene switches between two lighting conditions, one brighter, one weaker. I found that when the lighting condition changes, the camera will adjust image intensity (I guess via

[android-developers] Re: Latency of onPreviewFrame callback when using setPreviewCallbackWithBuffer()

2012-04-04 Thread Qianqian Fang
On Apr 3, 2:12 pm, Qianqian Fang fan...@gmail.com wrote: hi developers I am working on an android program to control an external hardware and process camera images in the real time. The hardware interface is an IOIO (http://www.sparkfun.com/products/10585). It controls an LED array to turn

[android-developers] Latency of onPreviewFrame callback when using setPreviewCallbackWithBuffer()

2012-04-03 Thread Qianqian Fang
hi developers I am working on an android program to control an external hardware and process camera images in the real time. The hardware interface is an IOIO (http://www.sparkfun.com/products/10585). It controls an LED array to turn on and off. The software captures images from the camera using

[android-developers] saving camera preview frames to a file with minimum slow-down

2012-04-01 Thread Qianqian Fang
hi list I'd like to get some advice on optimizing file IO of a camera-frame processing code I am working on. I used the setPreviewCallbackWithBuffer() method to capture each preview frame and do some processing in the real-time. The processed frame (an int array) is then save to the sdcard. I

[android-developers] Processing camera preview frames and display results via OpenGL

2012-03-27 Thread Qianqian Fang
hi there I am trying to write a program to process camera preview data on-the- fly, and display the results as (semitransparent) overlays. I found one example that is particularly useful: http://nhenze.net/?p=172 the source code is at http://nhenze.net/uploads/OpenGL_Cam_1_2.zip In this

[android-developers] Running camera preview while recording video at the same time

2012-03-27 Thread Qianqian Fang
hi I am working on a real-time video processing project. I used setPreviewCallbackWithBuffer() and display both the preview image and the processed image on SurfaceViews. Now, I'd like to record video at the same time. I read from some posts that the video recording involves low-level io that is

[android-developers] strange camera preview image buffer wrapping problem

2011-07-13 Thread Qianqian Fang
hi I found a strange problem when processing the preview images grabbed from my Epic 4G phone camera (android 2.2.1). The image data were captured in a callback set up by setPreviewCallbackWithBuffer(). The pixelformat of the image were set to RGB565. For each callback, I simply dump the raw

[android-developers] converting RGB565 byte array to integer buffer generate wrong results

2011-07-11 Thread Qianqian Fang
hi I am working on an android program to process multiple frames of camera images. I used the setPreviewCallbackWithBuffer function and process the data inside the PreviewCallback. The code works generally ok, except the resulting data have weird values. I set the camera picture format to

[android-developers] Re: converting RGB565 byte array to integer buffer generate wrong results

2011-07-11 Thread Qianqian Fang
On Jul 11, 4:50 pm, Streets Of Boston flyingdutc...@gmail.com wrote: In the preview, the data is not RGB. It is yuv_420 or a similar format. Query the camera-parameters for the exact format and decode the data accordingly. hi thanks for your comment. In the ... part of my original post, I did

[android-developers] Re: converting RGB565 byte array to integer buffer generate wrong results

2011-07-11 Thread Qianqian Fang
On Jul 11, 4:50 pm, Streets Of Boston flyingdutc...@gmail.com wrote: In the preview, the data is not RGB. It is yuv_420 or a similar format. Query the camera-parameters for the exact format and decode the data accordingly. problem found! it was caused by endianness of the data. By inserting

[android-developers] set camera focus distance programmatically in the FOCUS_FIXED mode

2011-07-08 Thread Qianqian Fang
hi everyone I need to let the camera to focus to a user supplied distance. In the SDK, I only found getFocusDistance to inquire the focus distance, but not one to set the focus distance manually. Can someone give me a hint how to achieve this? thanks Qianqian -- You received this message

[android-developers] how to use setPreviewCallbackWithBuffer() for real-time camera processing

2011-07-05 Thread Qianqian Fang
hi I am new to android sdk. I need to write a program to process the camera image frames. I found setPreviewCallbackWithBuffer() from the sdk documentation, but did not figure out how to get it to work. Here is my code skeleton: public void onResume() { super.onResume();

Re: [android-developers] how to use setPreviewCallbackWithBuffer() for real-time camera processing

2011-07-05 Thread Qianqian Fang
On 07/04/2011 06:43 PM, Qianqian Fang wrote: hi I am new to android sdk. I need to write a program to process the camera image frames. I found setPreviewCallbackWithBuffer() from the sdk documentation, but did not figure out how to get it to work. Here is my code skeleton: public void