public void setCodecPolicy(CodecPolicy codecPolicy) throws SdpPortManagerException { // checking codec policy: required should not be excluded String[] required = codecPolicy.getRequiredCodecs(); for (String codec : required) { if (lookup(codec, codecPolicy.getExcludedCodecs())) { throw new SdpPortManagerException("Codec " + codec + " is excluded"); } } // checking codec policy: excluded should not be in capabilities or // preferences String[] excluded = codecPolicy.getExcludedCodecs(); for (String codec : excluded) { if (lookup(codec, codecPolicy.getCodecCapabilities())) { throw new SdpPortManagerException("Codec " + codec + " is excluded but in capabilities"); } if (lookup(codec, codecPolicy.getCodecPreferences())) { throw new SdpPortManagerException("Codec " + codec + " is excluded but in preferences"); } } // assign specified policy this.codecPolicy = codecPolicy; }
private boolean applyCodecPolicy(SessionDescription sdp) throws SdpException { for (String f : codecPolicy.getRequiredCodecs()) { if (!sdpProcessor.containsFormat(f, sdp)) { if (f.equalsIgnoreCase("AMR")) { for (String f : codecPolicy.getCodecCapabilities()) { if (!isBogus(f) && !sdpProcessor.containsFormat(f, localSdp)) { connection.error = SdpPortManagerEvent.SDP_NOT_ACCEPTABLE; for (String m : codecPolicy.getMediaTypeCapabilities()) { if (!sdpProcessor.containsMedia(m, localSdp)) { connection.error = SdpPortManagerEvent.SDP_NOT_ACCEPTABLE;
for (String f : codecPolicy.getExcludedCodecs()) { try { sdpProcessor.exclude(f, remoteSdp);
networkConnection.setParameters(sdpParameters); CodecPolicy codecPolicy = new CodecPolicy(); codecPolicy.setMediaTypeCapabilities(mediaAttributes.getMediaType().getCodecPolicy());
for (String f : codecPolicy.getExcludedCodecs()) { try { sdpProcessor.exclude(f, remoteSdp);
public void setCodecPolicy(CodecPolicy codecPolicy) throws SdpPortManagerException { // checking codec policy: required should not be excluded String[] required = codecPolicy.getRequiredCodecs(); for (String codec : required) { if (lookup(codec, codecPolicy.getExcludedCodecs())) { throw new SdpPortManagerException("Codec " + codec + " is excluded"); } } // checking codec policy: excluded should not be in capabilities or // preferences String[] excluded = codecPolicy.getExcludedCodecs(); for (String codec : excluded) { if (lookup(codec, codecPolicy.getCodecCapabilities())) { throw new SdpPortManagerException("Codec " + codec + " is excluded but in capabilities"); } if (lookup(codec, codecPolicy.getCodecPreferences())) { throw new SdpPortManagerException("Codec " + codec + " is excluded but in preferences"); } } // assign specified policy this.codecPolicy = codecPolicy; }
private boolean applyCodecPolicy(SessionDescription sdp) throws SdpException { for (String f : codecPolicy.getRequiredCodecs()) { if (!sdpProcessor.containsFormat(f, sdp)) { if (f.equalsIgnoreCase("AMR")) { for (String f : codecPolicy.getCodecCapabilities()) { if (!isBogus(f) && !sdpProcessor.containsFormat(f, localSdp)) { connection.error = SdpPortManagerEvent.SDP_NOT_ACCEPTABLE; for (String m : codecPolicy.getMediaTypeCapabilities()) { if (!sdpProcessor.containsMedia(m, localSdp)) { connection.error = SdpPortManagerEvent.SDP_NOT_ACCEPTABLE;