views:

316

answers:

2

analogous to this thread: http://stackoverflow.com/questions/2093594/opengl-extensions-available-on-different-android-devices I would like to collect the different PixelFormats the android devices use.

To find out you must do the following:

Parameters camParams = camera.getParameters();
int format = camParams.getPreviewFormat();

Now you got to find the number in the following list: developer.android.com/reference/android/graphics/PixelFormat.html#A_8

How to generally open the camera is described here: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html

I'll have a start:

device: T-mobile G1 / HTC Dream
android: 1.6 (cyanogen mod)
format: YCbCr_420_SP

so what formats do your android phones use? thanks in advance :D

A: 

device: Motorola XT720(MOTOROI) android: 2.0.1 format: YCbCr_420_SP

dalcomkim
A: 

According to the documentation this is the default in all devices

public abstract void onPreviewFrame (byte[] data, Camera camera)

Since: API Level 1 The callback that delivers the preview frames. Parameters data The contents of the preview frame in the format defined by ImageFormat, which can be queried with getPreviewFormat(). If setPreviewFormat(int) is never called, the default will be the YCbCr_420_SP (NV21) format.

I've tried to use setPreviewFormat to change this without much success on HTC Tattoo and HTC Desire

ee3509