Package rtpi.packets

Examples of rtpi.packets.SourceDescriptionItem


    synchronized boolean checkForItemValueChange(SourceDescriptionItem item) throws IllegalValueException {
  int type=item.getType();
  if (type < 1 || type > 7) {
      throw new IllegalValueException("RtpiSourceInfo: could not compare standard items of type: "+type);
  }
  SourceDescriptionItem oldItem = sdesItems[type-1];

  if (oldItem==null) {
      if (item.getData()==null || item.getData().length==0) {
    return false;
      } else {
    return true;
      }
  }

  if (item.getData()==null || item.getData().length==0) {
      if (oldItem==null) {
    return false;
      } else {
    return true;
      }
  }
 
  byte[] data = item.getData();
  byte[] oldData = oldItem.getData();

  if (data.length != oldData.length) {
      return true;
  }
View Full Code Here


      dos.close();
      bos.close();
  } catch (Exception ex) {
      throw new IllegalValueException("RtcpiSourceInfo: Error while convertig cName to UTF");
  }
  sdesItems[0] = new SourceDescriptionItem(SourceDescriptionItem.CNAME,cNameBytes);
    }
View Full Code Here

      dos.close();
      bos.close();
  } catch (Exception ex) {
      throw new IllegalValueException("RtcpiSourceInfo: Error while convertig Name to UTF");
  }
  sdesItems[1] = new SourceDescriptionItem(SourceDescriptionItem.NAME,nameBytes);
    }
View Full Code Here

      dos.close();
      bos.close();
  } catch (Exception ex) {
      throw new IllegalValueException("RtcpiSourceInfo: Error while convertig email to UTF");
  }
  sdesItems[2] = new SourceDescriptionItem(SourceDescriptionItem.EMAIL,emailBytes);
    }
View Full Code Here

      dos.close();
      bos.close();
  } catch (Exception ex) {
      throw new IllegalValueException("RtcpiSourceInfo: Error while convertig phone to UTF");
  }
  sdesItems[3] = new SourceDescriptionItem(SourceDescriptionItem.PHONE,phoneBytes);
    }
View Full Code Here

      dos.close();
      bos.close();
  } catch (Exception ex) {
      throw new IllegalValueException("RtcpiSourceInfo: Error while convertig loc to UTF");
  }
  sdesItems[4] = new SourceDescriptionItem(SourceDescriptionItem.LOC,locBytes);
    }
View Full Code Here

      dos.close();
      bos.close();
  } catch (Exception ex) {
      throw new IllegalValueException("RtcpiSourceInfo: Error while convertig tool to UTF");
  }
  sdesItems[5] = new SourceDescriptionItem(SourceDescriptionItem.TOOL,toolBytes);
    }
View Full Code Here

      dos.close();
      bos.close();
  } catch (Exception ex) {
      throw new IllegalValueException("RtcpiSourceInfo: Error while convertig tool to UTF");
  }
  sdesItems[6] = new SourceDescriptionItem(SourceDescriptionItem.NOTE,noteBytes);
    }
View Full Code Here

  // Now calculate the size of the first RTCP/I packet that we are going to send:
  // this packet will contain a single SDES packet with the CNAME and NAME items!

  avg_rtcpi_size=RtcpiPacket.HEADER_SIZE;
 
  SourceDescriptionItem item;

  try {
      item = localParticipant.getStandardItem(SourceDescriptionItem.CNAME);
      if (item!= null) {
    avg_rtcpi_size+=item.getData().length+1; // +1 for length field!
      }
  } catch (Exception ex) {
      System.err.println("Rtpi: could not calculate length of CNAME SDES item "+ex);
  }   

  try {
      item = localParticipant.getStandardItem(SourceDescriptionItem.NAME);
      if (item!= null) {
    avg_rtcpi_size+=item.getData().length+1; // +1 for length field!
      }
  } catch (Exception ex) {
      System.err.println("Rtpi: could not calculate length of NAME SDES item "+ex);
  }   
View Full Code Here

      info = new RtpiSourceInfo(spacket.getParticipantID());
      newParticipant=true;
  }

  LinkedList items = spacket.getSourceDescriptionItems();
  SourceDescriptionItem item;
  int itemType;
  for (ListIterator iter=items.listIterator(); iter.hasNext();) {
      item=(SourceDescriptionItem) iter.next();
      try {
    if (info.checkForItemValueChange(item)) {
View Full Code Here

TOP

Related Classes of rtpi.packets.SourceDescriptionItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.