Interface CodecParameters


public interface CodecParameters
Represents codec parameters used in media session configurations.

Implementations of this interface encapsulate essential codec-related properties such as RTP payload type, sampling rate, channel count, target bitrate, and format parameters. These parameters are used during media session negotiation and configuration across various modules of the OCCAS Media Engine.

Example usage:


 CodecParameters codecParams = new CodecParametersImpl.Builder()
     .rtpPayloadType(rtpPayloadType)
     .samplingRate(samplingRate)
     .channelCount(channelCount)
     .targetBitrate(targetBitrate)
     .formatParams(formatParams)
     .build();
 

Replace each variable with the appropriate value.

Author:
Copyright (c) 2025 by Oracle, Inc. All Rights Reserved.
  • Method Details

    • getRtpPayloadType

      Integer getRtpPayloadType()
      Gets the RTP payload type for the codec.
      Returns:
      RTP payload type as an integer, or null if not set.
    • setRtpPayloadType

      void setRtpPayloadType(Integer rtpPayloadType)
      Sets the RTP payload type for the codec.
      Parameters:
      rtpPayloadType - the RTP payload type to set.
    • getSamplingRate

      Integer getSamplingRate()
      Gets the sampling rate for the codec in Hz.
      Returns:
      sampling rate in Hz, or null if not set.
    • setSamplingRate

      void setSamplingRate(Integer samplingRate)
      Sets the sampling rate for the codec in Hz.
      Parameters:
      samplingRate - the sampling rate to set.
    • getChannelCount

      Integer getChannelCount()
      Gets the number of audio channels for the codec.
      Returns:
      number of channels, or null if not set.
    • setChannelCount

      void setChannelCount(Integer channelCount)
      Sets the number of audio channels for the codec.
      Parameters:
      channelCount - the number of channels to set.
    • getTargetBitrate

      Integer getTargetBitrate()
      Gets the target bitrate for the codec in bits per second.
      Returns:
      target bitrate, or null if not set.
    • setTargetBitrate

      void setTargetBitrate(Integer targetBitrate)
      Sets the target bitrate for the codec in bits per second. If sent , this value should be set as 64000 for PCMA and PCMU codec .
      Parameters:
      targetBitrate - the target bitrate to set.
    • getFormatParams

      String getFormatParams()
      Gets the codec format parameters (e.g., SDP fmtp).
      Returns:
      format parameters string, or null if not set.
    • setFormatParams

      void setFormatParams(String formatParams)
      Sets the codec format parameters (e.g., SDP fmtp). Any non-empty value, but must align with codec, rate, etc. The formatParam value is set as "a" line from the SDP Example for OPUS: formatParams ->"a=fmtp:111 maxplaybackrate=16000; maxaveragebitrate=20000; stereo=0; useinbandfec=1; minptime=10"
    • For OPUS codec , the values for “maxplaybackrate” should be from the given set ( 8000, 12000, 16000, 24000, 48000).
    • For OPUS codec , the value for “maxaveragebitrate’ should be in the given range ( 6000–510000) .
    • For AMRNB codec ,value of the mode-set parameter can be anything between 0 to 7, including multiple values also as comma separated. For ex, “0,2,5" is also a valid value . (Example formatParams ->"a=fmtp:98 octet-align=1; mode-change-period=2; mode-change-neighbor=1; mode-set=2,3,4,7")
    • Parameters:
      formatParams - the format parameters to set.
    • getFormat

      String getFormat()
      Gets the codec format ( e.g. ,F32 sl16).
      Returns:
      format string, or null if not set.
    • setFormat

      void setFormat(String format)
      Sets the codec format (e.g., F32 sl16).
      Parameters:
      format - the format to set.