|
@@ -128,9 +128,9 @@ public class CameraPreviewManager implements SurfaceHolder.Callback , TextureVie
|
|
|
this.previewHeight = height;
|
|
|
this.videoDirection = videoDirection;
|
|
|
|
|
|
- Log.e("TEST","previewWidth--"+previewWidth);
|
|
|
- Log.e("TEST","previewHeight--"+previewHeight);
|
|
|
- Log.e("TEST","videoDirection--"+videoDirection);
|
|
|
+ Log.e(TAG,"previewWidth--"+previewWidth);
|
|
|
+ Log.e(TAG,"previewHeight--"+previewHeight);
|
|
|
+ Log.e(TAG,"videoDirection--"+videoDirection);
|
|
|
|
|
|
}else {
|
|
|
this.previewWidth = width;
|
|
@@ -140,10 +140,10 @@ public class CameraPreviewManager implements SurfaceHolder.Callback , TextureVie
|
|
|
this.mirrorVideoRGB = textureView.getMirrorRGB();
|
|
|
|
|
|
|
|
|
- Log.e("TEST","previewWidth--"+previewWidth);
|
|
|
- Log.e("TEST","previewHeight--"+previewHeight);
|
|
|
- Log.e("TEST","videoDirection--"+videoDirection);
|
|
|
- Log.e("TEST","mirrorVideoRGB--"+mirrorVideoRGB);
|
|
|
+ Log.e(TAG,"previewWidth--"+previewWidth);
|
|
|
+ Log.e(TAG,"previewHeight--"+previewHeight);
|
|
|
+ Log.e(TAG,"videoDirection--"+videoDirection);
|
|
|
+ Log.e(TAG,"mirrorVideoRGB--"+mirrorVideoRGB);
|
|
|
|
|
|
mSurfaceTexture = mTextureView.getTextureView().getSurfaceTexture();
|
|
|
mTextureView.getTextureView().setSurfaceTextureListener(this);
|
|
@@ -176,6 +176,7 @@ public class CameraPreviewManager implements SurfaceHolder.Callback , TextureVie
|
|
|
}
|
|
|
|
|
|
public int[] initCamera(){
|
|
|
+ Log.e(TAG, "initCamera---");
|
|
|
try {
|
|
|
if (mCamera == null) {
|
|
|
mCamera = Camera.open(cameraFacing);
|
|
@@ -234,6 +235,7 @@ public class CameraPreviewManager implements SurfaceHolder.Callback , TextureVie
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
Log.e(TAG, e.getMessage());
|
|
|
+ Log.e(TAG, "e:"+e.toString());
|
|
|
}
|
|
|
}
|
|
|
if (surfaceView != null){
|
|
@@ -243,6 +245,7 @@ public class CameraPreviewManager implements SurfaceHolder.Callback , TextureVie
|
|
|
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
+ Log.e(TAG, "e:"+e.toString());
|
|
|
}
|
|
|
return new int[]{videoWidth , videoHeight};
|
|
|
}
|
|
@@ -250,7 +253,7 @@ public class CameraPreviewManager implements SurfaceHolder.Callback , TextureVie
|
|
|
* 开启摄像头
|
|
|
*/
|
|
|
public void openCamera() {
|
|
|
-
|
|
|
+ Log.e(TAG, "---openCamera");
|
|
|
try {
|
|
|
try {
|
|
|
mCamera.setPreviewTexture(surfaceView.getFramebuffer());
|
|
@@ -351,17 +354,19 @@ public class CameraPreviewManager implements SurfaceHolder.Callback , TextureVie
|
|
|
mPreviewed = true;
|
|
|
}
|
|
|
} catch (Exception exception) {
|
|
|
+ Log.e(TAG, "IOException caused by setPreviewDisplay()---exception:"+exception);
|
|
|
Log.e("chaixiaogang", "IOException caused by setPreviewDisplay()", exception);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int i, int i1) {
|
|
|
- Log.e(TAG, "--surfaceTexture--TextureSizeChanged");
|
|
|
+ Log.e(TAG, "--surfaceTexture--TextureSizeChanged--i:"+i+" i1:"+i1);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture) {
|
|
|
+ Log.e(TAG, "onSurfaceTextureDestroyed");
|
|
|
if (mCamera != null) {
|
|
|
// mCamera.stopPreview();
|
|
|
mPreviewed = false;
|