Removed the TCP video streaming code.

This commit is contained in:
2014-01-21 12:19:23 -04:30
parent f865c39cb7
commit 1c7430edd6
3 changed files with 15 additions and 12 deletions

View File

@@ -35,7 +35,10 @@ public class MotorControlThread extends Thread {
return; return;
}else{ }else{
while(!done){ while(!done){
Object msg = readMessage();
MotorEvent event = verifyMessage(msg);
if(event != null)
queue.addEvent(event);
} }
} }
} }

View File

@@ -182,21 +182,21 @@ public class VideoStreamingThread extends Thread{
}*/ }*/
public void run(){ public void run(){
connectToServer(); //connectToServer();
try{ try{
udpSocket = new DatagramSocket(); udpSocket = new DatagramSocket();
udpSocket.setSendBufferSize(Integer.MAX_VALUE); //udpSocket.setSendBufferSize(Integer.MAX_VALUE);
}catch(IOException io){ }catch(IOException io){
Logger.log_e(TAG, CLASS_NAME + ".run() :: IOException received creating socket " + io.getMessage()); Logger.log_e(TAG, CLASS_NAME + ".run() :: IOException received creating socket " + io.getMessage());
System.exit(1); System.exit(1);
} }
if(!socket.isConnected()){ /*if(!socket.isConnected()){
Logger.log_e(TAG, CLASS_NAME + ".run() :: Not connected to a server. Finishing thread."); Logger.log_e(TAG, CLASS_NAME + ".run() :: Not connected to a server. Finishing thread.");
return; return;
}else{ }else{*/
while(!done){ while(!done){
//sendImage(); //sendImage();
sendUdp(); sendUdp();
@@ -204,7 +204,7 @@ public class VideoStreamingThread extends Thread{
sleep(50L); sleep(50L);
}catch(InterruptedException ie){} }catch(InterruptedException ie){}
} }
} //}
Logger.log_d(TAG, CLASS_NAME + ".run() :: Thread finish reached."); Logger.log_d(TAG, CLASS_NAME + ".run() :: Thread finish reached.");
} }
@@ -260,10 +260,10 @@ public class VideoStreamingThread extends Thread{
size = int2ByteArray(bufferSize); size = int2ByteArray(bufferSize);
try{ try{
packet = new DatagramPacket(size, 4, InetAddress.getByName(serverIp), ProjectConstants.SERVER_TCP_PORT_2); packet = new DatagramPacket(size, 4, InetAddress.getByName(serverIp), ProjectConstants.SERVER_TCP_PORT_1);
udpSocket.send(packet); udpSocket.send(packet);
packet = new DatagramPacket(buffer, buffer.length, InetAddress.getByName(serverIp), ProjectConstants.SERVER_TCP_PORT_2); packet = new DatagramPacket(buffer, buffer.length, InetAddress.getByName(serverIp), ProjectConstants.SERVER_TCP_PORT_1);
udpSocket.send(packet); udpSocket.send(packet);
}catch(UnknownHostException uo){ }catch(UnknownHostException uo){