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 an unbounded Time specification (i.e., "t=0 0").
  *
  * @throws SdpException
  * @return an unbounded Time specification (i.e., "t=0 0").
  */
 public Time createTime() throws SdpException {
   TimeField timeImpl = new TimeField();
   timeImpl.setZero();
   return timeImpl;
 }
Exemplo n.º 5
0
 /**
  * Returns a Time specification with the specified start and stop times.
  *
  * @param start start time
  * @param stop stop time
  * @throws SdpException if the parameters are null
  * @return a Time specification with the specified start and stop times.
  */
 public Time createTime(Date start, Date stop) throws SdpException {
   TimeField timeImpl = new TimeField();
   timeImpl.setStart(start);
   timeImpl.setStop(stop);
   return timeImpl;
 }