code: public void negotiateFormats(MediaDescriptionField media) {
  		// Clean currently offered formats
  		this.offeredFormats.clean();
  		
  		// Map payload types to RTP Format
          for (String payloadType : media.getPayloadTypes()) {
          	RTPFormat format;
          	try {
  				int payloadTypeInt = Integer.parseInt(payloadType);
  
  				if(payloadTypeInt < AVProfile.DYNAMIC_PT_MIN || payloadTypeInt > AVProfile.DYNAMIC_PT_MAX) {
  					// static payload type
  					format = AVProfile.getFormat(payloadTypeInt, AVProfile.AUDIO);
  				} else {
  					// dynamic payload type
  					final RtpMapAttribute codecSdp = media.getFormat(payloadTypeInt);
  					final String codecName = codecSdp.getCodec();
  					final RTPFormat staticFormat = AVProfile.getFormat(codecName);
  
  					// Check if code is supported
  					final boolean supported = staticFormat != null && staticFormat.getClockRate() == codecSdp.getClockRate();
  					if(supported) {
  						format = new RTPFormat(payloadTypeInt, staticFormat.getFormat(), staticFormat.getClockRate());
  					} else {
  						format = null;
  					}
  				}
  			} catch (NumberFormatException e) {
          		format = null;
  			}
  
  			if(format != null) {
          		this.offeredFormats.add(format);
  			} else {
          		if (logger.isDebugEnabled()) {
  					logger.debug(this.mediaType + " channel " + this.ssrc + " dropped unsupported RTP payload type " + payloadType);
  				}
  			}
          }
  		
  		// Negotiate the formats and store intersection
  		this.negotiatedFormats.clean();
  		this.supportedFormats.intersection(this.offeredFormats, this.negotiatedFormats);
  		
  		// Apply formats
  		setFormats(this.negotiatedFormats);
  		this.negotiated = true;
  	}
docs: Negotiates the list of supported codecs with the remote peer over SDP.
  
  @param media
  The corresponding media description of the remote peer which
  contains the payload types.