1// Copyright 2010 Google Inc. 2// All Rights Reserved. 3 4package com.example.android.videochatcameratest; 5 6import android.content.Context; 7import android.util.AttributeSet; 8import android.view.SurfaceHolder; 9import android.view.SurfaceView; 10 11public class CameraPreviewView extends SurfaceView implements SurfaceHolder.Callback { 12 public SurfaceHolder mHolder; 13 14 /** 15 * @param context 16 */ 17 public CameraPreviewView(Context context) { 18 this(context, null); 19 // TODO Auto-generated constructor stub 20 } 21 22 /** 23 * @param context 24 * @param attrs 25 */ 26 public CameraPreviewView(Context context, AttributeSet attrs) { 27 super(context, attrs); 28 mHolder = getHolder(); 29 mHolder.addCallback(this); 30 mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); 31 // TODO Auto-generated constructor stub 32 } 33 34 /* (non-Javadoc) 35 * @see android.view.SurfaceHolder.Callback#surfaceChanged(android.view.SurfaceHolder, int, int, int) 36 */ 37 @Override 38 public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { 39 // TODO Auto-generated method stub 40 41 } 42 43 /* (non-Javadoc) 44 * @see android.view.SurfaceHolder.Callback#surfaceCreated(android.view.SurfaceHolder) 45 */ 46 @Override 47 public void surfaceCreated(SurfaceHolder holder) { 48 // TODO Auto-generated method stub 49 50 } 51 52 /* (non-Javadoc) 53 * @see android.view.SurfaceHolder.Callback#surfaceDestroyed(android.view.SurfaceHolder) 54 */ 55 @Override 56 public void surfaceDestroyed(SurfaceHolder holder) { 57 // TODO Auto-generated method stub 58 59 } 60 61} 62