Example #1
0
 public void start() {
   if (streamReader != null && streamReader.isAlive()) {
     System.out.println("Camera already started");
     return;
   }
   streamReader = new Thread(this, "HTTP Stream reader");
   keepAlive = true;
   streamReader.start();
 }
Example #2
0
 public void stop() {
   if (streamReader == null || !streamReader.isAlive()) {
     System.out.println("Camera already stopped");
     return;
   }
   keepAlive = false;
   try {
     streamReader.join();
   } catch (InterruptedException e) {
     System.err.println(e.getMessage());
   }
 }
Example #3
0
 public boolean isAlive() {
   return streamReader.isAlive();
 }