|
在MPUCameraUtil类中,调用下面这个方法,并把render.iWidth 和 render.iHeight 在代码中设置为固定的 1280 和 720 , 之前的代码写的是cameraParam.width 和 cameraParam.height , 我们打印出来是 1920 * 1080
public void openExtcamCamera() {
if (!(new ExtCamData(context).ExtDataIsRight())) {
MPUToast.makeText(context,
context.getString(R.string.ExtcamOpenFail),
MPUToast.LENGTH_SHORT).show();
}
try {
closeCamera();
closeRender();
mpu.setCameraIndex(CameraListViewAdapter.EXTERNAL_CAMREA + 1);
CameraHolder.getCameraHolder().setCapture(false);
int index = 4;
CameraParam cameraParam = mpu.getCameraParam();
cameraParam.videoIndex = index;
BVPU_VideoControl_Render render = new BVPU_VideoControl_Render();
render.iWidth = 1280;
render.iHeight = 720;
render.hWnd = mSurfaceView.getHolder().getSurface();
render.iYUVConvert = mpu.getCameraParam().renderCovertIndex;// refresh
// param
render.iRotate = mpu.getPreviewEntity().getExtcamCameraRotateIndex();
if(mpu.getCamCapabilities().szDevice.equals("EMPIA")){
if(EmpiaCamControl.openCam(mpu.getExtCamCaptureParam()) == 0){
EmpiaCamControl.startCaptureStream();
}
}else{
mpu.getmConnection().extcam(mpu.getExtCamCaptureParam());
}
isCamOpened = true;
mpu.getmConnection().render(render);
extcamState = true;
mpu.getPreviewActivity().changeBottomMenuUI(true, true,
mpu.getCameraIndex() - 1);
} catch (Exception e) {
MPUToast.makeText(context, e.toString(), Toast.LENGTH_SHORT).show();
}
} |
|