| // Copyright 2010 Google Inc. |
| // All Rights Reserved. |
| |
| package com.example.android.videochatcameratest; |
| |
| import android.content.Context; |
| import android.util.AttributeSet; |
| import android.view.SurfaceHolder; |
| import android.view.SurfaceView; |
| |
| public class CameraPreviewView extends SurfaceView implements SurfaceHolder.Callback { |
| public SurfaceHolder mHolder; |
| |
| /** |
| * @param context |
| */ |
| public CameraPreviewView(Context context) { |
| this(context, null); |
| // TODO Auto-generated constructor stub |
| } |
| |
| /** |
| * @param context |
| * @param attrs |
| */ |
| public CameraPreviewView(Context context, AttributeSet attrs) { |
| super(context, attrs); |
| mHolder = getHolder(); |
| mHolder.addCallback(this); |
| mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); |
| // TODO Auto-generated constructor stub |
| } |
| |
| /* (non-Javadoc) |
| * @see android.view.SurfaceHolder.Callback#surfaceChanged(android.view.SurfaceHolder, int, int, int) |
| */ |
| @Override |
| public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { |
| // TODO Auto-generated method stub |
| |
| } |
| |
| /* (non-Javadoc) |
| * @see android.view.SurfaceHolder.Callback#surfaceCreated(android.view.SurfaceHolder) |
| */ |
| @Override |
| public void surfaceCreated(SurfaceHolder holder) { |
| // TODO Auto-generated method stub |
| |
| } |
| |
| /* (non-Javadoc) |
| * @see android.view.SurfaceHolder.Callback#surfaceDestroyed(android.view.SurfaceHolder) |
| */ |
| @Override |
| public void surfaceDestroyed(SurfaceHolder holder) { |
| // TODO Auto-generated method stub |
| |
| } |
| |
| } |