Ejemplo n.º 1
0
  /**
   * Open the input stream
   *
   * @throws Exception
   */
  public void open() throws Exception {
    // Create the RTP receiver
    rtpReceiver = new RtpPacketReceiver(localPort, rtcpSession);

    // Create the RTCP receiver
    rtcpReceiver = new RtcpPacketReceiver(localPort + 1, rtcpSession);
    rtcpReceiver.start();

    // Create the RTCP transmitter
    rtcpTransmitter =
        new RtcpPacketTransmitter(
            remoteAddress, remotePort + 1, rtcpSession, rtcpReceiver.getConnection());
    rtcpTransmitter.start();
  }
Ejemplo n.º 2
0
  /** Close the input stream */
  public void close() {
    try {
      // Close the RTCP transmitter
      if (rtcpTransmitter != null) rtcpTransmitter.close();

      // Close the RTP receiver
      if (rtpReceiver != null) {
        rtpReceiver.close();
      }

      // Close the RTCP receiver
      if (rtcpReceiver != null) {
        rtcpReceiver.close();
      }
    } catch (Exception e) {
      if (logger.isActivated()) {
        logger.error("Can't close correctly RTP ressources", e);
      }
    }
  }