コード例 #1
0
ファイル: VideoTransmit.java プロジェクト: sourabhg/VidcoFed
 /** Stops the transmission if already started */
 public void stop() {
   synchronized (this) {
     if (processor != null) {
       processor.stop();
       processor.close();
       processor = null;
       rtptransmitter.close();
       rtptransmitter = null;
     }
   }
 }
コード例 #2
0
ファイル: VideoTransmit.java プロジェクト: sourabhg/VidcoFed
  /**
   * 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;
  }