• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2010 Google Inc.
2 // All Rights Reserved.
3 
4 package com.example.android.videochatcameratest;
5 
6 import android.content.Context;
7 import android.util.AttributeSet;
8 import android.view.SurfaceHolder;
9 import android.view.SurfaceView;
10 
11 public class CameraPreviewView extends SurfaceView implements SurfaceHolder.Callback {
12     public SurfaceHolder mHolder;
13 
14     /**
15      * @param context
16      */
CameraPreviewView(Context context)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      */
CameraPreviewView(Context context, AttributeSet attrs)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
surfaceChanged(SurfaceHolder holder, int format, int width, int height)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
surfaceCreated(SurfaceHolder holder)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
surfaceDestroyed(SurfaceHolder holder)56     public void surfaceDestroyed(SurfaceHolder holder) {
57         // TODO Auto-generated method stub
58 
59     }
60 
61 }
62