Ejemplo n.º 1
0
 /** Stops the transmission if already started */
 public void stop() {
   synchronized (this) {
     if (processor != null) {
       processor.stop();
       processor.close();
       processor = null;
       rtptransmitter.close();
       rtptransmitter = null;
     }
   }
 }
Ejemplo n.º 2
0
  /**
   * Starts the transmission. Returns null if transmission started ok. Otherwise it returns a string
   * with the reason why the setup failed.
   */
  public synchronized String start() {
    String result;

    // Create a processor for the specified media locator
    // and program it to output JPEG/RTP
    result = createProcessor();
    if (result != null) return result;

    // Create an RTP session to transmit the output of the
    // processor to the specified IP address and port no.
    result = createTransmitter();
    if (result != null) {
      processor.close();
      processor = null;
      return result;
    }

    // Start the transmission
    processor.start();

    return null;
  }