Exemplo n.º 1
0
  /**
   * Creates a new, empty SessionDescription. The session is set as follows:
   *
   * <p>v=0
   *
   * <p>o=this.createOrigin ("user", InetAddress.getLocalHost().toString());
   *
   * <p>s=-
   *
   * <p>t=0 0
   *
   * @throws SdpException SdpException, - if there is a problem constructing the SessionDescription.
   * @return a new, empty SessionDescription.
   */
  public SessionDescription createSessionDescription() throws SdpException {
    SessionDescriptionImpl sessionDescriptionImpl = new SessionDescriptionImpl();

    ProtoVersionField ProtoVersionField = new ProtoVersionField();
    ProtoVersionField.setVersion(0);
    sessionDescriptionImpl.setVersion(ProtoVersionField);

    OriginField originImpl = null;
    try {
      originImpl =
          (OriginField) this.createOrigin("user", InetAddress.getLocalHost().getHostAddress());
    } catch (UnknownHostException e) {
      e.printStackTrace();
    }
    sessionDescriptionImpl.setOrigin(originImpl);

    SessionNameField sessionNameImpl = new SessionNameField();
    sessionNameImpl.setValue("-");
    sessionDescriptionImpl.setSessionName(sessionNameImpl);

    TimeDescriptionImpl timeDescriptionImpl = new TimeDescriptionImpl();
    TimeField timeImpl = new TimeField();
    timeImpl.setZero();
    timeDescriptionImpl.setTime(timeImpl);
    Vector times = new Vector();
    times.addElement(timeDescriptionImpl);
    sessionDescriptionImpl.setTimeDescriptions(times);

    sessionDescriptionsList.addElement(sessionDescriptionImpl);
    return sessionDescriptionImpl;
  }
Exemplo n.º 2
0
 /**
  * Returns TimeDescription unbounded (i.e. "t=0 0");
  *
  * @throws SdpException
  * @return TimeDescription unbounded (i.e. "t=0 0");
  */
 public TimeDescription createTimeDescription() throws SdpException {
   TimeDescriptionImpl timeDescriptionImpl = new TimeDescriptionImpl();
   TimeField timeImpl = new TimeField();
   timeImpl.setZero();
   timeDescriptionImpl.setTime(timeImpl);
   return timeDescriptionImpl;
 }
Exemplo n.º 3
0
 /**
  * Returns TimeDescription object with the specified properties.
  *
  * @param start start time.
  * @param stop stop time.
  * @throws SdpException if the parameters are null
  * @return TimeDescription
  */
 public TimeDescription createTimeDescription(Date start, Date stop) throws SdpException {
   TimeDescriptionImpl timeDescriptionImpl = new TimeDescriptionImpl();
   TimeField timeImpl = new TimeField();
   timeImpl.setStart(start);
   timeImpl.setStop(stop);
   timeDescriptionImpl.setTime(timeImpl);
   return timeDescriptionImpl;
 }
Exemplo n.º 4
0
 /**
  * Returns TimeDescription object with the specified properties.
  *
  * @param t the Time that the time description applies to. Returns TimeDescription object with the
  *     specified properties.
  * @throws SdpException
  * @return TimeDescription
  */
 public TimeDescription createTimeDescription(Time t) throws SdpException {
   TimeDescriptionImpl timeDescriptionImpl = new TimeDescriptionImpl();
   timeDescriptionImpl.setTime(t);
   return timeDescriptionImpl;
 }