|
|
@ -38,7 +38,6 @@ public class MyVideo extends Activity {
|
|
|
|
OutputStream socketWriter;
|
|
|
|
OutputStream socketWriter;
|
|
|
|
private Button TakePhotos;
|
|
|
|
private Button TakePhotos;
|
|
|
|
private Button ViewPhotos;
|
|
|
|
private Button ViewPhotos;
|
|
|
|
private Button BtnForward, BtnBackward, BtnLeft, BtnRight, BtnStop;
|
|
|
|
|
|
|
|
private Socket socket;
|
|
|
|
private Socket socket;
|
|
|
|
private RockerView rockerView;
|
|
|
|
private RockerView rockerView;
|
|
|
|
private long exitTime = 0;
|
|
|
|
private long exitTime = 0;
|
|
|
@ -57,12 +56,6 @@ public class MyVideo extends Activity {
|
|
|
|
TakePhotos = findViewById(R.id.TakePhoto);
|
|
|
|
TakePhotos = findViewById(R.id.TakePhoto);
|
|
|
|
ViewPhotos = findViewById(R.id.ViewPhoto);
|
|
|
|
ViewPhotos = findViewById(R.id.ViewPhoto);
|
|
|
|
|
|
|
|
|
|
|
|
BtnForward = findViewById(R.id.button_forward);
|
|
|
|
|
|
|
|
BtnBackward = findViewById(R.id.button_backward);
|
|
|
|
|
|
|
|
BtnLeft = findViewById(R.id.button_left);
|
|
|
|
|
|
|
|
BtnRight = findViewById(R.id.button_right);
|
|
|
|
|
|
|
|
BtnStop = findViewById(R.id.button_stop);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Intent intent = getIntent();
|
|
|
|
Intent intent = getIntent();
|
|
|
|
//´ÓIntentµ±Öиù¾ÝkeyÈ¡µÃvalue
|
|
|
|
//´ÓIntentµ±Öиù¾ÝkeyÈ¡µÃvalue
|
|
|
|
CameraIp = intent.getStringExtra("CameraIp");
|
|
|
|
CameraIp = intent.getStringExtra("CameraIp");
|
|
|
@ -74,57 +67,6 @@ public class MyVideo extends Activity {
|
|
|
|
rockerView = new RockerView(this,socketWriter,this.getApplicationContext(),null);
|
|
|
|
rockerView = new RockerView(this,socketWriter,this.getApplicationContext(),null);
|
|
|
|
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(1000,1000);
|
|
|
|
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(1000,1000);
|
|
|
|
addContentView(rockerView,params);
|
|
|
|
addContentView(rockerView,params);
|
|
|
|
BtnForward.setOnClickListener(arg0 -> {
|
|
|
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
socketWriter.write(new byte[]{(byte) 0xff, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0xff});
|
|
|
|
|
|
|
|
socketWriter.flush();
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BtnBackward.setOnClickListener(arg0 -> {
|
|
|
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
socketWriter.write(new byte[]{(byte) 0xff, (byte) 0x00, (byte) 0x02, (byte) 0x00, (byte) 0xff});
|
|
|
|
|
|
|
|
socketWriter.flush();
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
BtnRight.setOnClickListener(arg0 -> {
|
|
|
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
socketWriter.write(new byte[]{(byte) 0xff, (byte) 0x00, (byte) 0x03, (byte) 0x00, (byte) 0xff});
|
|
|
|
|
|
|
|
socketWriter.flush();
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
BtnLeft.setOnClickListener(arg0 -> {
|
|
|
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
socketWriter.write(new byte[]{(byte) 0xff, (byte) 0x00, (byte) 0x04, (byte) 0x00, (byte) 0xff});
|
|
|
|
|
|
|
|
socketWriter.flush();
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
BtnStop.setOnClickListener(arg0 -> {
|
|
|
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
socketWriter.write(new byte[]{(byte) 0xff, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xff});
|
|
|
|
|
|
|
|
socketWriter.flush();
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
TakePhotos.setOnClickListener(arg0 -> {
|
|
|
|
TakePhotos.setOnClickListener(arg0 -> {
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
if (null != Constant.handler) {
|
|
|
|
if (null != Constant.handler) {
|
|
|
|