edu.dhbw.andar
Class CameraPreviewHandler

java.lang.Object
  extended by edu.dhbw.andar.CameraPreviewHandler

public class CameraPreviewHandler
extends java.lang.Object

Handles callbacks of the camera preview camera preview demo: http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html YCbCr 420 colorspace infos: http://wiki.multimedia.cx/index.php?title=YCbCr_4:2:0 http://de.wikipedia.org/wiki/YCbCr-Farbmodell http://www.elektroniknet.de/home/bauelemente/embedded-video/grundlagen-der-videotechnik-ii-farbraum-gammakorrektur-digitale-video-signale/4/

Author:
Tobias Domhan
See Also:
android.hardware.Camera.PreviewCallback

Field Summary
static int MODE_GRAY
           
static int MODE_RGB
           
 
Constructor Summary
CameraPreviewHandler(GLSurfaceView glSurfaceView, PreviewFrameSink sink, Resources res, ARToolkit markerInfo, CameraStatus camStatus)
           
 
Method Summary
static int getBestSupportedFormat(java.util.List<java.lang.Integer> listOfFormats)
          Returns the best pixel format of the list or -1 if none suites.
 void onPreviewFrame(byte[] data, Camera camera)
          new frame from the camera arrived. convert and hand over to the renderer how to convert between YUV and RGB:http://en.wikipedia.org/wiki/YUV#Y.27UV444 Conversion in C-Code(Android Project): http://www.netmite.com/android/mydroid/donut/development/tools/yuv420sp2rgb/yuv420sp2rgb.c http://code.google.com/p/android/issues/detail?
 void stopThreads()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE_RGB

public static final int MODE_RGB
See Also:
Constant Field Values

MODE_GRAY

public static final int MODE_GRAY
See Also:
Constant Field Values
Constructor Detail

CameraPreviewHandler

public CameraPreviewHandler(GLSurfaceView glSurfaceView,
                            PreviewFrameSink sink,
                            Resources res,
                            ARToolkit markerInfo,
                            CameraStatus camStatus)
Method Detail

getBestSupportedFormat

public static int getBestSupportedFormat(java.util.List<java.lang.Integer> listOfFormats)
Returns the best pixel format of the list or -1 if none suites.

Parameters:
listOfFormats -
Returns:

onPreviewFrame

public void onPreviewFrame(byte[] data,
                           Camera camera)
new frame from the camera arrived. convert and hand over to the renderer how to convert between YUV and RGB:http://en.wikipedia.org/wiki/YUV#Y.27UV444 Conversion in C-Code(Android Project): http://www.netmite.com/android/mydroid/donut/development/tools/yuv420sp2rgb/yuv420sp2rgb.c http://code.google.com/p/android/issues/detail?id=823

See Also:
android.hardware.Camera.PreviewCallback#onPreviewFrame(byte[], android.hardware.Camera)

stopThreads

public void stopThreads()