io.agora.rtc

## Class RtcConnConfig

- java.lang.Object
- - io.agora.rtc.RtcConnConfig

-     public class RtcConnConfig
      extends java.lang.Object

  Configuration for RTC connection.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private int` | `audioRecvEncodedFrame` Determines whether to receive audio encoded frame or not.
    `private int` | `audioRecvMediaPacket` Determines whether to receive audio media packet or not.
    `private AudioSubscriptionOptions` | `audioSubsOptions` The options for audio subscription: AudioSubscriptionOptions.
    `private int` | `autoSubscribeAudio` Determines whether to subscribe to all audio streams automatically.
    `private int` | `autoSubscribeVideo` Determines whether to subscribe to all video streams automatically.
    `private int` | `channelProfile` Channel profile
    `private int` | `clientRoleType` The role of the user: #CLIENT_ROLE_TYPE.
    `private int` | `enableAudioRecordingOrPlayout` Determines whether to enable audio recording or playout.
    `private int` | `maxPort` The maximum port.
    `private int` | `maxSendBitrate` The maximum sending bitrate.
    `private int` | `minPort` The minimum port.
    `private int` | `videoRecvMediaPacket` Determines whether to receive video media packet or not.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RtcConnConfig()` Default constructor for RtcConnConfig.
    `RtcConnConfig(int autoSubscribeAudio, int autoSubscribeVideo, int enableAudioRecordingOrPlayout, int maxSendBitrate, int minPort, int maxPort, AudioSubscriptionOptions audioSubsOptions, int clientRoleType, int channelProfile, int audioRecvMediaPacket, int audioRecvEncodedFrame, int videoRecvMediaPacket)` Constructs RtcConnConfig with all parameters.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getAudioRecvEncodedFrame()` Gets whether to receive audio encoded frame.
    `int` | `getAudioRecvMediaPacket()` Gets whether to receive audio media packet.
    `AudioSubscriptionOptions` | `getAudioSubsOptions()` Gets the audio subscription options.
    `int` | `getAutoSubscribeAudio()` Gets whether to subscribe to all audio streams automatically.
    `int` | `getAutoSubscribeVideo()` Gets whether to subscribe to all video streams automatically.
    `int` | `getChannelProfile()` Gets the channel profile.
    `int` | `getClientRoleType()` Gets the client role type.
    `int` | `getEnableAudioRecordingOrPlayout()` Gets whether to enable audio recording or playout.
    `int` | `getMaxPort()` Gets the maximum port.
    `int` | `getMaxSendBitrate()` Gets the maximum sending bitrate.
    `int` | `getMinPort()` Gets the minimum port.
    `int` | `getVideoRecvMediaPacket()` Gets whether to receive video media packet.
    `void` | `setAudioRecvEncodedFrame(int audioRecvEncodedFrame)` Sets whether to receive audio encoded frame.
    `void` | `setAudioRecvMediaPacket(int audioRecvMediaPacket)` Sets whether to receive audio media packet.
    `void` | `setAudioSubsOptions(AudioSubscriptionOptions audioSubsOptions)` Sets the audio subscription options.
    `void` | `setAutoSubscribeAudio(int autoSubscribeAudio)` Sets whether to subscribe to all audio streams automatically.
    `void` | `setAutoSubscribeVideo(int autoSubscribeVideo)` Sets whether to subscribe to all video streams automatically.
    `void` | `setChannelProfile(int channelProfile)` Sets the channel profile.
    `void` | `setClientRoleType(int clientRoleType)` Sets the client role type.
    `void` | `setEnableAudioRecordingOrPlayout(int enableAudioRecordingOrPlayout)` Sets whether to enable audio recording or playout.
    `void` | `setMaxPort(int maxPort)` Sets the maximum port.
    `void` | `setMaxSendBitrate(int maxSendBitrate)` Sets the maximum sending bitrate.
    `void` | `setMinPort(int minPort)` Sets the minimum port.
    `void` | `setVideoRecvMediaPacket(int videoRecvMediaPacket)` Sets whether to receive video media packet.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### autoSubscribeAudio

          private int autoSubscribeAudio

      Determines whether to subscribe to all audio streams automatically. - 1: (Default) Subscribe to all audio streams automatically. - 0: Do not subscribe to any audio stream automatically.

    - #### autoSubscribeVideo

          private int autoSubscribeVideo

      Determines whether to subscribe to all video streams automatically. - 1: (Default) Subscribe to all video streams automatically. - 0: Do not subscribe to any video stream automatically.

    - #### enableAudioRecordingOrPlayout

          private int enableAudioRecordingOrPlayout

      Determines whether to enable audio recording or playout. - 1: It's used to publish audio and mix microphone, or subscribe audio and playout - 0: It's used to publish extenal audio frame only without mixing microphone, or no need audio device to playout audio either

    - #### maxSendBitrate

          private int maxSendBitrate

      The maximum sending bitrate.

    - #### minPort

          private int minPort

      The minimum port.

    - #### maxPort

          private int maxPort

      The maximum port.

    - #### audioSubsOptions

          private AudioSubscriptionOptions audioSubsOptions

      The options for audio subscription: AudioSubscriptionOptions.

    - #### clientRoleType

          private int clientRoleType

      The role of the user: #CLIENT_ROLE_TYPE. The default user role is CLIENT_ROLE_AUDIENCE.

    - #### audioRecvMediaPacket

          private int audioRecvMediaPacket

      Determines whether to receive audio media packet or not.

    - #### audioRecvEncodedFrame

          private int audioRecvEncodedFrame

      Determines whether to receive audio encoded frame or not.

    - #### videoRecvMediaPacket

          private int videoRecvMediaPacket

      Determines whether to receive video media packet or not.

    - #### channelProfile

          private int channelProfile

      Channel profile

  - ### Constructor Detail

    - #### RtcConnConfig

          public RtcConnConfig()

      Default constructor for RtcConnConfig.

    - #### RtcConnConfig

          public RtcConnConfig(int autoSubscribeAudio,
                               int autoSubscribeVideo,
                               int enableAudioRecordingOrPlayout,
                               int maxSendBitrate,
                               int minPort,
                               int maxPort,
                               AudioSubscriptionOptions audioSubsOptions,
                               int clientRoleType,
                               int channelProfile,
                               int audioRecvMediaPacket,
                               int audioRecvEncodedFrame,
                               int videoRecvMediaPacket)

      Constructs RtcConnConfig with all parameters.
      Parameters:
        `autoSubscribeAudio` - Whether to subscribe to all audio streams automatically
        `autoSubscribeVideo` - Whether to subscribe to all video streams automatically
        `enableAudioRecordingOrPlayout` - Whether to enable audio recording or playout
        `maxSendBitrate` - Maximum sending bitrate
        `minPort` - Minimum port
        `maxPort` - Maximum port
        `audioSubsOptions` - Audio subscription options
        `clientRoleType` - Client role type
        `channelProfile` - Channel profile
        `audioRecvMediaPacket` - Whether to receive audio media packet
        `audioRecvEncodedFrame` - Whether to receive audio encoded frame
        `videoRecvMediaPacket` - Whether to receive video media packet

  - ### Method Detail

    - #### getAutoSubscribeAudio

          public int getAutoSubscribeAudio()

      Gets whether to subscribe to all audio streams automatically.
      Returns:
        1 to subscribe automatically, 0 otherwise

    - #### setAutoSubscribeAudio

          public void setAutoSubscribeAudio(int autoSubscribeAudio)

      Sets whether to subscribe to all audio streams automatically.
      Parameters:
        `autoSubscribeAudio` - 1 to subscribe automatically, 0 otherwise

    - #### getAutoSubscribeVideo

          public int getAutoSubscribeVideo()

      Gets whether to subscribe to all video streams automatically.
      Returns:
        1 to subscribe automatically, 0 otherwise

    - #### setAutoSubscribeVideo

          public void setAutoSubscribeVideo(int autoSubscribeVideo)

      Sets whether to subscribe to all video streams automatically.
      Parameters:
        `autoSubscribeVideo` - 1 to subscribe automatically, 0 otherwise

    - #### getEnableAudioRecordingOrPlayout

          public int getEnableAudioRecordingOrPlayout()

      Gets whether to enable audio recording or playout.
      Returns:
        1 to enable, 0 otherwise

    - #### setEnableAudioRecordingOrPlayout

          public void setEnableAudioRecordingOrPlayout(int enableAudioRecordingOrPlayout)

      Sets whether to enable audio recording or playout.
      Parameters:
        `enableAudioRecordingOrPlayout` - 1 to enable, 0 otherwise

    - #### getMaxSendBitrate

          public int getMaxSendBitrate()

      Gets the maximum sending bitrate.
      Returns:
        Maximum sending bitrate

    - #### setMaxSendBitrate

          public void setMaxSendBitrate(int maxSendBitrate)

      Sets the maximum sending bitrate.
      Parameters:
        `maxSendBitrate` - Maximum sending bitrate

    - #### getMinPort

          public int getMinPort()

      Gets the minimum port.
      Returns:
        Minimum port

    - #### setMinPort

          public void setMinPort(int minPort)

      Sets the minimum port.
      Parameters:
        `minPort` - Minimum port

    - #### getMaxPort

          public int getMaxPort()

      Gets the maximum port.
      Returns:
        Maximum port

    - #### setMaxPort

          public void setMaxPort(int maxPort)

      Sets the maximum port.
      Parameters:
        `maxPort` - Maximum port

    - #### getAudioSubsOptions

          public AudioSubscriptionOptions getAudioSubsOptions()

      Gets the audio subscription options.
      Returns:
        Audio subscription options

    - #### setAudioSubsOptions

          public void setAudioSubsOptions(AudioSubscriptionOptions audioSubsOptions)

      Sets the audio subscription options.
      Parameters:
        `audioSubsOptions` - Audio subscription options

    - #### getClientRoleType

          public int getClientRoleType()

      Gets the client role type.
      Returns:
        Client role type

    - #### setClientRoleType

          public void setClientRoleType(int clientRoleType)

      Sets the client role type.
      Parameters:
        `clientRoleType` - Client role type

    - #### getChannelProfile

          public int getChannelProfile()

      Gets the channel profile.
      Returns:
        Channel profile

    - #### setChannelProfile

          public void setChannelProfile(int channelProfile)

      Sets the channel profile.
      Parameters:
        `channelProfile` - Channel profile

    - #### getAudioRecvMediaPacket

          public int getAudioRecvMediaPacket()

      Gets whether to receive audio media packet.
      Returns:
        1 to receive, 0 otherwise

    - #### setAudioRecvMediaPacket

          public void setAudioRecvMediaPacket(int audioRecvMediaPacket)

      Sets whether to receive audio media packet.
      Parameters:
        `audioRecvMediaPacket` - 1 to receive, 0 otherwise

    - #### getAudioRecvEncodedFrame

          public int getAudioRecvEncodedFrame()

      Gets whether to receive audio encoded frame.
      Returns:
        1 to receive, 0 otherwise

    - #### setAudioRecvEncodedFrame

          public void setAudioRecvEncodedFrame(int audioRecvEncodedFrame)

      Sets whether to receive audio encoded frame.
      Parameters:
        `audioRecvEncodedFrame` - 1 to receive, 0 otherwise

    - #### getVideoRecvMediaPacket

          public int getVideoRecvMediaPacket()

      Gets whether to receive video media packet.
      Returns:
        1 to receive, 0 otherwise

    - #### setVideoRecvMediaPacket

          public void setVideoRecvMediaPacket(int videoRecvMediaPacket)

      Sets whether to receive video media packet.
      Parameters:
        `videoRecvMediaPacket` - 1 to receive, 0 otherwise

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`