// // ARRtcEngine SDK // // Copyright (c) 2019 anyrtc.io. All rights reserved. // /** @defgroup createARRtcEngine Create an ARRtcEngine */ #ifndef __I_AR_RTC_ENGINE_H__ #define __I_AR_RTC_ENGINE_H__ #include "ArBase.h" #include "IArService.h" #if defined(_WIN32) #include "IArMediaEngine.h" #endif #ifndef AR #define AR ar::rtc #endif #ifndef AU #define AU ar::util #endif namespace ar { namespace rtc { typedef const char* uid_t; typedef void* view_t; /** Maximum length of the device ID. */ enum MAX_DEVICE_ID_LENGTH_TYPE { /** The maximum length of the device ID is 512 bytes. */ MAX_DEVICE_ID_LENGTH = 512 }; /** Maximum length of user account. */ enum MAX_USER_ACCOUNT_LENGTH_TYPE { /** The maximum length of user account is 255 bytes. */ MAX_USER_ACCOUNT_LENGTH = 256 }; /** Maximum length of channel ID. */ enum MAX_CHANNEL_ID_LENGTH_TYPE { /** The maximum length of channel id is 64 bytes. */ MAX_CHANNEL_ID_LENGTH = 65 }; /** Formats of the quality report. */ enum QUALITY_REPORT_FORMAT_TYPE { /** 0: The quality report in JSON format, */ QUALITY_REPORT_JSON = 0, /** 1: The quality report in HTML format. */ QUALITY_REPORT_HTML = 1, }; enum MEDIA_ENGINE_EVENT_CODE_TYPE { /** 0: For internal use only. */ MEDIA_ENGINE_RECORDING_ERROR = 0, /** 1: For internal use only. */ MEDIA_ENGINE_PLAYOUT_ERROR = 1, /** 2: For internal use only. */ MEDIA_ENGINE_RECORDING_WARNING = 2, /** 3: For internal use only. */ MEDIA_ENGINE_PLAYOUT_WARNING = 3, /** 10: For internal use only. */ MEDIA_ENGINE_AUDIO_FILE_MIX_FINISH = 10, /** 12: For internal use only. */ MEDIA_ENGINE_AUDIO_FAREND_MUSIC_BEGINS = 12, /** 13: For internal use only. */ MEDIA_ENGINE_AUDIO_FAREND_MUSIC_ENDS = 13, /** 14: For internal use only. */ MEDIA_ENGINE_LOCAL_AUDIO_RECORD_ENABLED = 14, /** 15: For internal use only. */ MEDIA_ENGINE_LOCAL_AUDIO_RECORD_DISABLED = 15, // media engine role changed /** 20: For internal use only. */ MEDIA_ENGINE_ROLE_BROADCASTER_SOLO = 20, /** 21: For internal use only. */ MEDIA_ENGINE_ROLE_BROADCASTER_INTERACTIVE = 21, /** 22: For internal use only. */ MEDIA_ENGINE_ROLE_AUDIENCE = 22, /** 23: For internal use only. */ MEDIA_ENGINE_ROLE_COMM_PEER = 23, /** 24: For internal use only. */ MEDIA_ENGINE_ROLE_GAME_PEER = 24, // iOS adm sample rate changed /** 110: For internal use only. */ MEDIA_ENGINE_AUDIO_ADM_REQUIRE_RESTART = 110, /** 111: For internal use only. */ MEDIA_ENGINE_AUDIO_ADM_SPECIAL_RESTART = 111, /** 112: For internal use only. */ MEDIA_ENGINE_AUDIO_ADM_USING_COMM_PARAMS = 112, /** 113: For internal use only. */ MEDIA_ENGINE_AUDIO_ADM_USING_NORM_PARAMS = 113, // audio mix state /** 710: For internal use only. */ MEDIA_ENGINE_AUDIO_EVENT_MIXING_PLAY = 710, /** 711: For internal use only. */ MEDIA_ENGINE_AUDIO_EVENT_MIXING_PAUSED = 711, /** 712: For internal use only. */ MEDIA_ENGINE_AUDIO_EVENT_MIXING_RESTART = 712, /** 713: For internal use only. */ MEDIA_ENGINE_AUDIO_EVENT_MIXING_STOPPED = 713, /** 714: For internal use only. */ MEDIA_ENGINE_AUDIO_EVENT_MIXING_ERROR = 714, //Mixing error codes /** 701: For internal use only. */ MEDIA_ENGINE_AUDIO_ERROR_MIXING_OPEN = 701, /** 702: For internal use only. */ MEDIA_ENGINE_AUDIO_ERROR_MIXING_TOO_FREQUENT = 702, /** 703: The audio mixing file playback is interrupted. For internal use only. */ MEDIA_ENGINE_AUDIO_ERROR_MIXING_INTERRUPTED_EOF = 703, /** 0: For internal use only. */ MEDIA_ENGINE_AUDIO_ERROR_MIXING_NO_ERROR = 0, }; /** The states of the local user's audio mixing file. */ enum AUDIO_MIXING_STATE_TYPE{ /** 710: The audio mixing file is playing. */ AUDIO_MIXING_STATE_PLAYING = 710, /** 711: The audio mixing file pauses playing. */ AUDIO_MIXING_STATE_PAUSED = 711, /** 713: The audio mixing file stops playing. */ AUDIO_MIXING_STATE_STOPPED = 713, /** 714: An exception occurs when playing the audio mixing file. See #AUDIO_MIXING_ERROR_TYPE. */ AUDIO_MIXING_STATE_FAILED = 714, }; /** The error codes of the local user's audio mixing file. */ enum AUDIO_MIXING_ERROR_TYPE{ /** 701: The SDK cannot open the audio mixing file. */ AUDIO_MIXING_ERROR_CAN_NOT_OPEN = 701, /** 702: The SDK opens the audio mixing file too frequently. */ AUDIO_MIXING_ERROR_TOO_FREQUENT_CALL = 702, /** 703: The audio mixing file playback is interrupted. */ AUDIO_MIXING_ERROR_INTERRUPTED_EOF = 703, /** 0: The SDK can open the audio mixing file. */ AUDIO_MIXING_ERROR_OK = 0, }; /** Media device states. */ enum MEDIA_DEVICE_STATE_TYPE { /** 1: The device is active. */ MEDIA_DEVICE_STATE_ACTIVE = 1, /** 2: The device is disabled. */ MEDIA_DEVICE_STATE_DISABLED = 2, /** 4: The device is not present. */ MEDIA_DEVICE_STATE_NOT_PRESENT = 4, /** 8: The device is unplugged. */ MEDIA_DEVICE_STATE_UNPLUGGED = 8 }; /** Media device types. */ enum MEDIA_DEVICE_TYPE { /** -1: Unknown device type. */ UNKNOWN_AUDIO_DEVICE = -1, /** 0: Audio playback device. */ AUDIO_PLAYOUT_DEVICE = 0, /** 1: Audio recording device. */ AUDIO_RECORDING_DEVICE = 1, /** 2: Video renderer. */ VIDEO_RENDER_DEVICE = 2, /** 3: Video capturer. */ VIDEO_CAPTURE_DEVICE = 3, /** 4: Application audio playback device. */ AUDIO_APPLICATION_PLAYOUT_DEVICE = 4, }; /** Local video state types */ enum LOCAL_VIDEO_STREAM_STATE { /** 0: Initial state */ LOCAL_VIDEO_STREAM_STATE_STOPPED = 0, /** 1: The local video capturing device starts successfully. * * The SDK also reports this state when you share a maximized window by calling \ref IRtcEngine::startScreenCaptureByWindowId "startScreenCaptureByWindowId". */ LOCAL_VIDEO_STREAM_STATE_CAPTURING = 1, /** 2: The first video frame is successfully encoded. */ LOCAL_VIDEO_STREAM_STATE_ENCODING = 2, /** 3: The local video fails to start. */ LOCAL_VIDEO_STREAM_STATE_FAILED = 3 }; /** Local video state error codes */ enum LOCAL_VIDEO_STREAM_ERROR { /** 0: The local video is normal. */ LOCAL_VIDEO_STREAM_ERROR_OK = 0, /** 1: No specified reason for the local video failure. */ LOCAL_VIDEO_STREAM_ERROR_FAILURE = 1, /** 2: No permission to use the local video capturing device. */ LOCAL_VIDEO_STREAM_ERROR_DEVICE_NO_PERMISSION = 2, /** 3: The local video capturing device is in use. */ LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY = 3, /** 4: The local video capture fails. Check whether the capturing device is working properly. */ LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE = 4, /** 5: The local video encoding fails. */ LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE = 5, /** 6: (iOS only) The application is in the background. * * @since v3.3.0 */ LOCAL_VIDEO_STREAM_ERROR_CAPTURE_INBACKGROUND = 6, /** 7: (iOS only) The application is running in Slide Over, Split View, or Picture in Picture mode. * * @since v3.3.0 */ LOCAL_VIDEO_STREAM_ERROR_CAPTURE_MULTIPLE_FOREGROUND_APPS = 7, /** 11: The shared window is minimized when you call \ref IRtcEngine::startScreenCaptureByWindowId "startScreenCaptureByWindowId" to share a window. */ LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_MINIMIZED = 11, /** 12: The error code indicates that a window shared by the window ID has been closed, or a full-screen window * shared by the window ID has exited full-screen mode. * After exiting full-screen mode, remote users cannot see the shared window. To prevent remote users from seeing a * black screen, AR recommends that you immediately stop screen sharing. * * Common scenarios for reporting this error code: * - When the local user closes the shared window, the SDK reports this error code. * - The local user shows some slides in full-screen mode first, and then shares the windows of the slides. After * the user exits full-screen mode, the SDK reports this error code. * - The local user watches web video or reads web document in full-screen mode first, and then shares the window of * the web video or document. After the user exits full-screen mode, the SDK reports this error code. */ LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_CLOSED = 12, }; /** Local audio state types. */ enum LOCAL_AUDIO_STREAM_STATE { /** 0: The local audio is in the initial state. */ LOCAL_AUDIO_STREAM_STATE_STOPPED = 0, /** 1: The recording device starts successfully. */ LOCAL_AUDIO_STREAM_STATE_RECORDING = 1, /** 2: The first audio frame encodes successfully. */ LOCAL_AUDIO_STREAM_STATE_ENCODING = 2, /** 3: The local audio fails to start. */ LOCAL_AUDIO_STREAM_STATE_FAILED = 3 }; /** Local audio state error codes. */ enum LOCAL_AUDIO_STREAM_ERROR { /** 0: The local audio is normal. */ LOCAL_AUDIO_STREAM_ERROR_OK = 0, /** 1: No specified reason for the local audio failure. */ LOCAL_AUDIO_STREAM_ERROR_FAILURE = 1, /** 2: No permission to use the local audio device. */ LOCAL_AUDIO_STREAM_ERROR_DEVICE_NO_PERMISSION = 2, /** 3: The microphone is in use. */ LOCAL_AUDIO_STREAM_ERROR_DEVICE_BUSY = 3, /** 4: The local audio recording fails. Check whether the recording device * is working properly. */ LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE = 4, /** 5: The local audio encoding fails. */ LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE = 5 }; /** Audio recording qualities. */ enum AUDIO_RECORDING_QUALITY_TYPE { /** 0: Low quality. The sample rate is 32 kHz, and the file size is around * 1.2 MB after 10 minutes of recording. */ AUDIO_RECORDING_QUALITY_LOW = 0, /** 1: Medium quality. The sample rate is 32 kHz, and the file size is * around 2 MB after 10 minutes of recording. */ AUDIO_RECORDING_QUALITY_MEDIUM = 1, /** 2: High quality. The sample rate is 32 kHz, and the file size is * around 3.75 MB after 10 minutes of recording. */ AUDIO_RECORDING_QUALITY_HIGH = 2, }; /** Network quality types. */ enum QUALITY_TYPE { /** 0: The network quality is unknown. */ QUALITY_UNKNOWN = 0, /** 1: The network quality is excellent. */ QUALITY_EXCELLENT = 1, /** 2: The network quality is quite good, but the bitrate may be slightly lower than excellent. */ QUALITY_GOOD = 2, /** 3: Users can feel the communication slightly impaired. */ QUALITY_POOR = 3, /** 4: Users cannot communicate smoothly. */ QUALITY_BAD = 4, /** 5: The network is so bad that users can barely communicate. */ QUALITY_VBAD = 5, /** 6: The network is down and users cannot communicate at all. */ QUALITY_DOWN = 6, /** 7: Users cannot detect the network quality. (Not in use.) */ QUALITY_UNSUPPORTED = 7, /** 8: Detecting the network quality. */ QUALITY_DETECTING = 8, }; /** Video display modes. */ enum RENDER_MODE_TYPE { /** 1: Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents. */ RENDER_MODE_HIDDEN = 1, /** 2: Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to disparity in the aspect ratio are filled with black. */ RENDER_MODE_FIT = 2, /** **DEPRECATED** 3: This mode is deprecated. */ RENDER_MODE_ADAPTIVE = 3, /** 4: The fill mode. In this mode, the SDK stretches or zooms the video to fill the display window. */ RENDER_MODE_FILL = 4, }; /** Video mirror modes. */ enum VIDEO_MIRROR_MODE_TYPE { /** 0: (Default) The SDK enables the mirror mode. */ VIDEO_MIRROR_MODE_AUTO = 0,//determined by SDK /** 1: Enable mirror mode. */ VIDEO_MIRROR_MODE_ENABLED = 1,//enabled mirror /** 2: Disable mirror mode. */ VIDEO_MIRROR_MODE_DISABLED = 2,//disable mirror }; /** **DEPRECATED** Video profiles. */ enum VIDEO_PROFILE_TYPE { /** 0: 160 * 120, frame rate 15 fps, bitrate 65 Kbps. */ VIDEO_PROFILE_LANDSCAPE_120P = 0, /** 2: 120 * 120, frame rate 15 fps, bitrate 50 Kbps. */ VIDEO_PROFILE_LANDSCAPE_120P_3 = 2, /** 10: 320*180, frame rate 15 fps, bitrate 140 Kbps. */ VIDEO_PROFILE_LANDSCAPE_180P = 10, /** 12: 180 * 180, frame rate 15 fps, bitrate 100 Kbps. */ VIDEO_PROFILE_LANDSCAPE_180P_3 = 12, /** 13: 240 * 180, frame rate 15 fps, bitrate 120 Kbps. */ VIDEO_PROFILE_LANDSCAPE_180P_4 = 13, /** 20: 320 * 240, frame rate 15 fps, bitrate 200 Kbps. */ VIDEO_PROFILE_LANDSCAPE_240P = 20, /** 22: 240 * 240, frame rate 15 fps, bitrate 140 Kbps. */ VIDEO_PROFILE_LANDSCAPE_240P_3 = 22, /** 23: 424 * 240, frame rate 15 fps, bitrate 220 Kbps. */ VIDEO_PROFILE_LANDSCAPE_240P_4 = 23, /** 30: 640 * 360, frame rate 15 fps, bitrate 400 Kbps. */ VIDEO_PROFILE_LANDSCAPE_360P = 30, /** 32: 360 * 360, frame rate 15 fps, bitrate 260 Kbps. */ VIDEO_PROFILE_LANDSCAPE_360P_3 = 32, /** 33: 640 * 360, frame rate 30 fps, bitrate 600 Kbps. */ VIDEO_PROFILE_LANDSCAPE_360P_4 = 33, /** 35: 360 * 360, frame rate 30 fps, bitrate 400 Kbps. */ VIDEO_PROFILE_LANDSCAPE_360P_6 = 35, /** 36: 480 * 360, frame rate 15 fps, bitrate 320 Kbps. */ VIDEO_PROFILE_LANDSCAPE_360P_7 = 36, /** 37: 480 * 360, frame rate 30 fps, bitrate 490 Kbps. */ VIDEO_PROFILE_LANDSCAPE_360P_8 = 37, /** 38: 640 * 360, frame rate 15 fps, bitrate 800 Kbps. @note `LIVE_BROADCASTING` profile only. */ VIDEO_PROFILE_LANDSCAPE_360P_9 = 38, /** 39: 640 * 360, frame rate 24 fps, bitrate 800 Kbps. @note `LIVE_BROADCASTING` profile only. */ VIDEO_PROFILE_LANDSCAPE_360P_10 = 39, /** 100: 640 * 360, frame rate 24 fps, bitrate 1000 Kbps. @note `LIVE_BROADCASTING` profile only. */ VIDEO_PROFILE_LANDSCAPE_360P_11 = 100, /** 40: 640 * 480, frame rate 15 fps, bitrate 500 Kbps. */ VIDEO_PROFILE_LANDSCAPE_480P = 40, /** 42: 480 * 480, frame rate 15 fps, bitrate 400 Kbps. */ VIDEO_PROFILE_LANDSCAPE_480P_3 = 42, /** 43: 640 * 480, frame rate 30 fps, bitrate 750 Kbps. */ VIDEO_PROFILE_LANDSCAPE_480P_4 = 43, /** 45: 480 * 480, frame rate 30 fps, bitrate 600 Kbps. */ VIDEO_PROFILE_LANDSCAPE_480P_6 = 45, /** 47: 848 * 480, frame rate 15 fps, bitrate 610 Kbps. */ VIDEO_PROFILE_LANDSCAPE_480P_8 = 47, /** 48: 848 * 480, frame rate 30 fps, bitrate 930 Kbps. */ VIDEO_PROFILE_LANDSCAPE_480P_9 = 48, /** 49: 640 * 480, frame rate 10 fps, bitrate 400 Kbps. */ VIDEO_PROFILE_LANDSCAPE_480P_10 = 49, /** 50: 1280 * 720, frame rate 15 fps, bitrate 1130 Kbps. */ VIDEO_PROFILE_LANDSCAPE_720P = 50, /** 52: 1280 * 720, frame rate 30 fps, bitrate 1710 Kbps. */ VIDEO_PROFILE_LANDSCAPE_720P_3 = 52, /** 54: 960 * 720, frame rate 15 fps, bitrate 910 Kbps. */ VIDEO_PROFILE_LANDSCAPE_720P_5 = 54, /** 55: 960 * 720, frame rate 30 fps, bitrate 1380 Kbps. */ VIDEO_PROFILE_LANDSCAPE_720P_6 = 55, /** 60: 1920 * 1080, frame rate 15 fps, bitrate 2080 Kbps. */ VIDEO_PROFILE_LANDSCAPE_1080P = 60, /** 62: 1920 * 1080, frame rate 30 fps, bitrate 3150 Kbps. */ VIDEO_PROFILE_LANDSCAPE_1080P_3 = 62, /** 64: 1920 * 1080, frame rate 60 fps, bitrate 4780 Kbps. */ VIDEO_PROFILE_LANDSCAPE_1080P_5 = 64, /** 66: 2560 * 1440, frame rate 30 fps, bitrate 4850 Kbps. */ VIDEO_PROFILE_LANDSCAPE_1440P = 66, /** 67: 2560 * 1440, frame rate 60 fps, bitrate 6500 Kbps. */ VIDEO_PROFILE_LANDSCAPE_1440P_2 = 67, /** 70: 3840 * 2160, frame rate 30 fps, bitrate 6500 Kbps. */ VIDEO_PROFILE_LANDSCAPE_4K = 70, /** 72: 3840 * 2160, frame rate 60 fps, bitrate 6500 Kbps. */ VIDEO_PROFILE_LANDSCAPE_4K_3 = 72, /** 1000: 120 * 160, frame rate 15 fps, bitrate 65 Kbps. */ VIDEO_PROFILE_PORTRAIT_120P = 1000, /** 1002: 120 * 120, frame rate 15 fps, bitrate 50 Kbps. */ VIDEO_PROFILE_PORTRAIT_120P_3 = 1002, /** 1010: 180 * 320, frame rate 15 fps, bitrate 140 Kbps. */ VIDEO_PROFILE_PORTRAIT_180P = 1010, /** 1012: 180 * 180, frame rate 15 fps, bitrate 100 Kbps. */ VIDEO_PROFILE_PORTRAIT_180P_3 = 1012, /** 1013: 180 * 240, frame rate 15 fps, bitrate 120 Kbps. */ VIDEO_PROFILE_PORTRAIT_180P_4 = 1013, /** 1020: 240 * 320, frame rate 15 fps, bitrate 200 Kbps. */ VIDEO_PROFILE_PORTRAIT_240P = 1020, /** 1022: 240 * 240, frame rate 15 fps, bitrate 140 Kbps. */ VIDEO_PROFILE_PORTRAIT_240P_3 = 1022, /** 1023: 240 * 424, frame rate 15 fps, bitrate 220 Kbps. */ VIDEO_PROFILE_PORTRAIT_240P_4 = 1023, /** 1030: 360 * 640, frame rate 15 fps, bitrate 400 Kbps. */ VIDEO_PROFILE_PORTRAIT_360P = 1030, /** 1032: 360 * 360, frame rate 15 fps, bitrate 260 Kbps. */ VIDEO_PROFILE_PORTRAIT_360P_3 = 1032, /** 1033: 360 * 640, frame rate 30 fps, bitrate 600 Kbps. */ VIDEO_PROFILE_PORTRAIT_360P_4 = 1033, /** 1035: 360 * 360, frame rate 30 fps, bitrate 400 Kbps. */ VIDEO_PROFILE_PORTRAIT_360P_6 = 1035, /** 1036: 360 * 480, frame rate 15 fps, bitrate 320 Kbps. */ VIDEO_PROFILE_PORTRAIT_360P_7 = 1036, /** 1037: 360 * 480, frame rate 30 fps, bitrate 490 Kbps. */ VIDEO_PROFILE_PORTRAIT_360P_8 = 1037, /** 1038: 360 * 640, frame rate 15 fps, bitrate 800 Kbps. @note `LIVE_BROADCASTING` profile only. */ VIDEO_PROFILE_PORTRAIT_360P_9 = 1038, /** 1039: 360 * 640, frame rate 24 fps, bitrate 800 Kbps. @note `LIVE_BROADCASTING` profile only. */ VIDEO_PROFILE_PORTRAIT_360P_10 = 1039, /** 1100: 360 * 640, frame rate 24 fps, bitrate 1000 Kbps. @note `LIVE_BROADCASTING` profile only. */ VIDEO_PROFILE_PORTRAIT_360P_11 = 1100, /** 1040: 480 * 640, frame rate 15 fps, bitrate 500 Kbps. */ VIDEO_PROFILE_PORTRAIT_480P = 1040, /** 1042: 480 * 480, frame rate 15 fps, bitrate 400 Kbps. */ VIDEO_PROFILE_PORTRAIT_480P_3 = 1042, /** 1043: 480 * 640, frame rate 30 fps, bitrate 750 Kbps. */ VIDEO_PROFILE_PORTRAIT_480P_4 = 1043, /** 1045: 480 * 480, frame rate 30 fps, bitrate 600 Kbps. */ VIDEO_PROFILE_PORTRAIT_480P_6 = 1045, /** 1047: 480 * 848, frame rate 15 fps, bitrate 610 Kbps. */ VIDEO_PROFILE_PORTRAIT_480P_8 = 1047, /** 1048: 480 * 848, frame rate 30 fps, bitrate 930 Kbps. */ VIDEO_PROFILE_PORTRAIT_480P_9 = 1048, /** 1049: 480 * 640, frame rate 10 fps, bitrate 400 Kbps. */ VIDEO_PROFILE_PORTRAIT_480P_10 = 1049, /** 1050: 720 * 1280, frame rate 15 fps, bitrate 1130 Kbps. */ VIDEO_PROFILE_PORTRAIT_720P = 1050, /** 1052: 720 * 1280, frame rate 30 fps, bitrate 1710 Kbps. */ VIDEO_PROFILE_PORTRAIT_720P_3 = 1052, /** 1054: 720 * 960, frame rate 15 fps, bitrate 910 Kbps. */ VIDEO_PROFILE_PORTRAIT_720P_5 = 1054, /** 1055: 720 * 960, frame rate 30 fps, bitrate 1380 Kbps. */ VIDEO_PROFILE_PORTRAIT_720P_6 = 1055, /** 1060: 1080 * 1920, frame rate 15 fps, bitrate 2080 Kbps. */ VIDEO_PROFILE_PORTRAIT_1080P = 1060, /** 1062: 1080 * 1920, frame rate 30 fps, bitrate 3150 Kbps. */ VIDEO_PROFILE_PORTRAIT_1080P_3 = 1062, /** 1064: 1080 * 1920, frame rate 60 fps, bitrate 4780 Kbps. */ VIDEO_PROFILE_PORTRAIT_1080P_5 = 1064, /** 1066: 1440 * 2560, frame rate 30 fps, bitrate 4850 Kbps. */ VIDEO_PROFILE_PORTRAIT_1440P = 1066, /** 1067: 1440 * 2560, frame rate 60 fps, bitrate 6500 Kbps. */ VIDEO_PROFILE_PORTRAIT_1440P_2 = 1067, /** 1070: 2160 * 3840, frame rate 30 fps, bitrate 6500 Kbps. */ VIDEO_PROFILE_PORTRAIT_4K = 1070, /** 1072: 2160 * 3840, frame rate 60 fps, bitrate 6500 Kbps. */ VIDEO_PROFILE_PORTRAIT_4K_3 = 1072, /** Default 640 * 360, frame rate 15 fps, bitrate 400 Kbps. */ VIDEO_PROFILE_DEFAULT = VIDEO_PROFILE_LANDSCAPE_360P, }; /** Audio profiles. Sets the sample rate, bitrate, encoding mode, and the number of channels:*/ enum AUDIO_PROFILE_TYPE // sample rate, bit rate, mono/stereo, speech/music codec { /** 0: Default audio profile: - For the interactive streaming profile: A sample rate of 48 KHz, music encoding, mono, and a bitrate of up to 64 Kbps. - For the `COMMUNICATION` profile: - Windows: A sample rate of 16 KHz, music encoding, mono, and a bitrate of up to 16 Kbps. - Android/macOS/iOS: A sample rate of 32 KHz, music encoding, mono, and a bitrate of up to 18 Kbps. */ AUDIO_PROFILE_DEFAULT = 0, // use default settings /** 1: A sample rate of 32 KHz, audio encoding, mono, and a bitrate of up to 18 Kbps. */ AUDIO_PROFILE_SPEECH_STANDARD = 1, // 32Khz, 18Kbps, mono, speech /** 2: A sample rate of 48 KHz, music encoding, mono, and a bitrate of up to 64 Kbps. */ AUDIO_PROFILE_MUSIC_STANDARD = 2, // 48Khz, 48Kbps, mono, music /** 3: A sample rate of 48 KHz, music encoding, stereo, and a bitrate of up to 80 Kbps. */ AUDIO_PROFILE_MUSIC_STANDARD_STEREO = 3, // 48Khz, 56Kbps, stereo, music /** 4: A sample rate of 48 KHz, music encoding, mono, and a bitrate of up to 96 Kbps. */ AUDIO_PROFILE_MUSIC_HIGH_QUALITY = 4, // 48Khz, 128Kbps, mono, music /** 5: A sample rate of 48 KHz, music encoding, stereo, and a bitrate of up to 128 Kbps. */ AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO = 5, // 48Khz, 192Kbps, stereo, music /** 6: A sample rate of 16 KHz, audio encoding, mono, and Acoustic Echo Cancellation (AES) enabled. */ AUDIO_PROFILE_IOT = 6, AUDIO_PROFILE_NUM = 7, }; /** Audio application scenarios. */ enum AUDIO_SCENARIO_TYPE // set a suitable scenario for your app type { /** 0: Default audio scenario. */ AUDIO_SCENARIO_DEFAULT = 0, /** 1: Entertainment scenario where users need to frequently switch the user role. */ AUDIO_SCENARIO_CHATROOM_ENTERTAINMENT = 1, /** 2: Education scenario where users want smoothness and stability. */ AUDIO_SCENARIO_EDUCATION = 2, /** 3: High-quality audio chatroom scenario where hosts mainly play music. */ AUDIO_SCENARIO_GAME_STREAMING = 3, /** 4: Showroom scenario where a single host wants high-quality audio. */ AUDIO_SCENARIO_SHOWROOM = 4, /** 5: Gaming scenario for group chat that only contains the human voice. */ AUDIO_SCENARIO_CHATROOM_GAMING = 5, /** 6: IoT (Internet of Things) scenario where users use IoT devices with low power consumption. */ AUDIO_SCENARIO_IOT = 6, /** 8: Meeting scenario that mainly contains the human voice. * * @since v3.2.0 */ AUDIO_SCENARIO_MEETING = 8, /** The number of elements in the enumeration. */ AUDIO_SCENARIO_NUM = 9, }; /** The channel profile of the AR RtcEngine. */ enum CHANNEL_PROFILE_TYPE { /** (Default) Communication. This profile applies to scenarios such as an audio call or video call, * where all users can publish and subscribe to streams. */ CHANNEL_PROFILE_COMMUNICATION = 0, /** Live streaming. In this profile, uses have roles, namely, host and audience (default). * A host both publishes and subscribes to streams, while an audience subscribes to streams only. * This profile applies to scenarios such as a chat room or interactive video streaming. */ CHANNEL_PROFILE_LIVE_BROADCASTING = 1, /** 2: Gaming. This profile uses a codec with a lower bitrate and consumes less power. Applies to the gaming scenario, where all game players can talk freely. * * @note AR does not recommend using this setting. */ CHANNEL_PROFILE_GAME = 2, }; /// @cond /** The role of a user in a live interactive streaming. */ enum CLIENT_ROLE_TYPE { /** 1: Host. A host can both send and receive streams. */ CLIENT_ROLE_BROADCASTER = 1, /** 2: (Default) Audience. An `audience` member can only receive streams. */ CLIENT_ROLE_AUDIENCE = 2, }; /** The latency level of an audience member in a live interactive streaming. * * @note Takes effect only when the user role is `CLIENT_ROLE_BROADCASTER`. */ enum AUDIENCE_LATENCY_LEVEL_TYPE { /** 1: Low latency. */ AUDIENCE_LATENCY_LEVEL_LOW_LATENCY = 1, /** 2: (Default) Ultra low latency. */ AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY = 2, }; /// @cond /** The reason why the super-resolution algorithm is not successfully enabled. */ enum SUPER_RESOLUTION_STATE_REASON { /** 0: The super-resolution algorithm is successfully enabled. */ SR_STATE_REASON_SUCCESS = 0, /** 1: The origin resolution of the remote video is beyond the range where * the super-resolution algorithm can be applied. */ SR_STATE_REASON_STREAM_OVER_LIMITATION = 1, /** 2: Another user is already using the super-resolution algorithm. */ SR_STATE_REASON_USER_COUNT_OVER_LIMITATION = 2, /** 3: The device does not support the super-resolution algorithm. */ SR_STATE_REASON_DEVICE_NOT_SUPPORTED = 3, }; /// @endcond /** Reasons for a user being offline. */ enum USER_OFFLINE_REASON_TYPE { /** 0: The user quits the call. */ USER_OFFLINE_QUIT = 0, /** 1: The SDK times out and the user drops offline because no data packet is received within a certain period of time. If the user quits the call and the message is not passed to the SDK (due to an unreliable channel), the SDK assumes the user dropped offline. */ USER_OFFLINE_DROPPED = 1, /** 2: (Live broadcast only.) The client role switched from the host to the audience. */ USER_OFFLINE_BECOME_AUDIENCE = 2, }; /** States of the RTMP streaming. */ enum RTMP_STREAM_PUBLISH_STATE { /** The RTMP streaming has not started or has ended. This state is also triggered after you remove an RTMP address from the CDN by calling removePublishStreamUrl. */ RTMP_STREAM_PUBLISH_STATE_IDLE = 0, /** The SDK is connecting to AR's streaming server and the RTMP server. This state is triggered after you call the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method. */ RTMP_STREAM_PUBLISH_STATE_CONNECTING = 1, /** The RTMP streaming publishes. The SDK successfully publishes the RTMP streaming and returns this state. */ RTMP_STREAM_PUBLISH_STATE_RUNNING = 2, /** The RTMP streaming is recovering. When exceptions occur to the CDN, or the streaming is interrupted, the SDK tries to resume RTMP streaming and returns this state. - If the SDK successfully resumes the streaming, #RTMP_STREAM_PUBLISH_STATE_RUNNING (2) returns. - If the streaming does not resume within 60 seconds or server errors occur, #RTMP_STREAM_PUBLISH_STATE_FAILURE (4) returns. You can also reconnect to the server by calling the \ref IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" and \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" methods. */ RTMP_STREAM_PUBLISH_STATE_RECOVERING = 3, /** The RTMP streaming fails. See the errCode parameter for the detailed error information. You can also call the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method to publish the RTMP streaming again. */ RTMP_STREAM_PUBLISH_STATE_FAILURE = 4, }; /** Error codes of the RTMP streaming. */ enum RTMP_STREAM_PUBLISH_ERROR { /** The RTMP streaming publishes successfully. */ RTMP_STREAM_PUBLISH_ERROR_OK = 0, /** Invalid argument used. If, for example, you do not call the \ref IRtcEngine::setLiveTranscoding "setLiveTranscoding" method to configure the LiveTranscoding parameters before calling the addPublishStreamUrl method, the SDK returns this error. Check whether you set the parameters in the *setLiveTranscoding* method properly. */ RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT = 1, /** The RTMP streaming is encrypted and cannot be published. */ RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED = 2, /** Timeout for the RTMP streaming. Call the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method to publish the streaming again. */ RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT = 3, /** An error occurs in AR's streaming server. Call the addPublishStreamUrl method to publish the streaming again. */ RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR = 4, /** An error occurs in the RTMP server. */ RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR = 5, /** The RTMP streaming publishes too frequently. */ RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN = 6, /** The host publishes more than 10 URLs. Delete the unnecessary URLs before adding new ones. */ RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT = 7, /** The host manipulates other hosts' URLs. Check your app logic. */ RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED = 8, /** AR's server fails to find the RTMP streaming. */ RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND = 9, /** The format of the RTMP streaming URL is not supported. Check whether the URL format is correct. */ RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED = 10, /** 推流中的背景图片或者水印地址无法拉取 **/ RTMP_STREAMING_ERROR_FAILED_LOAD_IMAGE = 11, }; /** Events during the RTMP streaming. */ enum RTMP_STREAMING_EVENT { /** An error occurs when you add a background image or a watermark image to the RTMP stream. */ RTMP_STREAMING_EVENT_FAILED_LOAD_IMAGE = 1, }; /** States of importing an external video stream in the live interactive streaming. */ enum INJECT_STREAM_STATUS { /** 0: The external video stream imported successfully. */ INJECT_STREAM_STATUS_START_SUCCESS = 0, /** 1: The external video stream already exists. */ INJECT_STREAM_STATUS_START_ALREADY_EXISTS = 1, /** 2: The external video stream to be imported is unauthorized. */ INJECT_STREAM_STATUS_START_UNAUTHORIZED = 2, /** 3: Import external video stream timeout. */ INJECT_STREAM_STATUS_START_TIMEDOUT = 3, /** 4: Import external video stream failed. */ INJECT_STREAM_STATUS_START_FAILED = 4, /** 5: The external video stream stopped importing successfully. */ INJECT_STREAM_STATUS_STOP_SUCCESS = 5, /** 6: No external video stream is found. */ INJECT_STREAM_STATUS_STOP_NOT_FOUND = 6, /** 7: The external video stream to be stopped importing is unauthorized. */ INJECT_STREAM_STATUS_STOP_UNAUTHORIZED = 7, /** 8: Stop importing external video stream timeout. */ INJECT_STREAM_STATUS_STOP_TIMEDOUT = 8, /** 9: Stop importing external video stream failed. */ INJECT_STREAM_STATUS_STOP_FAILED = 9, /** 10: The external video stream is corrupted. */ INJECT_STREAM_STATUS_BROKEN = 10, }; /** Remote video stream types. */ enum REMOTE_VIDEO_STREAM_TYPE { /** 0: High-stream video. */ REMOTE_VIDEO_STREAM_HIGH = 0, /** 1: Low-stream video. */ REMOTE_VIDEO_STREAM_LOW = 1, }; /** Use modes of the \ref media::IAudioFrameObserver::onRecordAudioFrame "onRecordAudioFrame" callback. */ enum RAW_AUDIO_FRAME_OP_MODE_TYPE { /** 0: Read-only mode: Users only read the \ref AM::IAudioFrameObserver::AudioFrame "AudioFrame" data without modifying anything. For example, when users acquire the data with the AR SDK, then push the RTMP streams. */ RAW_AUDIO_FRAME_OP_MODE_READ_ONLY = 0, /** 1: Write-only mode: Users replace the \ref AM::IAudioFrameObserver::AudioFrame "AudioFrame" data with their own data and pass the data to the SDK for encoding. For example, when users acquire the data. */ RAW_AUDIO_FRAME_OP_MODE_WRITE_ONLY = 1, /** 2: Read and write mode: Users read the data from \ref AM::IAudioFrameObserver::AudioFrame "AudioFrame", modify it, and then play it. For example, when users have their own sound-effect processing module and perform some voice pre-processing, such as a voice change. */ RAW_AUDIO_FRAME_OP_MODE_READ_WRITE = 2, }; /** Audio-sample rates. */ enum AUDIO_SAMPLE_RATE_TYPE { /** 32000: 32 kHz */ AUDIO_SAMPLE_RATE_32000 = 32000, /** 44100: 44.1 kHz */ AUDIO_SAMPLE_RATE_44100 = 44100, /** 48000: 48 kHz */ AUDIO_SAMPLE_RATE_48000 = 48000, }; /** Video codec profile types. */ enum VIDEO_CODEC_PROFILE_TYPE { /** 66: Baseline video codec profile. Generally used in video calls on mobile phones. */ VIDEO_CODEC_PROFILE_BASELINE = 66, /** 77: Main video codec profile. Generally used in mainstream electronics such as MP4 players, portable video players, PSP, and iPads. */ VIDEO_CODEC_PROFILE_MAIN = 77, /** 100: (Default) High video codec profile. Generally used in high-resolution broadcasts or television. */ VIDEO_CODEC_PROFILE_HIGH = 100, }; /** Video codec types */ enum VIDEO_CODEC_TYPE { /** Standard VP8 */ VIDEO_CODEC_VP8 = 1, /** Standard H264 */ VIDEO_CODEC_H264 = 2, /** Enhanced VP8 */ VIDEO_CODEC_EVP = 3, /** Enhanced H264 */ VIDEO_CODEC_E264 = 4, /** Standard Jpeg*/ VIDEO_CODEC_MJPG = 5, }; /** * Audio codec type list. */ enum AUDIO_CODEC_TYPE { /** * 1: OPUS */ AUDIO_CODEC_OPUS = 1, /** * 3: G711 */ AUDIO_CODEC_G711A = 3, AUDIO_CODEC_G711U = 4, /** * 5: G722 */ AUDIO_CODEC_G722 = 5, /** * 8: AACLC */ AUDIO_CODEC_AACLC = 8, /** * 9: HEAAC */ AUDIO_CODEC_HEAAC = 9, /** * 253: GENERIC */ AUDIO_CODEC_GENERIC = 253, }; /** Video Codec types for publishing streams. */ enum VIDEO_CODEC_TYPE_FOR_STREAM { VIDEO_CODEC_H264_FOR_STREAM = 1, VIDEO_CODEC_H265_FOR_STREAM = 2, }; /** Audio equalization band frequencies. */ enum AUDIO_EQUALIZATION_BAND_FREQUENCY { /** 0: 31 Hz */ AUDIO_EQUALIZATION_BAND_31 = 0, /** 1: 62 Hz */ AUDIO_EQUALIZATION_BAND_62 = 1, /** 2: 125 Hz */ AUDIO_EQUALIZATION_BAND_125 = 2, /** 3: 250 Hz */ AUDIO_EQUALIZATION_BAND_250 = 3, /** 4: 500 Hz */ AUDIO_EQUALIZATION_BAND_500 = 4, /** 5: 1 kHz */ AUDIO_EQUALIZATION_BAND_1K = 5, /** 6: 2 kHz */ AUDIO_EQUALIZATION_BAND_2K = 6, /** 7: 4 kHz */ AUDIO_EQUALIZATION_BAND_4K = 7, /** 8: 8 kHz */ AUDIO_EQUALIZATION_BAND_8K = 8, /** 9: 16 kHz */ AUDIO_EQUALIZATION_BAND_16K = 9, }; /** Audio reverberation types. */ enum AUDIO_REVERB_TYPE { /** 0: The level of the dry signal (db). The value is between -20 and 10. */ AUDIO_REVERB_DRY_LEVEL = 0, // (dB, [-20,10]), the level of the dry signal /** 1: The level of the early reflection signal (wet signal) (dB). The value is between -20 and 10. */ AUDIO_REVERB_WET_LEVEL = 1, // (dB, [-20,10]), the level of the early reflection signal (wet signal) /** 2: The room size of the reflection. The value is between 0 and 100. */ AUDIO_REVERB_ROOM_SIZE = 2, // ([0,100]), the room size of the reflection /** 3: The length of the initial delay of the wet signal (ms). The value is between 0 and 200. */ AUDIO_REVERB_WET_DELAY = 3, // (ms, [0,200]), the length of the initial delay of the wet signal in ms /** 4: The reverberation strength. The value is between 0 and 100. */ AUDIO_REVERB_STRENGTH = 4, // ([0,100]), the strength of the reverberation }; /** * Local voice changer options. */ enum VOICE_CHANGER_PRESET { /** * The original voice (no local voice change). */ VOICE_CHANGER_OFF = 0x00000000, //Turn off the voice changer /** * The voice of an old man. */ VOICE_CHANGER_OLDMAN = 0x00000001, /** * The voice of a little boy. */ VOICE_CHANGER_BABYBOY = 0x00000002, /** * The voice of a little girl. */ VOICE_CHANGER_BABYGIRL = 0x00000003, /** * The voice of Zhu Bajie, a character in Journey to the West who has a voice like that of a growling bear. */ VOICE_CHANGER_ZHUBAJIE = 0x00000004, /** * The ethereal voice. */ VOICE_CHANGER_ETHEREAL = 0x00000005, /** * The voice of Hulk. */ VOICE_CHANGER_HULK = 0x00000006, /** * A more vigorous voice. */ VOICE_BEAUTY_VIGOROUS = 0x00100001,//7, /** * A deeper voice. */ VOICE_BEAUTY_DEEP = 0x00100002, /** * A mellower voice. */ VOICE_BEAUTY_MELLOW = 0x00100003, /** * Falsetto. */ VOICE_BEAUTY_FALSETTO = 0x00100004, /** * A fuller voice. */ VOICE_BEAUTY_FULL = 0x00100005, /** * A clearer voice. */ VOICE_BEAUTY_CLEAR = 0x00100006, /** * A more resounding voice. */ VOICE_BEAUTY_RESOUNDING = 0x00100007, /** * A more ringing voice. */ VOICE_BEAUTY_RINGING = 0x00100008, /** * A more spatially resonant voice. */ VOICE_BEAUTY_SPACIAL = 0x00100009, /** * (For male only) A more magnetic voice. Do not use it when the speaker is a female; otherwise, voice distortion occurs. */ GENERAL_BEAUTY_VOICE_MALE_MAGNETIC = 0x00200001, /** * (For female only) A fresher voice. Do not use it when the speaker is a male; otherwise, voice distortion occurs. */ GENERAL_BEAUTY_VOICE_FEMALE_FRESH = 0x00200002, /** * (For female only) A more vital voice. Do not use it when the speaker is a male; otherwise, voice distortion occurs. */ GENERAL_BEAUTY_VOICE_FEMALE_VITALITY = 0x00200003 }; /** Local voice reverberation presets. */ enum AUDIO_REVERB_PRESET { /** * Turn off local voice reverberation, that is, to use the original voice. */ AUDIO_REVERB_OFF = 0x00000000, // Turn off audio reverb /** * The reverberation style typical of a KTV venue (enhanced). */ AUDIO_REVERB_FX_KTV = 0x00100001, /** * The reverberation style typical of a concert hall (enhanced). */ AUDIO_REVERB_FX_VOCAL_CONCERT = 0x00100002, /** * The reverberation style typical of an uncle's voice. */ AUDIO_REVERB_FX_UNCLE = 0x00100003, /** * The reverberation style typical of a little sister's voice. */ AUDIO_REVERB_FX_SISTER = 0x00100004, /** * The reverberation style typical of a recording studio (enhanced). */ AUDIO_REVERB_FX_STUDIO = 0x00100005, /** * The reverberation style typical of popular music (enhanced). */ AUDIO_REVERB_FX_POPULAR = 0x00100006, /** * The reverberation style typical of R&B music (enhanced). */ AUDIO_REVERB_FX_RNB = 0x00100007, /** * The reverberation style typical of the vintage phonograph. */ AUDIO_REVERB_FX_PHONOGRAPH = 0x00100008, /** * The reverberation style typical of popular music. */ AUDIO_REVERB_POPULAR = 0x00000001, /** * The reverberation style typical of R&B music. */ AUDIO_REVERB_RNB = 0x00000002, /** * The reverberation style typical of rock music. */ AUDIO_REVERB_ROCK = 0x00000003, /** * The reverberation style typical of hip-hop music. */ AUDIO_REVERB_HIPHOP = 0x00000004, /** * The reverberation style typical of a concert hall. */ AUDIO_REVERB_VOCAL_CONCERT = 0x00000005, /** * The reverberation style typical of a KTV venue. */ AUDIO_REVERB_KTV = 0x00000006, /** * The reverberation style typical of a recording studio. */ AUDIO_REVERB_STUDIO = 0x00000007, /** * The reverberation of the virtual stereo. The virtual stereo is an effect that renders the monophonic * audio as the stereo audio, so that all users in the channel can hear the stereo voice effect. * To achieve better virtual stereo reverberation, AR recommends setting `profile` in `setAudioProfile` * as `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)`. */ AUDIO_VIRTUAL_STEREO = 0x00200001, /** 1: Electronic Voice.*/ AUDIO_ELECTRONIC_VOICE = 0x00300001, /** 1: 3D Voice.*/ AUDIO_THREEDIM_VOICE = 0x00400001 }; /** The options for SDK preset voice beautifier effects. */ enum VOICE_BEAUTIFIER_PRESET { /** Turn off voice beautifier effects and use the original voice. */ VOICE_BEAUTIFIER_OFF = 0x00000000, /** A more magnetic voice. * * @note AR recommends using this enumerator to process a male-sounding voice; otherwise, you may experience vocal distortion. */ CHAT_BEAUTIFIER_MAGNETIC = 0x01010100, /** A fresher voice. * * @note AR recommends using this enumerator to process a female-sounding voice; otherwise, you may experience vocal distortion. */ CHAT_BEAUTIFIER_FRESH = 0x01010200, /** A more vital voice. * * @note AR recommends using this enumerator to process a female-sounding voice; otherwise, you may experience vocal distortion. */ CHAT_BEAUTIFIER_VITALITY = 0x01010300, /** A more vigorous voice. */ TIMBRE_TRANSFORMATION_VIGOROUS = 0x01030100, /** A deeper voice. */ TIMBRE_TRANSFORMATION_DEEP = 0x01030200, /** A mellower voice. */ TIMBRE_TRANSFORMATION_MELLOW = 0x01030300, /** A falsetto voice. */ TIMBRE_TRANSFORMATION_FALSETTO = 0x01030400, /** A falsetto voice. */ TIMBRE_TRANSFORMATION_FULL = 0x01030500, /** A clearer voice. */ TIMBRE_TRANSFORMATION_CLEAR = 0x01030600, /** A more resounding voice. */ TIMBRE_TRANSFORMATION_RESOUNDING = 0x01030700, /** A more ringing voice. */ TIMBRE_TRANSFORMATION_RINGING = 0x01030800 }; /** The options for SDK preset audio effects. */ enum AUDIO_EFFECT_PRESET { /** Turn off audio effects and use the original voice. */ AUDIO_EFFECT_OFF = 0x00000000, /** An audio effect typical of a KTV venue. * * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" * and setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` * before setting this enumerator. */ ROOM_ACOUSTICS_KTV = 0x02010100, /** An audio effect typical of a concert hall. * * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" * and setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` * before setting this enumerator. */ ROOM_ACOUSTICS_VOCAL_CONCERT = 0x02010200, /** An audio effect typical of a recording studio. * * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" * and setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` * before setting this enumerator. */ ROOM_ACOUSTICS_STUDIO = 0x02010300, /** An audio effect typical of a vintage phonograph. * * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" * and setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` * before setting this enumerator. */ ROOM_ACOUSTICS_PHONOGRAPH = 0x02010400, /** A virtual stereo effect that renders monophonic audio as stereo audio. * * @note Call \ref IRtcEngine::setAudioProfile "setAudioProfile" and set the `profile` parameter to * `AUDIO_PROFILE_MUSIC_STANDARD_STEREO(3)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before setting this * enumerator; otherwise, the enumerator setting does not take effect. */ ROOM_ACOUSTICS_VIRTUAL_STEREO = 0x02010500, /** A more spatial audio effect. * * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" * and setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` * before setting this enumerator. */ ROOM_ACOUSTICS_SPACIAL = 0x02010600, /** A more ethereal audio effect. * * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" * and setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` * before setting this enumerator. */ ROOM_ACOUSTICS_ETHEREAL = 0x02010700, /** A 3D voice effect that makes the voice appear to be moving around the user. The default cycle period of the 3D * voice effect is 10 seconds. To change the cycle period, call \ref IRtcEngine::setAudioEffectParameters "setAudioEffectParameters" * after this method. * * @note * - Call \ref IRtcEngine::setAudioProfile "setAudioProfile" and set the `profile` parameter to `AUDIO_PROFILE_MUSIC_STANDARD_STEREO(3)` * or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before setting this enumerator; otherwise, the enumerator setting does not take effect. * - If the 3D voice effect is enabled, users need to use stereo audio playback devices to hear the anticipated voice effect. */ ROOM_ACOUSTICS_3D_VOICE = 0x02010800, /** The voice of an uncle. * * @note * - AR recommends using this enumerator to process a male-sounding voice; otherwise, you may not hear the anticipated voice effect. * - To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and * setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before * setting this enumerator. */ VOICE_CHANGER_EFFECT_UNCLE = 0x02020100, /** The voice of an old man. * * @note * - AR recommends using this enumerator to process a male-sounding voice; otherwise, you may not hear the anticipated voice effect. * - To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and setting * the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before setting * this enumerator. */ VOICE_CHANGER_EFFECT_OLDMAN = 0x02020200, /** The voice of a boy. * * @note * - AR recommends using this enumerator to process a male-sounding voice; otherwise, you may not hear the anticipated voice effect. * - To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and setting * the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before * setting this enumerator. */ VOICE_CHANGER_EFFECT_BOY = 0x02020300, /** The voice of a young woman. * * @note * - AR recommends using this enumerator to process a female-sounding voice; otherwise, you may not hear the anticipated voice effect. * - To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and setting * the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before * setting this enumerator. */ VOICE_CHANGER_EFFECT_SISTER = 0x02020400, /** The voice of a girl. * * @note * - AR recommends using this enumerator to process a female-sounding voice; otherwise, you may not hear the anticipated voice effect. * - To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and setting * the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before * setting this enumerator. */ VOICE_CHANGER_EFFECT_GIRL = 0x02020500, /** The voice of Pig King, a character in Journey to the West who has a voice like a growling bear. * * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and * setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before * setting this enumerator. */ VOICE_CHANGER_EFFECT_PIGKING = 0x02020600, /** The voice of Hulk. * * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and * setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before * setting this enumerator. */ VOICE_CHANGER_EFFECT_HULK = 0x02020700, /** An audio effect typical of R&B music. * * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and * setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before * setting this enumerator. */ STYLE_TRANSFORMATION_RNB = 0x02030100, /** An audio effect typical of popular music. * * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and * setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before * setting this enumerator. */ STYLE_TRANSFORMATION_POPULAR = 0x02030200, /** A pitch correction effect that corrects the user's pitch based on the pitch of the natural C major scale. * To change the basic mode and tonic pitch, call \ref IRtcEngine::setAudioEffectParameters "setAudioEffectParameters" after this method. * * @note To achieve better audio effect quality, AR recommends calling \ref IRtcEngine::setAudioProfile "setAudioProfile" and * setting the `profile` parameter to `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before * setting this enumerator. */ PITCH_CORRECTION = 0x02040100 }; /** Audio codec profile types. The default value is LC_ACC. */ enum AUDIO_CODEC_PROFILE_TYPE { /** 0: LC-AAC, which is the low-complexity audio codec type. */ AUDIO_CODEC_PROFILE_LC_AAC = 0, /** 1: HE-AAC, which is the high-efficiency audio codec type. */ AUDIO_CODEC_PROFILE_HE_AAC = 1, }; /** Remote audio states. */ enum REMOTE_AUDIO_STATE { /** 0: The remote audio is in the default state, probably due to * #REMOTE_AUDIO_REASON_LOCAL_MUTED (3), * #REMOTE_AUDIO_REASON_REMOTE_MUTED (5), or * #REMOTE_AUDIO_REASON_REMOTE_OFFLINE (7). */ REMOTE_AUDIO_STATE_STOPPED = 0, // Default state, audio is started or remote user disabled/muted audio stream /** 1: The first remote audio packet is received. */ REMOTE_AUDIO_STATE_STARTING = 1, // The first audio frame packet has been received /** 2: The remote audio stream is decoded and plays normally, probably * due to #REMOTE_AUDIO_REASON_NETWORK_RECOVERY (2), * #REMOTE_AUDIO_REASON_LOCAL_UNMUTED (4), or * #REMOTE_AUDIO_REASON_REMOTE_UNMUTED (6). */ REMOTE_AUDIO_STATE_DECODING = 2, // The first remote audio frame has been decoded or fronzen state ends /** 3: The remote audio is frozen, probably due to * #REMOTE_AUDIO_REASON_NETWORK_CONGESTION (1). */ REMOTE_AUDIO_STATE_FROZEN = 3, // Remote audio is frozen, probably due to network issue /** 4: The remote audio fails to start, probably due to * #REMOTE_AUDIO_REASON_INTERNAL (0). */ REMOTE_AUDIO_STATE_FAILED = 4, // Remote audio play failed }; /** Remote audio state reasons. */ enum REMOTE_AUDIO_STATE_REASON { /** 0: Internal reasons. */ REMOTE_AUDIO_REASON_INTERNAL = 0, /** 1: Network congestion. */ REMOTE_AUDIO_REASON_NETWORK_CONGESTION = 1, /** 2: Network recovery. */ REMOTE_AUDIO_REASON_NETWORK_RECOVERY = 2, /** 3: The local user stops receiving the remote audio stream or * disables the audio module. */ REMOTE_AUDIO_REASON_LOCAL_MUTED = 3, /** 4: The local user resumes receiving the remote audio stream or * enables the audio module. */ REMOTE_AUDIO_REASON_LOCAL_UNMUTED = 4, /** 5: The remote user stops sending the audio stream or disables the * audio module. */ REMOTE_AUDIO_REASON_REMOTE_MUTED = 5, /** 6: The remote user resumes sending the audio stream or enables the * audio module. */ REMOTE_AUDIO_REASON_REMOTE_UNMUTED = 6, /** 7: The remote user leaves the channel. */ REMOTE_AUDIO_REASON_REMOTE_OFFLINE = 7, }; /** Remote video states. */ // enum REMOTE_VIDEO_STATE // { // // REMOTE_VIDEO_STATE_STOPPED is not used at this version. Ignore this value. // // REMOTE_VIDEO_STATE_STOPPED = 0, // Default state, video is started or remote user disabled/muted video stream // /** 1: The remote video is playing. */ // REMOTE_VIDEO_STATE_RUNNING = 1, // Running state, remote video can be displayed normally // /** 2: The remote video is frozen. */ // REMOTE_VIDEO_STATE_FROZEN = 2, // Remote video is frozen, probably due to network issue. // }; /** The state of the remote video. */ enum REMOTE_VIDEO_STATE { /** 0: The remote video is in the default state, probably due to #REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED (3), #REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED (5), or #REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE (7). */ REMOTE_VIDEO_STATE_STOPPED = 0, /** 1: The first remote video packet is received. */ REMOTE_VIDEO_STATE_STARTING = 1, /** 2: The remote video stream is decoded and plays normally, probably due to #REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY (2), #REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED (4), #REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED (6), or #REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY (9). */ REMOTE_VIDEO_STATE_DECODING = 2, /** 3: The remote video is frozen, probably due to #REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION (1) or #REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK (8). */ REMOTE_VIDEO_STATE_FROZEN = 3, /** 4: The remote video fails to start, probably due to #REMOTE_VIDEO_STATE_REASON_INTERNAL (0). */ REMOTE_VIDEO_STATE_FAILED = 4 }; /** The publishing state. */ enum STREAM_PUBLISH_STATE { /** 0: The initial publishing state after joining the channel. */ PUB_STATE_IDLE = 0, /** 1: Fails to publish the local stream. Possible reasons: * - The local user calls \ref IRtcEngine::muteLocalAudioStream "muteLocalAudioStream(true)" or \ref IRtcEngine::muteLocalVideoStream "muteLocalVideoStream(true)" to stop sending local streams. * - The local user calls \ref IRtcEngine::disableAudio "disableAudio" or \ref IRtcEngine::disableVideo "disableVideo" to disable the entire audio or video module. * - The local user calls \ref IRtcEngine::enableLocalAudio "enableLocalAudio(false)" or \ref IRtcEngine::enableLocalVideo "enableLocalVideo(false)" to disable the local audio sampling or video capturing. * - The role of the local user is `AUDIENCE`. */ PUB_STATE_NO_PUBLISHED = 1, /** 2: Publishing. */ PUB_STATE_PUBLISHING = 2, /** 3: Publishes successfully. */ PUB_STATE_PUBLISHED = 3 }; /** The subscribing state. */ enum STREAM_SUBSCRIBE_STATE { /** 0: The initial subscribing state after joining the channel. */ SUB_STATE_IDLE = 0, /** 1: Fails to subscribe to the remote stream. Possible reasons: * - The remote user: * - Calls \ref IRtcEngine::muteLocalAudioStream "muteLocalAudioStream(true)" or \ref IRtcEngine::muteLocalVideoStream "muteLocalVideoStream(true)" to stop sending local streams. * - Calls \ref IRtcEngine::disableAudio "disableAudio" or \ref IRtcEngine::disableVideo "disableVideo" to disable the entire audio or video modules. * - Calls \ref IRtcEngine::enableLocalAudio "enableLocalAudio(false)" or \ref IRtcEngine::enableLocalVideo "enableLocalVideo(false)" to disable the local audio sampling or video capturing. * - The role of the remote user is `AUDIENCE`. * - The local user calls the following methods to stop receiving remote streams: * - Calls \ref IRtcEngine::muteRemoteAudioStream "muteRemoteAudioStream(true)", \ref IRtcEngine::muteAllRemoteAudioStreams "muteAllRemoteAudioStreams(true)", or \ref IRtcEngine::setDefaultMuteAllRemoteAudioStreams "setDefaultMuteAllRemoteAudioStreams(true)" to stop receiving remote audio streams. * - Calls \ref IRtcEngine::muteRemoteVideoStream "muteRemoteVideoStream(true)", \ref IRtcEngine::muteAllRemoteVideoStreams "muteAllRemoteVideoStreams(true)", or \ref IRtcEngine::setDefaultMuteAllRemoteVideoStreams "setDefaultMuteAllRemoteVideoStreams(true)" to stop receiving remote video streams. */ SUB_STATE_NO_SUBSCRIBED = 1, /** 2: Subscribing. */ SUB_STATE_SUBSCRIBING = 2, /** 3: Subscribes to and receives the remote stream successfully. */ SUB_STATE_SUBSCRIBED = 3 }; /** The remote video frozen type. */ enum XLA_REMOTE_VIDEO_FROZEN_TYPE { /** 0: 500ms video frozen type. */ XLA_REMOTE_VIDEO_FROZEN_500MS = 0, /** 1: 200ms video frozen type. */ XLA_REMOTE_VIDEO_FROZEN_200MS = 1, /** 2: 600ms video frozen type. */ XLA_REMOTE_VIDEO_FROZEN_600MS = 2, /** 3: max video frozen type. */ XLA_REMOTE_VIDEO_FROZEN_TYPE_MAX = 3, }; /** The remote audio frozen type. */ enum XLA_REMOTE_AUDIO_FROZEN_TYPE { /** 0: 80ms audio frozen. */ XLA_REMOTE_AUDIO_FROZEN_80MS = 0, /** 1: 200ms audio frozen. */ XLA_REMOTE_AUDIO_FROZEN_200MS = 1, /** 2: max audio frozen type. */ XLA_REMOTE_AUDIO_FROZEN_TYPE_MAX = 2, }; /** The reason for the remote video state change. */ enum REMOTE_VIDEO_STATE_REASON { /** 0: The SDK reports this reason when the video state changes. */ REMOTE_VIDEO_STATE_REASON_INTERNAL = 0, /** 1: Network congestion. */ REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION = 1, /** 2: Network recovery. */ REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY = 2, /** 3: The local user stops receiving the remote video stream or disables the video module. */ REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED = 3, /** 4: The local user resumes receiving the remote video stream or enables the video module. */ REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED = 4, /** 5: The remote user stops sending the video stream or disables the video module. */ REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED = 5, /** 6: The remote user resumes sending the video stream or enables the video module. */ REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED = 6, /** 7: The remote user leaves the channel. */ REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE = 7, /** 8: The remote audio-and-video stream falls back to the audio-only stream due to poor network conditions. */ REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK = 8, /** 9: The remote audio-only stream switches back to the audio-and-video stream after the network conditions improve. */ REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY = 9 }; /** Video frame rates. */ enum FRAME_RATE { /** 1: 1 fps */ FRAME_RATE_FPS_1 = 1, /** 7: 7 fps */ FRAME_RATE_FPS_7 = 7, /** 10: 10 fps */ FRAME_RATE_FPS_10 = 10, /** 15: 15 fps */ FRAME_RATE_FPS_15 = 15, /** 24: 24 fps */ FRAME_RATE_FPS_24 = 24, /** 30: 30 fps */ FRAME_RATE_FPS_30 = 30, /** 60: 60 fps (Windows and macOS only) */ FRAME_RATE_FPS_60 = 60, }; /** Video output orientation modes. */ enum ORIENTATION_MODE { /** 0: (Default) Adaptive mode. The video encoder adapts to the orientation mode of the video input device. - If the width of the captured video from the SDK is greater than the height, the encoder sends the video in landscape mode. The encoder also sends the rotational information of the video, and the receiver uses the rotational information to rotate the received video. - When you use a custom video source, the output video from the encoder inherits the orientation of the original video. If the original video is in portrait mode, the output video from the encoder is also in portrait mode. The encoder also sends the rotational information of the video to the receiver. */ ORIENTATION_MODE_ADAPTIVE = 0, /** 1: Landscape mode. The video encoder always sends the video in landscape mode. The video encoder rotates the original video before sending it and the rotational infomation is 0. This mode applies to scenarios involving CDN live streaming. */ ORIENTATION_MODE_FIXED_LANDSCAPE = 1, /** 2: Portrait mode. The video encoder always sends the video in portrait mode. The video encoder rotates the original video before sending it and the rotational infomation is 0. This mode applies to scenarios involving CDN live streaming. */ ORIENTATION_MODE_FIXED_PORTRAIT = 2, }; /** Video degradation preferences when the bandwidth is a constraint. */ enum DEGRADATION_PREFERENCE { /** 0: (Default) Degrade the frame rate in order to maintain the video quality. */ MAINTAIN_QUALITY = 0, /** 1: Degrade the video quality in order to maintain the frame rate. */ MAINTAIN_FRAMERATE = 1, /** 2: (For future use) Maintain a balance between the frame rate and video quality. */ MAINTAIN_BALANCED = 2, }; /** Stream fallback options. */ enum STREAM_FALLBACK_OPTIONS { /** 0: No fallback behavior for the local/remote video stream when the uplink/downlink network conditions are poor. The quality of the stream is not guaranteed. */ STREAM_FALLBACK_OPTION_DISABLED = 0, /** 1: Under poor downlink network conditions, the remote video stream, to which you subscribe, falls back to the low-stream (low resolution and low bitrate) video. You can set this option only in the \ref IRtcEngine::setRemoteSubscribeFallbackOption "setRemoteSubscribeFallbackOption" method. Nothing happens when you set this in the \ref IRtcEngine::setLocalPublishFallbackOption "setLocalPublishFallbackOption" method. */ STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW = 1, /** 2: Under poor uplink network conditions, the published video stream falls back to audio only. Under poor downlink network conditions, the remote video stream, to which you subscribe, first falls back to the low-stream (low resolution and low bitrate) video; and then to an audio-only stream if the network conditions worsen.*/ STREAM_FALLBACK_OPTION_AUDIO_ONLY = 2, }; /** Camera capturer configuration. */ enum CAPTURER_OUTPUT_PREFERENCE { /** 0: (Default) self-adapts the camera output parameters to the system performance and network conditions to balance CPU consumption and video preview quality. */ CAPTURER_OUTPUT_PREFERENCE_AUTO = 0, /** 1: Prioritizes the system performance. The SDK chooses the dimension and frame rate of the local camera capture closest to those set by \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration". */ CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE = 1, /** 2: Prioritizes the local preview quality. The SDK chooses higher camera output parameters to improve the local video preview quality. This option requires extra CPU and RAM usage for video pre-processing. */ CAPTURER_OUTPUT_PREFERENCE_PREVIEW = 2, /** 3: Allows you to customize the width and height of the video image captured by the local camera. * * @since v3.3.0 */ CAPTURER_OUTPUT_PREFERENCE_MANUAL = 3, }; /** The priority of the remote user. */ enum PRIORITY_TYPE { /** 50: The user's priority is high. */ PRIORITY_HIGH = 50, /** 100: (Default) The user's priority is normal. */ PRIORITY_NORMAL = 100, }; /** Connection states. */ enum CONNECTION_STATE_TYPE { /** 1: The SDK is disconnected from AR's edge server. - This is the initial state before calling the \ref ar::rtc::IRtcEngine::joinChannel "joinChannel" method. - The SDK also enters this state when the application calls the \ref ar::rtc::IRtcEngine::leaveChannel "leaveChannel" method. */ CONNECTION_STATE_DISCONNECTED = 1, /** 2: The SDK is connecting to AR's edge server. - When the application calls the \ref ar::rtc::IRtcEngine::joinChannel "joinChannel" method, the SDK starts to establish a connection to the specified channel, triggers the \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback, and switches to the #CONNECTION_STATE_CONNECTING state. - When the SDK successfully joins the channel, it triggers the \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback and switches to the #CONNECTION_STATE_CONNECTED state. - After the SDK joins the channel and when it finishes initializing the media engine, the SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onJoinChannelSuccess "onJoinChannelSuccess" callback. */ CONNECTION_STATE_CONNECTING = 2, /** 3: The SDK is connected to AR's edge server and has joined a channel. You can now publish or subscribe to a media stream in the channel. If the connection to the channel is lost because, for example, if the network is down or switched, the SDK automatically tries to reconnect and triggers: - The \ref ar::rtc::IRtcEngineEventHandler::onConnectionInterrupted "onConnectionInterrupted" callback (deprecated). - The \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback and switches to the #CONNECTION_STATE_RECONNECTING state. */ CONNECTION_STATE_CONNECTED = 3, /** 4: The SDK keeps rejoining the channel after being disconnected from a joined channel because of network issues. - If the SDK cannot rejoin the channel within 10 seconds after being disconnected from AR's edge server, the SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onConnectionLost "onConnectionLost" callback, stays in the #CONNECTION_STATE_RECONNECTING state, and keeps rejoining the channel. - If the SDK fails to rejoin the channel 20 minutes after being disconnected from AR's edge server, the SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callback, switches to the #CONNECTION_STATE_FAILED state, and stops rejoining the channel. */ CONNECTION_STATE_RECONNECTING = 4, /** 5: The SDK fails to connect to AR's edge server or join the channel. You must call the \ref ar::rtc::IRtcEngine::leaveChannel "leaveChannel" method to leave this state, and call the \ref ar::rtc::IRtcEngine::joinChannel "joinChannel" method again to rejoin the channel. If the SDK is banned from joining the channel by AR's edge server (through the RESTful API), the SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onConnectionBanned "onConnectionBanned" (deprecated) and \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged" callbacks. */ CONNECTION_STATE_FAILED = 5, }; /** Reasons for a connection state change. */ enum CONNECTION_CHANGED_REASON_TYPE { /** 0: The SDK is connecting to AR's edge server. */ CONNECTION_CHANGED_CONNECTING = 0, /** 1: The SDK has joined the channel successfully. */ CONNECTION_CHANGED_JOIN_SUCCESS = 1, /** 2: The connection between the SDK and AR's edge server is interrupted. */ CONNECTION_CHANGED_INTERRUPTED = 2, /** 3: The connection between the SDK and AR's edge server is banned by AR's edge server. */ CONNECTION_CHANGED_BANNED_BY_SERVER = 3, /** 4: The SDK fails to join the channel for more than 20 minutes and stops reconnecting to the channel. */ CONNECTION_CHANGED_JOIN_FAILED = 4, /** 5: The SDK has left the channel. */ CONNECTION_CHANGED_LEAVE_CHANNEL = 5, /** 6: The connection failed since Appid is not valid. */ CONNECTION_CHANGED_INVALID_APP_ID = 6, /** 7: The connection failed since channel name is not valid. */ CONNECTION_CHANGED_INVALID_CHANNEL_NAME = 7, /** 8: The connection failed since token is not valid, possibly because: - The App Certificate for the project is enabled in Console, but you do not use Token when joining the channel. If you enable the App Certificate, you must use a token to join the channel. - The uid that you specify in the \ref ar::rtc::IRtcEngine::joinChannel "joinChannel" method is different from the uid that you pass for generating the token. */ CONNECTION_CHANGED_INVALID_TOKEN = 8, /** 9: The connection failed since token is expired. */ CONNECTION_CHANGED_TOKEN_EXPIRED = 9, /** 10: The connection is rejected by server. This error usually occurs in the following situations: * - When the user is already in the channel, and still calls the method to join the channel, for example, * \ref IRtcEngine::joinChannel "joinChannel". * - When the user tries to join a channel during \ref IRtcEngine::startEchoTest "startEchoTest". Once you * call \ref IRtcEngine::startEchoTest "startEchoTest", you need to call \ref IRtcEngine::stopEchoTest "stopEchoTest" before joining a channel. * */ CONNECTION_CHANGED_REJECTED_BY_SERVER = 10, /** 11: The connection changed to reconnecting since SDK has set a proxy server. */ CONNECTION_CHANGED_SETTING_PROXY_SERVER = 11, /** 12: When SDK is in connection failed, the renew token operation will make it connecting. */ CONNECTION_CHANGED_RENEW_TOKEN = 12, /** 13: The IP Address of SDK client has changed. i.e., Network type or IP/Port changed by network operator might change client IP address. */ CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED = 13, /** 14: Timeout for the keep-alive of the connection between the SDK and AR's edge server. The connection state changes to CONNECTION_STATE_RECONNECTING(4). */ CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT = 14, }; /** Network type. */ enum NETWORK_TYPE { /** -1: The network type is unknown. */ NETWORK_TYPE_UNKNOWN = -1, /** 0: The SDK disconnects from the network. */ NETWORK_TYPE_DISCONNECTED = 0, /** 1: The network type is LAN. */ NETWORK_TYPE_LAN = 1, /** 2: The network type is Wi-Fi(including hotspots). */ NETWORK_TYPE_WIFI = 2, /** 3: The network type is mobile 2G. */ NETWORK_TYPE_MOBILE_2G = 3, /** 4: The network type is mobile 3G. */ NETWORK_TYPE_MOBILE_3G = 4, /** 5: The network type is mobile 4G. */ NETWORK_TYPE_MOBILE_4G = 5, }; /** States of the last-mile network probe test. */ enum LASTMILE_PROBE_RESULT_STATE { /** 1: The last-mile network probe test is complete. */ LASTMILE_PROBE_RESULT_COMPLETE = 1, /** 2: The last-mile network probe test is incomplete and the bandwidth estimation is not available, probably due to limited test resources. */ LASTMILE_PROBE_RESULT_INCOMPLETE_NO_BWE = 2, /** 3: The last-mile network probe test is not carried out, probably due to poor network conditions. */ LASTMILE_PROBE_RESULT_UNAVAILABLE = 3 }; /** Audio output routing. */ enum AUDIO_ROUTE_TYPE { /** Default. */ AUDIO_ROUTE_DEFAULT = -1, /** Headset. */ AUDIO_ROUTE_HEADSET = 0, /** Earpiece. */ AUDIO_ROUTE_EARPIECE = 1, /** Headset with no microphone. */ AUDIO_ROUTE_HEADSET_NO_MIC = 2, /** Speakerphone. */ AUDIO_ROUTE_SPEAKERPHONE = 3, /** Loudspeaker. */ AUDIO_ROUTE_LOUDSPEAKER = 4, /** Bluetooth headset. */ AUDIO_ROUTE_BLUETOOTH = 5, /** USB peripheral. */ AUDIO_ROUTE_USB = 6, /** HDMI peripheral. */ AUDIO_ROUTE_HDMI = 7, /** DisplayPort peripheral. */ AUDIO_ROUTE_DISPLAYPORT = 8, /** Apple AirPlay. */ AUDIO_ROUTE_AIRPLAY = 9, }; #if (defined(__APPLE__) && TARGET_OS_IOS) /** Audio session restriction. */ enum AUDIO_SESSION_OPERATION_RESTRICTION { /** No restriction, the SDK has full control of the audio session operations. */ AUDIO_SESSION_OPERATION_RESTRICTION_NONE = 0, /** The SDK does not change the audio session category. */ AUDIO_SESSION_OPERATION_RESTRICTION_SET_CATEGORY = 1, /** The SDK does not change any setting of the audio session (category, mode, categoryOptions). */ AUDIO_SESSION_OPERATION_RESTRICTION_CONFIGURE_SESSION = 1 << 1, /** The SDK keeps the audio session active when leaving a channel. */ AUDIO_SESSION_OPERATION_RESTRICTION_DEACTIVATE_SESSION = 1 << 2, /** The SDK does not configure the audio session anymore. */ AUDIO_SESSION_OPERATION_RESTRICTION_ALL = 1 << 7, }; #endif #if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS) enum CAMERA_DIRECTION { /** The rear camera. */ CAMERA_REAR = 0, /** The front camera. */ CAMERA_FRONT = 1, }; #endif /** The uplink or downlink last-mile network probe test result. */ struct LastmileProbeOneWayResult { /** The packet loss rate (%). */ unsigned int packetLossRate; /** The network jitter (ms). */ unsigned int jitter; /* The estimated available bandwidth (bps). */ unsigned int availableBandwidth; }; /** The uplink and downlink last-mile network probe test result. */ struct LastmileProbeResult{ /** The state of the probe test. */ LASTMILE_PROBE_RESULT_STATE state; /** The uplink last-mile network probe test result. */ LastmileProbeOneWayResult uplinkReport; /** The downlink last-mile network probe test result. */ LastmileProbeOneWayResult downlinkReport; /** The round-trip delay time (ms). */ unsigned int rtt; }; /** Configurations of the last-mile network probe test. */ struct LastmileProbeConfig { /** Sets whether or not to test the uplink network. Some users, for example, the audience in a `LIVE_BROADCASTING` channel, do not need such a test: - true: test. - false: do not test. */ bool probeUplink; /** Sets whether or not to test the downlink network: - true: test. - false: do not test. */ bool probeDownlink; /** The expected maximum sending bitrate (bps) of the local user. The value ranges between 100000 and 5000000. We recommend setting this parameter according to the bitrate value set by \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration". */ unsigned int expectedUplinkBitrate; /** The expected maximum receiving bitrate (bps) of the local user. The value ranges between 100000 and 5000000. */ unsigned int expectedDownlinkBitrate; }; /** Properties of the audio volume information. An array containing the user ID and volume information for each speaker. */ struct AudioVolumeInfo { /** User ID of the speaker. The uid of the local user is 0. */ uid_t uid; /** The volume of the speaker. The volume ranges between 0 (lowest volume) and 255 (highest volume). */ unsigned int volume; /** Voice activity status of the local user. * - 0: The local user is not speaking. * - 1: The local user is speaking. * * @note * - The `vad` parameter cannot report the voice activity status of the remote users. In the remote users' callback, `vad` = 0. * - Ensure that you set `report_vad`(true) in the \ref ar::rtc::IRtcEngine::enableAudioVolumeIndication(int, int, bool) "enableAudioVolumeIndication" method to enable the voice activity detection of the local user. */ unsigned int vad; /** The channel ID, which indicates which channel the speaker is in. */ const char * channelId; }; /// @cond /** The detailed options of a user. */ struct ClientRoleOptions { /** The latency level of an audience member in a live interactive streaming. See #AUDIENCE_LATENCY_LEVEL_TYPE. */ AUDIENCE_LATENCY_LEVEL_TYPE audienceLatencyLevel; ClientRoleOptions() : audienceLatencyLevel(AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY) {} }; /// @endcond /** Statistics of the channel. */ struct RtcStats { /** Call duration (s), represented by an aggregate value. */ unsigned int duration; /** Total number of bytes transmitted, represented by an aggregate value. */ unsigned int txBytes; /** Total number of bytes received, represented by an aggregate value. */ unsigned int rxBytes; /** Total number of audio bytes sent (bytes), represented * by an aggregate value. */ unsigned int txAudioBytes; /** Total number of video bytes sent (bytes), represented * by an aggregate value. */ unsigned int txVideoBytes; /** Total number of audio bytes received (bytes) before * network countermeasures, represented by an aggregate value. */ unsigned int rxAudioBytes; /** Total number of video bytes received (bytes), * represented by an aggregate value. */ unsigned int rxVideoBytes; /** Transmission bitrate (Kbps), represented by an instantaneous value. */ unsigned short txKBitRate; /** Receive bitrate (Kbps), represented by an instantaneous value. */ unsigned short rxKBitRate; /** Audio receive bitrate (Kbps), represented by an instantaneous value. */ unsigned short rxAudioKBitRate; /** Audio transmission bitrate (Kbps), represented by an instantaneous value. */ unsigned short txAudioKBitRate; /** Video receive bitrate (Kbps), represented by an instantaneous value. */ unsigned short rxVideoKBitRate; /** Video transmission bitrate (Kbps), represented by an instantaneous value. */ unsigned short txVideoKBitRate; /** Client-server latency (ms) */ unsigned short lastmileDelay; /** The packet loss rate (%) from the local client to AR's edge server, * before using the anti-packet-loss method. */ unsigned short txPacketLossRate; /** The packet loss rate (%) from AR's edge server to the local client, * before using the anti-packet-loss method. */ unsigned short rxPacketLossRate; /** Number of users in the channel. - Communication profile: The number of users in the channel. - Live broadcast profile: - If the local user is an audience: The number of users in the channel = The number of hosts in the channel + 1. - If the user is a host: The number of users in the channel = The number of hosts in the channel. */ unsigned int userCount; /** Application CPU usage (%). */ double cpuAppUsage; /** System CPU usage (%). */ double cpuTotalUsage; /** The round-trip time delay from the client to the local router. */ int gatewayRtt; /** The memory usage ratio of the app (%). @note This value is for reference only. Due to system limitations, you may not get the value of this member. */ double memoryAppUsageRatio; /** The memory usage ratio of the system (%). @note This value is for reference only. Due to system limitations, you may not get the value of this member. */ double memoryTotalUsageRatio; /** The memory usage of the app (KB). @note This value is for reference only. Due to system limitations, you may not get the value of this member. */ int memoryAppUsageInKbytes; RtcStats() : duration(0) , txBytes(0) , rxBytes(0) , txAudioBytes(0) , txVideoBytes(0) , rxAudioBytes(0) , rxVideoBytes(0) , txKBitRate(0) , rxKBitRate(0) , rxAudioKBitRate(0) , txAudioKBitRate(0) , rxVideoKBitRate(0) , txVideoKBitRate(0) , lastmileDelay(0) , txPacketLossRate(0) , rxPacketLossRate(0) , userCount(0) , cpuAppUsage(0) , cpuTotalUsage(0) , gatewayRtt(0) , memoryAppUsageRatio(0) , memoryTotalUsageRatio(0) , memoryAppUsageInKbytes(0) {} }; /** Quality change of the local video in terms of target frame rate and target bit rate since last count. */ enum QUALITY_ADAPT_INDICATION { /** The quality of the local video stays the same. */ ADAPT_NONE = 0, /** The quality improves because the network bandwidth increases. */ ADAPT_UP_BANDWIDTH = 1, /** The quality worsens because the network bandwidth decreases. */ ADAPT_DOWN_BANDWIDTH = 2, }; /** The error code in CHANNEL_MEDIA_RELAY_ERROR. */ enum CHANNEL_MEDIA_RELAY_ERROR { /** 0: The state is normal. */ RELAY_OK = 0, /** 1: An error occurs in the server response. */ RELAY_ERROR_SERVER_ERROR_RESPONSE = 1, /** 2: No server response. You can call the * \ref ar::rtc::IRtcEngine::leaveChannel "leaveChannel" method to * leave the channel. */ RELAY_ERROR_SERVER_NO_RESPONSE = 2, /** 3: The SDK fails to access the service, probably due to limited * resources of the server. */ RELAY_ERROR_NO_RESOURCE_AVAILABLE = 3, /** 4: Fails to send the relay request. */ RELAY_ERROR_FAILED_JOIN_SRC = 4, /** 5: Fails to accept the relay request. */ RELAY_ERROR_FAILED_JOIN_DEST = 5, /** 6: The server fails to receive the media stream. */ RELAY_ERROR_FAILED_PACKET_RECEIVED_FROM_SRC = 6, /** 7: The server fails to send the media stream. */ RELAY_ERROR_FAILED_PACKET_SENT_TO_DEST = 7, /** 8: The SDK disconnects from the server due to poor network * connections. You can call the \ref ar::rtc::IRtcEngine::leaveChannel * "leaveChannel" method to leave the channel. */ RELAY_ERROR_SERVER_CONNECTION_LOST = 8, /** 9: An internal error occurs in the server. */ RELAY_ERROR_INTERNAL_ERROR = 9, /** 10: The token of the source channel has expired. */ RELAY_ERROR_SRC_TOKEN_EXPIRED = 10, /** 11: The token of the destination channel has expired. */ RELAY_ERROR_DEST_TOKEN_EXPIRED = 11, }; /** The event code in CHANNEL_MEDIA_RELAY_EVENT. */ enum CHANNEL_MEDIA_RELAY_EVENT { /** 0: The user disconnects from the server due to poor network * connections. */ RELAY_EVENT_NETWORK_DISCONNECTED = 0, /** 1: The network reconnects. */ RELAY_EVENT_NETWORK_CONNECTED = 1, /** 2: The user joins the source channel. */ RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL = 2, /** 3: The user joins the destination channel. */ RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL = 3, /** 4: The SDK starts relaying the media stream to the destination channel. */ RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL = 4, /** 5: The server receives the video stream from the source channel. */ RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC = 5, /** 6: The server receives the audio stream from the source channel. */ RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC = 6, /** 7: The destination channel is updated. */ RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL = 7, /** 8: The destination channel update fails due to internal reasons. */ RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED = 8, /** 9: The destination channel does not change, which means that the * destination channel fails to be updated. */ RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE = 9, /** 10: The destination channel name is NULL. */ RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_IS_NULL = 10, /** 11: The video profile is sent to the server. */ RELAY_EVENT_VIDEO_PROFILE_UPDATE = 11, }; /** The state code in CHANNEL_MEDIA_RELAY_STATE. */ enum CHANNEL_MEDIA_RELAY_STATE { /** 0: The SDK is initializing. */ RELAY_STATE_IDLE = 0, /** 1: The SDK tries to relay the media stream to the destination channel. */ RELAY_STATE_CONNECTING = 1, /** 2: The SDK successfully relays the media stream to the destination * channel. */ RELAY_STATE_RUNNING = 2, /** 3: A failure occurs. See the details in code. */ RELAY_STATE_FAILURE = 3, }; /** Statistics of the local video stream. */ struct LocalVideoStats { /** Bitrate (Kbps) sent in the reported interval, which does not include * the bitrate of the retransmission video after packet loss. */ int sentBitrate; /** Frame rate (fps) sent in the reported interval, which does not include * the frame rate of the retransmission video after packet loss. */ int sentFrameRate; /** The encoder output frame rate (fps) of the local video. */ int encoderOutputFrameRate; /** The render output frame rate (fps) of the local video. */ int rendererOutputFrameRate; /** The target bitrate (Kbps) of the current encoder. This value is estimated by the SDK based on the current network conditions. */ int targetBitrate; /** The target frame rate (fps) of the current encoder. */ int targetFrameRate; /** Quality change of the local video in terms of target frame rate and * target bit rate in this reported interval. See #QUALITY_ADAPT_INDICATION. */ QUALITY_ADAPT_INDICATION qualityAdaptIndication; /** The encoding bitrate (Kbps), which does not include the bitrate of the * re-transmission video after packet loss. */ int encodedBitrate; /** The width of the encoding frame (px). */ int encodedFrameWidth; /** The height of the encoding frame (px). */ int encodedFrameHeight; /** The value of the sent frames, represented by an aggregate value. */ int encodedFrameCount; /** The codec type of the local video: * - VIDEO_CODEC_VP8 = 1: VP8. * - VIDEO_CODEC_H264 = 2: (Default) H.264. */ VIDEO_CODEC_TYPE codecType; /** The video packet loss rate (%) from the local client to the AR edge server before applying the anti-packet loss strategies. */ unsigned short txPacketLossRate; /** The capture frame rate (fps) of the local video. */ int captureFrameRate; }; /** Statistics of the remote video stream. */ struct RemoteVideoStats { /** User ID of the remote user sending the video streams. */ uid_t uid; /** **DEPRECATED** Time delay (ms). * * In scenarios where audio and video is synchronized, you can use the value of * `networkTransportDelay` and `jitterBufferDelay` in `RemoteAudioStats` to know the delay statistics of the remote video. */ int delay; /** Width (pixels) of the video stream. */ int width; /** Height (pixels) of the video stream. */ int height; /** Bitrate (Kbps) received since the last count. */ int receivedBitrate; /** The decoder output frame rate (fps) of the remote video. */ int decoderOutputFrameRate; /** The render output frame rate (fps) of the remote video. */ int rendererOutputFrameRate; /** Packet loss rate (%) of the remote video stream after using the anti-packet-loss method. */ int packetLossRate; /** The type of the remote video stream: #REMOTE_VIDEO_STREAM_TYPE */ REMOTE_VIDEO_STREAM_TYPE rxStreamType; /** The total freeze time (ms) of the remote video stream after the remote user joins the channel. In a video session where the frame rate is set to no less than 5 fps, video freeze occurs when the time interval between two adjacent renderable video frames is more than 500 ms. */ int totalFrozenTime; /** The total video freeze time as a percentage (%) of the total time when the video is available. */ int frozenRate; /** The total time (ms) when the remote user in the Communication profile or the remote broadcaster in the Live-broadcast profile neither stops sending the video stream nor disables the video module after joining the channel. @since v3.0.1 */ int totalActiveTime; /** * The total publish duration (ms) of the remote video stream. */ int publishDuration; }; /** Audio statistics of the local user */ struct LocalAudioStats { /** The number of channels. */ int numChannels; /** The sample rate (Hz). */ int sentSampleRate; /** The average sending bitrate (Kbps). */ int sentBitrate; /** The audio packet loss rate (%) from the local client to the AR edge server before applying the anti-packet loss strategies. */ unsigned short txPacketLossRate; }; /** Audio statistics of a remote user */ struct RemoteAudioStats { /** User ID of the remote user sending the audio streams. * */ uid_t uid; /** Audio quality received by the user: #QUALITY_TYPE. */ int quality; /** Network delay (ms) from the sender to the receiver. */ int networkTransportDelay; /** Network delay (ms) from the receiver to the jitter buffer. */ int jitterBufferDelay; /** The audio frame loss rate in the reported interval. */ int audioLossRate; /** The number of channels. */ int numChannels; /** The sample rate (Hz) of the received audio stream in the reported * interval. */ int receivedSampleRate; /** The average bitrate (Kbps) of the received audio stream in the * reported interval. */ int receivedBitrate; /** The total freeze time (ms) of the remote audio stream after the remote user joins the channel. In a session, audio freeze occurs when the audio frame loss rate reaches 4%. */ int totalFrozenTime; /** The total audio freeze time as a percentage (%) of the total time when the audio is available. */ int frozenRate; /** The total time (ms) when the remote user in the `COMMUNICATION` profile or the remote host in the `LIVE_BROADCASTING` profile neither stops sending the audio stream nor disables the audio module after joining the channel. */ int totalActiveTime; /** * The total publish duration (ms) of the remote audio stream. */ int publishDuration; /** * Quality of experience (QoE) of the local user when receiving a remote audio stream. See #EXPERIENCE_QUALITY_TYPE. * * @since v3.3.0 */ int qoeQuality; /** * The reason for poor QoE of the local user when receiving a remote audio stream. See #EXPERIENCE_POOR_REASON. * * @since v3.3.0 */ int qualityChangedReason; /** * The mos value of remote audio. */ int mosValue; }; /** * Video dimensions. */ struct VideoDimensions { /** Width (pixels) of the video. */ int width; /** Height (pixels) of the video. */ int height; VideoDimensions() : width(640), height(480) {} VideoDimensions(int w, int h) : width(w), height(h) {} }; /** (Recommended) The standard bitrate set in the \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration" method. In this mode, the bitrates differ between the live interactive streaming and communication profiles: - `COMMUNICATION` profile: The video bitrate is the same as the base bitrate. - `LIVE_BROADCASTING` profile: The video bitrate is twice the base bitrate. */ const int STANDARD_BITRATE = 0; /** The compatible bitrate set in the \ref IRtcEngine::setVideoEncoderConfiguration "setVideoEncoderConfiguration" method. The bitrate remains the same regardless of the channel profile. If you choose this mode in the Live-broadcast profile, the video frame rate may be lower than the set value. */ const int COMPATIBLE_BITRATE = -1; /** Use the default minimum bitrate. */ const int DEFAULT_MIN_BITRATE = -1; /** Video encoder configurations. */ struct VideoEncoderConfiguration { /** The video frame dimensions (px) used to specify the video quality and measured by the total number of pixels along a frame's width and height: VideoDimensions. The default value is 640 x 360. */ VideoDimensions dimensions; /** The frame rate of the video: #FRAME_RATE. The default value is 15. Note that we do not recommend setting this to a value greater than 30. */ FRAME_RATE frameRate; /** The minimum frame rate of the video. The default value is -1. */ int minFrameRate; /** The video encoding bitrate (Kbps). Choose one of the following options: - #STANDARD_BITRATE: (Recommended) The standard bitrate. - the `COMMUNICATION` profile: the encoding bitrate equals the base bitrate. - the `LIVE_BROADCASTING` profile: the encoding bitrate is twice the base bitrate. - #COMPATIBLE_BITRATE: The compatible bitrate: the bitrate stays the same regardless of the profile. the `COMMUNICATION` profile prioritizes smoothness, while the `LIVE_BROADCASTING` profile prioritizes video quality (requiring a higher bitrate). We recommend setting the bitrate mode as #STANDARD_BITRATE to address this difference. The following table lists the recommended video encoder configurations, where the base bitrate applies to the `COMMUNICATION` profile. Set your bitrate based on this table. If you set a bitrate beyond the proper range, the SDK automatically sets it to within the range. @note In the following table, **Base Bitrate** applies to the `COMMUNICATION` profile, and **Live Bitrate** applies to the `LIVE_BROADCASTING` profile. | Resolution | Frame Rate (fps) | Base Bitrate (Kbps) | Live Bitrate (Kbps) | |------------------------|------------------|----------------------------------------|----------------------------------------| | 160 * 120 | 15 | 65 | 130 | | 120 * 120 | 15 | 50 | 100 | | 320 * 180 | 15 | 140 | 280 | | 180 * 180 | 15 | 100 | 200 | | 240 * 180 | 15 | 120 | 240 | | 320 * 240 | 15 | 200 | 400 | | 240 * 240 | 15 | 140 | 280 | | 424 * 240 | 15 | 220 | 440 | | 640 * 360 | 15 | 400 | 800 | | 360 * 360 | 15 | 260 | 520 | | 640 * 360 | 30 | 600 | 1200 | | 360 * 360 | 30 | 400 | 800 | | 480 * 360 | 15 | 320 | 640 | | 480 * 360 | 30 | 490 | 980 | | 640 * 480 | 15 | 500 | 1000 | | 480 * 480 | 15 | 400 | 800 | | 640 * 480 | 30 | 750 | 1500 | | 480 * 480 | 30 | 600 | 1200 | | 848 * 480 | 15 | 610 | 1220 | | 848 * 480 | 30 | 930 | 1860 | | 640 * 480 | 10 | 400 | 800 | | 1280 * 720 | 15 | 1130 | 2260 | | 1280 * 720 | 30 | 1710 | 3420 | | 960 * 720 | 15 | 910 | 1820 | | 960 * 720 | 30 | 1380 | 2760 | | 1920 * 1080 | 15 | 2080 | 4160 | | 1920 * 1080 | 30 | 3150 | 6300 | | 1920 * 1080 | 60 | 4780 | 6500 | | 2560 * 1440 | 30 | 4850 | 6500 | | 2560 * 1440 | 60 | 6500 | 6500 | | 3840 * 2160 | 30 | 6500 | 6500 | | 3840 * 2160 | 60 | 6500 | 6500 | */ int bitrate; /** The minimum encoding bitrate (Kbps). The SDK automatically adjusts the encoding bitrate to adapt to the network conditions. Using a value greater than the default value forces the video encoder to output high-quality images but may cause more packet loss and hence sacrifice the smoothness of the video transmission. That said, unless you have special requirements for image quality, AR does not recommend changing this value. @note This parameter applies only to the `LIVE_BROADCASTING` profile. */ int minBitrate; /** The video orientation mode of the video: #ORIENTATION_MODE. */ ORIENTATION_MODE orientationMode; /** The video encoding degradation preference under limited bandwidth: #DEGRADATION_PREFERENCE. */ DEGRADATION_PREFERENCE degradationPreference; /** Sets the mirror mode of the published local video stream. It only affects the video that the remote user sees. See #VIDEO_MIRROR_MODE_TYPE @note: The SDK disables the mirror mode by default. */ VIDEO_MIRROR_MODE_TYPE mirrorMode; VideoEncoderConfiguration( const VideoDimensions& d, FRAME_RATE f, int b, ORIENTATION_MODE m, VIDEO_MIRROR_MODE_TYPE mr = VIDEO_MIRROR_MODE_AUTO) : dimensions(d), frameRate(f), minFrameRate(-1), bitrate(b), minBitrate(DEFAULT_MIN_BITRATE), orientationMode(m), degradationPreference(MAINTAIN_QUALITY), mirrorMode(mr) {} VideoEncoderConfiguration( int width, int height, FRAME_RATE f, int b, ORIENTATION_MODE m, VIDEO_MIRROR_MODE_TYPE mr = VIDEO_MIRROR_MODE_AUTO) : dimensions(width, height), frameRate(f), minFrameRate(-1), bitrate(b), minBitrate(DEFAULT_MIN_BITRATE), orientationMode(m), degradationPreference(MAINTAIN_QUALITY), mirrorMode(mr) {} VideoEncoderConfiguration() : dimensions(640, 480) , frameRate(FRAME_RATE_FPS_15) , minFrameRate(-1) , bitrate(STANDARD_BITRATE) , minBitrate(DEFAULT_MIN_BITRATE) , orientationMode(ORIENTATION_MODE_ADAPTIVE) , degradationPreference(MAINTAIN_QUALITY) , mirrorMode(VIDEO_MIRROR_MODE_AUTO) {} }; /** The video and audio properties of the user displaying the video in the CDN live. AR supports a maximum of 17 transcoding users in a CDN streaming channel. */ typedef struct TranscodingUser { /** User ID of the user displaying the video in the CDN live. */ uid_t uid; /** Horizontal position (pixel) of the video frame relative to the top left corner. */ int x; /** Vertical position (pixel) of the video frame relative to the top left corner. */ int y; /** Width (pixel) of the video frame. The default value is 360. */ int width; /** Height (pixel) of the video frame. The default value is 640. */ int height; /** The layer index of the video frame. An integer. The value range is [0, 100]. - 0: (Default) Bottom layer. - 100: Top layer. @note - If zOrder is beyond this range, the SDK reports #ERR_INVALID_ARGUMENT. - As of v2.3, the SDK supports zOrder = 0. */ int zOrder; /** The transparency level of the user's video. The value ranges between 0 and 1.0: - 0: Completely transparent - 1.0: (Default) Opaque */ double alpha; /** The audio channel of the sound. The default value is 0: - 0: (Default) Supports dual channels at most, depending on the upstream of the host. - 1: The audio stream of the host uses the FL audio channel. If the upstream of the host uses multiple audio channels, these channels are mixed into mono first. - 2: The audio stream of the host uses the FC audio channel. If the upstream of the host uses multiple audio channels, these channels are mixed into mono first. - 3: The audio stream of the host uses the FR audio channel. If the upstream of the host uses multiple audio channels, these channels are mixed into mono first. - 4: The audio stream of the host uses the BL audio channel. If the upstream of the host uses multiple audio channels, these channels are mixed into mono first. - 5: The audio stream of the host uses the BR audio channel. If the upstream of the host uses multiple audio channels, these channels are mixed into mono first. @note If your setting is not 0, you may need a specialized player. */ int audioChannel; TranscodingUser() : uid(0) , x(0) , y(0) , width(0) , height(0) , zOrder(0) , alpha(1.0) , audioChannel(0) {} } TranscodingUser; /** Image properties. The properties of the watermark and background images. */ typedef struct RtcImage { RtcImage() : url(NULL), x(0), y(0), width(0), height(0) {} /** HTTP/HTTPS URL address of the image on the live video. The maximum length of this parameter is 1024 bytes. */ const char* url; /** Horizontal position of the image from the upper left of the live video. */ int x; /** Vertical position of the image from the upper left of the live video. */ int y; /** Width of the image on the live video. */ int width; /** Height of the image on the live video. */ int height; } RtcImage; /** The configuration for advanced features of the RTMP streaming with transcoding. */ typedef struct LiveStreamAdvancedFeature { LiveStreamAdvancedFeature() : featureName(NULL) , opened(false) { } /** The advanced feature for high-quality video with a lower bitrate. */ const char* LBHQ = "lbhq"; /** The advanced feature for the optimized video encoder. */ const char* VEO = "veo"; /** The name of the advanced feature. It contains LBHQ and VEO. */ const char* featureName; /** Whether to enable the advanced feature: * - true: Enable the advanced feature. * - false: (Default) Disable the advanced feature. */ bool opened; } LiveStreamAdvancedFeature; /** A struct for managing CDN live audio/video transcoding settings. */ typedef struct LiveTranscoding { /** The width of the video in pixels. The default value is 360. * - When pushing video streams to the CDN, ensure that `width` is at least 64; otherwise, the AR server adjusts the value to 64. * - When pushing audio streams to the CDN, set `width` and `height` as 0. */ int width; /** The height of the video in pixels. The default value is 640. * - When pushing video streams to the CDN, ensure that `height` is at least 64; otherwise, the AR server adjusts the value to 64. * - When pushing audio streams to the CDN, set `width` and `height` as 0. */ int height; /** Bitrate of the CDN live output video stream. The default value is 400 Kbps. Set this parameter according to the Video Bitrate Table. If you set a bitrate beyond the proper range, the SDK automatically adapts it to a value within the range. */ int videoBitrate; /** Frame rate of the output video stream set for the CDN live streaming. The default value is 15 fps, and the value range is (0,30]. @note The AR server adjusts any value over 30 to 30. */ int videoFramerate; /** **DEPRECATED** Latency mode: - true: Low latency with unassured quality. - false: (Default) High latency with assured quality. */ bool lowLatency; /** Video GOP in frames. The default value is 30 fps. */ int videoGop; /** Self-defined video codec profile: #VIDEO_CODEC_PROFILE_TYPE. @note If you set this parameter to other values, AR adjusts it to the default value of 100. */ VIDEO_CODEC_PROFILE_TYPE videoCodecProfile; /** The background color in RGB hex value. Value only. Do not include a preceeding #. For example, 0xFFB6C1 (light pink). The default value is 0x000000 (black). */ unsigned int backgroundColor; /** video codec type */ VIDEO_CODEC_TYPE_FOR_STREAM videoCodecType; /** The number of users in the live interactive streaming. */ unsigned int userCount; /** TranscodingUser */ TranscodingUser *transcodingUsers; /** Reserved property. Extra user-defined information to send SEI for the H.264/H.265 video stream to the CDN live client. Maximum length: 4096 Bytes. For more information on SEI frame, see [SEI-related questions](https://docs.ar.io/en/faq/sei). */ const char *transcodingExtraInfo; /** **DEPRECATED** The metadata sent to the CDN live client defined by the RTMP or FLV metadata. */ const char *metadata; /** The watermark image added to the CDN live publishing stream. Ensure that the format of the image is PNG. Once a watermark image is added, the audience of the CDN live publishing stream can see the watermark image. See RtcImage. */ RtcImage* watermark; /** The background image added to the CDN live publishing stream. Once a background image is added, the audience of the CDN live publishing stream can see the background image. See RtcImage. */ RtcImage* backgroundImage; /** Self-defined audio-sample rate: #AUDIO_SAMPLE_RATE_TYPE. */ AUDIO_SAMPLE_RATE_TYPE audioSampleRate; /** Bitrate of the CDN live audio output stream. The default value is 48 Kbps, and the highest value is 128. */ int audioBitrate; /** The numbder of audio channels for the CDN live stream. ar recommends choosing 1 (mono), or 2 (stereo) audio channels. Special players are required if you choose option 3, 4, or 5: - 1: (Default) Mono. - 2: Stereo. - 3: Three audio channels. - 4: Four audio channels. - 5: Five audio channels. */ int audioChannels; /** Self-defined audio codec profile: #AUDIO_CODEC_PROFILE_TYPE. */ AUDIO_CODEC_PROFILE_TYPE audioCodecProfile; /** Advanced features of the RTMP streaming with transcoding. See LiveStreamAdvancedFeature. * * @since v3.1.0 */ LiveStreamAdvancedFeature* advancedFeatures; /** The number of enabled advanced features. The default value is 0. */ unsigned int advancedFeatureCount; LiveTranscoding() : width(360) , height(640) , videoBitrate(400) , videoFramerate(15) , lowLatency(false) , videoGop(30) , videoCodecProfile(VIDEO_CODEC_PROFILE_HIGH) , backgroundColor(0x000000) , videoCodecType(VIDEO_CODEC_H264_FOR_STREAM) , userCount(0) , transcodingUsers(NULL) , transcodingExtraInfo(NULL) , metadata(NULL) , watermark(NULL) , backgroundImage(NULL) , audioSampleRate(AUDIO_SAMPLE_RATE_48000) , audioBitrate(48) , audioChannels(1) , audioCodecProfile(AUDIO_CODEC_PROFILE_LC_AAC) , advancedFeatures(NULL) , advancedFeatureCount(0) {} } LiveTranscoding; /** Camera capturer configuration. */ struct CameraCapturerConfiguration{ /** Camera capturer preference settings. See: #CAPTURER_OUTPUT_PREFERENCE. */ CAPTURER_OUTPUT_PREFERENCE preference; /** The width (px) of the video image captured by the local camera. * To customize the width of the video image, set `preference` as #CAPTURER_OUTPUT_PREFERENCE_MANUAL (3) first, * and then use `captureWidth`. * * @since v3.3.0 */ int captureWidth; /** The height (px) of the video image captured by the local camera. * To customize the height of the video image, set `preference` as #CAPTURER_OUTPUT_PREFERENCE_MANUAL (3) first, * and then use `captureHeight`. * * @since v3.3.0 */ int captureHeight; #if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS) /** Camera direction settings (for Android/iOS only). See: #CAMERA_DIRECTION. */ CAMERA_DIRECTION cameraDirection; #endif CameraCapturerConfiguration() :preference(CAPTURER_OUTPUT_PREFERENCE_AUTO) ,captureWidth(640) ,captureHeight(480) {} CameraCapturerConfiguration(int width, int height) :preference(CAPTURER_OUTPUT_PREFERENCE_MANUAL) ,captureWidth(width) ,captureHeight(height) {} }; /** The configurations for the data stream. * * @since v3.3.0 * * |`syncWithAudio` |`ordered`| SDK behaviors| * |--------------|--------|-------------| * | false | false |The SDK triggers the `onStreamMessage` callback immediately after the receiver receives a data packet | * | true | false |
If the data packet delay is within the audio delay, the SDK triggers the `onStreamMessage` callback when the synchronized audio packet is played out.
If the data packet delay exceeds the audio delay, the SDK triggers the `onStreamMessage` callback as soon as the data packet is received. In this case, the data packet is not synchronized with the audio packet.
| * | false | true |If the delay of a data packet is within five seconds, the SDK corrects the order of the data packet.
If the delay of a data packet exceeds five seconds, the SDK discards the data packet.
| * | true | true |If the delay of a data packet is within the audio delay, the SDK corrects the order of the data packet.
If the delay of a data packet exceeds the audio delay, the SDK discards this data packet.
| */ struct DataStreamConfig { /** Whether to synchronize the data packet with the published audio packet. * * - true: Synchronize the data packet with the audio packet. * - false: Do not synchronize the data packet with the audio packet. * * When you set the data packet to synchronize with the audio, then if the data * packet delay is within the audio delay, the SDK triggers the `onStreamMessage` callback when * the synchronized audio packet is played out. Do not set this parameter as `true` if you * need the receiver to receive the data packet immediately. AR recommends that you set * this parameter to `true` only when you need to implement specific functions, for example * lyric synchronization. */ bool syncWithAudio; /** Whether the SDK guarantees that the receiver receives the data in the sent order. * * - true: Guarantee that the receiver receives the data in the sent order. * - false: Do not guarantee that the receiver receives the data in the sent order. * * Do not set this parameter to `true` if you need the receiver to receive the data immediately. */ bool ordered; }; /** Configuration of the injected media stream. */ struct InjectStreamConfig { /** Width of the injected stream in the live interactive streaming. The default value is 0 (same width as the original stream). */ int width; /** Height of the injected stream in the live interactive streaming. The default value is 0 (same height as the original stream). */ int height; /** Video GOP (in frames) of the injected stream in the live interactive streaming. The default value is 30 fps. */ int videoGop; /** Video frame rate of the injected stream in the live interactive streaming. The default value is 15 fps. */ int videoFramerate; /** Video bitrate of the injected stream in the live interactive streaming. The default value is 400 Kbps. @note The setting of the video bitrate is closely linked to the resolution. If the video bitrate you set is beyond a reasonable range, the SDK sets it within a reasonable range. */ int videoBitrate; /** Audio-sample rate of the injected stream in the live interactive streaming: #AUDIO_SAMPLE_RATE_TYPE. The default value is 48000 Hz. @note We recommend setting the default value. */ AUDIO_SAMPLE_RATE_TYPE audioSampleRate; /** Audio bitrate of the injected stream in the live interactive streaming. The default value is 48. @note We recommend setting the default value. */ int audioBitrate; /** Audio channels in the live interactive streaming. - 1: (Default) Mono - 2: Two-channel stereo @note We recommend setting the default value. */ int audioChannels; // width / height default set to 0 means pull the stream with its original resolution InjectStreamConfig() : width(0) , height(0) , videoGop(30) , videoFramerate(15) , videoBitrate(400) , audioSampleRate(AUDIO_SAMPLE_RATE_48000) , audioBitrate(48) , audioChannels(1) {} }; /** The definition of ChannelMediaInfo. */ struct ChannelMediaInfo { /** The channel name. */ const char* channelName; /** The token that enables the user to join the channel. */ const char* token; /** The user ID. */ uid_t uid; }; /** The definition of ChannelMediaRelayConfiguration. */ struct ChannelMediaRelayConfiguration { /** Pointer to the information of the source channel: ChannelMediaInfo. It contains the following members: * - `channelName`: The name of the source channel. The default value is `NULL`, which means the SDK applies the name of the current channel. * - `uid`: ID of the host whose media stream you want to relay. The default value is 0, which means the SDK generates a random UID. You must set it as 0. * - `token`: The token for joining the source channel. It is generated with the `channelName` and `uid` you set in `srcInfo`. * - If you have not enabled the App Certificate, set this parameter as the default value `NULL`, which means the SDK applies the App ID. * - If you have enabled the App Certificate, you must use the `token` generated with the `channelName` and `uid`, and the `uid` must be set as 0. */ ChannelMediaInfo *srcInfo; /** Pointer to the information of the destination channel: ChannelMediaInfo. It contains the following members: * - `channelName`: The name of the destination channel. * - `uid`: ID of the host in the destination channel. The value ranges from 0 to (232-1). To avoid UID conflicts, this `uid` must be different from any other UIDs in the destination channel. The default value is 0, which means the SDK generates a random UID. * - `token`: The token for joining the destination channel. It is generated with the `channelName` and `uid` you set in `destInfos`. * - If you have not enabled the App Certificate, set this parameter as the default value `NULL`, which means the SDK applies the App ID. * - If you have enabled the App Certificate, you must use the `token` generated with the `channelName` and `uid`. */ ChannelMediaInfo *destInfos; /** The number of destination channels. The default value is 0, and the * value range is [0,4). Ensure that the value of this parameter * corresponds to the number of ChannelMediaInfo structs you define in * `destInfos`. */ int destCount; ChannelMediaRelayConfiguration() : srcInfo(nullptr) , destInfos(nullptr) , destCount(0) {} }; /** **DEPRECATED** Lifecycle of the CDN live video stream. */ enum RTMP_STREAM_LIFE_CYCLE_TYPE { /** Bind to the channel lifecycle. If all hosts leave the channel, the CDN live streaming stops after 30 seconds. */ RTMP_STREAM_LIFE_CYCLE_BIND2CHANNEL = 1, /** Bind to the owner of the RTMP stream. If the owner leaves the channel, the CDN live streaming stops immediately. */ RTMP_STREAM_LIFE_CYCLE_BIND2OWNER = 2, }; /** Content hints for screen sharing. */ enum VideoContentHint { /** (Default) No content hint. */ CONTENT_HINT_NONE, /** Motion-intensive content. Choose this option if you prefer smoothness or when you are sharing a video clip, movie, or video game. */ CONTENT_HINT_MOTION, /** Motionless content. Choose this option if you prefer sharpness or when you are sharing a picture, PowerPoint slide, or text. */ CONTENT_HINT_DETAILS }; /** The relative location of the region to the screen or window. */ struct Rectangle { /** The horizontal offset from the top-left corner. */ int x; /** The vertical offset from the top-left corner. */ int y; /** The width of the region. */ int width; /** The height of the region. */ int height; Rectangle(): x(0), y(0), width(0), height(0) {} Rectangle(int xx, int yy, int ww, int hh): x(xx), y(yy), width(ww), height(hh) {} }; /** **DEPRECATED** Definition of the rectangular region. */ typedef struct Rect { /** Y-axis of the top line. */ int top; /** X-axis of the left line. */ int left; /** Y-axis of the bottom line. */ int bottom; /** X-axis of the right line. */ int right; Rect(): top(0), left(0), bottom(0), right(0) {} Rect(int t, int l, int b, int r): top(t), left(l), bottom(b), right(r) {} } Rect; /** The options of the watermark image to be added. */ typedef struct WatermarkOptions { /** Sets whether or not the watermark image is visible in the local video preview: * - true: (Default) The watermark image is visible in preview. * - false: The watermark image is not visible in preview. */ bool visibleInPreview; /** * The watermark position in the landscape mode. See Rectangle. * For detailed information on the landscape mode, see the advanced guide *Video Rotation*. */ Rectangle positionInLandscapeMode; /** * The watermark position in the portrait mode. See Rectangle. * For detailed information on the portrait mode, see the advanced guide *Video Rotation*. */ Rectangle positionInPortraitMode; WatermarkOptions() : visibleInPreview(true) , positionInLandscapeMode(0, 0, 0, 0) , positionInPortraitMode(0, 0, 0, 0) {} } WatermarkOptions; /** Screen sharing encoding parameters. */ struct ScreenCaptureParameters { /** The maximum encoding dimensions of the shared region in terms of width * height. The default value is 1920 * 1080 pixels, that is, 2073600 pixels. AR uses the value of this parameter to calculate the charges. If the aspect ratio is different between the encoding dimensions and screen dimensions, AR applies the following algorithms for encoding. Suppose the encoding dimensions are 1920 x 1080: - If the value of the screen dimensions is lower than that of the encoding dimensions, for example, 1000 × 1000, the SDK uses 1000 × 1000 for encoding. - If the value of the screen dimensions is higher than that of the encoding dimensions, for example, 2000 × 1500, the SDK uses the maximum value under 1920 × 1080 with the aspect ratio of the screen dimension (4:3) for encoding, that is, 1440 × 1080. */ VideoDimensions dimensions; /** The frame rate (fps) of the shared region. The default value is 5. We do not recommend setting this to a value greater than 15. */ int frameRate; /** The bitrate (Kbps) of the shared region. The default value is 0 (the SDK works out a bitrate according to the dimensions of the current screen). */ int bitrate; /** Sets whether or not to capture the mouse for screen sharing: - true: (Default) Capture the mouse. - false: Do not capture the mouse. */ bool captureMouseCursor; /** Whether to bring the window to the front when calling \ref IRtcEngine::startScreenCaptureByWindowId "startScreenCaptureByWindowId" to share the window: * - true: Bring the window to the front. * - false: (Default) Do not bring the window to the front. */ bool windowFocus; /** A list of IDs of windows to be blocked. * * When calling \ref IRtcEngine::startScreenCaptureByScreenRect "startScreenCaptureByScreenRect" to start screen sharing, you can use this parameter to block the specified windows. * When calling \ref IRtcEngine::updateScreenCaptureParameters "updateScreenCaptureParameters" to update the configuration for screen sharing, you can use this parameter to dynamically block the specified windows during screen sharing. */ view_t* excludeWindowList; /** The number of windows to be blocked. */ int excludeWindowCount; /** Sets whether or not to capture the speaker audio for screen sharing: - true: Capture the speaker audio. - false: (Default) Do not capture the speaker audio. */ bool captureAudio; ScreenCaptureParameters() : dimensions(1920, 1080), frameRate(5), bitrate(STANDARD_BITRATE), captureMouseCursor(true), windowFocus(false), excludeWindowList(NULL), excludeWindowCount(0) {} ScreenCaptureParameters(const VideoDimensions& d, int f, int b, bool c, bool focus, view_t *ex = NULL, int cnt = 0) : dimensions(d), frameRate(f), bitrate(b), captureMouseCursor(c), windowFocus(focus), excludeWindowList(ex), excludeWindowCount(cnt) {} ScreenCaptureParameters(int width, int height, int f, int b, bool c, bool focus, view_t *ex = NULL, int cnt = 0) : dimensions(width, height), frameRate(f), bitrate(b), captureMouseCursor(c), windowFocus(focus), excludeWindowList(ex), excludeWindowCount(cnt) {} }; /** Video display settings of the VideoCanvas class. */ struct VideoCanvas { /** Video display window (view). */ view_t view; /** The rendering mode of the video view. See RENDER_MODE_TYPE */ int renderMode; /** The unique channel name for the ARRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are: - All lowercase English letters: a to z. - All uppercase English letters: A to Z. - All numeric characters: 0 to 9. - The space character. - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". @note - The default value is the empty string "". Use the default value if the user joins the channel using the \ref IRtcEngine::joinChannel "joinChannel" method in the IRtcEngine class. The `VideoCanvas` struct defines the video canvas of the user in the channel. - If the user joins the channel using the \ref IRtcEngine::joinChannel "joinChannel" method in the IChannel class, set this parameter as the `channelId` of the `IChannel` object. The `VideoCanvas` struct defines the video canvas of the user in the channel with the specified channel ID. */ char channelId[MAX_CHANNEL_ID_LENGTH]; /** The user ID. */ uid_t uid; void *priv; // private data (underlying video engine denotes it) /** The mirror mode of the video view. See VIDEO_MIRROR_MODE_TYPE @note - For the mirror mode of the local video view: If you use a front camera, the SDK enables the mirror mode by default; if you use a rear camera, the SDK disables the mirror mode by default. - For the mirror mode of the remote video view: The SDK disables the mirror mode by default. */ VIDEO_MIRROR_MODE_TYPE mirrorMode; VideoCanvas() : view(NULL) , renderMode(RENDER_MODE_HIDDEN) , uid(0) , priv(NULL) , mirrorMode(VIDEO_MIRROR_MODE_AUTO) { channelId[0] = '\0'; } VideoCanvas(view_t v, int m, uid_t u) : view(v) , renderMode(m) , uid(u) , priv(NULL) , mirrorMode(VIDEO_MIRROR_MODE_AUTO) { channelId[0] = '\0'; } VideoCanvas(view_t v, int m, const char *ch, uid_t u) : view(v) , renderMode(m) , uid(u) , priv(NULL) , mirrorMode(VIDEO_MIRROR_MODE_AUTO) { strncpy(channelId, ch, MAX_CHANNEL_ID_LENGTH); channelId[MAX_CHANNEL_ID_LENGTH - 1] = '\0'; } VideoCanvas(view_t v, int rm, uid_t u, VIDEO_MIRROR_MODE_TYPE mm) : view(v) , renderMode(rm) , uid(u) , priv(NULL) , mirrorMode(mm) { channelId[0] = '\0'; } VideoCanvas(view_t v, int rm, const char *ch, uid_t u, VIDEO_MIRROR_MODE_TYPE mm) : view(v) , renderMode(rm) , uid(u) , priv(NULL) , mirrorMode(mm) { strncpy(channelId, ch, MAX_CHANNEL_ID_LENGTH); channelId[MAX_CHANNEL_ID_LENGTH - 1] = '\0'; } }; /** Image enhancement options. */ struct BeautyOptions { /** The contrast level, used with the @p lightening parameter. */ enum LIGHTENING_CONTRAST_LEVEL { /** Low contrast level. */ LIGHTENING_CONTRAST_LOW = 0, /** (Default) Normal contrast level. */ LIGHTENING_CONTRAST_NORMAL, /** High contrast level. */ LIGHTENING_CONTRAST_HIGH }; /** The contrast level, used with the @p lightening parameter. */ LIGHTENING_CONTRAST_LEVEL lighteningContrastLevel; /** The brightness level. The value ranges from 0.0 (original) to 1.0. */ float lighteningLevel; /** The sharpness level. The value ranges between 0 (original) and 1. This parameter is usually used to remove blemishes. */ float smoothnessLevel; /** The redness level. The value ranges between 0 (original) and 1. This parameter adjusts the red saturation level. */ float rednessLevel; BeautyOptions(LIGHTENING_CONTRAST_LEVEL contrastLevel, float lightening, float smoothness, float redness) : lighteningLevel(lightening), smoothnessLevel(smoothness), rednessLevel(redness), lighteningContrastLevel(contrastLevel) {} BeautyOptions() : lighteningLevel(0), smoothnessLevel(0), rednessLevel(0), lighteningContrastLevel(LIGHTENING_CONTRAST_NORMAL) {} }; /** * The UserInfo struct. */ struct UserInfo { /** * The user ID. */ uid_t uid; /** * The user account. */ char userAccount[MAX_USER_ACCOUNT_LENGTH]; UserInfo() : uid(0) { userAccount[0] = '\0'; } }; /** * Regions for connetion. */ enum AREA_CODE { /** * Mainland China. */ AREA_CODE_CN = 0x00000001, /** * North America. */ AREA_CODE_NA = 0x00000002, /** * Europe. */ AREA_CODE_EU = 0x00000004, /** * Asia, excluding Mainland China. */ AREA_CODE_AS = 0x00000008, /** * Japan. */ AREA_CODE_JP = 0x00000010, /** * India. */ AREA_CODE_IN = 0x00000020, /** * (Default) Global. */ AREA_CODE_GLOB = 0xFFFFFFFF }; enum ENCRYPTION_CONFIG { /** * - 1: Force set master key and mode; * - 0: Not force set, checking whether encryption plugin exists */ ENCRYPTION_FORCE_SETTING = (1 << 0), /** * - 1: Force not encrypting packet; * - 0: Not force encrypting; */ ENCRYPTION_FORCE_DISABLE_PACKET = (1 << 1) }; /** Definition of IPacketObserver. */ class IPacketObserver { public: /** Definition of Packet. */ struct Packet { /** Buffer address of the sent or received data. * @note AR recommends that the value of buffer is more than 2048 bytes, otherwise, you may meet undefined behaviors such as a crash. */ const unsigned char* buffer; /** Buffer size of the sent or received data. */ unsigned int size; }; /** Occurs when the local user sends an audio packet. @param packet The sent audio packet. See Packet. @return - true: The audio packet is sent successfully. - false: The audio packet is discarded. */ virtual bool onSendAudioPacket(Packet& packet) = 0; /** Occurs when the local user sends a video packet. @param packet The sent video packet. See Packet. @return - true: The video packet is sent successfully. - false: The video packet is discarded. */ virtual bool onSendVideoPacket(Packet& packet) = 0; /** Occurs when the local user receives an audio packet. @param packet The received audio packet. See Packet. @return - true: The audio packet is received successfully. - false: The audio packet is discarded. */ virtual bool onReceiveAudioPacket(Packet& packet) = 0; /** Occurs when the local user receives a video packet. @param packet The received video packet. See Packet. @return - true: The video packet is received successfully. - false: The video packet is discarded. */ virtual bool onReceiveVideoPacket(Packet& packet) = 0; }; #if defined(_WIN32)||defined(__ANDROID__) || (defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_MAC)) /** The capture type of the custom video source. */ enum VIDEO_CAPTURE_TYPE { /** Unknown type. */ VIDEO_CAPTURE_UNKNOWN, /** (Default) Video captured by the camera. */ VIDEO_CAPTURE_CAMERA, /** Video for screen sharing. */ VIDEO_CAPTURE_SCREEN, }; /** The IVideoFrameConsumer class. The SDK uses it to receive the video frame that you capture. */ class IVideoFrameConsumer { public: /** Receives the raw video frame. * * @note Ensure that the video frame type that you specify in this method is the same as that in the \ref ar::rtc::IVideoSource::getBufferType "getBufferType" callback. * * @param buffer The video buffer. * @param frameType The video frame type. See \ref AM::ExternalVideoFrame::VIDEO_PIXEL_FORMAT "VIDEO_PIXEL_FORMAT". * @param width The width (px) of the video frame. * @param height The height (px) of the video frame. * @param rotation The angle (degree) at which the video frame rotates clockwise. If you set the rotation angle, the * SDK rotates the video frame after receiving it. You can set the rotation angle as `0`, `90`, `180`, and `270`. * @param timestamp The Unix timestamp (ms) of the video frame. You must set a timestamp for each video frame. */ #if defined(_WIN32) virtual void consumeRawVideoFrame(const unsigned char *buffer, AM::ExternalVideoFrame::VIDEO_PIXEL_FORMAT frameType, int width, int height, int rotation, long timestamp) = 0; #endif }; /** The IVideoSource class. You can use it to customize the video source. */ class IVideoSource { public: /** Notification for initializing the custom video source. * * The SDK triggers this callback to remind you to initialize the custom video source. After receiving this callback, * you can do some preparation, such as enabling the camera, and then use the return value to tell the SDK whether the * custom video source is prepared. * * @param consumer An IVideoFrameConsumer object that the SDK passes to you. You need to reserve this object and use it * to send the video frame to the SDK once the custom video source is started. See IVideoFrameConsumer. * * @return * - true: The custom video source is initialized. * - false: The custom video source is not ready or fails to initialize. The SDK stops and reports the error. */ virtual bool onInitialize(IVideoFrameConsumer *consumer) = 0; /** Notification for disabling the custom video source. * * The SDK triggers this callback to remind you to disable the custom video source device. This callback tells you * that the SDK is about to release the IVideoFrameConsumer object. Ensure that you no longer use IVideoFrameConsumer * after receiving this callback. */ virtual void onDispose() = 0; /** Notification for starting the custom video source. * * The SDK triggers this callback to remind you to start the custom video source for capturing video. The SDK uses * IVideoFrameConsumer to receive the video frame that you capture after the video source is started. You must use * the return value to tell the SDK whether the custom video source is started. * * @return * - true: The custom video source is started. * - false: The custom video source fails to start. The SDK stops and reports the error. */ virtual bool onStart() = 0; /** Notification for stopping capturing video. * * The SDK triggers this callback to remind you to stop capturing video. This callback tells you that the SDK is about * to stop using IVideoFrameConsumer to receive the video frame that you capture. */ virtual void onStop() = 0; /** Gets the video frame type. * * Before you initialize the custom video source, the SDK triggers this callback to query the video frame type. You * must specify the video frame type in the return value and then pass it to the SDK. * * @note Ensure that the video frame type that you specify in this callback is the same as that in the \ref ar::rtc::IVideoFrameConsumer::consumeRawVideoFrame "consumeRawVideoFrame" method. * * @return \ref AM::ExternalVideoFrame::VIDEO_PIXEL_FORMAT "VIDEO_PIXEL_FORMAT" */ #if defined(_WIN32) virtual AM::ExternalVideoFrame::VIDEO_PIXEL_FORMAT getBufferType() = 0; #endif /** Gets the capture type of the custom video source. * * Before you initialize the custom video source, the SDK triggers this callback to query the capture type of the video source. * You must specify the capture type in the return value and then pass it to the SDK. The SDK enables the corresponding video * processing algorithm according to the capture type after receiving the video frame. * * @return #VIDEO_CAPTURE_TYPE */ virtual VIDEO_CAPTURE_TYPE getVideoCaptureType() = 0; /** Gets the content hint of the custom video source. * * If you specify the custom video source as a screen-sharing video, the SDK triggers this callback to query the * content hint of the video source before you initialize the video source. You must specify the content hint in the * return value and then pass it to the SDK. The SDK enables the corresponding video processing algorithm according * to the content hint after receiving the video frame. * * @return \ref ar::rtc::VideoContentHint "VideoContentHint" */ virtual VideoContentHint getVideoContentHint() = 0; }; #endif /** The SDK uses the IRtcEngineEventHandler interface class to send callbacks to the application. The application inherits the methods of this interface class to retrieve these callbacks. All methods in this interface class have default (empty) implementations. Therefore, the application can only inherit some required events. In the callbacks, avoid time-consuming tasks or calling blocking APIs, such as the SendMessage method. Otherwise, the SDK may not work properly. */ class IRtcEngineEventHandler { public: virtual ~IRtcEngineEventHandler() {} /** Reports a warning during SDK runtime. In most cases, the application can ignore the warning reported by the SDK because the SDK can usually fix the issue and resume running. For example, when losing connection with the server, the SDK may report #WARN_LOOKUP_CHANNEL_TIMEOUT and automatically try to reconnect. @param warn Warning code: #WARN_CODE_TYPE. @param msg Pointer to the warning message. */ virtual void onWarning(int warn, const char* msg) { (void)warn; (void)msg; } /** Reports an error during SDK runtime. In most cases, the SDK cannot fix the issue and resume running. The SDK requires the application to take action or informs the user about the issue. For example, the SDK reports an #ERR_START_CALL error when failing to initialize a call. The application informs the user that the call initialization failed and invokes the \ref IRtcEngine::leaveChannel "leaveChannel" method to leave the channel. @param err Error code: #ERROR_CODE_TYPE. @param msg Pointer to the error message. */ virtual void onError(int err, const char* msg) { (void)err; (void)msg; } /** Occurs when a user joins a channel. This callback notifies the application that a user joins a specified channel when the application calls the \ref IRtcEngine::joinChannel "joinChannel" method. The channel name assignment is based on @p channelName specified in the \ref IRtcEngine::joinChannel "joinChannel" method. If the @p uid is not specified in the *joinChannel* method, the server automatically assigns a @p uid. @param channel Pointer to the channel name. @param uid User ID of the user joining the channel. @param elapsed Time elapsed (ms) from the user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback. */ virtual void onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) { (void)channel; (void)uid; (void)elapsed; } /** Occurs when a user rejoins the channel after disconnection due to network problems. When a user loses connection with the server because of network problems, the SDK automatically tries to reconnect and triggers this callback upon reconnection. @param channel Pointer to the channel name. @param uid User ID of the user rejoining the channel. @param elapsed Time elapsed (ms) from starting to reconnect until the SDK triggers this callback. */ virtual void onRejoinChannelSuccess(const char* channel, uid_t uid, int elapsed) { (void)channel; (void)uid; (void)elapsed; } /** Occurs when a user leaves the channel. This callback notifies the application that a user leaves the channel when the application calls the \ref IRtcEngine::leaveChannel "leaveChannel" method. The application retrieves information, such as the call duration and statistics. @param stats Pointer to the statistics of the call: RtcStats. */ virtual void onLeaveChannel(const RtcStats& stats) { (void)stats; } /** Occurs when the user role switches in a live broadcast. For example, from a host to an audience or vice versa. This callback notifies the application of a user role switch when the application calls the \ref IRtcEngine::setClientRole "setClientRole" method. The SDK triggers this callback when the local user switches the user role by calling the \ref ar::rtc::IRtcEngine::setClientRole "setClientRole" method after joining the channel. @param oldRole Role that the user switches from: #CLIENT_ROLE_TYPE. @param newRole Role that the user switches to: #CLIENT_ROLE_TYPE. */ virtual void onClientRoleChanged(CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole) { } /** Occurs when a remote user (Communication)/ host (Live Broadcast) joins the channel. - Communication profile: This callback notifies the application that another user joins the channel. If other users are already in the channel, the SDK also reports to the application on the existing users. - Live-broadcast profile: This callback notifies the application that the host joins the channel. If other hosts are already in the channel, the SDK also reports to the application on the existing hosts. We recommend limiting the number of hosts to 17. The SDK triggers this callback under one of the following circumstances: - A remote user/host joins the channel by calling the \ref ar::rtc::IRtcEngine::joinChannel "joinChannel" method. - A remote user switches the user role to the host by calling the \ref ar::rtc::IRtcEngine::setClientRole "setClientRole" method after joining the channel. - A remote user/host rejoins the channel after a network interruption. - The host injects an online media stream into the channel by calling the \ref ar::rtc::IRtcEngine::addInjectStreamUrl "addInjectStreamUrl" method. @note In the Live-broadcast profile: - The host receives this callback when another host joins the channel. - The audience in the channel receives this callback when a new host joins the channel. - When a web application joins the channel, the SDK triggers this callback as long as the web application publishes streams. @param uid User ID of the user or host joining the channel. @param elapsed Time delay (ms) from the local user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback. */ virtual void onUserJoined(uid_t uid, int elapsed) { (void)uid; (void)elapsed; } /** Occurs when a remote user (Communication)/host (Live Broadcast) leaves the channel. Reasons why the user is offline: - Leave the channel: When the user/host leaves the channel, the user/host sends a goodbye message. When the message is received, the SDK assumes that the user/host leaves the channel. - Drop offline: When no data packet of the user or host is received for a certain period of time, the SDK assumes that the user/host drops offline. Unreliable network connections may lead to false detections, so we recommend using a signaling system for more reliable offline detection. @param uid User ID of the user leaving the channel or going offline. @param reason Reason why the user is offline: #USER_OFFLINE_REASON_TYPE. */ virtual void onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) { (void)uid; (void)reason; } /** Reports the last mile network quality of the local user once every two seconds before the user joins the channel. Last mile refers to the connection between the local device and AR's edge server. After the application calls the \ref IRtcEngine::enableLastmileTest "enableLastmileTest" method, this callback reports once every two seconds the uplink and downlink last mile network conditions of the local user before the user joins the channel. @param quality The last mile network quality: #QUALITY_TYPE. */ virtual void onLastmileQuality(int quality) { (void)quality; } /** Reports the last-mile network probe result. The SDK triggers this callback within 30 seconds after the app calls the \ref ar::rtc::IRtcEngine::startLastmileProbeTest "startLastmileProbeTest" method. @param result The uplink and downlink last-mile network probe test result. See LastmileProbeResult. */ virtual void onLastmileProbeResult(const LastmileProbeResult& result) { (void)result; } /** **DEPRECATED** Occurs when the connection between the SDK and the server is interrupted. Deprecated as of v2.3.2. Replaced by the \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged(CONNECTION_STATE_RECONNECTING, CONNECTION_CHANGED_INTERRUPTED)" callback. The SDK triggers this callback when it loses connection with the server for more than four seconds after the connection is established. After triggering this callback, the SDK tries reconnecting to the server. You can use this callback to implement pop-up reminders. This callback is different from \ref ar::rtc::IRtcEngineEventHandler::onConnectionLost "onConnectionLost": - The SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onConnectionInterrupted "onConnectionInterrupted" callback when it loses connection with the server for more than four seconds after it successfully joins the channel. - The SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onConnectionLost "onConnectionLost" callback when it loses connection with the server for more than 10 seconds, whether or not it joins the channel. If the SDK fails to rejoin the channel 20 minutes after being disconnected from AR's edge server, the SDK stops rejoining the channel. */ virtual void onConnectionInterrupted() {} /** Occurs when the SDK cannot reconnect to AR's edge server 10 seconds after its connection to the server is interrupted. The SDK triggers this callback when it cannot connect to the server 10 seconds after calling the \ref IRtcEngine::joinChannel "joinChannel" method, whether or not it is in the channel. This callback is different from \ref ar::rtc::IRtcEngineEventHandler::onConnectionInterrupted "onConnectionInterrupted": - The SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onConnectionInterrupted "onConnectionInterrupted" callback when it loses connection with the server for more than four seconds after it successfully joins the channel. - The SDK triggers the \ref ar::rtc::IRtcEngineEventHandler::onConnectionLost "onConnectionLost" callback when it loses connection with the server for more than 10 seconds, whether or not it joins the channel. If the SDK fails to rejoin the channel 20 minutes after being disconnected from AR's edge server, the SDK stops rejoining the channel. */ virtual void onConnectionLost() {} /** **DEPRECATED** Deprecated as of v2.3.2. Replaced by the \ref ar::rtc::IRtcEngineEventHandler::onConnectionStateChanged "onConnectionStateChanged(CONNECTION_STATE_FAILED, CONNECTION_CHANGED_BANNED_BY_SERVER)" callback. Occurs when your connection is banned by the AR Server. */ virtual void onConnectionBanned() {} /** Occurs when a method is executed by the SDK. @param err The error code (#ERROR_CODE_TYPE) returned by the SDK when a method call fails. If the SDK returns 0, then the method call is successful. @param api Pointer to the method executed by the SDK. @param result Pointer to the result of the method call. */ virtual void onApiCallExecuted(int err, const char* api, const char* result) { (void)err; (void)api; (void)result; } /** Occurs when the token expires. After a token is specified by calling the \ref IRtcEngine::joinChannel "joinChannel" method, if the SDK losses connection with the AR server due to network issues, the token may expire after a certain period of time and a new token may be required to reconnect to the server. This callback notifies the application to generate a new token. Call the \ref IRtcEngine::renewToken "renewToken" method to renew the token. */ virtual void onRequestToken() { } /** Occurs when the token expires in 30 seconds. The user becomes offline if the token used in the \ref IRtcEngine::joinChannel "joinChannel" method expires. The SDK triggers this callback 30 seconds before the token expires to remind the application to get a new token. Upon receiving this callback, generate a new token on the server and call the \ref IRtcEngine::renewToken "renewToken" method to pass the new token to the SDK. @param token Pointer to the token that expires in 30 seconds. */ virtual void onTokenPrivilegeWillExpire(const char* token) { (void)token; } /** **DEPRECATED** Reports the statistics of the audio stream from each remote user/host. Deprecated as of v2.3.2. Use the \ref ar::rtc::IRtcEngineEventHandler::onRemoteAudioStats "onRemoteAudioStats" callback instead. The SDK triggers this callback once every two seconds to report the audio quality of each remote user/host sending an audio stream. If a channel has multiple users/hosts sending audio streams, the SDK triggers this callback as many times. @param uid User ID of the speaker. @param quality Audio quality of the user: #QUALITY_TYPE. @param delay Time delay (ms) of sending the audio packet from the sender to the receiver, including the time delay of audio sampling pre-processing, transmission, and the jitter buffer. @param lost Packet loss rate (%) of the audio packet sent from the sender to the receiver. */ virtual void onAudioQuality(uid_t uid, int quality, unsigned short delay, unsigned short lost) { (void)uid; (void)quality; (void)delay; (void)lost; } /** Reports the statistics of the current call. The SDK triggers this callback once every two seconds after the user joins the channel. @param stats Statistics of the RtcEngine: RtcStats. */ virtual void onRtcStats(const RtcStats& stats) { (void)stats; } /** Reports the last mile network quality of each user in the channel once every two seconds. Last mile refers to the connection between the local device and AR's edge server. This callback reports once every two seconds the last mile network conditions of each user in the channel. If a channel includes multiple users, the SDK triggers this callback as many times. @param uid User ID. The network quality of the user with this @p uid is reported. If @p uid is 0, the local network quality is reported. @param txQuality Uplink transmission quality rating of the user in terms of the transmission bitrate, packet loss rate, average RTT (Round-Trip Time), and jitter of the uplink network. @p txQuality is a quality rating helping you understand how well the current uplink network conditions can support the selected VideoEncoderConfiguration. For example, a 1000 Kbps uplink network may be adequate for video frames with a resolution of 640 × 480 and a frame rate of 15 fps in the Live-broadcast profile, but may be inadequate for resolutions higher than 1280 × 720. See #QUALITY_TYPE. @param rxQuality Downlink network quality rating of the user in terms of the packet loss rate, average RTT, and jitter of the downlink network. See #QUALITY_TYPE. */ virtual void onNetworkQuality(uid_t uid, int txQuality, int rxQuality) { (void)uid; (void)txQuality; (void)rxQuality; } /** Reports the statistics of the local video stream. * * The SDK triggers this callback once every two seconds for each * user/host. If there are multiple users/hosts in the channel, the SDK * triggers this callback as many times. * * @note * If you have called the \ref ar::rtc::IRtcEngine::enableDualStream * "enableDualStream" method, the \ref onLocalVideoStats() * "onLocalVideoStats" callback reports the statistics of the high-video * stream (high bitrate, and high-resolution video stream). * * @param stats Statistics of the local video stream. See LocalVideoStats. */ virtual void onLocalVideoStats(const LocalVideoStats& stats) { (void)stats; } /** Reports the statistics of the video stream from each remote user/host. * * The SDK triggers this callback once every two seconds for each remote * user/host. If a channel includes multiple remote users, the SDK * triggers this callback as many times. * * @param stats Statistics of the remote video stream. See * RemoteVideoStats. */ virtual void onRemoteVideoStats(const RemoteVideoStats& stats) { (void)stats; } /** Reports the statistics of the local audio stream. * * The SDK triggers this callback once every two seconds. * * @param stats The statistics of the local audio stream. * See LocalAudioStats. */ virtual void onLocalAudioStats(const LocalAudioStats& stats) { (void)stats; } /** Reports the statistics of the audio stream from each remote user/host. This callback replaces the \ref ar::rtc::IRtcEngineEventHandler::onAudioQuality "onAudioQuality" callback. The SDK triggers this callback once every two seconds for each remote user/host. If a channel includes multiple remote users, the SDK triggers this callback as many times. @param stats Pointer to the statistics of the received remote audio streams. See RemoteAudioStats. */ virtual void onRemoteAudioStats(const RemoteAudioStats& stats) { (void)stats; } /** Occurs when the local audio state changes. * * This callback indicates the state change of the local audio stream, * including the state of the audio recording and encoding, and allows * you to troubleshoot issues when exceptions occur. * * @note * When the state is #LOCAL_AUDIO_STREAM_STATE_FAILED (3), see the `error` * parameter for details. * * @param state State of the local audio. See #LOCAL_AUDIO_STREAM_STATE. * @param error The error information of the local audio. * See #LOCAL_AUDIO_STREAM_ERROR. */ virtual void onLocalAudioStateChanged(LOCAL_AUDIO_STREAM_STATE state, LOCAL_AUDIO_STREAM_ERROR error) { (void)state; (void)error; } /** Occurs when the remote audio state changes. * * This callback indicates the state change of the remote audio stream. * * @param uid ID of the remote user whose audio state changes. * @param state State of the remote audio. See #REMOTE_AUDIO_STATE. * @param reason The reason of the remote audio state change. * See #REMOTE_AUDIO_STATE_REASON. * @param elapsed Time elapsed (ms) from the local user calling the * \ref IRtcEngine::joinChannel "joinChannel" method until the SDK * triggers this callback. */ virtual void onRemoteAudioStateChanged(uid_t uid, REMOTE_AUDIO_STATE state, REMOTE_AUDIO_STATE_REASON reason, int elapsed) { (void)uid; (void)state; (void)reason; (void)elapsed; } /** Occurs when the audio publishing state changes. * * @since v3.1.0 * * This callback indicates the publishing state change of the local audio stream. * * @param channel The channel name. * @param oldState The previous publishing state. For details, see #STREAM_PUBLISH_STATE. * @param newState The current publishing state. For details, see #STREAM_PUBLISH_STATE. * @param elapseSinceLastState The time elapsed (ms) from the previous state to the current state. */ virtual void onAudioPublishStateChanged(const char* channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState) { (void)channel; (void)oldState; (void)newState; (void)elapseSinceLastState; } /** Occurs when the video publishing state changes. * * @since v3.1.0 * * This callback indicates the publishing state change of the local video stream. * * @param channel The channel name. * @param oldState The previous publishing state. For details, see #STREAM_PUBLISH_STATE. * @param newState The current publishing state. For details, see #STREAM_PUBLISH_STATE. * @param elapseSinceLastState The time elapsed (ms) from the previous state to the current state. */ virtual void onVideoPublishStateChanged(const char* channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState) { (void)channel; (void)oldState; (void)newState; (void)elapseSinceLastState; } /** Occurs when the audio subscribing state changes. * * @since v3.1.0 * * This callback indicates the subscribing state change of a remote audio stream. * * @param channel The channel name. * @param uid The ID of the remote user. * @param oldState The previous subscribing state. For details, see #STREAM_SUBSCRIBE_STATE. * @param newState The current subscribing state. For details, see #STREAM_SUBSCRIBE_STATE. * @param elapseSinceLastState The time elapsed (ms) from the previous state to the current state. */ virtual void onAudioSubscribeStateChanged(const char* channel, uid_t uid, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState) { (void)channel; (void)uid; (void)oldState; (void)newState; (void)elapseSinceLastState; } /** Occurs when the audio subscribing state changes. * * @since v3.1.0 * * This callback indicates the subscribing state change of a remote video stream. * * @param channel The channel name. * @param uid The ID of the remote user. * @param oldState The previous subscribing state. For details, see #STREAM_SUBSCRIBE_STATE. * @param newState The current subscribing state. For details, see #STREAM_SUBSCRIBE_STATE. * @param elapseSinceLastState The time elapsed (ms) from the previous state to the current state. */ virtual void onVideoSubscribeStateChanged(const char* channel, uid_t uid, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState) { (void)channel; (void)uid; (void)oldState; (void)newState; (void)elapseSinceLastState; } /** Reports which users are speaking, the speakers' volume and whether the local user is speaking. This callback reports the IDs and volumes of the loudest speakers at the moment in the channel, and whether the local user is speaking. By default, this callback is disabled. You can enable it by calling the \ref IRtcEngine::enableAudioVolumeIndication(int, int, bool) "enableAudioVolumeIndication" method. Once enabled, this callback is triggered at the set interval, regardless of whether a user speaks or not. The SDK triggers two independent `onAudioVolumeIndication` callbacks at one time, which separately report the volume information of the local user and all the remote speakers. For more information, see the detailed parameter descriptions. @note - To enable the voice activity detection of the local user, ensure that you set `report_vad`(true) in the `enableAudioVolumeIndication` method. - Calling the \ref ar::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method affects the SDK's behavior: - If the local user calls the \ref ar::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method, the SDK stops triggering the local user's callback. - 20 seconds after a remote speaker calls the *muteLocalAudioStream* method, the remote speakers' callback excludes this remote user's information; 20 seconds after all remote users call the *muteLocalAudioStream* method, the SDK stops triggering the remote speakers' callback. - An empty @p speakers array in the *onAudioVolumeIndication* callback suggests that no remote user is speaking at the moment. @param speakers A pointer to AudioVolumeInfo: - In the local user's callback, this struct contains the following members: - `uid` = 0, - `volume` = `totalVolume`, which reports the sum of the voice volume and audio-mixing volume of the local user, and - `vad`, which reports the voice activity status of the local user. - In the remote speakers' callback, this array contains the following members: - `uid` of the remote speaker, - `volume`, which reports the sum of the voice volume and audio-mixing volume of each remote speaker, and - `vad` = 0. An empty speakers array in the callback indicates that no remote user is speaking at the moment. @param speakerNumber Total number of speakers. The value range is [0, 3]. - In the local user’s callback, `speakerNumber` = 1, regardless of whether the local user speaks or not. - In the remote speakers' callback, the callback reports the IDs and volumes of the three loudest speakers when there are more than three remote users in the channel, and `speakerNumber` = 3. @param totalVolume Total volume after audio mixing. The value ranges between 0 (lowest volume) and 255 (highest volume). - In the local user’s callback, `totalVolume` is the sum of the voice volume and audio-mixing volume of the local user. - In the remote speakers' callback, `totalVolume` is the sum of the voice volume and audio-mixing volume of all the remote speakers. */ virtual void onAudioVolumeIndication(const AudioVolumeInfo* speakers, unsigned int speakerNumber, int totalVolume) { (void)speakers; (void)speakerNumber; (void)totalVolume; } /** Occurs when the most active speaker is detected. After a successful call of \ref IRtcEngine::enableAudioVolumeIndication(int, int, bool) "enableAudioVolumeIndication", the SDK continuously detects which remote user has the loudest volume. During the current period, the remote user, who is detected as the loudest for the most times, is the most active user. When the number of user is no less than two and an active speaker exists, the SDK triggers this callback and reports the `uid` of the most active speaker. - If the most active speaker is always the same user, the SDK triggers this callback only once. - If the most active speaker changes to another user, the SDK triggers this callback again and reports the `uid` of the new active speaker. @param uid The user ID of the most active speaker. */ virtual void onActiveSpeaker(uid_t uid) { (void)uid; } /** **DEPRECATED** Occurs when the video stops playing. The application can use this callback to change the configuration of the view (for example, displaying other pictures in the view) after the video stops playing. Deprecated as of v2.4.1. Use LOCAL_VIDEO_STREAM_STATE_STOPPED(0) in the \ref ar::rtc::IRtcEngineEventHandler::onLocalVideoStateChanged "onLocalVideoStateChanged" callback instead. */ virtual void onVideoStopped() {} /** Occurs when the first local video frame is displayed/rendered on the local video view. @param width Width (px) of the first local video frame. @param height Height (px) of the first local video frame. @param elapsed Time elapsed (ms) from the local user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback. If you call the \ref IRtcEngine::startPreview "startPreview" method before calling the *joinChannel* method, then @p elapsed is the time elapsed from calling the *startPreview* method until the SDK triggers this callback. */ virtual void onFirstLocalVideoFrame(int width, int height, int elapsed) { (void)width; (void)height; (void)elapsed; } /** Occurs when the first video frame is published. * * @since v3.1.0 * * The SDK triggers this callback under one of the following circumstances: * - The local client enables the video module and calls \ref IRtcEngine::joinChannel "joinChannel" successfully. * - The local client calls \ref IRtcEngine::muteLocalVideoStream "muteLocalVideoStream(true)" and \ref IRtcEngine::muteLocalVideoStream "muteLocalVideoStream(false)" in sequence. * - The local client calls \ref IRtcEngine::disableVideo "disableVideo" and \ref IRtcEngine::enableVideo "enableVideo" in sequence. * * @param elapsed The time elapsed (ms) from the local client calling \ref IRtcEngine::joinChannel "joinChannel" until the SDK triggers this callback. */ virtual void onFirstLocalVideoFramePublished(int elapsed) { (void)elapsed; } /** Occurs when the first remote video frame is received and decoded. * * @deprecated * This callback is deprecated and replaced by the * \ref onRemoteVideoStateChanged() "onRemoteVideoStateChanged" callback * with the following parameters: * - #REMOTE_VIDEO_STATE_STARTING (1) * - #REMOTE_VIDEO_STATE_DECODING (2) * * This callback is triggered in either of the following scenarios: * * - The remote user joins the channel and sends the video stream. * - The remote user stops sending the video stream and re-sends it after * 15 seconds. Reasons for such an interruption include: * - The remote user leaves the channel. * - The remote user drops offline. * - The remote user calls the * \ref ar::rtc::IRtcEngine::muteLocalVideoStream "muteLocalVideoStream" * method to stop sending the video stream. * - The remote user calls the * \ref ar::rtc::IRtcEngine::disableVideo "disableVideo" method to * disable video. * * The application can configure the user view settings in this callback. * * @param uid User ID of the remote user sending the video stream. * @param width Width (px) of the video stream. * @param height Height (px) of the video stream. * @param elapsed Time elapsed (ms) from the local user calling the * \ref IRtcEngine::joinChannel "joinChannel" method until the SDK * triggers this callback. */ virtual void onFirstRemoteVideoDecoded(uid_t uid, int width, int height, int elapsed) { (void)uid; (void)width; (void)height; (void)elapsed; } /** Occurs when the first remote video frame is rendered. The SDK triggers this callback when the first frame of the remote video is displayed in the user's video window. The application can retrieve the time elapsed from a user joining the channel until the first video frame is displayed. @param uid User ID of the remote user sending the video stream. @param width Width (px) of the video frame. @param height Height (px) of the video stream. @param elapsed Time elapsed (ms) from the local user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback. */ virtual void onFirstRemoteVideoFrame(uid_t uid, int width, int height, int elapsed) { (void)uid; (void)width; (void)height; (void)elapsed; } /** @deprecated This method is deprecated from v3.0.0, use the \ref ar::rtc::IRtcEngineEventHandler::onRemoteAudioStateChanged "onRemoteAudioStateChanged" callback instead. Occurs when a remote user's audio stream playback pauses/resumes. The SDK triggers this callback when the remote user stops or resumes sending the audio stream by calling the \ref ar::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method. @note This callback does not work properly when the number of users (in the `COMMUNICATION` profile) or hosts (in the `LIVE_BROADCASTING` profile) in the channel exceeds 17. @param uid User ID of the remote user. @param muted Whether the remote user's audio stream is muted/unmuted: - true: Muted. - false: Unmuted. */ virtual void onUserMuteAudio(uid_t uid, bool muted) { (void)uid; (void)muted; } /** Occurs when a remote user's video stream playback pauses/resumes. * * You can also use the * \ref onRemoteVideoStateChanged() "onRemoteVideoStateChanged" callback * with the following parameters: * - #REMOTE_VIDEO_STATE_STOPPED (0) and * #REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED (5). * - #REMOTE_VIDEO_STATE_DECODING (2) and * #REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED (6). * * The SDK triggers this callback when the remote user stops or resumes * sending the video stream by calling the * \ref ar::rtc::IRtcEngine::muteLocalVideoStream * "muteLocalVideoStream" method. * * @note This callback does not work properly when the number of users (in the `COMMUNICATION` profile) or hosts (in the `LIVE_BROADCASTING` profile) in the channel exceeds 17. * * @param uid User ID of the remote user. * @param muted Whether the remote user's video stream playback is * paused/resumed: * - true: Paused. * - false: Resumed. */ virtual void onUserMuteVideo(uid_t uid, bool muted) { (void)uid; (void)muted; } /** Occurs when a specific remote user enables/disables the video * module. * * @deprecated * This callback is deprecated and replaced by the * \ref onRemoteVideoStateChanged() "onRemoteVideoStateChanged" callback * with the following parameters: * - #REMOTE_VIDEO_STATE_STOPPED (0) and * #REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED (5). * - #REMOTE_VIDEO_STATE_DECODING (2) and * #REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED (6). * * Once the video module is disabled, the remote user can only use a * voice call. The remote user cannot send or receive any video from * other users. * * The SDK triggers this callback when the remote user enables or disables * the video module by calling the * \ref ar::rtc::IRtcEngine::enableVideo "enableVideo" or * \ref ar::rtc::IRtcEngine::disableVideo "disableVideo" method. * * @note This callback returns invalid when the number of users in a * channel exceeds 20. * * @param uid User ID of the remote user. * @param enabled Whether the remote user enables/disables the video * module: * - true: Enable. The remote user can enter a video session. * - false: Disable. The remote user can only enter a voice session, and * cannot send or receive any video stream. */ virtual void onUserEnableVideo(uid_t uid, bool enabled) { (void)uid; (void)enabled; } /** Occurs when the audio device state changes. This callback notifies the application that the system's audio device state is changed. For example, a headset is unplugged from the device. @param deviceId Pointer to the device ID. @param deviceType Device type: #MEDIA_DEVICE_TYPE. @param deviceState Device state: #MEDIA_DEVICE_STATE_TYPE. */ virtual void onAudioDeviceStateChanged(const char* deviceId, int deviceType, int deviceState) { (void)deviceId; (void)deviceType; (void)deviceState; } /** Occurs when the volume of the playback device, microphone, or application changes. @param deviceType Device type: #MEDIA_DEVICE_TYPE. @param volume Volume of the device. The value ranges between 0 and 255. @param muted - true: The audio device is muted. - false: The audio device is not muted. */ virtual void onAudioDeviceVolumeChanged(MEDIA_DEVICE_TYPE deviceType, int volume, bool muted) { (void)deviceType; (void)volume; (void)muted; } /** **DEPRECATED** Occurs when the camera turns on and is ready to capture the video. If the camera fails to turn on, fix the error reported in the \ref IRtcEngineEventHandler::onError "onError" callback. Deprecated as of v2.4.1. Use #LOCAL_VIDEO_STREAM_STATE_CAPTURING (1) in the \ref ar::rtc::IRtcEngineEventHandler::onLocalVideoStateChanged "onLocalVideoStateChanged" callback instead. */ virtual void onCameraReady() {} /** Occurs when the camera focus area changes. The SDK triggers this callback when the local user changes the camera focus position by calling the setCameraFocusPositionInPreview method. @note This callback is for Android and iOS only. @param x x coordinate of the changed camera focus area. @param y y coordinate of the changed camera focus area. @param width Width of the changed camera focus area. @param height Height of the changed camera focus area. */ virtual void onCameraFocusAreaChanged(int x, int y, int width, int height) { (void)x; (void)y; (void)width; (void)height; } #if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS) /** * Reports the face detection result of the local user. Applies to Android and iOS only. * @since v3.0.1 * * Once you enable face detection by calling \ref IRtcEngine::enableFaceDetection "enableFaceDetection"(true), you can get the following information on the local user in real-time: * - The width and height of the local video. * - The position of the human face in the local video. * - The distance between the human face and the device screen. This value is based on the fitting calculation of the local video size and the position of the human face. * * @note * - If the SDK does not detect a face, it reduces the frequency of this callback to reduce power consumption on the local device. * - The SDK stops triggering this callback when a human face is in close proximity to the screen. * - On Android, the `distance` value reported in this callback may be slightly different from the actual distance. Therefore, AR does not recommend using it for * accurate calculation. * @param imageWidth The width (px) of the local video. * @param imageHeight The height (px) of the local video. * @param vecRectangle The position and size of the human face on the local video: * - `x`: The x coordinate (px) of the human face in the local video. Taking the top left corner of the captured video as the origin, * the x coordinate represents the relative lateral displacement of the top left corner of the human face to the origin. * - `y`: The y coordinate (px) of the human face in the local video. Taking the top left corner of the captured video as the origin, * the y coordinate represents the relative longitudinal displacement of the top left corner of the human face to the origin. * - `width`: The width (px) of the human face in the captured video. * - `height`: The height (px) of the human face in the captured video. * @param vecDistance The distance (cm) between the human face and the screen. * @param numFaces The number of faces detected. If the value is 0, it means that no human face is detected. */ virtual void onFacePositionChanged(int imageWidth, int imageHeight, Rectangle* vecRectangle, int* vecDistance, int numFaces){ (void)imageWidth; (void)imageHeight; (void)vecRectangle; (void)vecDistance; (void)numFaces; } #endif /** Occurs when the camera exposure area changes. The SDK triggers this callback when the local user changes the camera exposure position by calling the setCameraExposurePosition method. @note This callback is for Android and iOS only. @param x x coordinate of the changed camera exposure area. @param y y coordinate of the changed camera exposure area. @param width Width of the changed camera exposure area. @param height Height of the changed camera exposure area. */ virtual void onCameraExposureAreaChanged(int x, int y, int width, int height) { (void)x; (void)y; (void)width; (void)height; } /** Occurs when the audio mixing file playback finishes. **DEPRECATED** use onAudioMixingStateChanged instead. You can start an audio mixing file playback by calling the \ref IRtcEngine::startAudioMixing "startAudioMixing" method. The SDK triggers this callback when the audio mixing file playback finishes. If the *startAudioMixing* method call fails, an error code returns in the \ref IRtcEngineEventHandler::onError "onError" callback. */ virtual void onAudioMixingFinished() { } /** Occurs when the state of the local user's audio mixing file changes. When you call the \ref IRtcEngine::startAudioMixing "startAudioMixing" method and the state of audio mixing file changes, the SDK triggers this callback. - When the audio mixing file plays, pauses playing, or stops playing, this callback returns 710, 711, or 713 in @p state, and 0 in @p errorCode. - When exceptions occur during playback, this callback returns 714 in @p state and an error in @p errorCode. - If the local audio mixing file does not exist, or if the SDK does not support the file format or cannot access the music file URL, the SDK returns WARN_AUDIO_MIXING_OPEN_ERROR = 701. @param state The state code. See #AUDIO_MIXING_STATE_TYPE. @param errorCode The error code. See #AUDIO_MIXING_ERROR_TYPE. */ virtual void onAudioMixingStateChanged(AUDIO_MIXING_STATE_TYPE state, AUDIO_MIXING_ERROR_TYPE errorCode){ } /** Occurs when a remote user starts audio mixing. When a remote user calls \ref IRtcEngine::startAudioMixing "startAudioMixing" to play the background music, the SDK reports this callback. */ virtual void onRemoteAudioMixingBegin() { } /** Occurs when a remote user finishes audio mixing. */ virtual void onRemoteAudioMixingEnd() { } /** Occurs when the local audio effect playback finishes. The SDK triggers this callback when the local audio effect file playback finishes. @param soundId ID of the local audio effect. Each local audio effect has a unique ID. */ virtual void onAudioEffectFinished(int soundId) { } /** Occurs when the SDK decodes the first remote audio frame for playback. @deprecated v3.0.0 This callback is deprecated. Use `onRemoteAudioStateChanged` instead. This callback is triggered in either of the following scenarios: - The remote user joins the channel and sends the audio stream. - The remote user stops sending the audio stream and re-sends it after 15 seconds. Reasons for such an interruption include: - The remote user leaves channel. - The remote user drops offline. - The remote user calls the \ref ar::rtc::IRtcEngine::muteLocalAudioStream "muteLocalAudioStream" method to stop sending the local audio stream. - The remote user calls the \ref ar::rtc::IRtcEngine::disableAudio "disableAudio" method to disable audio. @param uid User ID of the remote user sending the audio stream. @param elapsed Time elapsed (ms) from the local user calling the \ref IRtcEngine::joinChannel "joinChannel" method until the SDK triggers this callback. */ virtual void onFirstRemoteAudioDecoded(uid_t uid, int elapsed) { (void)uid; (void)elapsed; } /** Occurs when the video device state changes. @note On a Windows device with an external camera for video capturing, the video disables once the external camera is unplugged. @param deviceId Pointer to the device ID of the video device that changes state. @param deviceType Device type: #MEDIA_DEVICE_TYPE. @param deviceState Device state: #MEDIA_DEVICE_STATE_TYPE. */ virtual void onVideoDeviceStateChanged(const char* deviceId, int deviceType, int deviceState) { (void)deviceId; (void)deviceType; (void)deviceState; } /** Occurs when the local video stream state changes. This callback indicates the state of the local video stream, including camera capturing and video encoding, and allows you to troubleshoot issues when exceptions occur. @note For some device models, the SDK will not trigger this callback when the state of the local video changes while the local video capturing device is in use, so you have to make your own timeout judgment. @param localVideoState State type #LOCAL_VIDEO_STREAM_STATE. When the state is LOCAL_VIDEO_STREAM_STATE_FAILED (3), see the `error` parameter for details. @param error The detailed error information: #LOCAL_VIDEO_STREAM_ERROR. */ virtual void onLocalVideoStateChanged(LOCAL_VIDEO_STREAM_STATE localVideoState, LOCAL_VIDEO_STREAM_ERROR error) { (void)localVideoState; (void)error; } /** Occurs when the video size or rotation of a specified user changes. @param uid User ID of the remote user or local user (0) whose video size or rotation changes. @param width New width (pixels) of the video. @param height New height (pixels) of the video. @param rotation New rotation of the video [0 to 360). */ virtual void onVideoSizeChanged(uid_t uid, int width, int height, int rotation) { (void)uid; (void)width; (void)height; (void)rotation; } /** Occurs when the remote video state changes. * * @param uid ID of the remote user whose video state changes. * @param state State of the remote video. See #REMOTE_VIDEO_STATE. * @param reason The reason of the remote video state change. See * #REMOTE_VIDEO_STATE_REASON. * @param elapsed Time elapsed (ms) from the local user calling the * \ref ar::rtc::IRtcEngine::joinChannel "joinChannel" method until the * SDK triggers this callback. */ virtual void onRemoteVideoStateChanged(uid_t uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed) { (void)uid; (void)state; (void)reason; (void)elapsed; } /** Occurs when a specified remote user enables/disables the local video * capturing function. * * @deprecated * This callback is deprecated and replaced by the * \ref onRemoteVideoStateChanged() "onRemoteVideoStateChanged" callback * with the following parameters: * - #REMOTE_VIDEO_STATE_STOPPED (0) and * #REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED (5). * - #REMOTE_VIDEO_STATE_DECODING (2) and * #REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED (6). * * This callback is only applicable to the scenario when the user only * wants to watch the remote video without sending any video stream to the * other user. * * The SDK triggers this callback when the remote user resumes or stops * capturing the video stream by calling the * \ref ar::rtc::IRtcEngine::enableLocalVideo "enableLocalVideo" method. * * @param uid User ID of the remote user. * @param enabled Whether the specified remote user enables/disables the * local video capturing function: * - true: Enable. Other users in the channel can see the video of this * remote user. * - false: Disable. Other users in the channel can no longer receive the * video stream from this remote user, while this remote user can still * receive the video streams from other users. */ virtual void onUserEnableLocalVideo(uid_t uid, bool enabled) { (void)uid; (void)enabled; } // virtual void onStreamError(int streamId, int code, int parameter, const char* message, size_t length) {} /** Occurs when the local user receives the data stream from the remote user within five seconds. The SDK triggers this callback when the local user receives the stream message that the remote user sends by calling the \ref ar::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method. @param uid User ID of the remote user sending the message. @param streamId Stream ID. @param data Pointer to the data received by the local user. @param length Length of the data in bytes. */ virtual void onStreamMessage(uid_t uid, int streamId, const char* data, size_t length) { (void)uid; (void)streamId; (void)data; (void)length; } /** Occurs when the local user does not receive the data stream from the remote user within five seconds. The SDK triggers this callback when the local user fails to receive the stream message that the remote user sends by calling the \ref ar::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method. @param uid User ID of the remote user sending the message. @param streamId Stream ID. @param code Error code: #ERROR_CODE_TYPE. @param missed Number of lost messages. @param cached Number of incoming cached messages when the data stream is interrupted. */ virtual void onStreamMessageError(uid_t uid, int streamId, int code, int missed, int cached) { (void)uid; (void)streamId; (void)code; (void)missed; (void)cached; } /** Occurs when the media engine loads.*/ virtual void onMediaEngineLoadSuccess() { } /** Occurs when the media engine call starts.*/ virtual void onMediaEngineStartCallSuccess() { } /// @cond /** Reports whether the super-resolution algorithm is enabled. * * @since v3.2.0 * * After calling \ref IRtcEngine::enableRemoteSuperResolution "enableRemoteSuperResolution", the SDK triggers this * callback to report whether the super-resolution algorithm is successfully enabled. If not successfully enabled, * you can use reason for troubleshooting. * * @param uid The ID of the remote user. * @param enabled Whether the super-resolution algorithm is successfully enabled: * - true: The super-resolution algorithm is successfully enabled. * - false: The super-resolution algorithm is not successfully enabled. * @param reason The reason why the super-resolution algorithm is not successfully enabled. See #SUPER_RESOLUTION_STATE_REASON. */ virtual void onUserSuperResolutionEnabled(uid_t uid, bool enabled, SUPER_RESOLUTION_STATE_REASON reason) { (void)uid; (void)enabled; (void)reason; } /// @endcond /** Occurs when the state of the media stream relay changes. * * The SDK returns the state of the current media relay with any error * message. * * @param state The state code in #CHANNEL_MEDIA_RELAY_STATE. * @param code The error code in #CHANNEL_MEDIA_RELAY_ERROR. */ virtual void onChannelMediaRelayStateChanged(CHANNEL_MEDIA_RELAY_STATE state,CHANNEL_MEDIA_RELAY_ERROR code) { } /** Reports events during the media stream relay. * * @param code The event code in #CHANNEL_MEDIA_RELAY_EVENT. */ virtual void onChannelMediaRelayEvent(CHANNEL_MEDIA_RELAY_EVENT code) { } /** Occurs when the engine sends the first local audio frame. @deprecated Deprecated as of v3.1.0. Use the \ref IRtcEngineEventHandler::onFirstLocalAudioFramePublished "onFirstLocalAudioFramePublished" callback instead. @param elapsed Time elapsed (ms) from the local user calling \ref IRtcEngine::joinChannel "joinChannel" until the SDK triggers this callback. */ virtual void onFirstLocalAudioFrame(int elapsed) { (void)elapsed; } /** Occurs when the first audio frame is published. * * @since v3.1.0 * * The SDK triggers this callback under one of the following circumstances: * - The local client enables the audio module and calls \ref IRtcEngine::joinChannel "joinChannel" successfully. * - The local client calls \ref IRtcEngine::muteLocalAudioStream "muteLocalAudioStream(true)" and \ref IRtcEngine::muteLocalAudioStream "muteLocalAudioStream(false)" in sequence. * - The local client calls \ref IRtcEngine::disableAudio "disableAudio" and \ref IRtcEngine::enableAudio "enableAudio" in sequence. * * @param elapsed The time elapsed (ms) from the local client calling \ref IRtcEngine::joinChannel "joinChannel" until the SDK triggers this callback. */ virtual void onFirstLocalAudioFramePublished(int elapsed) { (void)elapsed; } /** Occurs when the engine receives the first audio frame from a specific remote user. @param uid User ID of the remote user. @param elapsed Time elapsed (ms) from the remote user calling \ref IRtcEngine::joinChannel "joinChannel" until the SDK triggers this callback. */ virtual void onFirstRemoteAudioFrame(uid_t uid, int elapsed) { (void)uid; (void)elapsed; } /** Occurs when the state of the RTMP streaming changes. The SDK triggers this callback to report the result of the local user calling the \ref ar::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" or \ref ar::rtc::IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" method. This callback indicates the state of the RTMP streaming. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the *errCode* parameter. @param url The RTMP URL address. @param state The RTMP streaming state. See: #RTMP_STREAM_PUBLISH_STATE. @param errCode The detailed error information for streaming. See: #RTMP_STREAM_PUBLISH_ERROR. */ virtual void onRtmpStreamingStateChanged(const char *url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_ERROR errCode) { (void) url; (void) state; (void) errCode; } /** Reports events during the RTMP streaming. * * @since v3.1.0 * * @param url The RTMP streaming URL. * @param eventCode The event code. See #RTMP_STREAMING_EVENT */ virtual void onRtmpStreamingEvent(const char* url, RTMP_STREAMING_EVENT eventCode) { (void) url; (void) eventCode; } /** @deprecated This method is deprecated, use the \ref ar::rtc::IRtcEngineEventHandler::onRtmpStreamingStateChanged "onRtmpStreamingStateChanged" callback instead. Reports the result of calling the \ref IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" method. (CDN live only.) @param url The RTMP URL address. @param error Error code: #ERROR_CODE_TYPE. Main errors include: - #ERR_OK (0): The publishing succeeds. - #ERR_FAILED (1): The publishing fails. - #ERR_INVALID_ARGUMENT (2): Invalid argument used. If, for example, you did not call \ref ar::rtc::IRtcEngine::setLiveTranscoding "setLiveTranscoding" to configure LiveTranscoding before calling \ref ar::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl", the SDK reports #ERR_INVALID_ARGUMENT. - #ERR_TIMEDOUT (10): The publishing timed out. - #ERR_ALREADY_IN_USE (19): The chosen URL address is already in use for CDN live streaming. - #ERR_RESOURCE_LIMITED (22): The backend system does not have enough resources for the CDN live streaming. - #ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH (130): You cannot publish an encrypted stream. - #ERR_PUBLISH_STREAM_CDN_ERROR (151) - #ERR_PUBLISH_STREAM_NUM_REACH_LIMIT (152) - #ERR_PUBLISH_STREAM_NOT_AUTHORIZED (153) - #ERR_PUBLISH_STREAM_INTERNAL_SERVER_ERROR (154) - #ERR_PUBLISH_STREAM_FORMAT_NOT_SUPPORTED (156) */ virtual void onStreamPublished(const char *url, int error) { (void)url; (void)error; } /** Reports the result of calling the \ref ar::rtc::IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" method. (CDN live only.) This callback indicates whether you have successfully removed an RTMP stream from the CDN. @param url The RTMP URL address. */ virtual void onStreamUnpublished(const char *url) { (void)url; } /** Occurs when the publisher's transcoding is updated. * * When the `LiveTranscoding` class in the \ref ar::rtc::IRtcEngine::setLiveTranscoding "setLiveTranscoding" method updates, the SDK triggers the `onTranscodingUpdated` callback to report the update information to the local host. * * @note If you call the `setLiveTranscoding` method to set the LiveTranscoding class for the first time, the SDK does not trigger the `onTranscodingUpdated` callback. * */ virtual void onTranscodingUpdated() { } /** Occurs when a voice or video stream URL address is added to a live broadcast. @param url Pointer to the URL address of the externally injected stream. @param uid User ID. @param status State of the externally injected stream: #INJECT_STREAM_STATUS. */ virtual void onStreamInjectedStatus(const char* url, uid_t uid, int status) { (void)url; (void)uid; (void)status; } /** Occurs when the local audio route changes. The SDK triggers this callback when the local audio route switches to an earpiece, speakerphone, headset, or Bluetooth device. @note This callback is for Android and iOS only. @param routing Audio output routing. See: #AUDIO_ROUTE_TYPE. */ virtual void onAudioRouteChanged(AUDIO_ROUTE_TYPE routing) { (void)routing; } /** Occurs when the locally published media stream falls back to an audio-only stream due to poor network conditions or switches back to the video after the network conditions improve. If you call \ref IRtcEngine::setLocalPublishFallbackOption "setLocalPublishFallbackOption" and set *option* as #STREAM_FALLBACK_OPTION_AUDIO_ONLY, the SDK triggers this callback when the locally published stream falls back to audio-only mode due to poor uplink conditions, or when the audio stream switches back to the video after the uplink network condition improves. @param isFallbackOrRecover Whether the locally published stream falls back to audio-only or switches back to the video: - true: The locally published stream falls back to audio-only due to poor network conditions. - false: The locally published stream switches back to the video after the network conditions improve. */ virtual void onLocalPublishFallbackToAudioOnly(bool isFallbackOrRecover) { (void)isFallbackOrRecover; } /** Occurs when the remote media stream falls back to audio-only stream * due to poor network conditions or switches back to the video stream * after the network conditions improve. * * If you call * \ref IRtcEngine::setRemoteSubscribeFallbackOption * "setRemoteSubscribeFallbackOption" and set * @p option as #STREAM_FALLBACK_OPTION_AUDIO_ONLY, the SDK triggers this * callback when the remote media stream falls back to audio-only mode due * to poor uplink conditions, or when the remote media stream switches * back to the video after the uplink network condition improves. * * @note Once the remote media stream switches to the low stream due to * poor network conditions, you can monitor the stream switch between a * high and low stream in the RemoteVideoStats callback. * * @param uid ID of the remote user sending the stream. * @param isFallbackOrRecover Whether the remotely subscribed media stream * falls back to audio-only or switches back to the video: * - true: The remotely subscribed media stream falls back to audio-only * due to poor network conditions. * - false: The remotely subscribed media stream switches back to the * video stream after the network conditions improved. */ virtual void onRemoteSubscribeFallbackToAudioOnly(uid_t uid, bool isFallbackOrRecover) { (void)uid; (void)isFallbackOrRecover; } /** Reports the transport-layer statistics of each remote audio stream. * * @deprecated * This callback is deprecated and replaced by the * \ref onRemoteAudioStats() "onRemoteAudioStats" callback. * * This callback reports the transport-layer statistics, such as the * packet loss rate and network time delay, once every two seconds after * the local user receives an audio packet from a remote user. * * @param uid User ID of the remote user sending the audio packet. * @param delay Network time delay (ms) from the remote user sending the * audio packet to the local user. * @param lost Packet loss rate (%) of the audio packet sent from the * remote user. * @param rxKBitRate Received bitrate (Kbps) of the audio packet sent * from the remote user. */ virtual void onRemoteAudioTransportStats( uid_t uid, unsigned short delay, unsigned short lost, unsigned short rxKBitRate) { (void)uid; (void)delay; (void)lost; (void)rxKBitRate; } /** Reports the transport-layer statistics of each remote video stream. * * @deprecated * This callback is deprecated and replaced by the * \ref onRemoteVideoStats() "onRemoteVideoStats" callback. * * This callback reports the transport-layer statistics, such as the * packet loss rate and network time delay, once every two seconds after * the local user receives a video packet from a remote user. * * @param uid User ID of the remote user sending the video packet. * @param delay Network time delay (ms) from the remote user sending the * video packet to the local user. * @param lost Packet loss rate (%) of the video packet sent from the * remote user. * @param rxKBitRate Received bitrate (Kbps) of the video packet sent * from the remote user. */ virtual void onRemoteVideoTransportStats( uid_t uid, unsigned short delay, unsigned short lost, unsigned short rxKBitRate) { (void)uid; (void)delay; (void)lost; (void)rxKBitRate; } /** **DEPRECATED** Occurs when the microphone is enabled/disabled. * * The \ref onMicrophoneEnabled() "onMicrophoneEnabled" callback is * deprecated. Use #LOCAL_AUDIO_STREAM_STATE_STOPPED (0) or * #LOCAL_AUDIO_STREAM_STATE_RECORDING (1) in the * \ref onLocalAudioStateChanged() "onLocalAudioStateChanged" callback * instead. * * The SDK triggers this callback when the local user resumes or stops * capturing the local audio stream by calling the * \ref ar::rtc::IRtcEngine::enableLocalAudio "enbaleLocalAudio" method. * * @param enabled Whether the microphone is enabled/disabled: * - true: Enabled. * - false: Disabled. */ virtual void onMicrophoneEnabled(bool enabled) { (void)enabled; } /** Occurs when the connection state between the SDK and the server changes. @param state See #CONNECTION_STATE_TYPE. @param reason See #CONNECTION_CHANGED_REASON_TYPE. */ virtual void onConnectionStateChanged( CONNECTION_STATE_TYPE state, CONNECTION_CHANGED_REASON_TYPE reason) { (void)state; (void)reason; } /** Occurs when the local network type changes. When the network connection is interrupted, this callback indicates whether the interruption is caused by a network type change or poor network conditions. @param type See #NETWORK_TYPE. */ virtual void onNetworkTypeChanged(NETWORK_TYPE type) { (void)type; } /** Occurs when the local user successfully registers a user account by calling the \ref ar::rtc::IRtcEngine::registerLocalUserAccount "registerLocalUserAccount" method or joins a channel by calling the \ref ar::rtc::IRtcEngine::joinChannelWithUserAccount "joinChannelWithUserAccount" method.This callback reports the user ID and user account of the local user. @param uid The ID of the local user. @param userAccount The user account of the local user. */ virtual void onLocalUserRegistered(uid_t uid, const char* userAccount) { (void)uid; (void)userAccount; } /** Occurs when the SDK gets the user ID and user account of the remote user. After a remote user joins the channel, the SDK gets the UID and user account of the remote user, caches them in a mapping table object (`userInfo`), and triggers this callback on the local client. @param uid The ID of the remote user. @param info The `UserInfo` object that contains the user ID and user account of the remote user. */ virtual void onUserInfoUpdated(uid_t uid, const UserInfo& info) { (void)uid; (void)info; } }; /** * Video device collection methods. The IVideoDeviceCollection interface class retrieves the video device information. */ class IVideoDeviceCollection { protected: virtual ~IVideoDeviceCollection(){} public: /** Retrieves the total number of the indexed video devices in the system. @return Total number of the indexed video devices: */ virtual int getCount() = 0; /** Retrieves a specified piece of information about an indexed video device. @param index The specified index of the video device that must be less than the return value of \ref IVideoDeviceCollection::getCount "getCount". @param deviceName Pointer to the video device name. @param deviceId Pointer to the video device ID. @return - 0: Success. - < 0: Failure. */ virtual int getDevice(int index, char deviceName[MAX_DEVICE_ID_LENGTH], char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; /** Sets the device with the device ID. @param deviceId Device ID of the device. @return - 0: Success. - < 0: Failure. */ virtual int setDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; /** Releases all IVideoDeviceCollection resources. */ virtual void release() = 0; }; /** Video device management methods. The IVideoDeviceManager interface class tests the video device interfaces. Instantiate an AVideoDeviceManager class to retrieve an IVideoDeviceManager interface. */ class IVideoDeviceManager { protected: virtual ~IVideoDeviceManager(){} public: /** Enumerates the video devices. This method returns an IVideoDeviceCollection object including all video devices in the system. With the IVideoDeviceCollection object, the application can enumerate the video devices. The application must call the \ref IVideoDeviceCollection::release "release" method to release the returned object after using it. @return - An IVideoDeviceCollection object including all video devices in the system: Success. - NULL: Failure. */ virtual IVideoDeviceCollection* enumerateVideoDevices() = 0; /** Starts the video-capture device test. This method tests whether the video-capture device works properly. Before calling this method, ensure that you have already called the \ref IRtcEngine::enableVideo "enableVideo" method, and the window handle (*hwnd*) parameter is valid. @param hwnd The window handle used to display the screen. @return - 0: Success. - < 0: Failure. */ virtual int startDeviceTest(view_t hwnd) = 0; /** Stops the video-capture device test. @return - 0: Success. - < 0: Failure. */ virtual int stopDeviceTest() = 0; /** Sets a device with the device ID. @param deviceId Pointer to the video-capture device ID. Call the \ref IVideoDeviceManager::enumerateVideoDevices "enumerateVideoDevices" method to retrieve it. @note Plugging or unplugging the device does not change the device ID. @return - 0: Success. - < 0: Failure. */ virtual int setDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; /** Retrieves the video-capture device that is in use. @param deviceId Pointer to the video-capture device ID. @return - 0: Success. - < 0: Failure. */ virtual int getDevice(char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; /** Select video device for Screen cast. @param deviceId Pointer to the video-capture device ID. @note: deviceId - scree0 for default desktop @return - 0: Success. - < 0: Failure. */ virtual int selectScreenCastDevice(char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; /** Releases all IVideoDeviceManager resources. */ virtual void release() = 0; }; /** Audio device collection methods. The IAudioDeviceCollection interface class retrieves device-related information. */ class IAudioDeviceCollection { protected: virtual ~IAudioDeviceCollection(){} public: /** Retrieves the total number of audio playback or audio recording devices. @note You must first call the \ref IAudioDeviceManager::enumeratePlaybackDevices "enumeratePlaybackDevices" or \ref IAudioDeviceManager::enumerateRecordingDevices "enumerateRecordingDevices" method before calling this method to return the number of audio playback or audio recording devices. @return Number of audio playback or audio recording devices. */ virtual int getCount() = 0; /** Retrieves a specified piece of information about an indexed audio device. @param index The specified index that must be less than the return value of \ref IAudioDeviceCollection::getCount "getCount". @param deviceName Pointer to the audio device name. @param deviceId Pointer to the audio device ID. @return - 0: Success. - < 0: Failure. */ virtual int getDevice(int index, char deviceName[MAX_DEVICE_ID_LENGTH], char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; /** Specifies a device with the device ID. @param deviceId Pointer to the device ID of the device. @return - 0: Success. - < 0: Failure. */ virtual int setDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; /** Sets the volume of the application. @param volume Application volume. The value ranges between 0 (lowest volume) and 255 (highest volume). @return - 0: Success. - < 0: Failure. */ virtual int setApplicationVolume(int volume) = 0; /** Retrieves the volume of the application. @param volume Pointer to the application volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume). @return - 0: Success. - < 0: Failure. */ virtual int getApplicationVolume(int& volume) = 0; /** Mutes the application. @param mute Sets whether to mute/unmute the application: - true: Mute the application. - false: Unmute the application. @return - 0: Success. - < 0: Failure. */ virtual int setApplicationMute(bool mute) = 0; /** Gets the mute state of the application. @param mute Pointer to whether the application is muted/unmuted. - true: The application is muted. - false: The application is not muted. @return - 0: Success. - < 0: Failure. */ virtual int isApplicationMute(bool& mute) = 0; /** Releases all IAudioDeviceCollection resources. */ virtual void release() = 0; }; /** Audio device management methods. The IAudioDeviceManager interface class allows for audio device interface testing. Instantiate an AAudioDeviceManager class to retrieve the IAudioDeviceManager interface. */ class IAudioDeviceManager { protected: virtual ~IAudioDeviceManager(){} public: /** Enumerates the audio playback devices. This method returns an IAudioDeviceCollection object that includes all audio playback devices in the system. With the IAudioDeviceCollection object, the application can enumerate the audio playback devices. @note The application must call the \ref IAudioDeviceCollection::release "release" method to release the returned object after using it. @return - Success: Returns an IAudioDeviceCollection object that includes all audio playback devices in the system. For wireless Bluetooth headset devices with master and slave headsets, the master headset is the playback device. - Returns NULL: Failure. */ virtual IAudioDeviceCollection* enumeratePlaybackDevices() = 0; /** Enumerates the audio recording devices. This method returns an IAudioDeviceCollection object that includes all audio recording devices in the system. With the IAudioDeviceCollection object, the application can enumerate the audio recording devices. @note The application needs to call the \ref IAudioDeviceCollection::release "release" method to release the returned object after using it. @return - Returns an IAudioDeviceCollection object that includes all audio recording devices in the system: Success. - Returns NULL: Failure. */ virtual IAudioDeviceCollection* enumerateRecordingDevices() = 0; /** Sets the audio playback device using the device ID. @note Plugging or unplugging the audio device does not change the device ID. @param deviceId Device ID of the audio playback device, retrieved by calling the \ref IAudioDeviceManager::enumeratePlaybackDevices "enumeratePlaybackDevices" method. @return - 0: Success. - < 0: Failure. */ virtual int setPlaybackDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; /** Sets the audio recording device using the device ID. @param deviceId Device ID of the audio recording device, retrieved by calling the \ref IAudioDeviceManager::enumerateRecordingDevices "enumerateRecordingDevices" method. @note Plugging or unplugging the audio device does not change the device ID. @return - 0: Success. - < 0: Failure. */ virtual int setRecordingDevice(const char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; /** Starts the audio playback device test. This method tests if the playback device works properly. In the test, the SDK plays an audio file specified by the user. If the user can hear the audio, the playback device works properly. @param testAudioFilePath Pointer to the path of the audio file for the audio playback device test in UTF-8: - Supported file formats: wav, mp3, m4a, and aac. - Supported file sample rates: 8000, 16000, 32000, 44100, and 48000 Hz. @return - 0: Success, and you can hear the sound of the specified audio file. - < 0: Failure. */ virtual int startPlaybackDeviceTest(const char* testAudioFilePath) = 0; /** Stops the audio playback device test. This method stops testing the audio playback device. You must call this method to stop the test after calling the \ref IAudioDeviceManager::startPlaybackDeviceTest "startPlaybackDeviceTest" method. @return - 0: Success. - < 0: Failure. */ virtual int stopPlaybackDeviceTest() = 0; /** Sets the volume of the audio playback device. @param volume Sets the volume of the audio playback device. The value ranges between 0 (lowest volume) and 255 (highest volume). @return - 0: Success. - < 0: Failure. */ virtual int setPlaybackDeviceVolume(int volume) = 0; /** Retrieves the volume of the audio playback device. @param volume Pointer to the audio playback device volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume). @return - 0: Success. - < 0: Failure. */ virtual int getPlaybackDeviceVolume(int *volume) = 0; /** Sets the volume of the microphone. @param volume Sets the volume of the microphone. The value ranges between 0 (lowest volume) and 255 (highest volume). @return - 0: Success. - < 0: Failure. */ virtual int setRecordingDeviceVolume(int volume) = 0; /** Retrieves the volume of the microphone. @param volume Pointer to the microphone volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume). @return - 0: Success. - < 0: Failure. */ virtual int getRecordingDeviceVolume(int *volume) = 0; /** Mutes the audio playback device. @param mute Sets whether to mute/unmute the audio playback device: - true: Mutes. - false: Unmutes. @return - 0: Success. - < 0: Failure. */ virtual int setPlaybackDeviceMute(bool mute) = 0; /** Retrieves the mute status of the audio playback device. @param mute Pointer to whether the audio playback device is muted/unmuted. - true: Muted. - false: Unmuted. @return - 0: Success. - < 0: Failure. */ virtual int getPlaybackDeviceMute(bool *mute) = 0; /** Mutes/Unmutes the microphone. @param mute Sets whether to mute/unmute the microphone: - true: Mutes. - false: Unmutes. @return - 0: Success. - < 0: Failure. */ virtual int setRecordingDeviceMute(bool mute) = 0; /** Retrieves the microphone's mute status. @param mute Pointer to whether the microphone is muted/unmuted. - true: Muted. - false: Unmuted. @return - 0: Success. - < 0: Failure. */ virtual int getRecordingDeviceMute(bool *mute) = 0; /** Starts the microphone test. This method tests whether the microphone works properly. Once the test starts, the SDK uses the \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback to notify the application with the volume information. @param indicationInterval Interval period (ms) of the \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback cycle. @return - 0: Success. - < 0: Failure. */ virtual int startRecordingDeviceTest(int indicationInterval) = 0; /** Stops the microphone test. This method stops the microphone test. You must call this method to stop the test after calling the \ref IAudioDeviceManager::startRecordingDeviceTest "startRecordingDeviceTest" method. @return - 0: Success. - < 0: Failure. */ virtual int stopRecordingDeviceTest() = 0; /** Retrieves the audio playback device associated with the device ID. @param deviceId Pointer to the ID of the audio playback device. @return - 0: Success. - < 0: Failure. */ virtual int getPlaybackDevice(char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; /** Retrieves the audio playback device information associated with the device ID and device name. @param deviceId Pointer to the device ID of the audio playback device. @param deviceName Pointer to the device name of the audio playback device. @return - 0: Success. - < 0: Failure. */ virtual int getPlaybackDeviceInfo(char deviceId[MAX_DEVICE_ID_LENGTH], char deviceName[MAX_DEVICE_ID_LENGTH]) = 0; /** Retrieves the audio recording device associated with the device ID. @param deviceId Pointer to the device ID of the audio recording device. @return - 0: Success. - < 0: Failure. */ virtual int getRecordingDevice(char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; /** Retrieves the audio recording device information associated with the device ID and device name. @param deviceId Pointer to the device ID of the recording audio device. @param deviceName Pointer to the device name of the recording audio device. @return - 0: Success. - < 0: Failure. */ virtual int getRecordingDeviceInfo(char deviceId[MAX_DEVICE_ID_LENGTH], char deviceName[MAX_DEVICE_ID_LENGTH]) = 0; /** Starts the audio device loopback test. This method tests whether the local audio devices are working properly. After calling this method, the microphone captures the local audio and plays it through the speaker. The \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback returns the local audio volume information at the set interval. @note This method tests the local audio devices and does not report the network conditions. @param indicationInterval The time interval (ms) at which the \ref IRtcEngineEventHandler::onAudioVolumeIndication "onAudioVolumeIndication" callback returns. @return - 0: Success. - < 0: Failure. */ virtual int startAudioDeviceLoopbackTest(int indicationInterval) = 0; /** Stops the audio device loopback test. @note Ensure that you call this method to stop the loopback test after calling the \ref IAudioDeviceManager::startAudioDeviceLoopbackTest "startAudioDeviceLoopbackTest" method. @return - 0: Success. - < 0: Failure. */ virtual int stopAudioDeviceLoopbackTest() = 0; /** Releases all IAudioDeviceManager resources. */ virtual void release() = 0; }; /** The configuration of the log files. * * @since v3.3.0 */ struct LogConfig { /** The absolute path of log files. * * The default file path is: * - Android: `/storage/emulated/0/Android/data/| OS version | Software | Software name | Whether support |
| win10 | Chrome | 76.0.3809.100 | No |
| Office Word | 18.1903.1152.0 | Yes | |
| Office Excel | No | ||
| Office PPT | No | ||
| WPS Word | 11.1.0.9145 | Yes | |
| WPS Excel | |||
| WPS PPT | |||
| Media Player (come with the system) | All | Yes | |
| win8 | Chrome | All | Yes |
| Office Word | All | Yes | |
| Office Excel | |||
| Office PPT | |||
| WPS Word | 11.1.0.9098 | Yes | |
| WPS Excel | |||
| WPS PPT | |||
| Media Player(come with the system) | All | Yes | |
| win7 | Chrome | 73.0.3683.103 | No |
| Office Word | All | Yes | |
| Office Excel | |||
| Office PPT | |||
| WPS Word | 11.1.0.9098 | No | |
| WPS Excel | |||
| WPS PPT | |||
| Media Player(come with the system) | All | No |