public RtspClient() {
    mCSeq = 0;
    mTmpParameters = new Parameters();
    mTmpParameters.port = 1935;
    mTmpParameters.path = "/";
    mTmpParameters.transport = TRANSPORT_UDP;
    mAuthorization = null;
    mCallback = null;
    mMainHandler = new Handler(Looper.getMainLooper());
    mState = STATE_STOPPED;

    final Semaphore signal = new Semaphore(0);
    new HandlerThread("RtspClient") {
      @Override
      protected void onLooperPrepared() {
        mHandler =
            new Handler() {

              @Override
              public void handleMessage(Message msg) {
                super.handleMessage(msg);
                if (msg.what == RtpThread.WHAT_THREAD_END_UNEXCEPTION) {
                  if (mCallback != null) {
                    mCallback.onRtspUpdate(RtpThread.WHAT_THREAD_END_UNEXCEPTION, null);
                  } else {
                    stopStream();
                  }
                }
              }
            };
        signal.release();
      }
    }.start();
    signal.acquireUninterruptibly();
  }
 @Override
 public Parameters clone() {
   Parameters params = new Parameters();
   params.host = host;
   params.username = username;
   params.password = password;
   params.path = path;
   params.session = session;
   params.port = port;
   params.transport = transport;
   return params;
 }
 /**
  * Sets the destination address of the RTSP server.
  *
  * @param host The destination address
  * @param port The destination port
  */
 public void setServerAddress(String host, int port) {
   mTmpParameters.port = port;
   mTmpParameters.host = host;
 }