DepthData mDepthData;
boolean m_bexit = false; // 控制视频绘制的标志
int m_Width;
int m_Height;
Bitmap m_colorBitmap;
private byte[] m_pixels;
private int[] m_rgbIntData;
/* Live UVC Camera */
WindowManager mWm;
private LiveCamera liveCamera;
LiveStreamProcessor processor = new LiveStreamProcessor();
private SurfaceView mSvPreview;
private SurfaceHolder mSurfaceHolder;
final int PREVIEW_WIDTH = 80;
final int PREVIEW_HEIGHT = 60;
private HomeKeyListener mHomeListener;
private TextView hintText;
private boolean isDialogShow = false; // 判断对话框是否弹出来的标志
private Thread mCameraThread = new Thread(new Runnable() {
@Override
public void run() {
Looper.prepare();
Log.d(TAG, "before initUVCCamera!!");
initUVCCamera();
Log.d(TAG, "after initUVCCamera!!");
Looper.loop();
}
});
private PermissionCallbacks m_callbacks = new PermissionCallbacks() {
@Override
public void onDevicePermissionGranted() {
try {
mDepthData = https://www.scwdwl.com/n/new DepthData(m_xc);
mDepthData.setMapOutputMode(GlobalDef.RES_DEPTH_WIDTH,
GlobalDef.RES_DEPTH_HEIGHT, 30);
m_rgbdata = https://www.scwdwl.com/n/new RGBData(m_xc);
m_rgbdata.setMapOutputMode(GlobalDef.RES_COLOR_WIDTH,
GlobalDef.RES_COLOR_HEIGHT, 30);
m_rgbdata.getGenerator().getMirrorCapability().setMirror(false);// true,false
m_Width = m_rgbdata.GetImageMap().getXRes();
m_Height = m_rgbdata.GetImageMap().getYRes();
// Log.i(TAG,"width = " + m_Width);
// Log.i(TAG,"m_Height = " + m_Height);
m_rgbIntData = https://www.scwdwl.com/n/new int[GlobalDef.RES_DISPLAY_WIDTH
* GlobalDef.RES_DISPLAY_HEIGHT];
m_colorBitmap = Bitmap.createBitmap(
GlobalDef.RES_DISPLAY_WIDTH,
GlobalDef.RES_DISPLAY_HEIGHT, Bitmap.Config.ARGB_8888);
} catch (Exception e) {
Log.w(TAG, "Exception: " + e.getMessage());
}
Log.i(TAG, "start xc!");
try {
m_xc.start(); // 开始生成设定好的数据
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
if (GlobalDef.USE_UVC) {
Log.d(TAG, "start Thread of UVC camera!!");
/*mCameraThread.start();
Message msg = new Message();
msg.what = 1;
// 1.5s delay
handler.sendMessageDelayed(msg, 3000);*/
} else {
Message msg = new Message();
msg.what = 1;
// 1.5s delay
handler.sendMessageDelayed(msg, 500);
}
}
@Override
public void onDevicePermissionDenied() {
Toast.makeText(MainActivity.this, "onDevicePermissionDenied ",
Toast.LENGTH_SHORT).show();
}
};
private Handler handler = new Handler() {
@Override
/* 褰撴湁娑堟伅鍙戦?鍑烘潵鐨勬椂鍊欏氨鎵цHandler鐨勮繖涓柟娉? */
public void handleMessage(Message msg) {
super.handleMessage(msg);
setContentView(R.layout.activity_main);
LinearLayout layout = (LinearLayout) findViewById(R.id.RGBLayout);
// Add the adView to it
layout.addView(new ColorView(MainActivity.this));
Log.i(TAG, "Create ColovrView!");
}
};
private Handler updateHandler = new Handler() {
public void handleMessage(Message msg) {
super.handleMessage(msg);
AlertDialog.Builder budler = new AlertDialog.Builder(
MainActivity.this);
budler.setTitle("恭喜您,获取二维码信息成功!");
budler.setMessage((String) msg.obj);
budler.setPositiveButton("确定", new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
isDialogShow = false;
}
});
budler.show();
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
- 中医心理学与西方心理学差别在哪里 华夏心理咨询培训机构怎么样
- 三叉穴在哪里 董氏奇穴治疗带状疱疹
- 想吃正宗阳澄湖大闸蟹去哪里买比较好 阳澄湖大闸蟹在哪里买
- 京东自营蜂蜜是真的吗 蜂蜜在哪里能买到真的
- 汗蒸东西十条附近哪里有汗蒸和桑拿 我家附近的汗蒸房在哪里
- 怎么知道一个女生敏感还是不敏感 女人敏感区在哪里图解
- 如何制作qq表白二维码 手机怎么做表白链接
- 比较有名的肿瘤医院在哪里 全国看肿瘤最好的中医院
- 有二维码还可以放歌的然后可以表白的是怎么弄的 表白网站制作网址免费
- 上衣尺码170/88A是什么意思