Agora C++ API Reference for All Platforms
Public Member Functions | Public Attributes | List of all members
agora::rtc::ChannelMediaOptions Struct Reference

Public Member Functions

 ChannelMediaOptions ()
 
 ~ChannelMediaOptions ()
 
void SetAll (const ChannelMediaOptions &change)
 
bool operator== (const ChannelMediaOptions &o) const
 
ChannelMediaOptionsoperator= (const ChannelMediaOptions &replace)
 

Public Attributes

Optional< bool > publishCameraTrack
 
Optional< bool > publishSecondaryCameraTrack
 
Optional< bool > publishMicrophoneTrack
 
Optional< bool > publishScreenCaptureVideo
 
Optional< bool > publishScreenCaptureAudio
 
Optional< bool > publishScreenTrack
 
Optional< bool > publishSecondaryScreenTrack
 
Optional< bool > publishCustomAudioTrack
 
Optional< int > publishCustomAudioSourceId
 
Optional< bool > publishCustomAudioTrackEnableAec
 
Optional< bool > publishDirectCustomAudioTrack
 
Optional< bool > publishCustomAudioTrackAec
 
Optional< bool > publishCustomVideoTrack
 
Optional< bool > publishEncodedVideoTrack
 
Optional< bool > publishMediaPlayerAudioTrack
 
Optional< bool > publishMediaPlayerVideoTrack
 
Optional< bool > publishTrancodedVideoTrack
 
Optional< bool > autoSubscribeAudio
 
Optional< bool > autoSubscribeVideo
 
Optional< bool > enableAudioRecordingOrPlayout
 
Optional< int > publishMediaPlayerId
 
Optional< CLIENT_ROLE_TYPEclientRoleType
 
Optional< AUDIENCE_LATENCY_LEVEL_TYPEaudienceLatencyLevel
 
Optional< VIDEO_STREAM_TYPEdefaultVideoStreamType
 
Optional< CHANNEL_PROFILE_TYPEchannelProfile
 
Optional< int > audioDelayMs
 
Optional< int > mediaPlayerAudioDelayMs
 
Optional< const char * > token
 
Optional< bool > enableBuiltInMediaEncryption
 
Optional< bool > publishRhythmPlayerTrack
 
Optional< bool > isInteractiveAudience
 
Optional< video_track_id_tcustomVideoTrackId
 
Optional< bool > isAudioFilterable
 

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: (Default) Publish the video track of the secondary camera capturer.
  • false: Do not publish the video track of the secondary 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ publishCustomAudioSourceId

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

The ID of the custom audio source to publish. The default value is 0.

If you have set the value of sourceNumber greater than 1 in setExternalAudioSource, the SDK creates the corresponding number of custom audio tracks and assigns an ID to each audio track starting from 0.

◆ publishCustomAudioTrackEnableAec

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

Whether to enable AEC when publishing the captured audio from a custom source:

  • true: Enable AEC when publishing the captured audio from a custom source.
  • false: (Default) Do not enable AEC when publishing the captured audio from a custom source.

◆ publishDirectCustomAudioTrack

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

Whether to publish direct custom audio track.

  • true: Publish.
  • false: (Default) Do not publish.

◆ publishCustomAudioTrackAec

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

Whether to publish AEC custom audio track.

  • true: Publish AEC track.
  • false: (Default) Do not publish AEC track.

◆ 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.

◆ publishTrancodedVideoTrack

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

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.

◆ 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.