Agora C++ API Reference for All Platforms

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
agora::rtc::ChannelMediaOptions Struct Reference

`#include <IAgoraRtcEngine.h>`

## Public Member Functions
| ChannelMediaOptions ()
| ~ChannelMediaOptions ()
void | SetAll (const ChannelMediaOptions &change)
bool | operator== (const ChannelMediaOptions &o) const
ChannelMediaOptions & | operator= (const ChannelMediaOptions &replace)

## Public Attributes
Optional< bool > | publishCameraTrack
Optional< bool > | publishSecondaryCameraTrack
Optional< bool > | publishThirdCameraTrack
Optional< bool > | publishFourthCameraTrack
Optional< bool > | publishMicrophoneTrack
Optional< bool > | publishScreenCaptureAudio
Optional< bool > | publishScreenCaptureVideo
Optional< bool > | publishScreenTrack
Optional< bool > | publishSecondaryScreenTrack
Optional< bool > | publishThirdScreenTrack
Optional< bool > | publishFourthScreenTrack
Optional< bool > | publishCustomAudioTrack
Optional< int > | publishCustomAudioTrackId
Optional< bool > | publishCustomVideoTrack
Optional< bool > | publishEncodedVideoTrack
Optional< bool > | publishMediaPlayerAudioTrack
Optional< bool > | publishMediaPlayerVideoTrack
Optional< bool > | publishTranscodedVideoTrack
Optional< bool > | publishMixedAudioTrack
Optional< bool > | publishLipSyncTrack
Optional< bool > | autoSubscribeAudio
Optional< bool > | autoSubscribeVideo
Optional< bool > | enableAudioRecordingOrPlayout
Optional< int > | publishMediaPlayerId
Optional< CLIENT_ROLE_TYPE > | clientRoleType
Optional< AUDIENCE_LATENCY_LEVEL_TYPE > | audienceLatencyLevel
Optional< VIDEO_STREAM_TYPE > | defaultVideoStreamType
Optional< CHANNEL_PROFILE_TYPE > | channelProfile
Optional< int > | audioDelayMs
Optional< int > | mediaPlayerAudioDelayMs
Optional< const char * > | token
Optional< bool > | enableBuiltInMediaEncryption
Optional< bool > | publishRhythmPlayerTrack
Optional< bool > | isInteractiveAudience
Optional< video_track_id_t > | customVideoTrackId
Optional< bool > | isAudioFilterable
Optional< const char * > | parameters
Optional< bool > | enableMultipath
Optional< MultipathMode > | uplinkMultipathMode
Optional< MultipathMode > | downlinkMultipathMode
Optional< MultipathType > | preferMultipathType

## Detailed Description

The channel media options.

Agora supports publishing multiple audio streams and one video stream at the same time and in the same RtcConnection. For example, `publishAudioTrack`, `publishCustomAudioTrack` and `publishMediaPlayerAudioTrack` can be true at the same time; but only one of `publishCameraTrack`, `publishScreenTrack`, `publishCustomVideoTrack`, and `publishEncodedVideoTrack` can be true at the same time.

## Constructor & Destructor Documentation

## ◆ ChannelMediaOptions()

agora::rtc::ChannelMediaOptions::ChannelMediaOptions | ( |  | ) |
| inline

## ◆ ~ChannelMediaOptions()

agora::rtc::ChannelMediaOptions::~ChannelMediaOptions | ( |  | ) |
| inline

## Member Function Documentation

## ◆ SetAll()

void agora::rtc::ChannelMediaOptions::SetAll | ( | const ChannelMediaOptions & | change | ) |
| inline

## ◆ operator==()

bool agora::rtc::ChannelMediaOptions::operator== | ( | const ChannelMediaOptions & | o | ) | const
| inline

## ◆ operator=()

ChannelMediaOptions & agora::rtc::ChannelMediaOptions::operator= | ( | const ChannelMediaOptions & | replace | ) |
| inline

## Member Data Documentation

## ◆ publishCameraTrack

Optional<bool> agora::rtc::ChannelMediaOptions::publishCameraTrack

Whether to publish the video of the camera track.

- `true`: (Default) Publish the video track of the camera capturer.
- `false`: Do not publish the video track of the camera capturer.

## ◆ publishSecondaryCameraTrack

Optional<bool> agora::rtc::ChannelMediaOptions::publishSecondaryCameraTrack

Whether to publish the video of the secondary camera track.

- `true`: Publish the video track of the secondary camera capturer.
- `false`: (Default) Do not publish the video track of the secondary camera capturer.

## ◆ publishThirdCameraTrack

Optional<bool> agora::rtc::ChannelMediaOptions::publishThirdCameraTrack

Whether to publish the video of the third camera track.

- `true`: Publish the video track of the third camera capturer.
- `false`: (Default) Do not publish the video track of the third camera capturer.

## ◆ publishFourthCameraTrack

Optional<bool> agora::rtc::ChannelMediaOptions::publishFourthCameraTrack

Whether to publish the video of the fourth camera track.

- `true`: Publish the video track of the fourth camera capturer.
- `false`: (Default) Do not publish the video track of the fourth camera capturer.

## ◆ publishMicrophoneTrack

Optional<bool> agora::rtc::ChannelMediaOptions::publishMicrophoneTrack

Whether to publish the recorded audio.

- `true`: (Default) Publish the recorded audio.
- `false`: Do not publish the recorded audio.

## ◆ publishScreenCaptureAudio

Optional<bool> agora::rtc::ChannelMediaOptions::publishScreenCaptureAudio

Whether to publish the audio track of the screen capturer:

- `true`: Publish the video audio of the screen capturer.
- `false`: (Default) Do not publish the audio track of the screen capturer.

## ◆ publishScreenCaptureVideo

Optional<bool> agora::rtc::ChannelMediaOptions::publishScreenCaptureVideo

Whether to publish the video track of the screen capturer:

- `true`: Publish the video track of the screen capture.
- `false`: (Default) Do not publish the video track of the screen capture.

## ◆ publishScreenTrack

Optional<bool> agora::rtc::ChannelMediaOptions::publishScreenTrack

Whether to publish the captured video from the screen:

- `true`: PPublish the captured video from the screen.
- `false`: (Default) Do not publish the captured video from the screen.

## ◆ publishSecondaryScreenTrack

Optional<bool> agora::rtc::ChannelMediaOptions::publishSecondaryScreenTrack

Whether to publish the captured video from the secondary screen:

- true: Publish the captured video from the secondary screen.
- false: (Default) Do not publish the captured video from the secondary screen.

## ◆ publishThirdScreenTrack

Optional<bool> agora::rtc::ChannelMediaOptions::publishThirdScreenTrack

Whether to publish the captured video from the third screen:

- true: Publish the captured video from the third screen.
- false: (Default) Do not publish the captured video from the third screen.

## ◆ publishFourthScreenTrack

Optional<bool> agora::rtc::ChannelMediaOptions::publishFourthScreenTrack

Whether to publish the captured video from the fourth screen:

- true: Publish the captured video from the fourth screen.
- false: (Default) Do not publish the captured video from the fourth screen.

## ◆ publishCustomAudioTrack

Optional<bool> agora::rtc::ChannelMediaOptions::publishCustomAudioTrack

Whether to publish the captured audio from a custom source:

- true: Publish the captured audio from a custom source.
- false: (Default) Do not publish the captured audio from the custom source.

## ◆ publishCustomAudioTrackId

Optional<int> agora::rtc::ChannelMediaOptions::publishCustomAudioTrackId

The custom audio track id. The default value is 0.

## ◆ publishCustomVideoTrack

Optional<bool> agora::rtc::ChannelMediaOptions::publishCustomVideoTrack

Whether to publish the captured video from a custom source:

- `true`: Publish the captured video from a custom source.
- `false`: (Default) Do not publish the captured video from the custom source.

## ◆ publishEncodedVideoTrack

Optional<bool> agora::rtc::ChannelMediaOptions::publishEncodedVideoTrack

Whether to publish the encoded video:

- `true`: Publish the encoded video.
- `false`: (Default) Do not publish the encoded video.

## ◆ publishMediaPlayerAudioTrack

Optional<bool> agora::rtc::ChannelMediaOptions::publishMediaPlayerAudioTrack

Whether to publish the audio from the media player:

- `true`: Publish the audio from the media player.
- `false`: (Default) Do not publish the audio from the media player.

## ◆ publishMediaPlayerVideoTrack

Optional<bool> agora::rtc::ChannelMediaOptions::publishMediaPlayerVideoTrack

Whether to publish the video from the media player:

- `true`: Publish the video from the media player.
- `false`: (Default) Do not publish the video from the media player.

## ◆ publishTranscodedVideoTrack

Optional<bool> agora::rtc::ChannelMediaOptions::publishTranscodedVideoTrack

Whether to publish the local transcoded video track.

- `true`: Publish the video track of local transcoded video track.
- `false`: (Default) Do not publish the local transcoded video track.

## ◆ publishMixedAudioTrack

Optional<bool> agora::rtc::ChannelMediaOptions::publishMixedAudioTrack

Whether to publish the local mixed track.

- `true`: Publish the audio track of local mixed track.
- `false`: (Default) Do not publish the local mixed track.

## ◆ publishLipSyncTrack

Optional<bool> agora::rtc::ChannelMediaOptions::publishLipSyncTrack

Whether to publish the local lip sync video track.

- `true`: Publish the video track of local lip sync video track.
- `false`: (Default) Do not publish the local lip sync video track.

## ◆ autoSubscribeAudio

Optional<bool> agora::rtc::ChannelMediaOptions::autoSubscribeAudio

Whether to automatically subscribe to all remote audio streams when the user joins a channel:

- `true`: (Default) Subscribe to all remote audio streams.
- `false`: Do not subscribe to any remote audio stream.

## ◆ autoSubscribeVideo

Optional<bool> agora::rtc::ChannelMediaOptions::autoSubscribeVideo

Whether to subscribe to all remote video streams when the user joins the channel:

- `true`: (Default) Subscribe to all remote video streams.
- `false`: Do not subscribe to any remote video stream.

## ◆ enableAudioRecordingOrPlayout

Optional<bool> agora::rtc::ChannelMediaOptions::enableAudioRecordingOrPlayout

Whether to enable audio capturing or playback.

- `true`: (Default) Enable audio capturing and playback.
- `false`: Do not enable audio capturing or playback.

## ◆ publishMediaPlayerId

Optional<int> agora::rtc::ChannelMediaOptions::publishMediaPlayerId

The ID of the media player to be published. The default value is 0.

## ◆ clientRoleType

Optional<CLIENT_ROLE_TYPE> agora::rtc::ChannelMediaOptions::clientRoleType

The client role type. See CLIENT_ROLE_TYPE. Default is CLIENT_ROLE_AUDIENCE.

## ◆ audienceLatencyLevel

Optional<AUDIENCE_LATENCY_LEVEL_TYPE> agora::rtc::ChannelMediaOptions::audienceLatencyLevel

The audience latency level type. See AUDIENCE_LATENCY_LEVEL_TYPE.

## ◆ defaultVideoStreamType

Optional<VIDEO_STREAM_TYPE> agora::rtc::ChannelMediaOptions::defaultVideoStreamType

The default video stream type. See VIDEO_STREAM_TYPE. Default is VIDEO_STREAM_HIGH.

## ◆ channelProfile

Optional<CHANNEL_PROFILE_TYPE> agora::rtc::ChannelMediaOptions::channelProfile

The channel profile. See CHANNEL_PROFILE_TYPE. Default is CHANNEL_PROFILE_LIVE_BROADCASTING.

## ◆ audioDelayMs

Optional<int> agora::rtc::ChannelMediaOptions::audioDelayMs

The delay in ms for sending audio frames. This is used for explicit control of A/V sync. To switch off the delay, set the value to zero.

## ◆ mediaPlayerAudioDelayMs

Optional<int> agora::rtc::ChannelMediaOptions::mediaPlayerAudioDelayMs

The delay in ms for sending media player audio frames. This is used for explicit control of A/V sync. To switch off the delay, set the value to zero.

## ◆ token

Optional<const char*> agora::rtc::ChannelMediaOptions::token

(Optional) The token generated on your server for authentication.

Note
  - This parameter takes effect only when calling `updateChannelMediaOptions` or `updateChannelMediaOptionsEx`.
  - Ensure that the App ID, channel name, and user name used for creating the token are the same ones as those used by the initialize method for initializing the RTC engine, and those used by the `joinChannel [2/2]` and `joinChannelEx` methods for joining the channel.

## ◆ enableBuiltInMediaEncryption

Optional<bool> agora::rtc::ChannelMediaOptions::enableBuiltInMediaEncryption

Whether to enable media packet encryption:

- `true`: Yes.
- `false`: (Default) No.

Note
  This parameter is ignored when calling `updateChannelMediaOptions`.

## ◆ publishRhythmPlayerTrack

Optional<bool> agora::rtc::ChannelMediaOptions::publishRhythmPlayerTrack

Whether to publish the sound of the rhythm player to remote users:

- `true`: (Default) Publish the sound of the rhythm player.
- `false`: Do not publish the sound of the rhythm player.

## ◆ isInteractiveAudience

Optional<bool> agora::rtc::ChannelMediaOptions::isInteractiveAudience

Whether the user is an interactive audience member in the channel.

- `true`: Enable low lentancy and smooth video when joining as an audience.
- `false`: (Default) Use default settings for audience role.
  Note
    This mode is only used for audience. In PK mode, client might join one channel as broadcaster, and join another channel as interactive audience to achieve low lentancy and smooth video from remote user.

## ◆ customVideoTrackId

Optional<video_track_id_t> agora::rtc::ChannelMediaOptions::customVideoTrackId

The custom video track id which will used to publish or preview. You can get the VideoTrackId after calling createCustomVideoTrack() of IRtcEngine.

## ◆ isAudioFilterable

Optional<bool> agora::rtc::ChannelMediaOptions::isAudioFilterable

Whether local audio stream can be filtered.

- `true`: (Default) Can be filtered when audio level is low.
- `false`: Do not Filter this audio stream.

## ◆ parameters

Optional<const char*> agora::rtc::ChannelMediaOptions::parameters

Provides the technical preview functionalities or special customizations by configuring the SDK with JSON options. Pointer to the set parameters in a JSON string. @technical preview

## ◆ enableMultipath

Optional<bool> agora::rtc::ChannelMediaOptions::enableMultipath

Whether to enable multipath transmission.

- `true`: Enable multipath transmission.
- `false`: Disable multipath transmission.

## ◆ uplinkMultipathMode

Optional<MultipathMode> agora::rtc::ChannelMediaOptions::uplinkMultipathMode

The mode for uplink multipath transmission. This defines how the uplink multipath is managed.

Note
  Ensure you set `enableMultipath` to `true` when using this parameter.

## ◆ downlinkMultipathMode

Optional<MultipathMode> agora::rtc::ChannelMediaOptions::downlinkMultipathMode

The mode for downlink multipath transmission. This defines how the downlink multipath is managed.

Note
  Ensure you set `enableMultipath` to `true` when using this parameter.

## ◆ preferMultipathType

Optional<MultipathType> agora::rtc::ChannelMediaOptions::preferMultipathType

The preferred type of multipath transmission. This allows the user to specify a preferred multipath type.

Note
  Ensure you set `enableMultipath` to `true` when using this parameter. This parameter is only effective when you set `MultipathMode` to `Dynamic`.