private void excludeFormat(String id, MediaDescription m) throws SdpParseException { Vector<String> fmts = m.getMedia().getMediaFormats(false); int count = 0; for (String s : fmts) { if (s.equals(id)) { break; } count++; } if (count < fmts.size()) { fmts.remove(count); } }
private void excludeFormat(String id, MediaDescription m) throws SdpParseException { Vector<String> fmts = m.getMedia().getMediaFormats(false); int count = 0; for (String s : fmts) { if (s.equals(id)) { break; } count++; } if (count < fmts.size()) { fmts.remove(count); } }
public boolean checkForMinimalOffer(SessionDescription sdp) throws SdpException { Vector<MediaDescription> mds = sdp.getMediaDescriptions(false); for (MediaDescription m : mds) { if (m.getMedia().getMediaFormats(false) == null) { return false; } } return true; }
public boolean checkForMinimalOffer(SessionDescription sdp) throws SdpException { Vector<MediaDescription> mds = sdp.getMediaDescriptions(false); for (MediaDescription m : mds) { if (m.getMedia().getMediaFormats(false) == null) { return false; } } return true; }
private static HashMap<Integer, Format> getVideoFormats(MediaDescription md) throws SdpParseException, SdpException { HashMap<Integer, Format> formats = new HashMap<Integer, Format>(); Media media = md.getMedia(); Enumeration<String> payloads = media.getMediaFormats(false).elements(); while (payloads.hasMoreElements()) { int payload = Integer.parseInt((String) payloads.nextElement()); Format fmt = AVProfile.getVideoFormat(payload); if (fmt != null) { formats.put(new Integer(payload), fmt); } } Enumeration attributes = md.getAttributes(false).elements(); while (attributes.hasMoreElements()) { Attribute attribute = (Attribute) attributes.nextElement(); if (attribute.getName().equals("rtpmap")) { RTPVideoFormat fmt = RTPVideoFormat.parseFormat(attribute.getValue()); formats.put(new Integer(fmt.getPayloadType()), fmt); } } return formats; }
private static HashMap<Integer, Format> getVideoFormats(MediaDescription md) throws SdpParseException, SdpException { HashMap<Integer, Format> formats = new HashMap<Integer, Format>(); Media media = md.getMedia(); Enumeration<String> payloads = media.getMediaFormats(false).elements(); while (payloads.hasMoreElements()) { int payload = Integer.parseInt((String) payloads.nextElement()); Format fmt = AVProfile.getVideoFormat(payload); if (fmt != null) { formats.put(new Integer(payload), fmt); } } Enumeration attributes = md.getAttributes(false).elements(); while (attributes.hasMoreElements()) { Attribute attribute = (Attribute) attributes.nextElement(); if (attribute.getName().equals("rtpmap")) { RTPVideoFormat fmt = RTPVideoFormat.parseFormat(attribute.getValue()); formats.put(new Integer(fmt.getPayloadType()), fmt); } } return formats; }
private static HashMap<Integer, Format> getAudioFormats(MediaDescription md) throws SdpParseException, SdpException { HashMap<Integer, Format> formats = new HashMap<Integer, Format>(); Media media = md.getMedia(); Enumeration payloads = media.getMediaFormats(false).elements(); while (payloads.hasMoreElements()) { int payload = Integer.parseInt((String) payloads.nextElement()); Format fmt = AVProfile.getAudioFormat(payload); if (fmt != null) { formats.put(new Integer(payload), fmt); } } Enumeration attributes = md.getAttributes(false).elements(); while (attributes.hasMoreElements()) { Attribute attribute = (Attribute) attributes.nextElement(); if (attribute.getName().equals("rtpmap")) { RTPAudioFormat fmt = RTPAudioFormat.parseRtpmapFormat(attribute.getValue()); if (fmt != null) { formats.put(new Integer(fmt.getPayloadType()), fmt); } } } return formats; }
private static HashMap<Integer, Format> getAudioFormats(MediaDescription md) throws SdpParseException, SdpException { HashMap<Integer, Format> formats = new HashMap<Integer, Format>(); Media media = md.getMedia(); Enumeration payloads = media.getMediaFormats(false).elements(); while (payloads.hasMoreElements()) { int payload = Integer.parseInt((String) payloads.nextElement()); Format fmt = AVProfile.getAudioFormat(payload); if (fmt != null) { formats.put(new Integer(payload), fmt); } } Enumeration attributes = md.getAttributes(false).elements(); while (attributes.hasMoreElements()) { Attribute attribute = (Attribute) attributes.nextElement(); if (attribute.getName().equals("rtpmap")) { RTPAudioFormat fmt = RTPAudioFormat.parseRtpmapFormat(attribute.getValue()); if (fmt != null) { formats.put(new Integer(fmt.getPayloadType()), fmt); } } } return formats; }
private Collection<RTPFormat> getRTPFormats(MediaDescription md) throws SdpParseException { ArrayList<RTPFormat> formats = new ArrayList(); Vector<String> fmts = md.getMedia().getMediaFormats(false); Vector<Attribute> attributes = md.getAttributes(false);
private Collection<RTPFormat> getRTPFormats(MediaDescription md) throws SdpParseException { ArrayList<RTPFormat> formats = new ArrayList(); Vector<String> fmts = md.getMedia().getMediaFormats(false); Vector<Attribute> attributes = md.getAttributes(false);
Vector formats = media.getMediaFormats(false); formats.removeAll(excludeFormats);
Vector formats = media.getMediaFormats(false); formats.removeAll(excludeFormats);