diff --git a/android/build.gradle b/android/build.gradle index cd3c74b3e..8689794f1 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -57,9 +57,9 @@ dependencies { if (isDev(project)) { implementation fileTree(dir: "libs", include: ["*.jar"]) } else { - api 'io.agora.rtc:iris-rtc:4.2.6-build.3' - api 'io.agora.rtc:full-sdk:4.2.6' - api 'io.agora.rtc:full-screen-sharing:4.2.6' + api 'io.agora.rtc:iris-rtc:4.3.0-dev.10' + api 'io.agora.rtc:agora-full-preview:4.3.0-dev.9' + api 'io.agora.rtc:full-screen-sharing-special:4.3.0-dev.9' } } diff --git a/android/src/main/cpp/third_party/include/agora_rtc/AgoraBase.h b/android/src/main/cpp/third_party/include/agora_rtc/AgoraBase.h index 81580b034..d1c62ebdd 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/AgoraBase.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/AgoraBase.h @@ -33,8 +33,10 @@ #if defined(AGORARTC_EXPORT) #define AGORA_API extern "C" __declspec(dllexport) +#define AGORA_CPP_API __declspec(dllexport) #else #define AGORA_API extern "C" __declspec(dllimport) +#define AGORA_CPP_API __declspec(dllimport) #endif // AGORARTC_EXPORT #define AGORA_CALL __cdecl @@ -46,11 +48,13 @@ #include #define AGORA_API extern "C" __attribute__((visibility("default"))) +#define AGORA_CPP_API __attribute__((visibility("default"))) #define AGORA_CALL #elif defined(__ANDROID__) || defined(__linux__) #define AGORA_API extern "C" __attribute__((visibility("default"))) +#define AGORA_CPP_API __attribute__((visibility("default"))) #define AGORA_CALL #define __deprecated @@ -58,6 +62,7 @@ #else // !_WIN32 && !__APPLE__ && !(__ANDROID__ || __linux__) #define AGORA_API extern "C" +#define AGORA_CPP_API #define AGORA_CALL #define __deprecated @@ -80,7 +85,7 @@ #endif #endif -#define INVALID_DISPLAY_ID 0xffff +#define INVALID_DISPLAY_ID (-2) namespace agora { namespace util { @@ -92,16 +97,16 @@ class AutoPtr { typedef T* pointer_type; public: - explicit AutoPtr(pointer_type p = NULL) : ptr_(p) {} + explicit AutoPtr(pointer_type p = OPTIONAL_NULLPTR) : ptr_(p) {} ~AutoPtr() { if (ptr_) { ptr_->release(); - ptr_ = NULL; + ptr_ = OPTIONAL_NULLPTR; } } - operator bool() const { return (ptr_ != NULL); } + operator bool() const { return (ptr_ != OPTIONAL_NULLPTR); } value_type& operator*() const { return *get(); } @@ -115,7 +120,7 @@ class AutoPtr { return ret; } - void reset(pointer_type ptr = NULL) { + void reset(pointer_type ptr = OPTIONAL_NULLPTR) { if (ptr != ptr_ && ptr_) { ptr_->release(); } @@ -125,12 +130,12 @@ class AutoPtr { template bool queryInterface(C1* c, C2 iid) { - pointer_type p = NULL; + pointer_type p = OPTIONAL_NULLPTR; if (c && !c->queryInterface(iid, reinterpret_cast(&p))) { reset(p); } - return (p != NULL); + return (p != OPTIONAL_NULLPTR); } private: @@ -153,7 +158,7 @@ class CopyableAutoPtr : public AutoPtr { return *this; } pointer_type clone() const { - if (!this->get()) return NULL; + if (!this->get()) return OPTIONAL_NULLPTR; return this->get()->clone(); } }; @@ -197,7 +202,7 @@ class AOutputIterator { typedef const value_type& const_reference; typedef value_type* pointer; typedef const value_type* const_pointer; - explicit AOutputIterator(IIterator* it = NULL) : p(it) {} + explicit AOutputIterator(IIterator* it = OPTIONAL_NULLPTR) : p(it) {} ~AOutputIterator() { if (p) p->release(); } @@ -215,7 +220,7 @@ class AOutputIterator { bool operator!=(const AOutputIterator& rhs) const { return !this->operator==(rhs); } reference operator*() { return *reinterpret_cast(p->current()); } const_reference operator*() const { return *reinterpret_cast(p->const_current()); } - bool valid() const { return p && p->current() != NULL; } + bool valid() const { return p && p->current() != OPTIONAL_NULLPTR; } }; template @@ -234,16 +239,16 @@ class AList { typedef const AOutputIterator const_iterator; public: - AList() : container(NULL), owner(false) {} + AList() : container(OPTIONAL_NULLPTR), owner(false) {} AList(IContainer* c, bool take_ownership) : container(c), owner(take_ownership) {} ~AList() { reset(); } - void reset(IContainer* c = NULL, bool take_ownership = false) { + void reset(IContainer* c = OPTIONAL_NULLPTR, bool take_ownership = false) { if (owner && container) container->release(); container = c; owner = take_ownership; } - iterator begin() { return container ? iterator(container->begin()) : iterator(NULL); } - iterator end() { return iterator(NULL); } + iterator begin() { return container ? iterator(container->begin()) : iterator(OPTIONAL_NULLPTR); } + iterator end() { return iterator(OPTIONAL_NULLPTR); } size_type size() const { return container ? container->size() : 0; } bool empty() const { return size() == 0; } }; @@ -731,10 +736,6 @@ enum ERROR_CODE_TYPE { * 1501: Video Device Module: The camera is not authorized. */ ERR_VDM_CAMERA_NOT_AUTHORIZED = 1501, - /** - * 2007: Audio Device Module: An error occurs in starting the application loopback. - */ - ERR_ADM_APPLICATION_LOOPBACK = 2007, }; enum LICENSE_ERROR_TYPE { @@ -857,9 +858,9 @@ enum INTERFACE_ID_TYPE { AGORA_IID_CLOUD_SPATIAL_AUDIO = 10, AGORA_IID_LOCAL_SPATIAL_AUDIO = 11, AGORA_IID_STATE_SYNC = 13, - AGORA_IID_METACHAT_SERVICE = 14, + AGORA_IID_META_SERVICE = 14, AGORA_IID_MUSIC_CONTENT_CENTER = 15, - AGORA_IID_H265_TRANSCODER = 16, + AGORA_IID_H265_TRANSCODER = 16, }; /** @@ -1267,7 +1268,7 @@ struct SenderOptions { SenderOptions() : ccMode(CC_ENABLED), - codecType(VIDEO_CODEC_H264), + codecType(VIDEO_CODEC_H265), targetBitrate(6500) {} }; @@ -1542,12 +1543,23 @@ struct VideoSubscriptionOptions { VideoSubscriptionOptions() {} }; + +/** The maximum length of the user account. + */ +enum MAX_USER_ACCOUNT_LENGTH_TYPE +{ + /** The maximum length of the user account is 256 bytes. + */ + MAX_USER_ACCOUNT_LENGTH = 256 +}; + /** * The definition of the EncodedVideoFrameInfo struct, which contains the information of the external encoded video frame. */ struct EncodedVideoFrameInfo { EncodedVideoFrameInfo() - : codecType(VIDEO_CODEC_H264), + : uid(0), + codecType(VIDEO_CODEC_H264), width(0), height(0), framesPerSecond(0), @@ -1556,11 +1568,11 @@ struct EncodedVideoFrameInfo { trackId(0), captureTimeMs(0), decodeTimeMs(0), - uid(0), streamType(VIDEO_STREAM_HIGH) {} EncodedVideoFrameInfo(const EncodedVideoFrameInfo& rhs) - : codecType(rhs.codecType), + : uid(rhs.uid), + codecType(rhs.codecType), width(rhs.width), height(rhs.height), framesPerSecond(rhs.framesPerSecond), @@ -1569,11 +1581,11 @@ struct EncodedVideoFrameInfo { trackId(rhs.trackId), captureTimeMs(rhs.captureTimeMs), decodeTimeMs(rhs.decodeTimeMs), - uid(rhs.uid), streamType(rhs.streamType) {} EncodedVideoFrameInfo& operator=(const EncodedVideoFrameInfo& rhs) { if (this == &rhs) return *this; + uid = rhs.uid; codecType = rhs.codecType; width = rhs.width; height = rhs.height; @@ -1583,12 +1595,16 @@ struct EncodedVideoFrameInfo { trackId = rhs.trackId; captureTimeMs = rhs.captureTimeMs; decodeTimeMs = rhs.decodeTimeMs; - uid = rhs.uid; streamType = rhs.streamType; return *this; } + + /** + * ID of the user that pushes the the external encoded video frame.. + */ + uid_t uid; /** - * The codec type of the local video stream. See #VIDEO_CODEC_TYPE. The default value is `VIDEO_CODEC_H264 (2)`. + * The codec type of the local video stream. See #VIDEO_CODEC_TYPE. The default value is `VIDEO_CODEC_H265 (3)`. */ VIDEO_CODEC_TYPE codecType; /** @@ -1626,16 +1642,13 @@ struct EncodedVideoFrameInfo { * The timestamp for decoding the video. */ int64_t decodeTimeMs; - /** - * ID of the user that pushes the the external encoded video frame.. - */ - uid_t uid; /** * The stream type of video frame. */ VIDEO_STREAM_TYPE streamType; }; + /** * Video compression preference. */ @@ -1750,6 +1763,8 @@ struct CodecCapInfo { int codecCapMask; /** The codec capability level, estimated based on the device hardware.*/ CodecCapLevels codecLevels; + + CodecCapInfo(): codecType(VIDEO_CODEC_NONE), codecCapMask(0) {} }; /** @@ -1863,7 +1878,7 @@ struct VideoEncoderConfiguration { AdvanceOptions advanceOptions; VideoEncoderConfiguration(const VideoDimensions& d, int f, int b, ORIENTATION_MODE m, VIDEO_MIRROR_MODE_TYPE mirror = VIDEO_MIRROR_MODE_DISABLED) - : codecType(VIDEO_CODEC_H264), + : codecType(VIDEO_CODEC_H265), dimensions(d), frameRate(f), bitrate(b), @@ -1873,7 +1888,7 @@ struct VideoEncoderConfiguration { mirrorMode(mirror), advanceOptions(PREFER_AUTO, PREFER_LOW_LATENCY) {} VideoEncoderConfiguration(int width, int height, int f, int b, ORIENTATION_MODE m, VIDEO_MIRROR_MODE_TYPE mirror = VIDEO_MIRROR_MODE_DISABLED) - : codecType(VIDEO_CODEC_H264), + : codecType(VIDEO_CODEC_H265), dimensions(width, height), frameRate(f), bitrate(b), @@ -1893,7 +1908,7 @@ struct VideoEncoderConfiguration { mirrorMode(config.mirrorMode), advanceOptions(config.advanceOptions) {} VideoEncoderConfiguration() - : codecType(VIDEO_CODEC_H264), + : codecType(VIDEO_CODEC_H265), dimensions(FRAME_WIDTH_960, FRAME_HEIGHT_540), frameRate(FRAME_RATE_FPS_15), bitrate(STANDARD_BITRATE), @@ -2583,6 +2598,29 @@ enum VIDEO_APPLICATION_SCENARIO_TYPE { APPLICATION_SCENARIO_MEETING = 1, }; +/** + * The video QoE preference type. + */ +enum VIDEO_QOE_PREFERENCE_TYPE { + /** + * 1: Default QoE type, balance the delay, picture quality and fluency. + */ + VIDEO_QOE_PREFERENCE_BALANCE = 1, + /** + * 2: lower the e2e delay. + */ + VIDEO_QOE_PREFERENCE_DELAY_FIRST = 2, + /** + * 3: picture quality. + */ + VIDEO_QOE_PREFERENCE_PICTURE_QUALITY_FIRST = 3, + /** + * 4: more fluency. + */ + VIDEO_QOE_PREFERENCE_FLUENCY_FIRST = 4, + +}; + /** * The brightness level of the video image captured by the local camera. */ @@ -2627,50 +2665,50 @@ enum LOCAL_AUDIO_STREAM_STATE { /** * Local audio state error codes. */ -enum LOCAL_AUDIO_STREAM_ERROR { +enum LOCAL_AUDIO_STREAM_REASON { /** * 0: The local audio is normal. */ - LOCAL_AUDIO_STREAM_ERROR_OK = 0, + LOCAL_AUDIO_STREAM_REASON_OK = 0, /** * 1: No specified reason for the local audio failure. Remind your users to try to rejoin the channel. */ - LOCAL_AUDIO_STREAM_ERROR_FAILURE = 1, + LOCAL_AUDIO_STREAM_REASON_FAILURE = 1, /** * 2: No permission to use the local audio device. Remind your users to grant permission. */ - LOCAL_AUDIO_STREAM_ERROR_DEVICE_NO_PERMISSION = 2, + LOCAL_AUDIO_STREAM_REASON_DEVICE_NO_PERMISSION = 2, /** * 3: (Android and iOS only) The local audio capture device is used. Remind your users to check * whether another application occupies the microphone. Local audio capture automatically resume * after the microphone is idle for about five seconds. You can also try to rejoin the channel * after the microphone is idle. */ - LOCAL_AUDIO_STREAM_ERROR_DEVICE_BUSY = 3, + LOCAL_AUDIO_STREAM_REASON_DEVICE_BUSY = 3, /** * 4: The local audio capture failed. */ - LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE = 4, + LOCAL_AUDIO_STREAM_REASON_RECORD_FAILURE = 4, /** * 5: The local audio encoding failed. */ - LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE = 5, + LOCAL_AUDIO_STREAM_REASON_ENCODE_FAILURE = 5, /** 6: The SDK cannot find the local audio recording device. */ - LOCAL_AUDIO_STREAM_ERROR_NO_RECORDING_DEVICE = 6, + LOCAL_AUDIO_STREAM_REASON_NO_RECORDING_DEVICE = 6, /** 7: The SDK cannot find the local audio playback device. */ - LOCAL_AUDIO_STREAM_ERROR_NO_PLAYOUT_DEVICE = 7, + LOCAL_AUDIO_STREAM_REASON_NO_PLAYOUT_DEVICE = 7, /** * 8: The local audio capturing is interrupted by the system call. */ - LOCAL_AUDIO_STREAM_ERROR_INTERRUPTED = 8, + LOCAL_AUDIO_STREAM_REASON_INTERRUPTED = 8, /** 9: An invalid audio capture device ID. */ - LOCAL_AUDIO_STREAM_ERROR_RECORD_INVALID_ID = 9, + LOCAL_AUDIO_STREAM_REASON_RECORD_INVALID_ID = 9, /** 10: An invalid audio playback device ID. */ - LOCAL_AUDIO_STREAM_ERROR_PLAYOUT_INVALID_ID = 10, + LOCAL_AUDIO_STREAM_REASON_PLAYOUT_INVALID_ID = 10, }; /** Local video state types. @@ -2698,73 +2736,73 @@ enum LOCAL_VIDEO_STREAM_STATE { /** * Local video state error codes. */ -enum LOCAL_VIDEO_STREAM_ERROR { +enum LOCAL_VIDEO_STREAM_REASON { /** * 0: The local video is normal. */ - LOCAL_VIDEO_STREAM_ERROR_OK = 0, + LOCAL_VIDEO_STREAM_REASON_OK = 0, /** * 1: No specified reason for the local video failure. */ - LOCAL_VIDEO_STREAM_ERROR_FAILURE = 1, + LOCAL_VIDEO_STREAM_REASON_FAILURE = 1, /** * 2: No permission to use the local video capturing device. Remind the user to grant permission * and rejoin the channel. */ - LOCAL_VIDEO_STREAM_ERROR_DEVICE_NO_PERMISSION = 2, + LOCAL_VIDEO_STREAM_REASON_DEVICE_NO_PERMISSION = 2, /** * 3: The local video capturing device is in use. Remind the user to check whether another * application occupies the camera. */ - LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY = 3, + LOCAL_VIDEO_STREAM_REASON_DEVICE_BUSY = 3, /** * 4: The local video capture fails. Remind the user to check whether the video capture device * is working properly or the camera is occupied by another application, and then to rejoin the * channel. */ - LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE = 4, + LOCAL_VIDEO_STREAM_REASON_CAPTURE_FAILURE = 4, /** * 5: The local video encoder is not supported. */ - LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE = 5, + LOCAL_VIDEO_STREAM_REASON_CODEC_NOT_SUPPORT = 5, /** * 6: (iOS only) The app is in the background. Remind the user that video capture cannot be * performed normally when the app is in the background. */ - LOCAL_VIDEO_STREAM_ERROR_CAPTURE_INBACKGROUND = 6, + LOCAL_VIDEO_STREAM_REASON_CAPTURE_INBACKGROUND = 6, /** * 7: (iOS only) The current application window is running in Slide Over, Split View, or Picture * in Picture mode, and another app is occupying the camera. Remind the user that the application * cannot capture video properly when the app is running in Slide Over, Split View, or Picture in * Picture mode and another app is occupying the camera. */ - LOCAL_VIDEO_STREAM_ERROR_CAPTURE_MULTIPLE_FOREGROUND_APPS = 7, + LOCAL_VIDEO_STREAM_REASON_CAPTURE_MULTIPLE_FOREGROUND_APPS = 7, /** * 8: Fails to find a local video capture device. Remind the user to check whether the camera is * connected to the device properly or the camera is working properly, and then to rejoin the * channel. */ - LOCAL_VIDEO_STREAM_ERROR_DEVICE_NOT_FOUND = 8, + LOCAL_VIDEO_STREAM_REASON_DEVICE_NOT_FOUND = 8, /** * 9: (macOS only) The video capture device currently in use is disconnected (such as being * unplugged). */ - LOCAL_VIDEO_STREAM_ERROR_DEVICE_DISCONNECTED = 9, + LOCAL_VIDEO_STREAM_REASON_DEVICE_DISCONNECTED = 9, /** * 10: (macOS and Windows only) The SDK cannot find the video device in the video device list. * Check whether the ID of the video device is valid. */ - LOCAL_VIDEO_STREAM_ERROR_DEVICE_INVALID_ID = 10, + LOCAL_VIDEO_STREAM_REASON_DEVICE_INVALID_ID = 10, /** * 101: The current video capture device is unavailable due to excessive system pressure. */ - LOCAL_VIDEO_STREAM_ERROR_DEVICE_SYSTEM_PRESSURE = 101, + LOCAL_VIDEO_STREAM_REASON_DEVICE_SYSTEM_PRESSURE = 101, /** * 11: (macOS only) The shared window is minimized when you call `startScreenCaptureByWindowId` * to share a window. The SDK cannot share a minimized window. You can cancel the minimization * of this window at the application layer, for example by maximizing this window. */ - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_MINIMIZED = 11, + LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_WINDOW_MINIMIZED = 11, /** * 12: (macOS and Windows only) 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. @@ -2779,31 +2817,38 @@ enum LOCAL_VIDEO_STREAM_ERROR { * 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_VIDEO_STREAM_REASON_SCREEN_CAPTURE_WINDOW_CLOSED = 12, /** 13: The local screen capture window is occluded. */ - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_OCCLUDED = 13, + LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_WINDOW_OCCLUDED = 13, /** 20: The local screen capture window is not supported. */ - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_NOT_SUPPORTED = 20, + LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_WINDOW_NOT_SUPPORTED = 20, /** 21: The screen capture fails. */ - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_FAILURE = 21, + LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_FAILURE = 21, /** 22: No permision to capture screen. */ - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_NO_PERMISSION = 22, - /** - * 23: The screen capture paused. + LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_NO_PERMISSION = 22, + /** + * 24: (Windows Only) An unexpected error (possibly due to window block failure) occurs during the screen + * sharing process, resulting in performance degradation. However, the screen sharing process itself is + * functioning normally. + */ + LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_AUTO_FALLBACK = 24, + /** 25: (Windows only) The local screen capture window is currently hidden and not visible on the desktop. */ + LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_WINDOW_HIDDEN = 25, + /** 26: (Windows only) The local screen capture window is recovered from its hidden state. */ + LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_HIDDEN = 26, + /** 27:(Windows only) The window is recovered from miniminzed */ + LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_MINIMIZED = 27, + /** + * 28: The screen capture paused. * * Common scenarios for reporting this error code: * - When the desktop switch to the secure desktop such as UAC dialog or the Winlogon desktop on * Windows platform, the SDK reports this error code. */ - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_PAUSED = 23, - /** 24: The screen capture is resumed. */ - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_RESUMED = 24, - /** 25: (Windows only) The local screen capture window is currently hidden and not visible on the desktop. */ - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_HIDDEN = 25, - /** 26: (Windows only) The local screen capture window is recovered from its hidden state. */ - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_HIDDEN = 26, - /** 27:(Windows only) The window is recovered from miniminzed */ - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_MINIMIZED = 27, + LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_PAUSED = 28, + /** 29: The screen capture is resumed. */ + LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_RESUMED = 29, + }; /** @@ -2991,7 +3036,6 @@ enum REMOTE_USER_STATE { * The remote user has enabled the local video capturing. */ USER_STATE_ENABLE_LOCAL_VIDEO = (1 << 8), - }; /** @@ -3001,7 +3045,7 @@ enum REMOTE_USER_STATE { struct VideoTrackInfo { VideoTrackInfo() : isLocal(false), ownerUid(0), trackId(0), channelId(OPTIONAL_NULLPTR) - , streamType(VIDEO_STREAM_HIGH), codecType(VIDEO_CODEC_H264) + , streamType(VIDEO_STREAM_HIGH), codecType(VIDEO_CODEC_H265) , encodedFrameOnly(false), sourceType(VIDEO_SOURCE_CAMERA_PRIMARY) , observationPosition(agora::media::base::POSITION_POST_CAPTURER) {} /** @@ -3014,7 +3058,6 @@ struct VideoTrackInfo { * ID of the user who publishes the video track. */ uid_t ownerUid; - /** * ID of the video track. */ @@ -3145,7 +3188,7 @@ class IPacketObserver { */ unsigned int size; - Packet() : buffer(NULL), size(0) {} + Packet() : buffer(OPTIONAL_NULLPTR), size(0) {} }; /** * Occurs when the SDK is ready to send the audio packet. @@ -3278,6 +3321,18 @@ struct LocalAudioStats * The audio delay of the device, contains record and playout delay */ int audioDeviceDelay; + /** + * The playout delay of the device + */ + int audioPlayoutDelay; + /** + * The signal delay estimated from audio in-ear monitoring (ms). + */ + int earMonitorDelay; + /** + * The signal delay estimated during the AEC process from nearin and farin (ms). + */ + int aecEstimatedDelay; }; @@ -3316,74 +3371,74 @@ enum RTMP_STREAM_PUBLISH_STATE { /** * Error codes of the RTMP or RTMPS streaming. */ -enum RTMP_STREAM_PUBLISH_ERROR_TYPE { +enum RTMP_STREAM_PUBLISH_REASON { /** * 0: The RTMP or RTMPS streaming publishes successfully. */ - RTMP_STREAM_PUBLISH_ERROR_OK = 0, + RTMP_STREAM_PUBLISH_REASON_OK = 0, /** * 1: Invalid argument used. If, for example, you do not call the `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, + RTMP_STREAM_PUBLISH_REASON_INVALID_ARGUMENT = 1, /** * 2: The RTMP or RTMPS streaming is encrypted and cannot be published. */ - RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED = 2, + RTMP_STREAM_PUBLISH_REASON_ENCRYPTED_STREAM_NOT_ALLOWED = 2, /** * 3: Timeout for the RTMP or RTMPS streaming. Call the `addPublishStreamUrl` method to publish the streaming again. */ - RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT = 3, + RTMP_STREAM_PUBLISH_REASON_CONNECTION_TIMEOUT = 3, /** * 4: An error occurs in Agora's streaming server. Call the `addPublishStreamUrl` method to publish the streaming again. */ - RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR = 4, + RTMP_STREAM_PUBLISH_REASON_INTERNAL_SERVER_ERROR = 4, /** * 5: An error occurs in the CDN server. */ - RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR = 5, + RTMP_STREAM_PUBLISH_REASON_RTMP_SERVER_ERROR = 5, /** * 6: The RTMP or RTMPS streaming publishes too frequently. */ - RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN = 6, + RTMP_STREAM_PUBLISH_REASON_TOO_OFTEN = 6, /** * 7: The host publishes more than 10 URLs. Delete the unnecessary URLs before adding new ones. */ - RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT = 7, + RTMP_STREAM_PUBLISH_REASON_REACH_LIMIT = 7, /** * 8: The host manipulates other hosts' URLs. Check your app logic. */ - RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED = 8, + RTMP_STREAM_PUBLISH_REASON_NOT_AUTHORIZED = 8, /** * 9: Agora's server fails to find the RTMP or RTMPS streaming. */ - RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND = 9, + RTMP_STREAM_PUBLISH_REASON_STREAM_NOT_FOUND = 9, /** * 10: The format of the RTMP or RTMPS streaming URL is not supported. Check whether the URL format is correct. */ - RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED = 10, + RTMP_STREAM_PUBLISH_REASON_FORMAT_NOT_SUPPORTED = 10, /** * 11: The user role is not host, so the user cannot use the CDN live streaming function. Check your application code logic. */ - RTMP_STREAM_PUBLISH_ERROR_NOT_BROADCASTER = 11, // Note: match to ERR_PUBLISH_STREAM_NOT_BROADCASTER in AgoraBase.h + RTMP_STREAM_PUBLISH_REASON_NOT_BROADCASTER = 11, // Note: match to ERR_PUBLISH_STREAM_NOT_BROADCASTER in AgoraBase.h /** * 13: The `updateRtmpTranscoding` or `setLiveTranscoding` method is called to update the transcoding configuration in a scenario where there is streaming without transcoding. Check your application code logic. */ - RTMP_STREAM_PUBLISH_ERROR_TRANSCODING_NO_MIX_STREAM = 13, // Note: match to ERR_PUBLISH_STREAM_TRANSCODING_NO_MIX_STREAM in AgoraBase.h + RTMP_STREAM_PUBLISH_REASON_TRANSCODING_NO_MIX_STREAM = 13, // Note: match to ERR_PUBLISH_STREAM_TRANSCODING_NO_MIX_STREAM in AgoraBase.h /** * 14: Errors occurred in the host's network. */ - RTMP_STREAM_PUBLISH_ERROR_NET_DOWN = 14, // Note: match to ERR_NET_DOWN in AgoraBase.h + RTMP_STREAM_PUBLISH_REASON_NET_DOWN = 14, // Note: match to ERR_NET_DOWN in AgoraBase.h /** * 15: Your App ID does not have permission to use the CDN live streaming function. */ - RTMP_STREAM_PUBLISH_ERROR_INVALID_APPID = 15, // Note: match to ERR_PUBLISH_STREAM_APPID_INVALID in AgoraBase.h + RTMP_STREAM_PUBLISH_REASON_INVALID_APPID = 15, // Note: match to ERR_PUBLISH_STREAM_APPID_INVALID in AgoraBase.h /** invalid privilege. */ - RTMP_STREAM_PUBLISH_ERROR_INVALID_PRIVILEGE = 16, + RTMP_STREAM_PUBLISH_REASON_INVALID_PRIVILEGE = 16, /** * 100: The streaming has been stopped normally. After you call `removePublishStreamUrl` to stop streaming, the SDK returns this value. */ - RTMP_STREAM_UNPUBLISH_ERROR_OK = 100, + RTMP_STREAM_UNPUBLISH_REASON_OK = 100, }; /** Events during the RTMP or RTMPS streaming. */ @@ -3445,7 +3500,7 @@ typedef struct RtcImage { */ double alpha; - RtcImage() : url(NULL), x(0), y(0), width(0), height(0), zOrder(0), alpha(1.0) {} + RtcImage() : url(OPTIONAL_NULLPTR), x(0), y(0), width(0), height(0), zOrder(0), alpha(1.0) {} } RtcImage; /** * The configuration for advanced features of the RTMP or RTMPS streaming with transcoding. @@ -3453,7 +3508,7 @@ typedef struct RtcImage { * If you want to enable the advanced features of streaming with transcoding, contact support@agora.io. */ struct LiveStreamAdvancedFeature { - LiveStreamAdvancedFeature() : featureName(NULL), opened(false) {} + LiveStreamAdvancedFeature() : featureName(OPTIONAL_NULLPTR), opened(false) {} LiveStreamAdvancedFeature(const char* feat_name, bool open) : featureName(feat_name), opened(open) {} /** The advanced feature for high-quality video with a lower bitrate. */ // static const char* LBHQ = "lbhq"; @@ -3573,6 +3628,7 @@ struct TranscodingUser { * @note If the value is not `0`, a special player is required. */ int audioChannel; + TranscodingUser() : uid(0), x(0), @@ -3692,7 +3748,31 @@ struct LiveTranscoding { /** 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), watermarkCount(0), backgroundImage(NULL), backgroundImageCount(0), audioSampleRate(AUDIO_SAMPLE_RATE_48000), audioBitrate(48), audioChannels(1), audioCodecProfile(AUDIO_CODEC_PROFILE_LC_AAC), advancedFeatures(NULL), advancedFeatureCount(0) {} + + 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(OPTIONAL_NULLPTR), + transcodingExtraInfo(OPTIONAL_NULLPTR), + metadata(OPTIONAL_NULLPTR), + watermark(OPTIONAL_NULLPTR), + watermarkCount(0), + backgroundImage(OPTIONAL_NULLPTR), + backgroundImageCount(0), + audioSampleRate(AUDIO_SAMPLE_RATE_48000), + audioBitrate(48), + audioChannels(1), + audioCodecProfile(AUDIO_CODEC_PROFILE_LC_AAC), + advancedFeatures(OPTIONAL_NULLPTR), + advancedFeatureCount(0) {} }; /** @@ -3754,7 +3834,7 @@ struct TranscodingVideoStream { TranscodingVideoStream() : sourceType(VIDEO_SOURCE_CAMERA_PRIMARY), remoteUserUid(0), - imageUrl(NULL), + imageUrl(OPTIONAL_NULLPTR), x(0), y(0), width(0), @@ -3764,7 +3844,6 @@ struct TranscodingVideoStream { mirror(false) {} }; - /** * The configuration of the video mixing on the local client. */ @@ -3788,11 +3867,7 @@ struct LocalTranscoderConfiguration { */ bool syncWithPrimaryCamera; - LocalTranscoderConfiguration() - : streamCount(0), - videoInputStreams(NULL), - videoOutputConfiguration(), - syncWithPrimaryCamera(true) {} + LocalTranscoderConfiguration() : streamCount(0), videoInputStreams(OPTIONAL_NULLPTR), videoOutputConfiguration(), syncWithPrimaryCamera(true) {} }; enum VIDEO_TRANSCODER_ERROR { @@ -4014,10 +4089,18 @@ enum CONNECTION_CHANGED_REASON_TYPE * 21: The connection is failed due to license validation failure. */ CONNECTION_CHANGED_LICENSE_VALIDATION_FAILURE = 21, - /** + /* * 22: The connection is failed due to certification verify failure. */ CONNECTION_CHANGED_CERTIFICATION_VERYFY_FAILURE = 22, + /** + * 23: The connection is failed due to the lack of granting permission to the stream channel. + */ + CONNECTION_CHANGED_STREAM_CHANNEL_NOT_AVAILABLE = 23, + /** + * 24: The connection is failed due to join channel with an inconsistent appid. + */ + CONNECTION_CHANGED_INCONSISTENT_APPID = 24, }; /** @@ -4156,14 +4239,19 @@ enum VIDEO_VIEW_SETUP_MODE { * Attributes of video canvas object. */ struct VideoCanvas { - /** - * Video display window. - */ - view_t view; /** * The user id of local video. */ uid_t uid; + + /** + * The uid of video stream composing the video stream from transcoder which will be drawn on this video canvas. + */ + uid_t subviewUid; + /** + * Video display window. + */ + view_t view; /** * A RGBA value indicates background color of the render view. Defaults to 0x00000000. */ @@ -4205,28 +4293,37 @@ struct VideoCanvas { * The default value is empty(that is, if it has zero width or height), which means no cropping. */ Rectangle cropArea; - /** - * Whether to apply alpha mask to the video frame if exsit: - * true: Apply alpha mask to video frame. - * false: (Default) Do not apply alpha mask to video frame. - */ + * Whether to apply alpha mask to the video frame if exsit: + * true: Apply alpha mask to video frame. + * false: (Default) Do not apply alpha mask to video frame. + */ bool enableAlphaMask; - + /** + * The video frame position in pipeline. See \ref VIDEO_MODULE_POSITION "VIDEO_MODULE_POSITION". + * The default value is POSITION_POST_CAPTURER. + */ + media::base::VIDEO_MODULE_POSITION position; + VideoCanvas() - : view(NULL), uid(0), backgroundColor(0x00000000), renderMode(media::base::RENDER_MODE_HIDDEN), mirrorMode(VIDEO_MIRROR_MODE_AUTO), + : uid(0), subviewUid(0), view(NULL), backgroundColor(0x00000000), renderMode(media::base::RENDER_MODE_HIDDEN), mirrorMode(VIDEO_MIRROR_MODE_AUTO), setupMode(VIDEO_VIEW_SETUP_REPLACE), sourceType(VIDEO_SOURCE_CAMERA_PRIMARY), mediaPlayerId(-ERR_NOT_READY), - cropArea(0, 0, 0, 0), enableAlphaMask(false) {} + cropArea(0, 0, 0, 0), enableAlphaMask(false), position(media::base::POSITION_POST_CAPTURER) {} + + VideoCanvas(view_t v, media::base::RENDER_MODE_TYPE m, VIDEO_MIRROR_MODE_TYPE mt) + : uid(0), subviewUid(0), view(v), backgroundColor(0x00000000), renderMode(m), mirrorMode(mt), setupMode(VIDEO_VIEW_SETUP_REPLACE), + sourceType(VIDEO_SOURCE_CAMERA_PRIMARY), mediaPlayerId(-ERR_NOT_READY), + cropArea(0, 0, 0, 0), enableAlphaMask(false), position(media::base::POSITION_POST_CAPTURER) {} VideoCanvas(view_t v, media::base::RENDER_MODE_TYPE m, VIDEO_MIRROR_MODE_TYPE mt, uid_t u) - : view(v), uid(u), backgroundColor(0x00000000), renderMode(m), mirrorMode(mt), setupMode(VIDEO_VIEW_SETUP_REPLACE), + : uid(u), subviewUid(0), view(v), backgroundColor(0x00000000), renderMode(m), mirrorMode(mt), setupMode(VIDEO_VIEW_SETUP_REPLACE), sourceType(VIDEO_SOURCE_CAMERA_PRIMARY), mediaPlayerId(-ERR_NOT_READY), - cropArea(0, 0, 0, 0), enableAlphaMask(false) {} + cropArea(0, 0, 0, 0), enableAlphaMask(false), position(media::base::POSITION_POST_CAPTURER) {} - VideoCanvas(view_t v, media::base::RENDER_MODE_TYPE m, VIDEO_MIRROR_MODE_TYPE mt, user_id_t) - : view(v), uid(0), backgroundColor(0x00000000), renderMode(m), mirrorMode(mt), setupMode(VIDEO_VIEW_SETUP_REPLACE), + VideoCanvas(view_t v, media::base::RENDER_MODE_TYPE m, VIDEO_MIRROR_MODE_TYPE mt, uid_t u, uid_t subu) + : uid(u), subviewUid(subu), view(v), backgroundColor(0x00000000), renderMode(m), mirrorMode(mt), setupMode(VIDEO_VIEW_SETUP_REPLACE), sourceType(VIDEO_SOURCE_CAMERA_PRIMARY), mediaPlayerId(-ERR_NOT_READY), - cropArea(0, 0, 0, 0), enableAlphaMask(false) {} + cropArea(0, 0, 0, 0), enableAlphaMask(false), position(media::base::POSITION_POST_CAPTURER) {} }; /** Image enhancement options. @@ -4438,7 +4535,7 @@ struct VirtualBackgroundSource { */ BACKGROUND_BLUR_DEGREE blur_degree; - VirtualBackgroundSource() : background_source_type(BACKGROUND_COLOR), color(0xffffff), source(NULL), blur_degree(BLUR_DEGREE_HIGH) {} + VirtualBackgroundSource() : background_source_type(BACKGROUND_COLOR), color(0xffffff), source(OPTIONAL_NULLPTR), blur_degree(BLUR_DEGREE_HIGH) {} }; struct SegmentationProperty { @@ -4836,22 +4933,22 @@ struct ScreenCaptureParameters { */ int excludeWindowCount; - /** The width (px) of the border. Defaults to 0, and the value range is [0,50]. - * - */ - int highLightWidth; - /** The color of the border in RGBA format. The default value is 0xFF8CBF26. - * - */ - unsigned int highLightColor; - /** Whether to place a border around the shared window or screen: - * - true: Place a border. - * - false: (Default) Do not place a border. - * - * @note When you share a part of a window or screen, the SDK places a border around the entire window or screen if you set `enableHighLight` as true. - * - */ - bool enableHighLight; + /** The width (px) of the border. Defaults to 0, and the value range is [0,50]. + * + */ + int highLightWidth; + /** The color of the border in RGBA format. The default value is 0xFF8CBF26. + * + */ + unsigned int highLightColor; + /** Whether to place a border around the shared window or screen: + * - true: Place a border. + * - false: (Default) Do not place a border. + * + * @note When you share a part of a window or screen, the SDK places a border around the entire window or screen if you set `enableHighLight` as true. + * + */ + bool enableHighLight; ScreenCaptureParameters() : dimensions(1920, 1080), frameRate(5), bitrate(STANDARD_BITRATE), captureMouseCursor(true), windowFocus(false), excludeWindowList(OPTIONAL_NULLPTR), excludeWindowCount(0), highLightWidth(0), highLightColor(0), enableHighLight(false) {} @@ -4968,7 +5065,7 @@ struct AudioRecordingConfiguration { int recordingChannel; AudioRecordingConfiguration() - : filePath(NULL), + : filePath(OPTIONAL_NULLPTR), encode(false), sampleRate(32000), fileRecordingType(AUDIO_FILE_RECORDING_MIXED), @@ -5172,59 +5269,6 @@ enum CHANNEL_MEDIA_RELAY_ERROR { RELAY_ERROR_DEST_TOKEN_EXPIRED = 11, }; -/** - * The event code of channel media relay. - */ -enum CHANNEL_MEDIA_RELAY_EVENT { - /** 0: The user disconnects from the server due to poor network connections. - */ - RELAY_EVENT_NETWORK_DISCONNECTED = 0, - /** 1: The user is connected to the server. - */ - 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, - /** 12: The SDK successfully pauses relaying the media stream to destination channels. - */ - RELAY_EVENT_PAUSE_SEND_PACKET_TO_DEST_CHANNEL_SUCCESS = 12, - /** 13: The SDK fails to pause relaying the media stream to destination channels. - */ - RELAY_EVENT_PAUSE_SEND_PACKET_TO_DEST_CHANNEL_FAILED = 13, - /** 14: The SDK successfully resumes relaying the media stream to destination channels. - */ - RELAY_EVENT_RESUME_SEND_PACKET_TO_DEST_CHANNEL_SUCCESS = 14, - /** 15: The SDK fails to resume relaying the media stream to destination channels. - */ - RELAY_EVENT_RESUME_SEND_PACKET_TO_DEST_CHANNEL_FAILED = 15, -}; /** * The state code of the channel media relay. */ @@ -5247,17 +5291,20 @@ enum CHANNEL_MEDIA_RELAY_STATE { /** The definition of ChannelMediaInfo. */ struct ChannelMediaInfo { - /** The channel name. The default value is NULL, which means that the SDK - * applies the current channel name. + /** The user ID. */ + uid_t uid; + /** The channel name. The default value is NULL, which means that the SDK + * applies the current channel name. + */ const char* channelName; - /** The token that enables the user to join the channel. The default value - * is NULL, which means that the SDK applies the current token. - */ + /** The token that enables the user to join the channel. The default value + * is NULL, which means that the SDK applies the current token. + */ const char* token; - /** The user ID. - */ - uid_t uid; + + ChannelMediaInfo() : uid(0), channelName(NULL), token(NULL) {} + ChannelMediaInfo(const char* c, const char* t, uid_t u) : uid(u), channelName(c), token(t) {} }; /** The definition of ChannelMediaRelayConfiguration. @@ -5275,7 +5322,7 @@ struct ChannelMediaRelayConfiguration { * - 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; + ChannelMediaInfo* srcInfo; /** The information of the destination channel `ChannelMediaInfo`. It contains the following members: * - `channelName`: The name of the destination channel. * - `uid`: The unique ID to identify the relay stream in the destination channel. The value @@ -5290,18 +5337,14 @@ struct ChannelMediaRelayConfiguration { * If you have enabled the App Certificate, you must use the token generated with the `channelName` * and `uid`. */ - ChannelMediaInfo *destInfos; + ChannelMediaInfo* destInfos; /** The number of destination channels. The default value is 0, and the value range is from 0 to * 6. Ensure that the value of this parameter corresponds to the number of `ChannelMediaInfo` * structs you define in `destInfo`. */ int destCount; - ChannelMediaRelayConfiguration() - : srcInfo(NULL), - destInfos(NULL), - destCount(0) - {} + ChannelMediaRelayConfiguration() : srcInfo(OPTIONAL_NULLPTR), destInfos(OPTIONAL_NULLPTR), destCount(0) {} }; /** @@ -5320,15 +5363,12 @@ struct UplinkNetworkInfo { } }; -/** - * The collections of downlink network info. - */ struct DownlinkNetworkInfo { struct PeerDownlinkInfo { /** * The ID of the user who owns the remote video stream. */ - const char* uid; + const char* userId; /** * The remote video stream type: #VIDEO_STREAM_TYPE. */ @@ -5343,28 +5383,41 @@ struct DownlinkNetworkInfo { int expected_bitrate_bps; PeerDownlinkInfo() - : uid(OPTIONAL_NULLPTR), + : userId(OPTIONAL_NULLPTR), stream_type(VIDEO_STREAM_HIGH), current_downscale_level(REMOTE_VIDEO_DOWNSCALE_LEVEL_NONE), expected_bitrate_bps(-1) {} + PeerDownlinkInfo(const PeerDownlinkInfo& rhs) + : stream_type(rhs.stream_type), + current_downscale_level(rhs.current_downscale_level), + expected_bitrate_bps(rhs.expected_bitrate_bps) { + if (rhs.userId != OPTIONAL_NULLPTR) { + const int len = std::strlen(rhs.userId); + char* buf = new char[len + 1]; + std::memcpy(buf, rhs.userId, len); + buf[len] = '\0'; + userId = buf; + } + } + PeerDownlinkInfo& operator=(const PeerDownlinkInfo& rhs) { if (this == &rhs) return *this; - uid = OPTIONAL_NULLPTR; + userId = OPTIONAL_NULLPTR; stream_type = rhs.stream_type; current_downscale_level = rhs.current_downscale_level; expected_bitrate_bps = rhs.expected_bitrate_bps; - if (rhs.uid != OPTIONAL_NULLPTR) { - char* temp = new char[strlen(rhs.uid) + 1]; - strcpy(temp, rhs.uid); - uid = temp; + if (rhs.userId != OPTIONAL_NULLPTR) { + const int len = std::strlen(rhs.userId); + char* buf = new char[len + 1]; + std::memcpy(buf, rhs.userId, len); + buf[len] = '\0'; + userId = buf; } return *this; } - ~PeerDownlinkInfo() { - if (uid) { delete [] uid; } - } + ~PeerDownlinkInfo() { delete[] userId; } }; /** @@ -5422,9 +5475,7 @@ struct DownlinkNetworkInfo { return *this; } - ~DownlinkNetworkInfo() { - if (peer_downlink_info) delete [] peer_downlink_info; - } + ~DownlinkNetworkInfo() { delete[] peer_downlink_info; } }; /** @@ -5487,7 +5538,7 @@ struct EncryptionConfig { EncryptionConfig() : encryptionMode(AES_128_GCM2), - encryptionKey(NULL) + encryptionKey(OPTIONAL_NULLPTR) { memset(encryptionKdfSalt, 0, sizeof(encryptionKdfSalt)); } @@ -5558,15 +5609,6 @@ enum PERMISSION_TYPE { SCREEN_CAPTURE = 2, }; -/** The maximum length of the user account. - */ -enum MAX_USER_ACCOUNT_LENGTH_TYPE -{ - /** The maximum length of the user account is 256 bytes. - */ - MAX_USER_ACCOUNT_LENGTH = 256 -}; - /** * The subscribing state. */ @@ -5654,8 +5696,8 @@ struct UserInfo { * The user account. The maximum data length is `MAX_USER_ACCOUNT_LENGTH_TYPE`. */ char userAccount[MAX_USER_ACCOUNT_LENGTH]; - UserInfo() - : uid(0) { + + UserInfo() : uid(0) { userAccount[0] = '\0'; } }; @@ -5896,22 +5938,6 @@ enum CONFIG_FETCH_TYPE { }; -/** - * media recorder source stream information - */ -struct RecorderStreamInfo { - /** - * The channel ID of the video track. - */ - const char* channelId; - /** - * The user ID. - */ - uid_t uid; - RecorderStreamInfo() : channelId(NULL), uid(0) {} -}; - - /** The local proxy mode type. */ enum LOCAL_PROXY_MODE { /** 0: Connect local proxy with high priority, if not connected to local proxy, fallback to sdrtn. @@ -5975,7 +6001,21 @@ struct LocalAccessPointConfiguration { LocalAccessPointConfiguration() : ipList(NULL), ipListSize(0), domainList(NULL), domainListSize(0), verifyDomainName(NULL), mode(ConnectivityFirst) {} }; - +/** + * The information about recorded media streams. + */ +struct RecorderStreamInfo { + const char* channelId; + /** + * The user ID. + */ + uid_t uid; + /** + * The channel ID of the audio/video stream needs to be recorded. + */ + RecorderStreamInfo() : channelId(NULL), uid(0) {} + RecorderStreamInfo(const char* channelId, uid_t uid) : channelId(channelId), uid(uid) {} +}; } // namespace rtc namespace base { @@ -5994,9 +6034,9 @@ class AParameter : public agora::util::AutoPtr { private: bool initialize(IEngineBase* engine) { - IAgoraParameter* p = NULL; + IAgoraParameter* p = OPTIONAL_NULLPTR; if (engine && !engine->queryInterface(rtc::AGORA_IID_PARAMETER_ENGINE, (void**)&p)) reset(p); - return p != NULL; + return p != OPTIONAL_NULLPTR; } }; @@ -6048,7 +6088,47 @@ struct SpatialAudioParams { */ Optional enable_doppler; }; +/** + * Layout info of video stream which compose a transcoder video stream. +*/ +struct VideoLayout +{ + /** + * Channel Id from which this video stream come from. + */ + const char* channelId; + /** + * User id of video stream. + */ + rtc::uid_t uid; + /** + * User account of video stream. + */ + user_id_t strUid; + /** + * x coordinate of video stream on a transcoded video stream canvas. + */ + uint32_t x; + /** + * y coordinate of video stream on a transcoded video stream canvas. + */ + uint32_t y; + /** + * width of video stream on a transcoded video stream canvas. + */ + uint32_t width; + /** + * height of video stream on a transcoded video stream canvas. + */ + uint32_t height; + /** + * video state of video stream on a transcoded video stream canvas. + * 0 for normal video , 1 for placeholder image showed , 2 for black image. + */ + uint32_t videoState; + VideoLayout() : channelId(OPTIONAL_NULLPTR), uid(0), strUid(OPTIONAL_NULLPTR), x(0), y(0), width(0), height(0), videoState(0) {} +}; } // namespace agora /** diff --git a/android/src/main/cpp/third_party/include/agora_rtc/AgoraMediaBase.h b/android/src/main/cpp/third_party/include/agora_rtc/AgoraMediaBase.h index bd0a7b881..15dfd4b38 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/AgoraMediaBase.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/AgoraMediaBase.h @@ -1,4 +1,3 @@ -// // Agora Engine SDK // // Created by Sting Feng in 2017-11. @@ -35,10 +34,8 @@ static const unsigned int INVALID_TRACK_ID = 0xffffffff; static const unsigned int DEFAULT_CONNECTION_ID = 0; static const unsigned int DUMMY_CONNECTION_ID = (std::numeric_limits::max)(); - struct EncodedVideoFrameInfo; - /** * Video source types definition. **/ @@ -105,45 +102,49 @@ enum AudioRoute */ ROUTE_DEFAULT = -1, /** - * The headset. + * The Headset. */ ROUTE_HEADSET = 0, /** - * The earpiece. + * The Earpiece. */ ROUTE_EARPIECE = 1, /** - * The headset with no microphone. + * The Headset with no microphone. */ ROUTE_HEADSETNOMIC = 2, /** - * The speakerphone. + * The Speakerphone. */ ROUTE_SPEAKERPHONE = 3, /** - * The loudspeaker. + * The Loudspeaker. */ ROUTE_LOUDSPEAKER = 4, /** - * The Bluetooth headset. + * The Bluetooth Headset via HFP. */ ROUTE_HEADSETBLUETOOTH = 5, /** - * The USB + * The USB. */ ROUTE_USB = 6, /** - * The HDMI + * The HDMI. */ ROUTE_HDMI = 7, /** - * The DISPLAYPORT + * The DisplayPort. */ ROUTE_DISPLAYPORT = 8, /** - * The AIRPLAY + * The AirPlay. */ ROUTE_AIRPLAY = 9, + /** + * The Bluetooth Speaker via A2DP. + */ + ROUTE_BLUETOOTH_SPEAKER = 10, }; /** @@ -551,6 +552,19 @@ enum CAMERA_VIDEO_SOURCE_TYPE { VIDEO_SOURCE_UNSPECIFIED = 2, }; +/** + * The IVideoFrameMetaInfo class. + * This interface provides access to metadata information. + */ +class IVideoFrameMetaInfo { + public: + enum META_INFO_KEY { + KEY_FACE_CAPTURE = 0, + }; + virtual ~IVideoFrameMetaInfo() {}; + virtual const char* getMetaInfoStr(META_INFO_KEY key) const = 0; +}; + /** * The definition of the ExternalVideoFrame struct. */ @@ -698,12 +712,12 @@ struct ExternalVideoFrame { uint8_t* alphaBuffer; /** - * [Windows Texture related parameter] The pointer of ID3D11Texture2D used by the video frame. + * [For Windows only] The pointer of ID3D11Texture2D used by the video frame. */ void *d3d11_texture_2d; /** - * [Windows Texture related parameter] The index of ID3D11Texture2D array used by the video frame. + * [For Windows only] The index of ID3D11Texture2D array used by the video frame. */ int texture_slice_index; }; @@ -731,7 +745,8 @@ struct VideoFrame { textureId(0), d3d11Texture2d(NULL), alphaBuffer(NULL), - pixelBuffer(NULL){ + pixelBuffer(NULL), + metaInfo(NULL){ memset(matrix, 0, sizeof(matrix)); } /** @@ -821,6 +836,10 @@ struct VideoFrame { *The type of CVPixelBufferRef, for iOS and macOS only. */ void* pixelBuffer; + /** + * The pointer to IVideoFrameMetaInfo, which is the interface to get metainfo contents from VideoFrame. + */ + IVideoFrameMetaInfo* metaInfo; }; /** @@ -865,6 +884,7 @@ enum VIDEO_MODULE_POSITION { POSITION_POST_CAPTURER = 1 << 0, POSITION_PRE_RENDERER = 1 << 1, POSITION_PRE_ENCODER = 1 << 2, + POSITION_POST_CAPTURER_ORIGIN = 1 << 3, }; } // namespace base @@ -942,10 +962,6 @@ class IAudioFrameObserverBase { * are used. */ int64_t renderTimeMs; - /** - * A reserved parameter. - */ - int avsync_type; /** * A reserved parameter. * @@ -953,7 +969,18 @@ class IAudioFrameObserverBase { * this will then filled into audio4 extension part, the remote side could use this pts in av * sync process with video frame. */ + int avsync_type; + /** + * The pts timestamp of this audio frame. + * + * This timestamp is used to indicate the origin pts time of the frame, and sync with video frame by + * the pts time stamp + */ int64_t presentationMs; + /** + * The number of the audio track. + */ + int audioTrackNumber; AudioFrame() : type(FRAME_TYPE_PCM16), samplesPerChannel(0), @@ -963,7 +990,8 @@ class IAudioFrameObserverBase { buffer(NULL), renderTimeMs(0), avsync_type(0), - presentationMs(0) {} + presentationMs(0), + audioTrackNumber(0) {} }; enum AUDIO_FRAME_POSITION { @@ -1180,9 +1208,9 @@ struct UserAudioSpectrumInfo { */ struct AudioSpectrumData spectrumData; - UserAudioSpectrumInfo () : uid(0), spectrumData() {} - UserAudioSpectrumInfo(agora::rtc::uid_t _uid, const float *data, int length) : - uid(_uid) { spectrumData.audioSpectrumData = data; spectrumData.dataLength = length; } + UserAudioSpectrumInfo() : uid(0) {} + + UserAudioSpectrumInfo(agora::rtc::uid_t uid, const float* data, int length) : uid(uid), spectrumData(data, length) {} }; /** @@ -1205,7 +1233,6 @@ class IAudioSpectrumObserver { * - false: Not processed. */ virtual bool onLocalAudioSpectrum(const AudioSpectrumData& data) = 0; - /** * Reports the audio spectrum of remote user. * @@ -1223,7 +1250,7 @@ class IAudioSpectrumObserver { * - true: Processed. * - false: Not processed. */ - virtual bool onRemoteAudioSpectrum(const UserAudioSpectrumInfo * spectrums, unsigned int spectrumNumber) = 0; + virtual bool onRemoteAudioSpectrum(const UserAudioSpectrumInfo* spectrums, unsigned int spectrumNumber) = 0; }; /** @@ -1505,7 +1532,7 @@ enum MediaRecorderStreamType { */ enum RecorderState { /** - * -1: An error occurs during the recording. See RecorderErrorCode for the reason. + * -1: An error occurs during the recording. See RecorderReasonCode for the reason. */ RECORDER_STATE_ERROR = -1, /** @@ -1522,27 +1549,27 @@ enum RecorderState { * * @since v3.5.2 */ -enum RecorderErrorCode { +enum RecorderReasonCode { /** * 0: No error occurs. */ - RECORDER_ERROR_NONE = 0, + RECORDER_REASON_NONE = 0, /** * 1: The SDK fails to write the recorded data to a file. */ - RECORDER_ERROR_WRITE_FAILED = 1, + RECORDER_REASON_WRITE_FAILED = 1, /** * 2: The SDK does not detect audio and video streams to be recorded, or audio and video streams are interrupted for more than five seconds during recording. */ - RECORDER_ERROR_NO_STREAM = 2, + RECORDER_REASON_NO_STREAM = 2, /** * 3: The recording duration exceeds the upper limit. */ - RECORDER_ERROR_OVER_MAX_DURATION = 3, + RECORDER_REASON_OVER_MAX_DURATION = 3, /** * 4: The recording configuration changes. */ - RECORDER_ERROR_CONFIG_CHANGED = 4, + RECORDER_REASON_CONFIG_CHANGED = 4, }; /** * Configurations for the local audio and video recording. @@ -1605,7 +1632,6 @@ struct RecorderInfo { RecorderInfo(const char* name, unsigned int dur, unsigned int size) : fileName(name), durationMs(dur), fileSize(size) {} }; - class IMediaRecorderObserver { public: /** @@ -1619,9 +1645,9 @@ class IMediaRecorderObserver { * @param channelId The channel name. * @param uid ID of the user. * @param state The current recording state. See \ref agora::media::RecorderState "RecorderState". - * @param error The reason for the state change. See \ref agora::media::RecorderErrorCode "RecorderErrorCode". + * @param reason The reason for the state change. See \ref agora::media::RecorderReasonCode "RecorderReasonCode". */ - virtual void onRecorderStateChanged(const char* channelId, rtc::uid_t uid, RecorderState state, RecorderErrorCode error) = 0; + virtual void onRecorderStateChanged(const char* channelId, rtc::uid_t uid, RecorderState state, RecorderReasonCode reason) = 0; /** * Occurs when the recording information is updated. * @@ -1637,7 +1663,9 @@ class IMediaRecorderObserver { * */ virtual void onRecorderInfoUpdated(const char* channelId, rtc::uid_t uid, const RecorderInfo& info) = 0; + virtual ~IMediaRecorderObserver() {} }; + } // namespace media } // namespace agora diff --git a/android/src/main/cpp/third_party/include/agora_rtc/AgoraMediaPlayerTypes.h b/android/src/main/cpp/third_party/include/agora_rtc/AgoraMediaPlayerTypes.h index d1bb17bb3..3beaba788 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/AgoraMediaPlayerTypes.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/AgoraMediaPlayerTypes.h @@ -105,61 +105,61 @@ enum MEDIA_PLAYER_STATE { * @brief Player error code * */ -enum MEDIA_PLAYER_ERROR { +enum MEDIA_PLAYER_REASON { /** No error. */ - PLAYER_ERROR_NONE = 0, + PLAYER_REASON_NONE = 0, /** The parameter is invalid. */ - PLAYER_ERROR_INVALID_ARGUMENTS = -1, + PLAYER_REASON_INVALID_ARGUMENTS = -1, /** Internel error. */ - PLAYER_ERROR_INTERNAL = -2, + PLAYER_REASON_INTERNAL = -2, /** No resource. */ - PLAYER_ERROR_NO_RESOURCE = -3, + PLAYER_REASON_NO_RESOURCE = -3, /** Invalid media source. */ - PLAYER_ERROR_INVALID_MEDIA_SOURCE = -4, + PLAYER_REASON_INVALID_MEDIA_SOURCE = -4, /** The type of the media stream is unknown. */ - PLAYER_ERROR_UNKNOWN_STREAM_TYPE = -5, + PLAYER_REASON_UNKNOWN_STREAM_TYPE = -5, /** The object is not initialized. */ - PLAYER_ERROR_OBJ_NOT_INITIALIZED = -6, + PLAYER_REASON_OBJ_NOT_INITIALIZED = -6, /** The codec is not supported. */ - PLAYER_ERROR_CODEC_NOT_SUPPORTED = -7, + PLAYER_REASON_CODEC_NOT_SUPPORTED = -7, /** Invalid renderer. */ - PLAYER_ERROR_VIDEO_RENDER_FAILED = -8, + PLAYER_REASON_VIDEO_RENDER_FAILED = -8, /** An error occurs in the internal state of the player. */ - PLAYER_ERROR_INVALID_STATE = -9, + PLAYER_REASON_INVALID_STATE = -9, /** The URL of the media file cannot be found. */ - PLAYER_ERROR_URL_NOT_FOUND = -10, + PLAYER_REASON_URL_NOT_FOUND = -10, /** Invalid connection between the player and the Agora server. */ - PLAYER_ERROR_INVALID_CONNECTION_STATE = -11, + PLAYER_REASON_INVALID_CONNECTION_STATE = -11, /** The playback buffer is insufficient. */ - PLAYER_ERROR_SRC_BUFFER_UNDERFLOW = -12, + PLAYER_REASON_SRC_BUFFER_UNDERFLOW = -12, /** The audio mixing file playback is interrupted. */ - PLAYER_ERROR_INTERRUPTED = -13, + PLAYER_REASON_INTERRUPTED = -13, /** The SDK does not support this function. */ - PLAYER_ERROR_NOT_SUPPORTED = -14, + PLAYER_REASON_NOT_SUPPORTED = -14, /** The token has expired. */ - PLAYER_ERROR_TOKEN_EXPIRED = -15, + PLAYER_REASON_TOKEN_EXPIRED = -15, /** The ip has expired. */ - PLAYER_ERROR_IP_EXPIRED = -16, + PLAYER_REASON_IP_EXPIRED = -16, /** An unknown error occurs. */ - PLAYER_ERROR_UNKNOWN = -17, + PLAYER_REASON_UNKNOWN = -17, }; /** @@ -357,18 +357,60 @@ struct CacheStatistics { int64_t downloadSize; }; -struct PlayerUpdatedInfo { - /** playerId has value when user trigger interface of opening +/** + * @brief The real time statistics of the media stream being played. + * + */ +struct PlayerPlaybackStats { + /** Video fps. */ - Optional playerId; - - /** deviceId has value when user trigger interface of opening + int videoFps; + /** Video bitrate (Kbps). + */ + int videoBitrateInKbps; + /** Audio bitrate (Kbps). */ - Optional deviceId; + int audioBitrateInKbps; + /** Total bitrate (Kbps). + */ + int totalBitrateInKbps; +}; - /** cacheStatistics exist if you enable cache, triggered 1s at a time after openning url +/** + * @brief The updated information of media player. + * + */ +struct PlayerUpdatedInfo { + /** @technical preview */ - Optional cacheStatistics; + const char* internalPlayerUuid; + /** The device ID of the playback device. + */ + const char* deviceId; + /** Video height. + */ + int videoHeight; + /** Video width. + */ + int videoWidth; + /** Audio sample rate. + */ + int audioSampleRate; + /** The audio channel number. + */ + int audioChannels; + /** The bit number of each audio sample. + */ + int audioBitsPerSample; + + PlayerUpdatedInfo() + : internalPlayerUuid(NULL), + deviceId(NULL), + videoHeight(0), + videoWidth(0), + audioSampleRate(0), + audioChannels(0), + audioBitsPerSample(0) {} }; /** @@ -436,6 +478,17 @@ struct MediaSource { * - false: (Default) Disable cache. */ bool enableCache; + /** + * Determines whether to enable multi-track audio stream decoding. + * Then you can select multi audio track of the media file for playback or publish to channel + * + * @note + * If you use the selectMultiAudioTrack API, you must set enableMultiAudioTrack to true. + * + * - true: Enable MultiAudioTrack;. + * - false: (Default) Disable MultiAudioTrack;. + */ + bool enableMultiAudioTrack; /** * Determines whether the opened media resource is a stream through the Agora Broadcast Streaming Network(CDN). * - true: It is a stream through the Agora Broadcast Streaming Network. @@ -454,7 +507,7 @@ struct MediaSource { IMediaPlayerCustomDataProvider* provider; MediaSource() : url(NULL), uri(NULL), startPos(0), autoPlay(true), enableCache(false), - provider(NULL){ + enableMultiAudioTrack(false), provider(NULL){ } }; diff --git a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraH265Transcoder.h b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraH265Transcoder.h index 250d5ad82..b2f5c5b31 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraH265Transcoder.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraH265Transcoder.h @@ -71,10 +71,8 @@ enum H265_TRANSCODE_RESULT { */ class IH265TranscoderObserver { public: - virtual ~IH265TranscoderObserver() {}; - /** * Use to notify the result of invoking enableTranscode interface. * @param result Result of invoking enableTranscode interface. There are some processing advice below of result. @@ -119,9 +117,8 @@ class IH265TranscoderObserver { /** * The IH265Transcoder class */ -class IH265Transcoder: public RefCountInterface { +class IH265Transcoder : public RefCountInterface { public: - /** * Enable transcoding for a channel. * @param token The token for authentication. @@ -154,7 +151,6 @@ class IH265Transcoder: public RefCountInterface { * - <0: Failure. */ virtual int triggerTranscode(const char* token, const char* channel, uid_t uid) = 0; - /** * Register a IH265TranscoderObserver object. * @param observer IH265TranscoderObserver. @@ -163,7 +159,6 @@ class IH265Transcoder: public RefCountInterface { * - <0: Failure. */ virtual int registerTranscoderObserver(IH265TranscoderObserver *observer) = 0; - /** * Unregister a IH265TranscoderObserver object. * @param observer IH265TranscoderObserver. @@ -178,5 +173,6 @@ class IH265Transcoder: public RefCountInterface { virtual ~IH265Transcoder() {}; }; + } // namespace rtc } // namespace agora \ No newline at end of file diff --git a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraLog.h b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraLog.h index f3952163a..2fae3aa13 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraLog.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraLog.h @@ -75,7 +75,7 @@ const uint32_t MAX_LOG_SIZE = 20 * 1024 * 1024; // 20MB const uint32_t MIN_LOG_SIZE = 128 * 1024; // 128KB /** The default log size in kb */ -const uint32_t DEFAULT_LOG_SIZE_IN_KB = 1024; +const uint32_t DEFAULT_LOG_SIZE_IN_KB = 2048; /** Definition of LogConfiguration */ @@ -83,7 +83,7 @@ struct LogConfig { /**The log file path, default is NULL for default log path */ const char* filePath; - /** The log file size, KB , set 1024KB to use default log size + /** The log file size, KB , set 2048KB to use default log size */ uint32_t fileSizeInKB; /** The log level, set LOG_LEVEL_INFO to use default log level diff --git a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMediaEngine.h b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMediaEngine.h index e2f8e06a9..e57404a22 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMediaEngine.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMediaEngine.h @@ -58,7 +58,6 @@ class IMediaEngine { * - < 0: Failure. */ virtual int registerVideoFrameObserver(IVideoFrameObserver* observer) = 0; - /** * Registers a receiver object for the encoded video image. * @@ -73,7 +72,6 @@ class IMediaEngine { * - < 0: Failure. */ virtual int registerVideoEncodedFrameObserver(IVideoEncodedFrameObserver* observer) = 0; - /** * Pushes the external audio data to the app. * @@ -83,7 +81,8 @@ class IMediaEngine { * - 0: Success. * - < 0: Failure. */ - virtual int pushAudioFrame(IAudioFrameObserver::AudioFrame* frame, rtc::track_id_t trackId = 0) = 0; + + virtual int pushAudioFrame(IAudioFrameObserverBase::AudioFrame* frame, rtc::track_id_t trackId = 0) = 0; /** * Pulls the remote audio data. @@ -101,7 +100,7 @@ class IMediaEngine { * - 0: Success. * - < 0: Failure. */ - virtual int pullAudioFrame(IAudioFrameObserver::AudioFrame* frame) = 0; + virtual int pullAudioFrame(IAudioFrameObserverBase::AudioFrame* frame) = 0; /** * Sets the external video source. @@ -237,7 +236,6 @@ class IMediaEngine { * - < 0: Failure. */ virtual int pushVideoFrame(base::ExternalVideoFrame* frame, unsigned int videoTrackId = 0) = 0; - /** * Pushes the encoded video image to the app. * @param imageBuffer A pointer to the video image. @@ -248,10 +246,9 @@ class IMediaEngine { * - 0: Success. * - < 0: Failure. */ - virtual int pushEncodedVideoImage(const uint8_t* imageBuffer, size_t length, + virtual int pushEncodedVideoImage(const unsigned char* imageBuffer, size_t length, const agora::rtc::EncodedVideoFrameInfo& videoEncodedFrameInfo, unsigned int videoTrackId = 0) = 0; - /** * @hide For internal usage only */ diff --git a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMediaPlayer.h b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMediaPlayer.h index cb5c8738e..bd3c7597c 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMediaPlayer.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMediaPlayer.h @@ -158,13 +158,30 @@ class IMediaPlayer : public RefCountInterface { /** * Slect playback audio track of the media file - * @param speed the index of the audio track in meia file + * @param index the index of the audio track in media file * @return * - 0: Success. * - < 0: Failure. */ virtual int selectAudioTrack(int index) = 0; + /** + * Selects multi audio track of the media file for playback or publish to channel. + * @param playoutTrackIndex The index of the audio track in media file for local playback. + * @param publishTrackIndex The index of the audio track in the media file published to the remote. + * + * @note + * You can obtain the streamIndex of the audio track by calling getStreamInfo.. + * If you want to use selectMultiAudioTrack, you need to open the media file with openWithMediaSource and set enableMultiAudioTrack to true. + * + * @return + * - 0: Success. + * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_REASON MEDIA_PLAYER_REASON}. + * - -2: Invalid argument. Argument must be greater than or equal to zero. + * - -8: Invalid State.You must open the media file with openWithMediaSource and set enableMultiAudioTrack to true + */ + virtual int selectMultiAudioTrack(int playoutTrackIndex, int publishTrackIndex) = 0; + /** * change player option before play a file * @param key the key of the option param @@ -217,7 +234,7 @@ class IMediaPlayer : public RefCountInterface { * @brief Turn mute on or off * * @param muted Whether to mute on - * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_ERROR + * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_REASON */ virtual int mute(bool muted) = 0; @@ -225,7 +242,7 @@ class IMediaPlayer : public RefCountInterface { * @brief Get mute state * * @param[out] muted Whether is mute on - * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_ERROR + * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_REASON */ virtual int getMute(bool& muted) = 0; @@ -237,7 +254,7 @@ class IMediaPlayer : public RefCountInterface { * 0: mute; * 100: original volume; * 400: Up to 4 times the original volume (with built-in overflow protection). - * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_ERROR + * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_REASON */ virtual int adjustPlayoutVolume(int volume) = 0; @@ -245,21 +262,21 @@ class IMediaPlayer : public RefCountInterface { * @brief Get the current playback volume * * @param[out] volume - * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_ERROR + * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_REASON */ virtual int getPlayoutVolume(int& volume) = 0; /** * @brief adjust publish signal volume * - * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_ERROR + * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_REASON */ virtual int adjustPublishSignalVolume(int volume) = 0; /** * @brief get publish signal volume * - * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_ERROR + * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_REASON */ virtual int getPublishSignalVolume(int& volume) = 0; @@ -267,7 +284,7 @@ class IMediaPlayer : public RefCountInterface { * @brief Set video rendering view * * @param view view object, windows platform is HWND - * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_ERROR + * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_REASON */ virtual int setView(media::base::view_t view) = 0; @@ -275,7 +292,7 @@ class IMediaPlayer : public RefCountInterface { * @brief Set video display mode * * @param renderMode Video display mode - * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_ERROR + * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_REASON */ virtual int setRenderMode(media::base::RENDER_MODE_TYPE renderMode) = 0; @@ -337,7 +354,7 @@ class IMediaPlayer : public RefCountInterface { * @brief Register the player video observer * * @param observer observer object - * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_ERROR + * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_REASON */ virtual int registerVideoFrameObserver(media::base::IVideoFrameObserver* observer) = 0; @@ -345,7 +362,7 @@ class IMediaPlayer : public RefCountInterface { * @brief UnRegister the player video observer * * @param observer observer object - * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_ERROR + * @return int < 0 on behalf of an error, the value corresponds to one of MEDIA_PLAYER_REASON */ virtual int unregisterVideoFrameObserver(agora::media::base::IVideoFrameObserver* observer) = 0; diff --git a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMediaPlayerSource.h b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMediaPlayerSource.h index 8d1a95be0..00be02233 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMediaPlayerSource.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMediaPlayerSource.h @@ -118,7 +118,7 @@ class IMediaPlayerSource : public RefCountInterface { * @param [out] pos A reference to the current playback position (ms). * @return * - 0: Success. - * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_ERROR MEDIA_PLAYER_ERROR}. + * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_REASON MEDIA_PLAYER_REASON}. */ virtual int getPlayPosition(int64_t& pos) = 0; @@ -127,7 +127,7 @@ class IMediaPlayerSource : public RefCountInterface { * @param [out] count The number of the media streams in the media source. * @return * - 0: Success. - * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_ERROR MEDIA_PLAYER_ERROR}. + * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_REASON MEDIA_PLAYER_REASON}. */ virtual int getStreamCount(int64_t& count) = 0; @@ -137,7 +137,7 @@ class IMediaPlayerSource : public RefCountInterface { * @param [out] info The detailed information of the media stream. See \ref media::base::PlayerStreamInfo "PlayerStreamInfo" for details. * @return * - 0: Success. - * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_ERROR MEDIA_PLAYER_ERROR}. + * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_REASON MEDIA_PLAYER_REASON}. */ virtual int getStreamInfo(int64_t index, media::base::PlayerStreamInfo* info) = 0; @@ -149,7 +149,7 @@ class IMediaPlayerSource : public RefCountInterface { * - -1: Play the media file in a loop indefinitely, until {@link stop} is called. * @return * - 0: Success. - * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_ERROR MEDIA_PLAYER_ERROR}. + * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_REASON MEDIA_PLAYER_REASON}. */ virtual int setLoopCount(int64_t loopCount) = 0; @@ -158,7 +158,7 @@ class IMediaPlayerSource : public RefCountInterface { * @param speed The playback speed ref [50-400]. * @return * - 0: Success. - * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_ERROR MEDIA_PLAYER_ERROR}. + * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_REASON MEDIA_PLAYER_REASON}. */ virtual int setPlaybackSpeed(int speed) = 0; @@ -167,17 +167,34 @@ class IMediaPlayerSource : public RefCountInterface { * @param index The index of the audio track in media file. * @return * - 0: Success. - * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_ERROR MEDIA_PLAYER_ERROR}. + * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_REASON MEDIA_PLAYER_REASON}. */ virtual int selectAudioTrack(int64_t index) = 0; + /** + * Selects multi audio track of the media file for playback or publish to channel. + * @param playoutTrackIndex The index of the audio track in media file for local playback. + * @param publishTrackIndex The index of the audio track in the media file published to the remote. + * + * @note + * You can obtain the streamIndex of the audio track by calling getStreamInfo.. + * If you want to use selectMultiAudioTrack, you need to open the media file with openWithMediaSource and set enableMultiAudioTrack to true. + * + * @return + * - 0: Success. + * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_REASON MEDIA_PLAYER_REASON}. + * - -2: Invalid argument. Argument must be greater than or equal to zero. + * - -8: Invalid State.You must open the media file with openWithMediaSource and set enableMultiAudioTrack to true + */ + virtual int selectMultiAudioTrack(int playoutTrackIndex, int publishTrackIndex) = 0; + /** * Changes the player option before playing a file. * @param key The key of the option paramemter. * @param value The value of option parameter. * @return * - 0: Success. - * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_ERROR MEDIA_PLAYER_ERROR}. + * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_REASON MEDIA_PLAYER_REASON}. */ virtual int setPlayerOption(const char* key, int64_t value) = 0; @@ -187,7 +204,7 @@ class IMediaPlayerSource : public RefCountInterface { * @param value The value of option parameter. * @return * - 0: Success. - * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_ERROR MEDIA_PLAYER_ERROR}. + * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_REASON MEDIA_PLAYER_REASON}. */ virtual int setPlayerOption(const char* key, const char* value) = 0; @@ -196,7 +213,7 @@ class IMediaPlayerSource : public RefCountInterface { * @param filename The filename of the screenshot file. * @return * - 0: Success. - * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_ERROR MEDIA_PLAYER_ERROR}. + * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_REASON MEDIA_PLAYER_REASON}. */ virtual int takeScreenshot(const char* filename) = 0; @@ -205,7 +222,7 @@ class IMediaPlayerSource : public RefCountInterface { * @param index The index of the internal subtitles. * @return * - 0: Success. - * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_ERROR MEDIA_PLAYER_ERROR}. + * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_REASON MEDIA_PLAYER_REASON}. */ virtual int selectInternalSubtitle(int64_t index) = 0; @@ -214,7 +231,7 @@ class IMediaPlayerSource : public RefCountInterface { * @param url The URL of the subtitle file. * @return * - 0: Success. - * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_ERROR MEDIA_PLAYER_ERROR}. + * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_REASON MEDIA_PLAYER_REASON}. */ virtual int setExternalSubtitle(const char* url) = 0; @@ -231,7 +248,7 @@ class IMediaPlayerSource : public RefCountInterface { * @param observer The pointer to the IMediaPlayerSourceObserver object. * @return * - 0: Success. - * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_ERROR MEDIA_PLAYER_ERROR}. + * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_REASON MEDIA_PLAYER_REASON}. */ virtual int registerPlayerSourceObserver(IMediaPlayerSourceObserver* observer) = 0; @@ -240,7 +257,7 @@ class IMediaPlayerSource : public RefCountInterface { * @param observer The pointer to the IMediaPlayerSourceObserver object. * @return * - 0: Success. - * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_ERROR MEDIA_PLAYER_ERROR}. + * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_REASON MEDIA_PLAYER_REASON}. */ virtual int unregisterPlayerSourceObserver(IMediaPlayerSourceObserver* observer) = 0; @@ -250,7 +267,7 @@ class IMediaPlayerSource : public RefCountInterface { * @param observer The pointer to the {@link media::IAudioPcmFrameSink observer} object. * @return * - 0: Success. - * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_ERROR MEDIA_PLAYER_ERROR}. + * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_REASON MEDIA_PLAYER_REASON}. */ virtual int registerAudioFrameObserver(media::IAudioPcmFrameSink* observer) = 0; @@ -259,7 +276,7 @@ class IMediaPlayerSource : public RefCountInterface { * @param observer The pointer to the {@link media::IAudioPcmFrameSink observer} object. * @return * - 0: Success. - * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_ERROR MEDIA_PLAYER_ERROR}. + * - < 0: Failure. See {@link media::base::MEDIA_PLAYER_REASON MEDIA_PLAYER_REASON}. */ virtual int unregisterAudioFrameObserver(media::IAudioPcmFrameSink* observer) = 0; @@ -380,18 +397,19 @@ class IMediaPlayerSourceObserver { * * When the state of the playback changes, the SDK triggers this callback to report the new playback state and the reason or error for the change. * @param state The new playback state after change. See {@link media::base::MEDIA_PLAYER_STATE MEDIA_PLAYER_STATE}. - * @param ec The player's error code. See {@link media::base::MEDIA_PLAYER_ERROR MEDIA_PLAYER_ERROR}. + * @param reason The player's error code. See {@link media::base::MEDIA_PLAYER_REASON MEDIA_PLAYER_REASON}. */ virtual void onPlayerSourceStateChanged(media::base::MEDIA_PLAYER_STATE state, - media::base::MEDIA_PLAYER_ERROR ec) = 0; + media::base::MEDIA_PLAYER_REASON reason) = 0; /** * @brief Reports current playback progress. * * The callback occurs once every one second during the playback and reports the current playback progress. - * @param position Current playback progress (milisecond). + * @param positionMs Current playback progress (milisecond). + * @param timestampMs Current NTP(Network Time Protocol) time (milisecond). */ - virtual void onPositionChanged(int64_t position_ms) = 0; + virtual void onPositionChanged(int64_t positionMs, int64_t timestampMs) = 0; /** * @brief Reports the playback event. @@ -455,6 +473,24 @@ class IMediaPlayerSourceObserver { * @param info Include information of media player. */ virtual void onPlayerInfoUpdated(const media::base::PlayerUpdatedInfo& info) = 0; + + /** + * @brief Triggered every 1 second, reports the statistics of the files being cached. + * + * @param stats Cached file statistics. + */ + virtual void onPlayerCacheStats(const media::base::CacheStatistics& stats) { + (void)stats; + } + + /** + * @brief Triggered every 1 second, reports the statistics of the media stream being played. + * + * @param stats The statistics of the media stream. + */ + virtual void onPlayerPlaybackStats(const media::base::PlayerPlaybackStats& stats) { + (void)stats; + } /** * @brief Triggered every 200 millisecond ,update player current volume range [0,255] diff --git a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMediaRecorder.h b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMediaRecorder.h index 6a4765f31..17375607c 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMediaRecorder.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMediaRecorder.h @@ -15,6 +15,7 @@ namespace rtc { class IMediaRecorder : public RefCountInterface { protected: virtual ~IMediaRecorder() {} + public: /** * Registers the IMediaRecorderObserver object. @@ -62,8 +63,7 @@ class IMediaRecorder : public RefCountInterface { * - The specified path of the recording file exists and is writable. * - The specified format of the recording file is supported. * - The maximum recording duration is correctly set. - * - During remote recording, ensure the channel ID and user ID After calling \ref - * IRtcEngine::createMediaRecorder did join the channel. + * - During remote recording, ensure the user whose media streams you want record did join the channel. * - `-4(ERR_NOT_SUPPORTED)`: IRtcEngine does not support the request due to one of the following reasons: * - The recording is ongoing. * - The recording stops because an error occurs. diff --git a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMusicContentCenter.h b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMusicContentCenter.h index 1889bbdea..d5ed99ef8 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMusicContentCenter.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMusicContentCenter.h @@ -44,36 +44,36 @@ typedef enum /** * 1: A general error occurs. */ - kMusicContentCenterStatusErr = 1, + kMusicContentCenterStatusError = 1, /** * 2: The gateway error. There are several possible reasons: * - Token is expired. Check if your token is expired. * - Token is invalid. Check the type of token you passed in. * - Network error. Check your network. */ - kMusicContentCenterStatusErrGateway = 2, + kMusicContentCenterStatusGateway = 2, /** * 3: Permission and resource error. There are several possible reasons: * - Your appid may not have the mcc permission. Please contact technical support * - The resource may not exist. Please contact technical support */ - kMusicContentCenterStatusErrPermissionAndResource = 3, + kMusicContentCenterStatusPermissionAndResource = 3, /** * 4: Internal data parse error. Please contact technical support */ - kMusicContentCenterStatusErrInternalDataParse = 4, + kMusicContentCenterStatusInternalDataParse = 4, /** * 5: Music loading error. Please contact technical support */ - kMusicContentCenterStatusErrMusicLoading = 5, + kMusicContentCenterStatusMusicLoading = 5, /** * 6: Music decryption error. Please contact technical support */ - kMusicContentCenterStatusErrMusicDecryption = 6, + kMusicContentCenterStatusMusicDecryption = 6, /** * 7: Http internal error. Please retry later. */ - kMusicContentCenterStatusErrHttpInternalError = 7, + kMusicContentCenterStatusHttpInternalError = 7, } MusicContentCenterStatusCode; typedef struct @@ -234,18 +234,18 @@ class IMusicContentCenterEventHandler { * * @param requestId The request id is same as that returned by getMusicCharts. * @param result The result of music chart collection - * @param errorCode The status of the request. See MusicContentCenterStatusCode + * @param status The status of the request. See MusicContentCenterStatusCode */ - virtual void onMusicChartsResult(const char* requestId, agora_refptr result, MusicContentCenterStatusCode errorCode) = 0; + virtual void onMusicChartsResult(const char* requestId, agora_refptr result, MusicContentCenterStatusCode status) = 0; /** * Music collection, occurs when getMusicCollectionByMusicChartId or searchMusic method is called. * * @param requestId The request id is same as that returned by getMusicCollectionByMusicChartId or searchMusic * @param result The result of music collection - * @param errorCode The status of the request. See MusicContentCenterStatusCode + * @param status The status of the request. See MusicContentCenterStatusCode */ - virtual void onMusicCollectionResult(const char* requestId, agora_refptr result, MusicContentCenterStatusCode errorCode) = 0; + virtual void onMusicCollectionResult(const char* requestId, agora_refptr result, MusicContentCenterStatusCode status) = 0; /** * Lyric url callback of getLyric, occurs when getLyric is called @@ -253,9 +253,9 @@ class IMusicContentCenterEventHandler { * @param requestId The request id is same as that returned by getLyric * @param songCode Song code * @param lyricUrl The lyric url of this music - * @param errorCode The status of the request. See MusicContentCenterStatusCode + * @param status The status of the request. See MusicContentCenterStatusCode */ - virtual void onLyricResult(const char* requestId, int64_t songCode, const char* lyricUrl, MusicContentCenterStatusCode errorCode) = 0; + virtual void onLyricResult(const char* requestId, int64_t songCode, const char* lyricUrl, MusicContentCenterStatusCode status) = 0; /** * Simple info callback of getSongSimpleInfo, occurs when getSongSimpleInfo is called @@ -263,9 +263,9 @@ class IMusicContentCenterEventHandler { * @param requestId The request id is same as that returned by getSongSimpleInfo. * @param songCode Song code * @param simpleInfo The metadata of the music. - * @param errorCode The status of the request. See MusicContentCenterStatusCode + * @param status The status of the request. See MusicContentCenterStatusCode */ - virtual void onSongSimpleInfoResult(const char* requestId, int64_t songCode, const char* simpleInfo, MusicContentCenterStatusCode errorCode) = 0; + virtual void onSongSimpleInfoResult(const char* requestId, int64_t songCode, const char* simpleInfo, MusicContentCenterStatusCode status) = 0; /** * Preload process callback, occurs when preload is called @@ -274,10 +274,10 @@ class IMusicContentCenterEventHandler { * @param songCode Song code * @param percent Preload progress (0 ~ 100) * @param lyricUrl The lyric url of this music - * @param status Preload status; see PreloadStatusCode. - * @param errorCode The status of the request. See MusicContentCenterStatusCode + * @param preloadStatus Preload status; see PreloadStatusCode. + * @param mccStatus The status of the request. See MusicContentCenterStatusCode */ - virtual void onPreLoadEvent(const char* requestId, int64_t songCode, int percent, const char* lyricUrl, PreloadStatusCode status, MusicContentCenterStatusCode errorCode) = 0; + virtual void onPreLoadEvent(const char* requestId, int64_t songCode, int percent, const char* lyricUrl, PreloadStatusCode preloadStatus, MusicContentCenterStatusCode mccStatus) = 0; virtual ~IMusicContentCenterEventHandler() {}; }; diff --git a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraParameter.h b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraParameter.h index 70ea5939e..b88969e1d 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraParameter.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraParameter.h @@ -15,6 +15,7 @@ */ #pragma once // NOLINT(build/header_guard) +#include "AgoraRefPtr.h" // external key /** @@ -115,6 +116,7 @@ * set the video codec type, such as "H264", "JPEG" */ #define KEY_RTC_VIDEO_CODEC_TYPE "engine.video.codec_type" +#define KEY_RTC_VIDEO_MINOR_STREAM_CODEC_TYPE "engine.video.minor_stream_codec_type" #define KEY_RTC_VIDEO_CODEC_INDEX "che.video.videoCodecIndex" /** * only use average QP for quality scaling @@ -144,7 +146,7 @@ typedef CopyableAutoPtr AString; namespace base { -class IAgoraParameter { +class IAgoraParameter : public RefCountInterface { public: /** * release the resource @@ -300,6 +302,7 @@ class IAgoraParameter { virtual int convertPath(const char* filePath, agora::util::AString& value) = 0; + protected: virtual ~IAgoraParameter() {} }; diff --git a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRhythmPlayer.h b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRhythmPlayer.h index b39322a2d..e2e00ac70 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRhythmPlayer.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRhythmPlayer.h @@ -35,19 +35,19 @@ enum RHYTHM_PLAYER_STATE_TYPE { }; /** - The error codes of the rhythm player. + The reason codes of the rhythm player. */ -enum RHYTHM_PLAYER_ERROR_TYPE { +enum RHYTHM_PLAYER_REASON { /** 0: The rhythm player works well. */ - RHYTHM_PLAYER_ERROR_OK = 0, + RHYTHM_PLAYER_REASON_OK = 0, /** 1: The rhythm player occurs a internal error. */ - RHYTHM_PLAYER_ERROR_FAILED = 1, + RHYTHM_PLAYER_REASON_FAILED = 1, /** 801: The rhythm player can not open the file. */ - RHYTHM_PLAYER_ERROR_CAN_NOT_OPEN = 801, + RHYTHM_PLAYER_REASON_CAN_NOT_OPEN = 801, /** 802: The rhythm player can not play the file. */ - RHYTHM_PLAYER_ERROR_CAN_NOT_PLAY, + RHYTHM_PLAYER_REASON_CAN_NOT_PLAY, /** 803: The file duration over the limit. The file duration limit is 1.2 seconds */ - RHYTHM_PLAYER_ERROR_FILE_OVER_DURATION_LIMIT, + RHYTHM_PLAYER_REASON_FILE_OVER_DURATION_LIMIT, }; /** diff --git a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtcEngine.h b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtcEngine.h index a54f24395..719a25f6c 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtcEngine.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtcEngine.h @@ -15,6 +15,9 @@ #include "IAgoraH265Transcoder.h" namespace agora { +namespace rtm { +class IStreamChannel; +} namespace rtc { template @@ -257,87 +260,87 @@ struct RtcConnection; */ struct LocalVideoStats { - /** - * ID of the local user. - */ - uid_t uid; - /** The actual bitrate (Kbps) while sending the local video stream. - * @note This value does not include the bitrate for resending the video after packet loss. - */ - int sentBitrate; - /** The actual frame rate (fps) while sending the local video stream. - * @note This value does not include the frame rate for resending the video after packet loss. - */ - int sentFrameRate; - /** The capture frame rate (fps) of the local video. - */ - int captureFrameRate; - /** The width of the capture frame (px). - */ - int captureFrameWidth; - /** The height of the capture frame (px). - */ - int captureFrameHeight; - /** - * The regulated frame rate of capture frame rate according to video encoder configuration. - */ - int regulatedCaptureFrameRate; - /** - * The regulated frame width (pixel) of capture frame width according to video encoder configuration. - */ - int regulatedCaptureFrameWidth; - /** - * The regulated frame height (pixel) of capture frame height according to video encoder configuration. - */ - int regulatedCaptureFrameHeight; - /** The output frame rate (fps) of the local video encoder. - */ - int encoderOutputFrameRate; - /** The width of the encoding frame (px). - */ - int encodedFrameWidth; - /** The height of the encoding frame (px). - */ - int encodedFrameHeight; - /** The output frame rate (fps) of the local video renderer. - */ - int rendererOutputFrameRate; - /** The target bitrate (Kbps) of the current encoder. This is an estimate made by the SDK based on the current network conditions. - */ - int targetBitrate; - /** The target frame rate (fps) of the current encoder. - */ - int targetFrameRate; - /** Quality adaption of the local video stream in the reported interval (based on the target frame - * rate and target bitrate). See #QUALITY_ADAPT_INDICATION. - */ - QUALITY_ADAPT_INDICATION qualityAdaptIndication; - /** The bitrate (Kbps) while encoding the local video stream. - * @note This value does not include the bitrate for resending the video after packet loss. - */ - int encodedBitrate; - /** The number of the sent video frames, represented by an aggregate value. - */ - int encodedFrameCount; - /** The codec type of the local video. See #VIDEO_CODEC_TYPE. - */ - VIDEO_CODEC_TYPE codecType; - /** - * The video packet loss rate (%) from the local client to the Agora server before applying the anti-packet loss strategies. - */ - unsigned short txPacketLossRate; - /** The brightness level of the video image captured by the local camera. See #CAPTURE_BRIGHTNESS_LEVEL_TYPE. - */ - CAPTURE_BRIGHTNESS_LEVEL_TYPE captureBrightnessLevel; - /** - * Whether we send dual stream now. - */ - bool dualStreamEnabled; - /** The hwEncoderAccelerating of the local video: - * - software = 0. - * - hardware = 1. - */ - int hwEncoderAccelerating; + /** + * ID of the local user. + */ + uid_t uid; + /** The actual bitrate (Kbps) while sending the local video stream. + * @note This value does not include the bitrate for resending the video after packet loss. + */ + int sentBitrate; + /** The actual frame rate (fps) while sending the local video stream. + * @note This value does not include the frame rate for resending the video after packet loss. + */ + int sentFrameRate; + /** The capture frame rate (fps) of the local video. + */ + int captureFrameRate; + /** The width of the capture frame (px). + */ + int captureFrameWidth; + /** The height of the capture frame (px). + */ + int captureFrameHeight; + /** + * The regulated frame rate of capture frame rate according to video encoder configuration. + */ + int regulatedCaptureFrameRate; + /** + * The regulated frame width (pixel) of capture frame width according to video encoder configuration. + */ + int regulatedCaptureFrameWidth; + /** + * The regulated frame height (pixel) of capture frame height according to video encoder configuration. + */ + int regulatedCaptureFrameHeight; + /** The output frame rate (fps) of the local video encoder. + */ + int encoderOutputFrameRate; + /** The width of the encoding frame (px). + */ + int encodedFrameWidth; + /** The height of the encoding frame (px). + */ + int encodedFrameHeight; + /** The output frame rate (fps) of the local video renderer. + */ + int rendererOutputFrameRate; + /** The target bitrate (Kbps) of the current encoder. This is an estimate made by the SDK based on the current network conditions. + */ + int targetBitrate; + /** The target frame rate (fps) of the current encoder. + */ + int targetFrameRate; + /** Quality adaption of the local video stream in the reported interval (based on the target frame + * rate and target bitrate). See #QUALITY_ADAPT_INDICATION. + */ + QUALITY_ADAPT_INDICATION qualityAdaptIndication; + /** The bitrate (Kbps) while encoding the local video stream. + * @note This value does not include the bitrate for resending the video after packet loss. + */ + int encodedBitrate; + /** The number of the sent video frames, represented by an aggregate value. + */ + int encodedFrameCount; + /** The codec type of the local video. See #VIDEO_CODEC_TYPE. + */ + VIDEO_CODEC_TYPE codecType; + /** + * The video packet loss rate (%) from the local client to the Agora server before applying the anti-packet loss strategies. + */ + unsigned short txPacketLossRate; + /** The brightness level of the video image captured by the local camera. See #CAPTURE_BRIGHTNESS_LEVEL_TYPE. + */ + CAPTURE_BRIGHTNESS_LEVEL_TYPE captureBrightnessLevel; + /** + * Whether we send dual stream now. + */ + bool dualStreamEnabled; + /** The hwEncoderAccelerating of the local video: + * - software = 0. + * - hardware = 1. + */ + int hwEncoderAccelerating; }; /** @@ -441,25 +444,25 @@ struct RemoteAudioStats */ unsigned int rxAudioBytes; - RemoteAudioStats() : - uid(0), - quality(0), - networkTransportDelay(0), - jitterBufferDelay(0), - audioLossRate(0), - numChannels(0), - receivedSampleRate(0), - receivedBitrate(0), - totalFrozenTime(0), - frozenRate(0), - mosValue(0), - frozenRateByCustomPlcCount(0), - plcCount(0), - totalActiveTime(0), - publishDuration(0), - qoeQuality(0), - qualityChangedReason(0), - rxAudioBytes(0) {} + RemoteAudioStats() + : uid(0), + quality(0), + networkTransportDelay(0), + jitterBufferDelay(0), + audioLossRate(0), + numChannels(0), + receivedSampleRate(0), + receivedBitrate(0), + totalFrozenTime(0), + frozenRate(0), + mosValue(0), + frozenRateByCustomPlcCount(0), + plcCount(0), + totalActiveTime(0), + publishDuration(0), + qoeQuality(0), + qualityChangedReason(0), + rxAudioBytes(0) {} }; /** @@ -575,8 +578,7 @@ struct VideoCompositingLayout { */ double alpha; - media::base::RENDER_MODE_TYPE - renderMode; // RENDER_MODE_HIDDEN: Crop, RENDER_MODE_FIT: Zoom to fit + media::base::RENDER_MODE_TYPE renderMode; // RENDER_MODE_HIDDEN: Crop, RENDER_MODE_FIT: Zoom to fit Region() : uid(0), @@ -619,10 +621,10 @@ struct VideoCompositingLayout { VideoCompositingLayout() : canvasWidth(0), canvasHeight(0), - backgroundColor(NULL), + backgroundColor(OPTIONAL_NULLPTR), regions(NULL), regionCount(0), - appData(NULL), + appData(OPTIONAL_NULLPTR), appDataLength(0) {} }; @@ -1033,7 +1035,7 @@ struct ChannelMediaOptions { * - `false`: (Default) Do not publish the video track of the secondary camera capturer. */ Optional publishSecondaryCameraTrack; - /** + /** * Whether to publish the video of the third camera track. * - `true`: Publish the video track of the third camera capturer. * - `false`: (Default) Do not publish the video track of the third camera capturer. @@ -1078,7 +1080,7 @@ struct ChannelMediaOptions { * - false: (Default) Do not publish the captured video from the secondary screen. */ Optional publishSecondaryScreenTrack; - /** + /** * Whether to publish the captured video from the third screen: * - true: Publish the captured video from the third screen. * - false: (Default) Do not publish the captured video from the third screen. @@ -1132,6 +1134,12 @@ struct ChannelMediaOptions { * - `false`: (Default) Do not publish the local transcoded video track. */ Optional publishTranscodedVideoTrack; + /** + * Whether to publish the local mixed track. + * - `true`: Publish the audio track of local mixed track. + * - `false`: (Default) Do not publish the local mixed track. + */ + Optional publishMixedAudioTrack; /** * Whether to automatically subscribe to all remote audio streams when the user joins a channel: * - `true`: (Default) Subscribe to all remote audio streams. @@ -1235,7 +1243,7 @@ struct ChannelMediaOptions { SET_FROM(publishCameraTrack); SET_FROM(publishSecondaryCameraTrack); SET_FROM(publishThirdCameraTrack); - SET_FROM(publishFourthCameraTrack); + SET_FROM(publishFourthCameraTrack); SET_FROM(publishMicrophoneTrack); #if defined(__ANDROID__) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) SET_FROM(publishScreenCaptureVideo); @@ -1247,6 +1255,7 @@ struct ChannelMediaOptions { SET_FROM(publishFourthScreenTrack); #endif SET_FROM(publishTranscodedVideoTrack); + SET_FROM(publishMixedAudioTrack); SET_FROM(publishCustomAudioTrack); SET_FROM(publishCustomAudioTrackId); SET_FROM(publishCustomVideoTrack); @@ -1293,6 +1302,7 @@ struct ChannelMediaOptions { ADD_COMPARE(publishFourthScreenTrack); #endif ADD_COMPARE(publishTranscodedVideoTrack); + ADD_COMPARE(publishMixedAudioTrack); ADD_COMPARE(publishCustomAudioTrack); ADD_COMPARE(publishCustomAudioTrackId); ADD_COMPARE(publishCustomVideoTrack); @@ -1342,6 +1352,7 @@ struct ChannelMediaOptions { REPLACE_BY(publishFourthScreenTrack); #endif REPLACE_BY(publishTranscodedVideoTrack); + REPLACE_BY(publishMixedAudioTrack); REPLACE_BY(publishCustomAudioTrack); REPLACE_BY(publishCustomAudioTrackId); REPLACE_BY(publishCustomVideoTrack); @@ -1512,8 +1523,7 @@ class IRtcEngineEventHandler { @param delay The network delay (ms) from the sender to the receiver, including the delay caused by audio sampling pre-processing, network transmission, and network jitter buffering. @param lost The audio packet loss rate (%) from the sender to the receiver. */ - virtual void onAudioQuality(uid_t uid, int quality, unsigned short delay, - unsigned short lost) __deprecated { + virtual void onAudioQuality(uid_t uid, int quality, unsigned short delay, unsigned short lost) __deprecated { (void)uid; (void)quality; (void)delay; @@ -1615,6 +1625,7 @@ class IRtcEngineEventHandler { If the startAudioMixing method call fails, the SDK returns the error code 701. */ virtual void onAudioMixingFinished() __deprecated {} + /** * Occurs when the playback of the local audio effect file finishes. * @@ -1782,7 +1793,7 @@ class IRtcEngineEventHandler { (void)width; (void)height; (void)rotation; - } + } /** Occurs when the local video stream state changes. * @@ -1792,13 +1803,13 @@ class IRtcEngineEventHandler { * you to troubleshoot issues when exceptions occur. * * The SDK triggers the onLocalVideoStateChanged callback with the state code of `LOCAL_VIDEO_STREAM_STATE_FAILED` - * and error code of `LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE` in the following situations: + * and error code of `LOCAL_VIDEO_STREAM_REASON_CAPTURE_FAILURE` in the following situations: * - The app switches to the background, and the system gets the camera resource. * - The camera starts normally, but does not output video for four consecutive seconds. * * When the camera outputs the captured video frames, if the video frames are the same for 15 * consecutive frames, the SDK triggers the `onLocalVideoStateChanged` callback with the state code - * of `LOCAL_VIDEO_STREAM_STATE_CAPTURING` and error code of `LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE`. + * of `LOCAL_VIDEO_STREAM_STATE_CAPTURING` and error code of `LOCAL_VIDEO_STREAM_REASON_CAPTURE_FAILURE`. * Note that the video frame duplication detection is only available for video frames with a resolution * greater than 200 × 200, a frame rate greater than or equal to 10 fps, and a bitrate less than 20 Kbps. * @@ -1808,12 +1819,12 @@ class IRtcEngineEventHandler { * * @param source The video source type: #VIDEO_SOURCE_TYPE. * @param state The state of the local video. See #LOCAL_VIDEO_STREAM_STATE. - * @param error The detailed error information. See #LOCAL_VIDEO_STREAM_ERROR. + * @param reason The detailed error information. See #LOCAL_VIDEO_STREAM_REASON. */ - virtual void onLocalVideoStateChanged(VIDEO_SOURCE_TYPE source, LOCAL_VIDEO_STREAM_STATE state, LOCAL_VIDEO_STREAM_ERROR error) { + virtual void onLocalVideoStateChanged(VIDEO_SOURCE_TYPE source, LOCAL_VIDEO_STREAM_STATE state, LOCAL_VIDEO_STREAM_REASON reason) { (void)source; (void)state; - (void)error; + (void)reason; } /** @@ -1836,13 +1847,13 @@ class IRtcEngineEventHandler { /** Occurs when the renderer receives the first frame of the remote video. * - * @param userId The user ID of the remote user sending the video stream. + * @param uid The user ID of the remote user sending the video stream. * @param width The width (px) of the video frame. * @param height The height (px) of the video stream. * @param elapsed The time elapsed (ms) from the local user calling `joinChannel` until the SDK triggers this callback. */ - virtual void onFirstRemoteVideoFrame(uid_t userId, int width, int height, int elapsed) { - (void)userId; + virtual void onFirstRemoteVideoFrame(uid_t uid, int width, int height, int elapsed) { + (void)uid; (void)width; (void)height; (void)elapsed; @@ -1922,8 +1933,8 @@ class IRtcEngineEventHandler { - true: The remote user has paused sending the video stream. - false: The remote user has resumed sending the video stream. */ - virtual void onUserMuteVideo(uid_t userId, bool muted) { - (void)userId; + virtual void onUserMuteVideo(uid_t uid, bool muted) { + (void)uid; (void)muted; } @@ -1945,11 +1956,11 @@ class IRtcEngineEventHandler { } /** - * Occurs when the remote user state is updated. + * Occurs when the remote user audio or video state is updated. * @param uid The uid of the remote user. - * @param state The remote user state: #REMOTE_USER_STATE. + * @param state The remote user's audio or video state: #REMOTE_USER_STATE. */ - virtual void onUserStateChanged(uid_t uid, uint32_t state) { + virtual void onUserStateChanged(uid_t uid, REMOTE_USER_STATE state) { (void)uid; (void)state; } @@ -1969,17 +1980,6 @@ class IRtcEngineEventHandler { (void)enabled; } - /** 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. The SDK triggers this callback once every two seconds for each remote user who is sending audio @@ -1991,6 +1991,17 @@ class IRtcEngineEventHandler { (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 local video stream. * * The SDK triggers this callback once every two seconds for each @@ -2020,12 +2031,14 @@ class IRtcEngineEventHandler { virtual void onRemoteVideoStats(const RemoteVideoStats& stats) { (void)stats; } + /** * Occurs when the camera turns on and is ready to capture the video. * @deprecated Use `LOCAL_VIDEO_STREAM_STATE_CAPTURING(1)` in onLocalVideoStateChanged instead. * This callback indicates that the camera has been successfully turned on and you can start to capture video. */ virtual void onCameraReady() __deprecated {} + /** * Occurs when the camera focus area changes. * @@ -2124,11 +2137,11 @@ class IRtcEngineEventHandler { callback. @param state The state code. See #RHYTHM_PLAYER_STATE_TYPE. - @param errorCode The error code. See #RHYTHM_PLAYER_ERROR_TYPE. + @param reason The error code. See #RHYTHM_PLAYER_REASON. */ - virtual void onRhythmPlayerStateChanged(RHYTHM_PLAYER_STATE_TYPE state, RHYTHM_PLAYER_ERROR_TYPE errorCode) { + virtual void onRhythmPlayerStateChanged(RHYTHM_PLAYER_STATE_TYPE state, RHYTHM_PLAYER_REASON reason) { (void)state; - (void)errorCode; + (void)reason; } /** @@ -2164,14 +2177,14 @@ class IRtcEngineEventHandler { * The SDK triggers this callback when the user receives the data stream that another user sends * by calling the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method. * - * @param userId ID of the user who sends the data stream. + * @param uid ID of the user who sends the data stream. * @param streamId The ID of the stream data. * @param data The data stream. * @param length The length (byte) of the data stream. * @param sentTs The time when the data stream sent. */ - virtual void onStreamMessage(uid_t userId, int streamId, const char* data, size_t length, uint64_t sentTs) { - (void)userId; + virtual void onStreamMessage(uid_t uid, int streamId, const char* data, size_t length, uint64_t sentTs) { + (void)uid; (void)streamId; (void)data; (void)length; @@ -2183,15 +2196,15 @@ class IRtcEngineEventHandler { * The SDK triggers this callback when the user fails to receive the data stream that another user sends * by calling the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage" method. * - * @param userId ID of the user who sends the data stream. + * @param uid ID of the user who sends the data stream. * @param streamId The ID of the stream data. * @param code The error code. * @param missed The number of lost messages. * @param cached The number of incoming cached messages when the data stream is * interrupted. */ - virtual void onStreamMessageError(uid_t userId, int streamId, int code, int missed, int cached) { - (void)userId; + virtual void onStreamMessageError(uid_t uid, int streamId, int code, int missed, int cached) { + (void)uid; (void)streamId; (void)code; (void)missed; @@ -2247,18 +2260,6 @@ class IRtcEngineEventHandler { (void)elapsed; } - /** Occurs when the SDK receives the first audio frame from a specific remote user. - * @deprecated Use `onRemoteAudioStateChanged` instead. - * - * @param uid ID of the remote user. - * @param elapsed The time elapsed (ms) from the loca user calling `joinChannel` - * until this callback is triggered. - */ - virtual void onFirstRemoteAudioFrame(uid_t uid, int elapsed) __deprecated { - (void)uid; - (void)elapsed; - } - /** * Occurs when the SDK decodes the first remote audio frame for playback. * @@ -2280,6 +2281,18 @@ class IRtcEngineEventHandler { (void)elapsed; } + /** Occurs when the SDK receives the first audio frame from a specific remote user. + * @deprecated Use `onRemoteAudioStateChanged` instead. + * + * @param uid ID of the remote user. + * @param elapsed The time elapsed (ms) from the loca user calling `joinChannel` + * until this callback is triggered. + */ + virtual void onFirstRemoteAudioFrame(uid_t uid, int elapsed) __deprecated { + (void)uid; + (void)elapsed; + } + /** Occurs when the local audio state changes. * * When the state of the local audio stream changes (including the state of the audio capture and encoding), the SDK @@ -2291,12 +2304,12 @@ class IRtcEngineEventHandler { * 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. + * @param reason The reason information of the local audio. + * See #LOCAL_AUDIO_STREAM_REASON. */ - virtual void onLocalAudioStateChanged(LOCAL_AUDIO_STREAM_STATE state, LOCAL_AUDIO_STREAM_ERROR error) { + virtual void onLocalAudioStateChanged(LOCAL_AUDIO_STREAM_STATE state, LOCAL_AUDIO_STREAM_REASON reason) { (void)state; - (void)error; + (void)reason; } /** Occurs when the remote audio state changes. @@ -2335,12 +2348,16 @@ class IRtcEngineEventHandler { * * @param userId The ID of the active speaker. A `uid` of 0 means the local user. */ - virtual void onActiveSpeaker(uid_t userId) { (void)userId; } + virtual void onActiveSpeaker(uid_t uid) { + (void)uid; + } + /** Reports result of content inspection. * * @param result The result of content inspection: #CONTENT_INSPECT_RESULT. */ virtual void onContentInspectResult(media::CONTENT_INSPECT_RESULT result) { (void)result; } + /** Reports the result of taking a video snapshot. * * After a successful `takeSnapshot` method call, the SDK triggers this callback to report whether the snapshot is @@ -2365,6 +2382,7 @@ class IRtcEngineEventHandler { (void)height; (void)errCode; } + /** * Occurs when the user role switches in the interactive live streaming. * @@ -2377,6 +2395,7 @@ class IRtcEngineEventHandler { (void)newRole; (void)newRoleOptions; } + /** * Occurs when the user role in a Live-Broadcast channel fails to switch, for example, from a broadcaster * to an audience or vice versa. @@ -2388,6 +2407,7 @@ class IRtcEngineEventHandler { (void)reason; (void)currentRole; } + /** Occurs when the audio device volume changes. @param deviceType The device type, see #MEDIA_DEVICE_TYPE @param volume The volume of the audio device. @@ -2410,13 +2430,13 @@ class IRtcEngineEventHandler { * * @param url The URL address where the state of the media push changes. * @param state The current state of the media push: #RTMP_STREAM_PUBLISH_STATE. - * @param errCode The detailed error information for the media push: #RTMP_STREAM_PUBLISH_ERROR_TYPE. + * @param reason The detailed error information for the media push: #RTMP_STREAM_PUBLISH_REASON. */ virtual void onRtmpStreamingStateChanged(const char* url, RTMP_STREAM_PUBLISH_STATE state, - RTMP_STREAM_PUBLISH_ERROR_TYPE errCode) { + RTMP_STREAM_PUBLISH_REASON reason) { (void)url; (void)state; - (void)errCode; + (void)reason; } /** Reports events during the media push. @@ -2456,7 +2476,6 @@ class IRtcEngineEventHandler { */ virtual void onAudioRoutingChanged(int routing) { (void)routing; } - /** * Occurs when the state of the media stream relay changes. * @@ -2493,32 +2512,6 @@ class IRtcEngineEventHandler { (void)code; } - /** - * Reports events during the media stream relay. - * @deprecated v4.2.0. This callback is not recommended and will be removed in future releases. - * @param code The event code for media stream relay: - * - `RELAY_EVENT_NETWORK_DISCONNECTED(0)`: The user disconnects from the server due to poor - * network connections. - * - `RELAY_EVENT_NETWORK_CONNECTED(1)`: The network reconnects. - * - `RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL(2)`: The user joins the source channel. - * - `RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL(3)`: The user joins the destination channel. - * - `RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL(4)`: The SDK starts relaying the media stream to the - * destination channel. - * - `RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC(5)`: The server receives the video stream from - * the source channel. - * - `RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC(6)`: The server receives the audio stream from - * the source channel. - * - `RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL(7)`: The destination channel is updated. - * - `RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED(8)`: The destination channel update fails due - * to internal reasons. Deprecated from 4.1.0 - * - `RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE(9)`: The destination channel does not - * change, which means that the destination channel fails to be updated. - * - `RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_IS_NULL(10)`: The destination channel name is NULL. - * - `RELAY_EVENT_VIDEO_PROFILE_UPDATE(11)`: The video profile is sent to the server. - */ - virtual void onChannelMediaRelayEvent(int code) __deprecated { - (void)code; - } /** * Occurs when the published media stream falls back to an audio-only stream due to poor network conditions or * switches back to video stream after the network conditions improve. @@ -2535,6 +2528,7 @@ class IRtcEngineEventHandler { 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 video stream after the network conditions improve. @@ -2571,8 +2565,7 @@ class IRtcEngineEventHandler { @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) __deprecated { + virtual void onRemoteAudioTransportStats(uid_t uid, unsigned short delay, unsigned short lost, unsigned short rxKBitRate) __deprecated { (void)uid; (void)delay; (void)lost; @@ -2596,8 +2589,7 @@ class IRtcEngineEventHandler { @param rxKBitRate The 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) __deprecated { + virtual void onRemoteVideoTransportStats(uid_t uid, unsigned short delay, unsigned short lost, unsigned short rxKBitRate) __deprecated { (void)uid; (void)delay; (void)lost; @@ -2635,7 +2627,7 @@ class IRtcEngineEventHandler { * @param currentStats Instantaneous value of optimization effect. * @param averageStats Average value of cumulative optimization effect. */ - virtual void onWlAccStats(WlAccStats currentStats, WlAccStats averageStats) { + virtual void onWlAccStats(const WlAccStats& currentStats, const WlAccStats& averageStats) { (void)currentStats; (void)averageStats; } @@ -2703,6 +2695,42 @@ class IRtcEngineEventHandler { (void)uid; (void)info; } + + /** + * Occurs when the user account is updated. + * + * @param uid The user ID. + * @param userAccount The user account. + */ + virtual void onUserAccountUpdated(uid_t uid, const char* userAccount){ + (void)uid; + (void)userAccount; + } + + /** + * Reports the tracing result of video rendering event of the user. + * + * @param uid The user ID. + * @param currentEvent The current event of the tracing result: #MEDIA_TRACE_EVENT. + * @param tracingInfo The tracing result: #VideoRenderingTracingInfo. + */ + virtual void onVideoRenderingTracingResult(uid_t uid, MEDIA_TRACE_EVENT currentEvent, VideoRenderingTracingInfo tracingInfo) { + (void)uid; + (void)currentEvent; + (void)tracingInfo; + } + + /** + * Occurs when local video transcoder stream has an error. + * + * @param stream Stream type of TranscodingVideoStream. + * @param error Error code of VIDEO_TRANSCODER_ERROR. + */ + virtual void onLocalVideoTranscoderError(const TranscodingVideoStream& stream, VIDEO_TRANSCODER_ERROR error){ + (void)stream; + (void)error; + } + /** * Reports the user log upload result * @param requestId RequestId of the upload @@ -2780,6 +2808,24 @@ class IRtcEngineEventHandler { (void)newState; (void)elapseSinceLastState; } + + /** + * Occurs when receive a video transcoder stream which has video layout info. + * + * @param uid user id of the transcoded stream. + * @param width width of the transcoded stream. + * @param height height of the transcoded stream. + * @param layoutCount count of layout info in the transcoded stream. + * @param layoutlist video layout info list of the transcoded stream. + */ + virtual void onTranscodedStreamLayoutInfo(uid_t uid, int width, int height, int layoutCount,const VideoLayout* layoutlist) { + (void)uid; + (void)width; + (void)height; + (void)layoutCount; + (void)layoutlist; + } + /** * The event callback of the extension. * @@ -2796,6 +2842,7 @@ class IRtcEngineEventHandler { (void)key; (void)value; } + /** * Occurs when the extension is enabled. * @@ -2808,6 +2855,7 @@ class IRtcEngineEventHandler { (void)provider; (void)extension; } + /** * Occurs when the extension is disabled. * @@ -2820,6 +2868,7 @@ class IRtcEngineEventHandler { (void)provider; (void)extension; } + /** * Occurs when the extension runs incorrectly. * @@ -2837,39 +2886,15 @@ class IRtcEngineEventHandler { (void)error; (void)message; } - /** - * Occurs when the user account is updated. - * - * @param uid The user ID. - * @param userAccount The user account. - */ - virtual void onUserAccountUpdated(uid_t uid, const char* userAccount){ - (void)uid; - (void)userAccount; - } - - /** - * Occurs when local video transcoder stream has an error. - * - * @param stream Stream type of TranscodingVideoStream. - * @param error Error code of VIDEO_TRANSCODER_ERROR. - */ - virtual void onLocalVideoTranscoderError(const TranscodingVideoStream& stream, VIDEO_TRANSCODER_ERROR error){ - (void)stream; - (void)error; - } /** - * Reports the tracing result of video rendering event of the user. - * - * @param uid The user ID. - * @param currentEvent The current event of the tracing result: #MEDIA_TRACE_EVENT. - * @param tracingInfo The tracing result: #VideoRenderingTracingInfo. + * Occurs when the SDK receives RTM setting change response. + * + * @technical preview + * @param code The error code. */ - virtual void onVideoRenderingTracingResult(uid_t uid, MEDIA_TRACE_EVENT currentEvent, VideoRenderingTracingInfo tracingInfo) { - (void)uid; - (void)currentEvent; - (void)tracingInfo; + virtual void onSetRtmFlagResult(int code) { + (void)code; } }; @@ -3027,8 +3052,6 @@ class IVideoDeviceManager { virtual void release() = 0; }; - -class IRtcEngineEventHandlerEx; /** * The context of IRtcEngine. */ @@ -3124,11 +3147,8 @@ struct RtcEngineContext { bool autoRegisterAgoraExtensions; RtcEngineContext() - : eventHandler(NULL), appId(NULL), context(NULL), - channelProfile(CHANNEL_PROFILE_LIVE_BROADCASTING), - license(NULL), - audioScenario(AUDIO_SCENARIO_DEFAULT), - areaCode(AREA_CODE_GLOB), + : eventHandler(NULL), appId(NULL), context(NULL), channelProfile(CHANNEL_PROFILE_LIVE_BROADCASTING), + license(NULL), audioScenario(AUDIO_SCENARIO_DEFAULT), areaCode(AREA_CODE_GLOB), logConfig(), useExternalEglContext(false), domainLimit(false), autoRegisterAgoraExtensions(true) {} }; @@ -3136,6 +3156,8 @@ struct RtcEngineContext { */ class IMetadataObserver { public: + virtual ~IMetadataObserver() {} + /** The metadata type. * * @note We only support video metadata for now. @@ -3163,25 +3185,25 @@ class IMetadataObserver { */ struct Metadata { - /** The User ID that sent the metadata. - * - For the receiver: The user ID of the user who sent the `metadata`. - * - For the sender: Ignore this value. - */ - unsigned int uid; - /** The buffer size of the sent or received `metadata`. - */ - unsigned int size; - /** The buffer address of the sent or received `metadata`. - */ - unsigned char *buffer; - /** The timestamp (ms) of the `metadata`. - * - */ - long long timeStampMs; + /** The User ID that sent the metadata. + * - For the receiver: The user ID of the user who sent the `metadata`. + * - For the sender: Ignore this value. + */ + unsigned int uid; + /** The buffer size of the sent or received `metadata`. + */ + unsigned int size; + /** The buffer address of the sent or received `metadata`. + */ + unsigned char* buffer; + /** The timestamp (ms) of the `metadata`. + * + */ + long long timeStampMs; + + Metadata() : uid(0), size(0), buffer(NULL), timeStampMs(0) {} }; - virtual ~IMetadataObserver() {} - /** Occurs when the SDK requests the maximum size of the metadata. * * @@ -3213,24 +3235,24 @@ class IMetadataObserver { * @note If the receiver is audience, the receiver cannot get the NTP timestamp (ms) * that the metadata sends. */ - virtual void onMetadataReceived(const Metadata &metadata) = 0; + virtual void onMetadataReceived(const Metadata& metadata) = 0; }; -// The error codes for media streaming +// The reason codes for media streaming // GENERATED_JAVA_ENUM_PACKAGE: io.agora.streaming -enum DIRECT_CDN_STREAMING_ERROR { +enum DIRECT_CDN_STREAMING_REASON { // No error occurs. - DIRECT_CDN_STREAMING_ERROR_OK = 0, + DIRECT_CDN_STREAMING_REASON_OK = 0, // A general error occurs (no specified reason). - DIRECT_CDN_STREAMING_ERROR_FAILED = 1, + DIRECT_CDN_STREAMING_REASON_FAILED = 1, // Audio publication error. - DIRECT_CDN_STREAMING_ERROR_AUDIO_PUBLICATION = 2, + DIRECT_CDN_STREAMING_REASON_AUDIO_PUBLICATION = 2, // Video publication error. - DIRECT_CDN_STREAMING_ERROR_VIDEO_PUBLICATION = 3, + DIRECT_CDN_STREAMING_REASON_VIDEO_PUBLICATION = 3, - DIRECT_CDN_STREAMING_ERROR_NET_CONNECT = 4, + DIRECT_CDN_STREAMING_REASON_NET_CONNECT = 4, // Already exist stream name. - DIRECT_CDN_STREAMING_ERROR_BAD_NAME = 5, + DIRECT_CDN_STREAMING_REASON_BAD_NAME = 5, }; // The connection state of media streaming @@ -3289,12 +3311,12 @@ class IDirectCdnStreamingEventHandler { /** * Event callback of direct cdn streaming * @param state Current status - * @param error Error Code + * @param reason Reason Code * @param message Message */ - virtual void onDirectCdnStreamingStateChanged(DIRECT_CDN_STREAMING_STATE state, DIRECT_CDN_STREAMING_ERROR error, const char* message) { + virtual void onDirectCdnStreamingStateChanged(DIRECT_CDN_STREAMING_STATE state, DIRECT_CDN_STREAMING_REASON reason, const char* message) { (void)state; - (void)error; + (void)reason; (void)message; }; @@ -3435,11 +3457,7 @@ struct ExtensionInfo { */ uid_t localUid; - ExtensionInfo() - : mediaSourceType(agora::media::UNKNOWN_MEDIA_SOURCE), - remoteUid(0), - channelId(NULL), - localUid(0) {} + ExtensionInfo() : mediaSourceType(agora::media::UNKNOWN_MEDIA_SOURCE), remoteUid(0), channelId(NULL), localUid(0) {} }; class IMediaPlayer; @@ -3450,7 +3468,6 @@ class IMediaRecorder; * * `IRtcEngine` provides the main methods that your app can call. * - * Before calling other APIs, you must call createAgoraRtcEngine to create an `IRtcEngine` object. */ class IRtcEngine : public agora::base::IEngineBase { public: @@ -3471,14 +3488,12 @@ class IRtcEngine : public agora::base::IEngineBase { * @param sync Determines whether this method is a synchronous call. * - `true`: This method is a synchronous call, which means that the result of this method call * returns after the IRtcEngine object resources are released. Do not call this method - * in any callback generated by the SDK, or it may result in a deadlock. The SDK automatically - * detects the deadlock and turns this method into an asynchronous call, but the test itself takes - * extra time. + * in any callback generated by the SDK, or it may result in a deadlock. * - `false`: This method is an asynchronous call. The result returns immediately even when the * IRtcEngine object resources are not released. * */ - virtual void release(bool sync = false) = 0; + AGORA_CPP_API static void release(bool sync = false); /** * Initializes `IRtcEngine`. @@ -3527,7 +3542,7 @@ class IRtcEngine : public agora::base::IEngineBase { /** * Queries the capacity of the current device codec. * - * @param codecInfo An array of the codec cap information: CodecCapInfo. + * @param codec_info An array of the codec cap information: CodecCapInfo. * @param size The array size. * @return * 0: Success. @@ -3535,6 +3550,17 @@ class IRtcEngine : public agora::base::IEngineBase { */ virtual int queryCodecCapability(CodecCapInfo* codecInfo, int& size) = 0; + /** + * Queries the score of the current device. + * + * @return + * > 0: If the value is greater than 0, it means that the device score has been retrieved and represents the score value. + * Most devices score between 60-100, with higher scores indicating better performance. + * + * < 0: Failure. + */ + virtual int queryDeviceScore() = 0; + /** * Preload a channel. * @@ -3542,8 +3568,7 @@ class IRtcEngine : public agora::base::IEngineBase { * * A successful call of this method will reduce the time of joining the same channel. * - * @since v4.2.2 - * @note + * Note: * 1. The SDK supports preloading up to 20 channels. Once the preloaded channels exceed the limit, the SDK will keep the latest 20 available. * 2. Renew the token of the preloaded channel by calling this method with the same 'channelId' and 'uid'. * @@ -3582,8 +3607,7 @@ class IRtcEngine : public agora::base::IEngineBase { * * A successful call of this method will reduce the time of joining the same channel. * - * @since v4.2.2 - * @note + * Note: * 1. The SDK supports preloading up to 20 channels. Once the preloaded channels exceed the limit, the SDK will keep the latest 20 available. * 2. Renew the token of the preloaded channel by calling this method with the same 'channelId' and 'userAccount'. * @@ -3615,15 +3639,13 @@ class IRtcEngine : public agora::base::IEngineBase { * - -102: The channel name is invalid. You need to pass in a valid channel name in channelId to * preload the channel again. */ - virtual int preloadChannel(const char* token, const char* channelId, const char* userAccount) = 0; + virtual int preloadChannelWithUserAccount(const char* token, const char* channelId, const char* userAccount) = 0; /** * Update token of the preloaded channels. * * An easy way to update all preloaded channels' tokens, if all preloaded channels use the same token. * - * @since v4.2.2 - * @note * If preloaded channels use different tokens, we need to call the 'preloadChannel' method with the same 'channelId' * and 'uid' or 'userAccount' to update the corresponding token. * @@ -3697,8 +3719,7 @@ class IRtcEngine : public agora::base::IEngineBase { * rejoin the channel. * - -121: The user ID is invalid. You need to pass in a valid user ID in uid to rejoin the channel. */ - virtual int joinChannel(const char* token, const char* channelId, const char* info, - uid_t uid) = 0; + virtual int joinChannel(const char* token, const char* channelId, const char* info, uid_t uid) = 0; /** * Joins a channel with media options. @@ -3767,8 +3788,7 @@ class IRtcEngine : public agora::base::IEngineBase { * rejoin the channel. * - -121: The user ID is invalid. You need to pass in a valid user ID in uid to rejoin the channel. */ - virtual int joinChannel(const char* token, const char* channelId, uid_t uid, - const ChannelMediaOptions& options) = 0; + virtual int joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options) = 0; /** * Updates the channel media options after joining the channel. @@ -3947,7 +3967,7 @@ class IRtcEngine : public agora::base::IEngineBase { /** Starts a video call test. * - * @param config Configuration for video call test. + * @param config: configuration for video call test. * * @return * - 0: Success. @@ -4287,6 +4307,26 @@ class IRtcEngine : public agora::base::IEngineBase { */ virtual int setVideoScenario(VIDEO_APPLICATION_SCENARIO_TYPE scenarioType) = 0; + /** + * Sets the video qoe preference. + * + * @since v4.2.1 + * + * You can call this method to set the expected QoE Preference. + * The SDK will optimize the video experience for each preference you set. + * + * + * @param qoePreference The qoe preference type. See #VIDEO_QOE_PREFERENCE_TYPE. + * + * @return + * - 0: Success. + * - < 0: Failure. + * - ERR_FAILED (1): A general error occurs (no specified reason). + * - ERR_NOT_SUPPORTED (4): Unable to set video application scenario. + * - ERR_NOT_INITIALIZED (7): The SDK is not initialized. + */ + virtual int setVideoQoEPreference(VIDEO_QOE_PREFERENCE_TYPE qoePreference) = 0; + /** * Enables the audio. * @@ -4314,7 +4354,7 @@ class IRtcEngine : public agora::base::IEngineBase { * - < 0: Failure. */ virtual int disableAudio() = 0; - + /** * Sets the audio parameters and application scenarios. * @@ -4337,7 +4377,7 @@ class IRtcEngine : public agora::base::IEngineBase { * - < 0: Failure. */ virtual int setAudioProfile(AUDIO_PROFILE_TYPE profile, AUDIO_SCENARIO_TYPE scenario) __deprecated = 0; - + /** * Sets the audio profile. * @@ -4601,6 +4641,17 @@ class IRtcEngine : public agora::base::IEngineBase { */ virtual int setDefaultMuteAllRemoteVideoStreams(bool mute) __deprecated = 0; + /** + * Sets the default stream type of the remote video if the remote user has enabled dual-stream. + * + * @param streamType Sets the default video stream type: #VIDEO_STREAM_TYPE. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int setRemoteDefaultVideoStreamType(VIDEO_STREAM_TYPE streamType) = 0; + /** * Stops or resumes receiving the video stream of a specified user. * @@ -4650,17 +4701,6 @@ class IRtcEngine : public agora::base::IEngineBase { */ virtual int setRemoteVideoSubscriptionOptions(uid_t uid, const VideoSubscriptionOptions &options) = 0; - /** - * Sets the default stream type of the remote video if the remote user has enabled dual-stream. - * - * @param streamType Sets the default video stream type: #VIDEO_STREAM_TYPE. - * - * @return - * - 0: Success. - * - < 0: Failure. - */ - virtual int setRemoteDefaultVideoStreamType(VIDEO_STREAM_TYPE streamType) = 0; - /** * Sets the blocklist of subscribe remote stream audio. * @@ -4840,8 +4880,8 @@ class IRtcEngine : public agora::base::IEngineBase { - < 0: Failure. */ virtual int stopAudioRecording() = 0; - - /** + + /** * Creates a media player source object and return its pointer. If full featured * media player source is supported, it will create it, or it will create a simple * media player. @@ -4869,7 +4909,7 @@ class IRtcEngine : public agora::base::IEngineBase { /** * Creates a media recorder object and return its pointer. * - * @param info The RecorderStreamInfo object. It contains user ID and channel name of user. + * @param info The RecorderStreamInfo object. It contains the user ID and the channel name. * * @return * - The pointer to \ref rtc::IMediaRecorder "IMediaRecorder", @@ -5405,6 +5445,7 @@ class IRtcEngine : public agora::base::IEngineBase { - < 0: Failure. */ virtual int enableSoundPositionIndication(bool enabled) = 0; + /** Sets the sound position and gain of a remote user. When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, such as Battle Royale games. @@ -5441,7 +5482,7 @@ class IRtcEngine : public agora::base::IEngineBase { /** Sets remote user parameters for spatial audio @param uid The ID of the remote user. - @param params Spatial audio parameters. see SpatialAudioParams. + @param param spatial audio parameters: SpatialAudioParams. @return int - 0: Success. @@ -5737,8 +5778,7 @@ class IRtcEngine : public agora::base::IEngineBase { - 0: Success. - -1: Failure. */ - virtual int setLocalVoiceEqualization(AUDIO_EQUALIZATION_BAND_FREQUENCY bandFrequency, - int bandGain) = 0; + virtual int setLocalVoiceEqualization(AUDIO_EQUALIZATION_BAND_FREQUENCY bandFrequency, int bandGain) = 0; /** Sets the local voice reverberation. @@ -5761,6 +5801,7 @@ class IRtcEngine : public agora::base::IEngineBase { - -1(ERR_FAILED): A general error occurs (no specified reason). */ virtual int setHeadphoneEQPreset(HEADPHONE_EQUALIZER_PRESET preset) = 0; + /** Sets the parameters of audio playback effect for remote headphones after remote audio is mixed. @param lowGain The higher the parameter value, the deeper the sound. The value range is [-10,10]. @@ -5876,6 +5917,7 @@ class IRtcEngine : public agora::base::IEngineBase { * - < 0: Failure. */ virtual int setLocalRenderMode(media::base::RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) = 0; + /** * Updates the display mode of the video view of a remote user. * @@ -5936,8 +5978,6 @@ class IRtcEngine : public agora::base::IEngineBase { /** * Enables or disables the dual video stream mode. * - * @deprecated v4.2.0. This method is deprecated. Use setDualStreamMode instead. - * * If dual-stream mode is enabled, the subscriber can choose to receive the high-stream * (high-resolution high-bitrate video stream) or low-stream (low-resolution low-bitrate video stream) * video using \ref setRemoteVideoStreamType "setRemoteVideoStreamType". @@ -5954,8 +5994,6 @@ class IRtcEngine : public agora::base::IEngineBase { /** * Enables or disables the dual video stream mode. * - * @deprecated v4.2.0. This method is deprecated. Use setDualStreamMode instead. - * * If dual-stream mode is enabled, the subscriber can choose to receive the high-stream * (high-resolution high-bitrate video stream) or low-stream (low-resolution low-bitrate video stream) * video using \ref setRemoteVideoStreamType "setRemoteVideoStreamType". @@ -6000,8 +6038,7 @@ class IRtcEngine : public agora::base::IEngineBase { * - 0: Success. * - < 0: Failure. */ - virtual int setDualStreamMode(SIMULCAST_STREAM_MODE mode, - const SimulcastStreamConfig& streamConfig) = 0; + virtual int setDualStreamMode(SIMULCAST_STREAM_MODE mode, const SimulcastStreamConfig& streamConfig) = 0; /** * Sets the external audio track. @@ -6230,7 +6267,7 @@ class IRtcEngine : public agora::base::IEngineBase { * - 0: Success. * - < 0: Failure. */ - virtual int adjustUserPlaybackSignalVolume(unsigned int uid, int volume) = 0; + virtual int adjustUserPlaybackSignalVolume(uid_t uid, int volume) = 0; /** Sets the fallback option for the published video stream based on the network conditions. @@ -6287,6 +6324,59 @@ class IRtcEngine : public agora::base::IEngineBase { */ virtual int setHighPriorityUserList(uid_t* uidList, int uidNum, STREAM_FALLBACK_OPTIONS option) = 0; + /** + * Enable/Disable an extension. + * By calling this function, you can dynamically enable/disable the extension without changing the pipeline. + * For example, enabling/disabling Extension_A means the data will be adapted/bypassed by Extension_A. + * + * NOTE: For compatibility reasons, if you haven't call registerExtension, + * enableExtension will automatically register the specified extension. + * We suggest you call registerExtension explicitly. + * + * @param provider The name of the extension provider, e.g. agora.io. + * @param extension The name of the extension, e.g. agora.beauty. + * @param extensionInfo The information for extension. + * @param enable Whether to enable the extension: + * - true: (Default) Enable the extension. + * - false: Disable the extension. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int enableExtension(const char* provider, const char* extension, const ExtensionInfo& extensionInfo, bool enable = true) = 0; + + /** + * Sets the properties of an extension. + * + * @param provider The name of the extension provider, e.g. agora.io. + * @param extension The name of the extension, e.g. agora.beauty. + * @param extensionInfo The information for extension. + * @param key The key of the extension. + * @param value The JSON formatted value of the extension key. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int setExtensionProperty(const char* provider, const char* extension, const ExtensionInfo& extensionInfo, const char* key, const char* value) = 0; + + /** + * Gets the properties of an extension. + * + * @param provider The name of the extension provider, e.g. agora.io. + * @param extension The name of the extension, e.g. agora.beauty. + * @param extensionInfo The information for extension. + * @param key The key of the extension. + * @param value The value of the extension key. + * @param buf_len Maximum length of the JSON string indicating the extension property. + * + * @return + * - 0: Success. + * - < 0: Failure. + */ + virtual int getExtensionProperty(const char* provider, const char* extension, const ExtensionInfo& extensionInfo, const char* key, char* value, int buf_len) = 0; + /** Enables loopback recording. * * If you enable loopback recording, the output of the default sound card is mixed into @@ -6370,8 +6460,7 @@ class IRtcEngine : public agora::base::IEngineBase { * - 0: Success. * - < 0: Failure. */ - virtual int setExtensionProviderProperty( - const char* provider, const char* key, const char* value) = 0; + virtual int setExtensionProviderProperty(const char* provider, const char* key, const char* value) = 0; /** * Registers an extension. Normally you should call this function immediately after engine initialization. @@ -6385,8 +6474,7 @@ class IRtcEngine : public agora::base::IEngineBase { * - 0: Success. * - < 0: Failure. */ - virtual int registerExtension(const char* provider, const char* extension, - agora::media::MEDIA_SOURCE_TYPE type = agora::media::UNKNOWN_MEDIA_SOURCE) = 0; + virtual int registerExtension(const char* provider, const char* extension, agora::media::MEDIA_SOURCE_TYPE type = agora::media::UNKNOWN_MEDIA_SOURCE) = 0; /** * Enable/Disable an extension. @@ -6408,30 +6496,7 @@ class IRtcEngine : public agora::base::IEngineBase { * - 0: Success. * - < 0: Failure. */ - virtual int enableExtension( - const char* provider, const char* extension, bool enable=true, agora::media::MEDIA_SOURCE_TYPE type = agora::media::UNKNOWN_MEDIA_SOURCE) = 0; - - /** - * Enable/Disable an extension. - * By calling this function, you can dynamically enable/disable the extension without changing the pipeline. - * For example, enabling/disabling Extension_A means the data will be adapted/bypassed by Extension_A. - * - * NOTE: For compatibility reasons, if you haven't call registerExtension, - * enableExtension will automatically register the specified extension. - * We suggest you call registerExtension explicitly. - * - * @param provider The name of the extension provider, e.g. agora.io. - * @param extension The name of the extension, e.g. agora.beauty. - * @param extensionInfo The information for extension. - * @param enable Whether to enable the extension: - * - true: (Default) Enable the extension. - * - false: Disable the extension. - * - * @return - * - 0: Success. - * - < 0: Failure. - */ - virtual int enableExtension(const char* provider, const char* extension, const ExtensionInfo& extensionInfo, bool enable = true) = 0; + virtual int enableExtension(const char* provider, const char* extension, bool enable=true, agora::media::MEDIA_SOURCE_TYPE type = agora::media::UNKNOWN_MEDIA_SOURCE) = 0; /** * Sets the properties of an extension. @@ -6466,37 +6531,6 @@ class IRtcEngine : public agora::base::IEngineBase { const char* provider, const char* extension, const char* key, char* value, int buf_len, agora::media::MEDIA_SOURCE_TYPE type = agora::media::UNKNOWN_MEDIA_SOURCE) = 0; - /** - * Sets the properties of an extension. - * - * @param provider The name of the extension provider, e.g. agora.io. - * @param extension The name of the extension, e.g. agora.beauty. - * @param extensionInfo The information for extension. - * @param key The key of the extension. - * @param value The JSON formatted value of the extension key. - * - * @return - * - 0: Success. - * - < 0: Failure. - */ - virtual int setExtensionProperty(const char* provider, const char* extension, const ExtensionInfo& extensionInfo, const char* key, const char* value) = 0; - - /** - * Gets the properties of an extension. - * - * @param provider The name of the extension provider, e.g. agora.io. - * @param extension The name of the extension, e.g. agora.beauty. - * @param extensionInfo The information for extension. - * @param key The key of the extension. - * @param value The value of the extension key. - * @param buf_len Maximum length of the JSON string indicating the extension property. - * - * @return - * - 0: Success. - * - < 0: Failure. - */ - virtual int getExtensionProperty(const char* provider, const char* extension, const ExtensionInfo& extensionInfo, const char* key, char* value, int buf_len) = 0; - /** Sets the camera capture configuration. * @note Call this method before enabling the local camera. * That said, you can call this method before calling \ref IRtcEngine::joinChannel "joinChannel", @@ -6510,7 +6544,6 @@ class IRtcEngine : public agora::base::IEngineBase { */ virtual int setCameraCapturerConfiguration(const CameraCapturerConfiguration& config) = 0; - /** * Get an custom video track id created by internal,which could used to publish or preview * @@ -6549,9 +6582,7 @@ class IRtcEngine : public agora::base::IEngineBase { */ virtual int destroyCustomEncodedVideoTrack(video_track_id_t video_track_id) = 0; - #if defined(__ANDROID__) || (defined(__APPLE__) && TARGET_OS_IOS) - /** * Switches between front and rear cameras. * @@ -6693,7 +6724,7 @@ class IRtcEngine : public agora::base::IEngineBase { */ virtual int setCameraExposurePosition(float positionXinView, float positionYinView) = 0; - /** + /** * Returns whether exposure value adjusting is supported by the current device. * Exposure compensation is in auto exposure mode. * @since v4.2.2 @@ -6812,9 +6843,8 @@ class IRtcEngine : public agora::base::IEngineBase { */ virtual bool isSpeakerphoneEnabled() = 0; - /** Select preferred route for android communication mode + /** Select preferred route for android communication mode - @since v4.2.2 @param route The preferred route. For example, when a Bluetooth headset is connected, you can use this API to switch the route to a wired headset. @return meanless, route switch result is pass through CallbackOnRoutingChanged @@ -6892,7 +6922,6 @@ class IRtcEngine : public agora::base::IEngineBase { #endif // __APPLE__ && TARGET_OS_MAC && !TARGET_OS_IPHONE #if defined(_WIN32) - /** * Shares the whole or part of a screen by specifying the screen rect. * @@ -6919,8 +6948,7 @@ class IRtcEngine : public agora::base::IEngineBase { virtual int startScreenCaptureByScreenRect(const Rectangle& screenRect, const Rectangle& regionRect, const ScreenCaptureParameters& captureParams) __deprecated = 0; - -#endif // _WIN32 +#endif #if defined(__ANDROID__) /** @@ -7104,8 +7132,7 @@ class IRtcEngine : public agora::base::IEngineBase { * - 0: Success. * - < 0: Failure. */ - virtual int rate(const char* callId, int rating, - const char* description) = 0; // 0~10 + virtual int rate(const char* callId, int rating, const char* description) = 0; // 0~10 /** * Allows a user to complain about the call quality. @@ -7177,6 +7204,10 @@ class IRtcEngine : public agora::base::IEngineBase { * - < 0: Failure. */ virtual int updateRtmpTranscoding(const LiveTranscoding& transcoding) = 0; + + virtual int startLocalVideoTranscoder(const LocalTranscoderConfiguration& config) = 0; + virtual int updateLocalTranscoderConfiguration(const LocalTranscoderConfiguration& config) = 0; + /** Stop an RTMP stream with transcoding or without transcoding from the CDN. (CDN live only.) * This method removes the RTMP URL address (added by the \ref IRtcEngine::startRtmpStreamWithoutTranscoding "startRtmpStreamWithoutTranscoding" method @@ -7197,9 +7228,6 @@ class IRtcEngine : public agora::base::IEngineBase { */ virtual int stopRtmpStream(const char* url) = 0; - - virtual int startLocalVideoTranscoder(const LocalTranscoderConfiguration& config) = 0; - virtual int updateLocalTranscoderConfiguration(const LocalTranscoderConfiguration& config) = 0; virtual int stopLocalVideoTranscoder() = 0; /** * Starts video capture with a camera. @@ -7402,7 +7430,7 @@ class IRtcEngine : public agora::base::IEngineBase { * - Returns 0: Success. * - < 0: Failure. */ - virtual int createDataStream(int* streamId, DataStreamConfig& config) = 0; + virtual int createDataStream(int* streamId, const DataStreamConfig& config) = 0; /** Sends a data stream. * @@ -7457,7 +7485,7 @@ class IRtcEngine : public agora::base::IEngineBase { - 0: Success. - < 0: Failure. */ - virtual int addVideoWatermark(const RtcImage& watermark) = 0; + virtual int addVideoWatermark(const RtcImage& watermark) __deprecated = 0; /** Adds a watermark image to the local video. @@ -7544,8 +7572,7 @@ class IRtcEngine : public agora::base::IEngineBase { * To try out this function, contact [support@agora.io](mailto:support@agora.io) * and discuss the format of customized messages with us. */ - virtual int sendCustomReportMessage( - const char* id, const char* category, const char* event, const char* label, int value) = 0; + virtual int sendCustomReportMessage(const char* id, const char* category, const char* event, const char* label, int value) = 0; /** Registers the metadata observer. @@ -7588,13 +7615,12 @@ class IRtcEngine : public agora::base::IEngineBase { "pre_play_proc", "at_playout", "atw_playout" for audio receiving. */ + virtual int startAudioFrameDump(const char* channel_id, uid_t uid, const char* location, const char* uuid, const char* passwd, long duration_ms, bool auto_upload) = 0; - virtual int startAudioFrameDump(const char* channel_id, uid_t user_id, const char* location, - const char* uuid, const char* passwd, long duration_ms, bool auto_upload) = 0; /** * Stops the audio frame dump. */ - virtual int stopAudioFrameDump(const char* channel_id, uid_t user_id, const char* location) = 0; + virtual int stopAudioFrameDump(const char* channel_id, uid_t uid, const char* location) = 0; /** * Enables/Disables Agora AI Noise Suppression(AINS) with preset mode. @@ -7676,8 +7702,7 @@ class IRtcEngine : public agora::base::IEngineBase { * - 0: Success. * - < 0: Failure. */ - virtual int joinChannelWithUserAccount(const char* token, const char* channelId, - const char* userAccount) = 0; + virtual int joinChannelWithUserAccount(const char* token, const char* channelId, const char* userAccount) = 0; /** Joins the channel with a user account. * @@ -7710,8 +7735,7 @@ class IRtcEngine : public agora::base::IEngineBase { * - 0: Success. * - < 0: Failure. */ - virtual int joinChannelWithUserAccount(const char* token, const char* channelId, - const char* userAccount, const ChannelMediaOptions& options) = 0; + virtual int joinChannelWithUserAccount(const char* token, const char* channelId, const char* userAccount, const ChannelMediaOptions& options) = 0; /** Joins the channel with a user account. * @@ -7786,157 +7810,73 @@ class IRtcEngine : public agora::base::IEngineBase { * - < 0: Failure. */ virtual int getUserInfoByUid(uid_t uid, rtc::UserInfo* userInfo) = 0; - /** Starts relaying media streams across channels or updates the channels for media relay. - * - * After a successful method call, the SDK triggers the - * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged - * "onChannelMediaRelayStateChanged" and - * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayEvent - * "onChannelMediaRelayEvent" callbacks, and these callbacks return the - * state and events of the media stream relay. - * - If the - * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged - * "onChannelMediaRelayStateChanged" callback returns - * #RELAY_STATE_RUNNING (2) and #RELAY_OK (0), and the - * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayEvent - * "onChannelMediaRelayEvent" callback returns - * #RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL (4), the host starts - * sending data to the destination channel. - * - If the - * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged - * "onChannelMediaRelayStateChanged" callback returns - * #RELAY_STATE_FAILURE (3), an exception occurs during the media stream - * relay. - * - * @note - * - Call this method after the \ref joinChannel() "joinChannel" method. - * - This method takes effect only when you are a host in a - * `LIVE_BROADCASTING` channel. - * - Contact sales-us@agora.io before implementing this function. - * - We do not support string user accounts in this API. - * - * @since v4.2.0 - * @param configuration The configuration of the media stream relay: - * ChannelMediaRelayConfiguration. - * - * @return - * - 0: Success. - * - < 0: Failure. - * - -1(ERR_FAILED): A general error occurs (no specified reason). - * - -2(ERR_INVALID_ARGUMENT): The argument is invalid. - * - -5(ERR_REFUSED): The request is rejected. - * - -8(ERR_INVALID_STATE): The current status is invalid, only allowed to be called when the role is the broadcaster. - */ - virtual int startOrUpdateChannelMediaRelay(const ChannelMediaRelayConfiguration &configuration) = 0; - /** Starts to relay media streams across channels. - * - * After a successful method call, the SDK triggers the - * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged - * "onChannelMediaRelayStateChanged" and - * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayEvent - * "onChannelMediaRelayEvent" callbacks, and these callbacks return the - * state and events of the media stream relay. - * - If the - * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged - * "onChannelMediaRelayStateChanged" callback returns - * #RELAY_STATE_RUNNING (2) and #RELAY_OK (0), and the - * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayEvent - * "onChannelMediaRelayEvent" callback returns - * #RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL (4), the host starts - * sending data to the destination channel. - * - If the - * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged - * "onChannelMediaRelayStateChanged" callback returns - * #RELAY_STATE_FAILURE (3), an exception occurs during the media stream - * relay. - * - * @note - * - Call this method after the \ref joinChannel() "joinChannel" method. - * - This method takes effect only when you are a host in a - * `LIVE_BROADCASTING` channel. - * - After a successful method call, if you want to call this method - * again, ensure that you call the - * \ref stopChannelMediaRelay() "stopChannelMediaRelay" method to quit the - * current relay. - * - Contact sales-us@agora.io before implementing this function. - * - We do not support string user accounts in this API. - * - * @deprecated v4.2.0 Use `startOrUpdateChannelMediaRelay` instead. - * @param configuration The configuration of the media stream relay: - * ChannelMediaRelayConfiguration. - * - * @return - * - 0: Success. - * - < 0: Failure. - * - -1(ERR_FAILED): A general error occurs (no specified reason). - * - -2(ERR_INVALID_ARGUMENT): The argument is invalid. - * - -5(ERR_REFUSED): The request is rejected. - * - -8(ERR_INVALID_STATE): The current status is invalid, only allowed to be called when the role is the broadcaster. - */ - virtual int startChannelMediaRelay(const ChannelMediaRelayConfiguration &configuration) __deprecated = 0; - - /** Updates the channels for media stream relay. After a successful - * \ref startChannelMediaRelay() "startChannelMediaRelay" method call, if - * you want to relay the media stream to more channels, or leave the - * current relay channel, you can call the - * \ref updateChannelMediaRelay() "updateChannelMediaRelay" method. - * - * After a successful method call, the SDK triggers the - * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayEvent - * "onChannelMediaRelayEvent" callback with the - * #RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL (7) state code. - * - * @note - * Call this method after the - * \ref startChannelMediaRelay() "startChannelMediaRelay" method to update - * the destination channel. - * - * @deprecated v4.2.0 Use `startOrUpdateChannelMediaRelay` instead. - * @param configuration The media stream relay configuration: - * ChannelMediaRelayConfiguration. - * - * @return - * - 0: Success. - * - < 0: Failure. - * - -1(ERR_FAILED): A general error occurs (no specified reason). - * - -2(ERR_INVALID_ARGUMENT): The argument is invalid. - * - -5(ERR_REFUSED): The request is rejected. - * - -7(ERR_NOT_INITIALIZED): cross channel media streams are not relayed. - */ - virtual int updateChannelMediaRelay(const ChannelMediaRelayConfiguration &configuration) __deprecated = 0; + /** Starts relaying media streams across channels or updates the channels for media relay. + * + * After a successful method call, the SDK triggers the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback, and this callback return the state of the media stream relay. + * - If the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback returns + * #RELAY_STATE_RUNNING (2) and #RELAY_OK (0), the host starts sending data to the destination channel. + * - If the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback returns + * #RELAY_STATE_FAILURE (3), an exception occurs during the media stream + * relay. + * + * @note + * - Call this method after the \ref joinChannel() "joinChannel" method. + * - This method takes effect only when you are a host in a + * `LIVE_BROADCASTING` channel. + * - Contact sales-us@agora.io before implementing this function. + * - We do not support string user accounts in this API. + * + * @since v4.2.0 + * @param configuration The configuration of the media stream relay: + * ChannelMediaRelayConfiguration. + * + * @return + * - 0: Success. + * - < 0: Failure. + * - -1(ERR_FAILED): A general error occurs (no specified reason). + * - -2(ERR_INVALID_ARGUMENT): The argument is invalid. + * - -5(ERR_REFUSED): The request is rejected. + * - -8(ERR_INVALID_STATE): The current status is invalid, only allowed to be called when the role is the broadcaster. + **/ + virtual int startOrUpdateChannelMediaRelay(const ChannelMediaRelayConfiguration &configuration) = 0; - /** Stops the media stream relay. - * - * Once the relay stops, the host quits all the destination - * channels. - * - * After a successful method call, the SDK triggers the - * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged - * "onChannelMediaRelayStateChanged" callback. If the callback returns - * #RELAY_STATE_IDLE (0) and #RELAY_OK (0), the host successfully - * stops the relay. - * - * @note - * If the method call fails, the SDK triggers the - * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged - * "onChannelMediaRelayStateChanged" callback with the - * #RELAY_ERROR_SERVER_NO_RESPONSE (2) or - * #RELAY_ERROR_SERVER_CONNECTION_LOST (8) state code. You can leave the - * channel by calling the \ref leaveChannel() "leaveChannel" method, and - * the media stream relay automatically stops. - * - * @return - * - 0: Success. - * - < 0: Failure. - * - -1(ERR_FAILED): A general error occurs (no specified reason). - * - -2(ERR_INVALID_ARGUMENT): The argument is invalid. - * - -5(ERR_REFUSED): The request is rejected. - * - -7(ERR_NOT_INITIALIZED): cross channel media streams are not relayed. - */ + /** Stops the media stream relay. + * + * Once the relay stops, the host quits all the destination + * channels. + * + * After a successful method call, the SDK triggers the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback. If the callback returns + * #RELAY_STATE_IDLE (0) and #RELAY_OK (0), the host successfully + * stops the relay. + * + * @note + * If the method call fails, the SDK triggers the + * \ref agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged + * "onChannelMediaRelayStateChanged" callback with the + * #RELAY_ERROR_SERVER_NO_RESPONSE (2) or + * #RELAY_ERROR_SERVER_CONNECTION_LOST (8) state code. You can leave the + * channel by calling the \ref leaveChannel() "leaveChannel" method, and + * the media stream relay automatically stops. + * + * @return + * - 0: Success. + * - < 0: Failure. + * - -1(ERR_FAILED): A general error occurs (no specified reason). + * - -2(ERR_INVALID_ARGUMENT): The argument is invalid. + * - -5(ERR_REFUSED): The request is rejected. + * - -7(ERR_NOT_INITIALIZED): cross channel media streams are not relayed. + */ virtual int stopChannelMediaRelay() = 0; - /** pause the channels for media stream relay. * @return * - 0: Success. @@ -8058,6 +7998,7 @@ class IRtcEngine : public agora::base::IEngineBase { * - < 0: Failure. */ virtual int configRhythmPlayer(const AgoraRhythmPlayerConfig& config) = 0; + /** * Takes a snapshot of a video stream. * @@ -8088,6 +8029,7 @@ class IRtcEngine : public agora::base::IEngineBase { * - < 0 : Failure. */ virtual int takeSnapshot(uid_t uid, const char* filePath) = 0; + /** Enables the content inspect. @param enabled Whether to enable content inspect: - `true`: Yes. @@ -8167,7 +8109,7 @@ class IRtcEngine : public agora::base::IEngineBase { - 0: Success - < 0: Failure */ - virtual int setAdvancedAudioOptions(AdvancedAudioOptions &options, int sourceType = 0) = 0; + virtual int setAdvancedAudioOptions(AdvancedAudioOptions& options, int sourceType = 0) = 0; /** Bind local user and a remote user as an audio&video sync group. The remote user is defined by cid and uid. * There’s a usage limit that local user must be a video stream sender. On the receiver side, media streams from same sync group will be time-synced @@ -8295,28 +8237,13 @@ class IRtcEngine : public agora::base::IEngineBase { /** * @brief Whether the target feature is available for the device. - * @since v4.2.0 + * @since v4.3.0 * @param type The feature type. See FeatureType. * @return * - true: available. * - false: not available. */ virtual bool isFeatureAvailableOnDevice(FeatureType type) = 0; - -}; - -class AAudioDeviceManager : public agora::util::AutoPtr { - public: - AAudioDeviceManager(IRtcEngine* engine) { - queryInterface(engine, AGORA_IID_AUDIO_DEVICE_MANAGER); - } -}; - -class AVideoDeviceManager : public agora::util::AutoPtr { - public: - AVideoDeviceManager(IRtcEngine* engine) { - queryInterface(engine, AGORA_IID_VIDEO_DEVICE_MANAGER); - } }; // The following types are either deprecated or not implmented yet. @@ -8493,6 +8420,20 @@ enum VIDEO_PROFILE_TYPE { VIDEO_PROFILE_DEFAULT = VIDEO_PROFILE_LANDSCAPE_360P, }; +class AAudioDeviceManager : public agora::util::AutoPtr { + public: + AAudioDeviceManager(IRtcEngine* engine) { + queryInterface(engine, AGORA_IID_AUDIO_DEVICE_MANAGER); + } +}; + +class AVideoDeviceManager : public agora::util::AutoPtr { + public: + AVideoDeviceManager(IRtcEngine* engine) { + queryInterface(engine, AGORA_IID_VIDEO_DEVICE_MANAGER); + } +}; + } // namespace rtc } // namespace agora diff --git a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtcEngineEx.h b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtcEngineEx.h index 32690cffe..e9826d78f 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtcEngineEx.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtcEngineEx.h @@ -91,6 +91,7 @@ class IRtcEngineEventHandlerEx : public IRtcEngineEventHandler { using IRtcEngineEventHandler::onNetworkTypeChanged; using IRtcEngineEventHandler::onEncryptionError; using IRtcEngineEventHandler::onUploadLogResult; + using IRtcEngineEventHandler::onUserInfoUpdated; using IRtcEngineEventHandler::onUserAccountUpdated; using IRtcEngineEventHandler::onAudioSubscribeStateChanged; using IRtcEngineEventHandler::onVideoSubscribeStateChanged; @@ -98,6 +99,8 @@ class IRtcEngineEventHandlerEx : public IRtcEngineEventHandler { using IRtcEngineEventHandler::onVideoPublishStateChanged; using IRtcEngineEventHandler::onSnapshotTaken; using IRtcEngineEventHandler::onVideoRenderingTracingResult; + using IRtcEngineEventHandler::onSetRtmFlagResult; + using IRtcEngineEventHandler::onTranscodedStreamLayoutInfo; virtual const char* eventHandlerType() const { return "event_handler_ex"; } @@ -322,13 +325,13 @@ class IRtcEngineEventHandlerEx : public IRtcEngineEventHandler { * you to troubleshoot issues when exceptions occur. * * The SDK triggers the onLocalVideoStateChanged callback with the state code of `LOCAL_VIDEO_STREAM_STATE_FAILED` - * and error code of `LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE` in the following situations: + * and error code of `LOCAL_VIDEO_STREAM_REASON_CAPTURE_FAILURE` in the following situations: * - The app switches to the background, and the system gets the camera resource. * - The camera starts normally, but does not output video for four consecutive seconds. * * When the camera outputs the captured video frames, if the video frames are the same for 15 * consecutive frames, the SDK triggers the `onLocalVideoStateChanged` callback with the state code - * of `LOCAL_VIDEO_STREAM_STATE_CAPTURING` and error code of `LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE`. + * of `LOCAL_VIDEO_STREAM_STATE_CAPTURING` and error code of `LOCAL_VIDEO_STREAM_REASON_CAPTURE_FAILURE`. * Note that the video frame duplication detection is only available for video frames with a resolution * greater than 200 × 200, a frame rate greater than or equal to 10 fps, and a bitrate less than 20 Kbps. * @@ -338,14 +341,14 @@ class IRtcEngineEventHandlerEx : public IRtcEngineEventHandler { * * @param connection The RtcConnection object. * @param state The state of the local video. See #LOCAL_VIDEO_STREAM_STATE. - * @param error The detailed error information. See #LOCAL_VIDEO_STREAM_ERROR. + * @param reason The detailed error information. See #LOCAL_VIDEO_STREAM_REASON. */ virtual void onLocalVideoStateChanged(const RtcConnection& connection, LOCAL_VIDEO_STREAM_STATE state, - LOCAL_VIDEO_STREAM_ERROR errorCode) { + LOCAL_VIDEO_STREAM_REASON reason) { (void)connection; (void)state; - (void)errorCode; + (void)reason; } /** @@ -762,13 +765,13 @@ class IRtcEngineEventHandlerEx : public IRtcEngineEventHandler { * * @param connection The RtcConnection object. * @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. + * @param reason The reason information of the local audio. + * See #LOCAL_AUDIO_STREAM_REASON. */ - virtual void onLocalAudioStateChanged(const RtcConnection& connection, LOCAL_AUDIO_STREAM_STATE state, LOCAL_AUDIO_STREAM_ERROR error) { + virtual void onLocalAudioStateChanged(const RtcConnection& connection, LOCAL_AUDIO_STREAM_STATE state, LOCAL_AUDIO_STREAM_REASON reason) { (void)connection; (void)state; - (void)error; + (void)reason; } /** Occurs when the remote audio state changes. @@ -976,6 +979,7 @@ class IRtcEngineEventHandlerEx : public IRtcEngineEventHandler { (void)success; (void)reason; } + /** * Occurs when the user account is updated. * @@ -983,10 +987,10 @@ class IRtcEngineEventHandlerEx : public IRtcEngineEventHandler { * @param remoteUid The user ID. * @param userAccount The user account. */ - virtual void onUserAccountUpdated(const RtcConnection& connection, uid_t remoteUid, const char* userAccount){ + virtual void onUserAccountUpdated(const RtcConnection& connection, uid_t remoteUid, const char* remoteUserAccount){ (void)connection; (void)remoteUid; - (void)userAccount; + (void)remoteUserAccount; } /** Reports the result of taking a video snapshot. @@ -1027,6 +1031,34 @@ class IRtcEngineEventHandlerEx : public IRtcEngineEventHandler { (void)currentEvent; (void)tracingInfo; } + + /** + * Occurs when receive use rtm response. + * + * @param connection The RtcConnection object. + * @param code The error code: + */ + virtual void onSetRtmFlagResult(const RtcConnection& connection, int code) { + (void)connection; + (void)code; + } + /** + * Occurs when receive a video transcoder stream which has video layout info. + * + * @param connection The RtcConnection object. + * @param uid user id of the transcoded stream. + * @param width width of the transcoded stream. + * @param height height of the transcoded stream. + * @param layoutCount count of layout info in the transcoded stream. + * @param layoutlist video layout info list of the transcoded stream. + */ + virtual void onTranscodedStreamLayoutInfo(const RtcConnection& connection, uid_t uid, int width, int height, int layoutCount,const VideoLayout* layoutlist) { + (void)uid; + (void)width; + (void)height; + (void)layoutCount; + (void)layoutlist; + } }; class IRtcEngineEx : public IRtcEngine { @@ -1488,7 +1520,7 @@ class IRtcEngineEx : public IRtcEngine { * - 0: Success. * - < 0: Failure. */ - virtual int adjustUserPlaybackSignalVolumeEx(unsigned int uid, int volume, const RtcConnection& connection) = 0; + virtual int adjustUserPlaybackSignalVolumeEx(uid_t uid, int volume, const RtcConnection& connection) = 0; /** Gets the current connection state of the SDK. @param connection The RtcConnection object. @@ -1561,7 +1593,7 @@ class IRtcEngineEx : public IRtcEngine { * - Returns 0: Success. * - < 0: Failure. */ - virtual int createDataStreamEx(int* streamId, DataStreamConfig& config, const RtcConnection& connection) = 0; + virtual int createDataStreamEx(int* streamId, const DataStreamConfig& config, const RtcConnection& connection) = 0; /** Sends a data stream. * * After calling \ref IRtcEngine::createDataStream "createDataStream", you can call @@ -1729,35 +1761,6 @@ class IRtcEngineEx : public IRtcEngine { */ virtual int startOrUpdateChannelMediaRelayEx(const ChannelMediaRelayConfiguration& configuration, const RtcConnection& connection) = 0; - /** Starts to relay media streams across channels. - * - * @deprecated v4.2.0 Use `startOrUpdateChannelMediaRelayEx` instead. - * @param configuration The configuration of the media stream relay:ChannelMediaRelayConfiguration. - * @param connection RtcConnection. - * @return - * - 0: Success. - * - < 0: Failure. - * - -1(ERR_FAILED): A general error occurs (no specified reason). - * - -2(ERR_INVALID_ARGUMENT): The argument is invalid. - * - -5(ERR_REFUSED): The request is rejected. - * - -8(ERR_INVALID_STATE): The current status is invalid, only allowed to be called when the role is the broadcaster. - */ - virtual int startChannelMediaRelayEx(const ChannelMediaRelayConfiguration& configuration, const RtcConnection& connection) __deprecated = 0; - - /** Updates the channels for media stream relay - * @deprecated v4.2.0 Use `startOrUpdateChannelMediaRelayEx` instead. - * @param configuration The media stream relay configuration: ChannelMediaRelayConfiguration. - * @param connection RtcConnection. - * @return - * - 0: Success. - * - < 0: Failure. - * - -1(ERR_FAILED): A general error occurs (no specified reason). - * - -2(ERR_INVALID_ARGUMENT): The argument is invalid. - * - -5(ERR_REFUSED): The request is rejected. - * - -7(ERR_NOT_INITIALIZED): cross channel media streams are not relayed. - */ - virtual int updateChannelMediaRelayEx(const ChannelMediaRelayConfiguration& configuration, const RtcConnection& connection) __deprecated = 0; - /** Stops the media stream relay. * * Once the relay stops, the host quits all the destination @@ -1942,6 +1945,16 @@ class IRtcEngineEx : public IRtcEngine { - -7(ERR_NOT_INITIALIZED): The SDK is not initialized. Initialize the `IRtcEngine` instance before calling this method. */ virtual int startMediaRenderingTracingEx(const RtcConnection& connection) = 0; + + /** Provides the technical preview functionalities or special customizations by configuring the SDK with JSON options. + @since v4.3.0 + @param connection The connection information. See RtcConnection. + @param parameters Pointer to the set parameters in a JSON string. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int setParametersEx(const RtcConnection& connection, const char* parameters) = 0; }; } // namespace rtc diff --git a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraSpatialAudio.h b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraSpatialAudio.h index 51b382575..f4a3ba6a3 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraSpatialAudio.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraSpatialAudio.h @@ -4,8 +4,7 @@ // Copyright (c) 2019 Agora.io. All rights reserved. // -#ifndef AGORA_SPATIAL_AUDIO_H -#define AGORA_SPATIAL_AUDIO_H +#pragma once #include #include "AgoraBase.h" @@ -22,7 +21,6 @@ struct RemoteVoicePositionInfo { float position[3]; // The forward vector of remote voice, (x, y, z). When it's not set, the vector is forward to listner. float forward[3]; - RemoteVoicePositionInfo() = default; }; struct SpatialAudioZone { @@ -44,7 +42,6 @@ struct SpatialAudioZone { float upLength; //the audio attenuation of zone float audioAttenuation; - SpatialAudioZone() = default; }; /** The definition of LocalSpatialAudioConfig @@ -60,15 +57,93 @@ struct LocalSpatialAudioConfig { /** The IBaseSpatialAudioEngine class provides the common methods of ICloudSpatialAudioEngine and ILocalSpatialAudioEngine. */ -class IBaseSpatialAudioEngine: public RefCountInterface { +class ILocalSpatialAudioEngine: public RefCountInterface { protected: - virtual ~IBaseSpatialAudioEngine() {} + virtual ~ILocalSpatialAudioEngine() {} public: /** * Releases all the resources occupied by spatial audio engine. */ virtual void release() = 0; + + /** + * Initializes the ILocalSpatialAudioEngine object and allocates the internal resources. + * + * @note Ensure that you call IRtcEngine::queryInterface and initialize before calling any other ILocalSpatialAudioEngine APIs. + * + * @param config The pointer to the LocalSpatialAudioConfig. See #LocalSpatialAudioConfig. + * + * @return + * - 0: Success. + * - <0: Failure. + */ + virtual int initialize(const LocalSpatialAudioConfig& config) = 0; + /** + * Updates the position information of remote user. You should call it when remote user whose role is broadcaster moves. + * + * @param uid The remote user ID. It should be the same as RTC channel remote user id. + * @param posInfo The position information of remote user. See #RemoteVoicePositionInfo. + * @return + * - 0: Success. + * - <0: Failure. + */ + virtual int updateRemotePosition(uid_t uid, const RemoteVoicePositionInfo &posInfo) = 0; + /** + * Updates the position of remote user. It's supposed to use with IRtcEngineEx::joinChannelEx. + * + * @param uid The remote user ID. It should be the same as RTC channel remote user id. + * @param posInfo The position information of remote user. See #RemoteVoicePositionInfo. + * @param connection The RTC connection whose spatial audio effect you want to update. See #RtcConnection. + * @return + * - 0: Success. + * - <0: Failure. + */ + virtual int updateRemotePositionEx(uid_t uid, const RemoteVoicePositionInfo &posInfo, const RtcConnection& connection) = 0; + /** + * Remove the position information of remote user. You should call it when remote user called IRtcEngine::leaveChannel. + * + * @param uid The remote user ID. It should be the same as RTC channel remote user id. + * @return + * - 0: Success. + * - <0: Failure. + */ + virtual int removeRemotePosition(uid_t uid) = 0; + /** + * Remove the position information of remote user. It's supposed to use with IRtcEngineEx::joinChannelEx. + * + * @param uid The remote user ID. It should be the same as RTC channel remote user id. + * @param connection The RTC connection whose spatial audio effect you want to update. See #RtcConnection. + * @return + * - 0: Success. + * - <0: Failure. + */ + virtual int removeRemotePositionEx(uid_t uid, const RtcConnection& connection) = 0; + /** + * Clear the position informations of remote users. It's supposed to use with IRtcEngineEx::joinChannelEx. + * + * @return + * - 0: Success. + * - <0: Failure. + */ + virtual int clearRemotePositionsEx(const RtcConnection& connection) = 0; + /** + * Updates the position of local user. This method is used in scene with multi RtcConnection. + * + * @note + * - This method is only effective in ILocalSpatialAudioEngine currently. + * + * @param position The sound position of the user. The coordinate order is forward, right, and up. + * @param axisForward The vector in the direction of the forward axis in the coordinate system. + * @param axisRight The vector in the direction of the right axis in the coordinate system. + * @param axisUp The vector in the direction of the up axis in the coordinate system. + * @param connection The RTC connection whose spatial audio effect you want to update. + * @return + * - 0: Success. + * - <0: Failure. + */ + virtual int updateSelfPositionEx(const float position[3], const float axisForward[3], const float axisRight[3], const float axisUp[3], const RtcConnection& connection) = 0; + /** * This method sets the maximum number of streams that a player can receive in a * specified audio reception range. @@ -136,24 +211,7 @@ class IBaseSpatialAudioEngine: public RefCountInterface { * - 0: Success. * - <0: Failure. */ - virtual int updateSelfPosition(float position[3], float axisForward[3], float axisRight[3], float axisUp[3]) = 0; - /** - * Updates the position of local user. This method is used in scene with multi RtcConnection. - * - * @note - * - This method is only effective in ILocalSpatialAudioEngine currently. - * - * @param position The sound position of the user. The coordinate order is forward, right, and up. - * @param axisForward The vector in the direction of the forward axis in the coordinate system. - * @param axisRight The vector in the direction of the right axis in the coordinate system. - * @param axisUp The vector in the direction of the up axis in the coordinate system. - * @param connection The RTC connection whose spatial audio effect you want to update. - * @return - * - 0: Success. - * - <0: Failure. - */ - virtual int updateSelfPositionEx(float position[3], float axisForward[3], float axisRight[3], float axisUp[3], const RtcConnection& connection) = 0; - + virtual int updateSelfPosition(const float position[3], const float axisForward[3], const float axisRight[3], const float axisUp[3]) = 0; /** * Updates the position of a media player in scene. This method has same behavior both in ICloudSpatialAudioEngine and ILocalSpatialAudioEngine. * @@ -196,28 +254,7 @@ class IBaseSpatialAudioEngine: public RefCountInterface { * - <0: Failure. */ virtual int muteAllRemoteAudioStreams(bool mute) = 0; - - - /** - * Setting up sound Space - * - * @param zones The Sound space array - * @param zoneCount the sound Space count of array - * @return - * - 0: Success. - * - <0: Failure. - */ - virtual int setZones(const SpatialAudioZone *zones, unsigned int zoneCount) = 0; - /** - * Set the audio attenuation coefficient of the player - * @param playerId The ID of the media player. You can get it by IMediaPlayer::getMediaPlayerId. - * @param attenuation The audio attenuation of the media player. - * @param forceSet Whether to force the setting of audio attenuation coefficient. - * @return - * - 0: Success. - * - <0: Failure. - */ - virtual int setPlayerAttenuation(int playerId, double attenuation, bool forceSet) = 0; + /** * Mute or unmute remote user audio stream. * @@ -228,65 +265,29 @@ class IBaseSpatialAudioEngine: public RefCountInterface { * - <0: Failure. */ virtual int muteRemoteAudioStream(uid_t uid, bool mute) = 0; -}; - -class ILocalSpatialAudioEngine : public IBaseSpatialAudioEngine { -protected: - virtual ~ILocalSpatialAudioEngine() {} -public: - /** - * Initializes the ILocalSpatialAudioEngine object and allocates the internal resources. - * - * @note Ensure that you call IRtcEngine::queryInterface and initialize before calling any other ILocalSpatialAudioEngine APIs. - * - * @param config The pointer to the LocalSpatialAudioConfig. See #LocalSpatialAudioConfig. - * - * @return - * - 0: Success. - * - <0: Failure. - */ - virtual int initialize(const LocalSpatialAudioConfig& config) = 0; - /** - * Updates the position information of remote user. You should call it when remote user whose role is broadcaster moves. - * - * @param uid The remote user ID. It should be the same as RTC channel remote user id. - * @param posInfo The position information of remote user. See #RemoteVoicePositionInfo. - * @return - * - 0: Success. - * - <0: Failure. - */ - virtual int updateRemotePosition(uid_t uid, const RemoteVoicePositionInfo &posInfo) = 0; - /** - * Updates the position of remote user. It's supposed to use with IRtcEngineEx::joinChannelEx. - * - * @param uid The remote user ID. It should be the same as RTC channel remote user id. - * @param posInfo The position information of remote user. See #RemoteVoicePositionInfo. - * @param connection The RTC connection whose spatial audio effect you want to update. See #RtcConnection. - * @return - * - 0: Success. - * - <0: Failure. - */ - virtual int updateRemotePositionEx(uid_t uid, const RemoteVoicePositionInfo &posInfo, const RtcConnection& connection) = 0; + virtual int setRemoteAudioAttenuation(uid_t uid, double attenuation, bool forceSet) = 0; + /** - * Remove the position information of remote user. You should call it when remote user called IRtcEngine::leaveChannel. + * Setting up sound Space * - * @param uid The remote user ID. It should be the same as RTC channel remote user id. + * @param zones The Sound space array + * @param zoneCount the sound Space count of array * @return * - 0: Success. * - <0: Failure. */ - virtual int removeRemotePosition(uid_t uid) = 0; + virtual int setZones(const SpatialAudioZone *zones, unsigned int zoneCount) = 0; /** - * Remove the position information of remote user. It's supposed to use with IRtcEngineEx::joinChannelEx. - * - * @param uid The remote user ID. It should be the same as RTC channel remote user id. - * @param connection The RTC connection whose spatial audio effect you want to update. See #RtcConnection. + * Set the audio attenuation coefficient of the player + * @param playerId The ID of the media player. You can get it by IMediaPlayer::getMediaPlayerId. + * @param attenuation The audio attenuation of the media player. + * @param forceSet Whether to force the setting of audio attenuation coefficient. * @return * - 0: Success. * - <0: Failure. */ - virtual int removeRemotePositionEx(uid_t uid, const RtcConnection& connection) = 0; + virtual int setPlayerAttenuation(int playerId, double attenuation, bool forceSet) = 0; /** * Clear the position informations of remote users. * @@ -294,21 +295,8 @@ class ILocalSpatialAudioEngine : public IBaseSpatialAudioEngine { * - 0: Success. * - <0: Failure. */ - virtual int clearRemotePositions() = 0; - /** - * Clear the position informations of remote users. It's supposed to use with IRtcEngineEx::joinChannelEx. - * - * @return - * - 0: Success. - * - <0: Failure. - */ - virtual int clearRemotePositionsEx(const RtcConnection& connection) = 0; - - - virtual int setRemoteAudioAttenuation(uid_t uid, double attenuation, bool forceSet) = 0; + virtual int clearRemotePositions() = 0; }; } // namespace rtc } // namespace agora - -#endif diff --git a/android/src/main/cpp/third_party/include/iris/iris_engine_base.h b/android/src/main/cpp/third_party/include/iris/iris_engine_base.h index a7c2a15c2..bbaa73288 100644 --- a/android/src/main/cpp/third_party/include/iris/iris_engine_base.h +++ b/android/src/main/cpp/third_party/include/iris/iris_engine_base.h @@ -1,6 +1,6 @@ #pragma once -#include "iris_module.h" +#include "iris_base.h" class IApiEngineBase { public: diff --git a/android/src/main/cpp/third_party/include/iris/iris_module.h b/android/src/main/cpp/third_party/include/iris/iris_module.h index e98489975..0ec4eb531 100644 --- a/android/src/main/cpp/third_party/include/iris/iris_module.h +++ b/android/src/main/cpp/third_party/include/iris/iris_module.h @@ -6,26 +6,16 @@ #define IRIS_DELEGATE_H_ #include "iris_base.h" -#include namespace agora { namespace iris { -class IRIS_DEBUG_CPP_API IrisEventHandler { +class IrisEventHandler { public: virtual ~IrisEventHandler() = default; public: - virtual void OnEvent(EventParam *param){}; -}; - -class IModule { - public: - virtual ~IModule(){}; - virtual void Initialize(void *rtc_engine) = 0; - virtual void Release() = 0; - virtual int CallApi(const char *func_name, const char *buff, - uint32_t buffLength, std::string &out) = 0; + virtual void OnEvent(EventParam *param) {} }; }// namespace iris diff --git a/android/src/main/cpp/third_party/include/iris/iris_platform.h b/android/src/main/cpp/third_party/include/iris/iris_platform.h index c9b9ec916..a485a3580 100644 --- a/android/src/main/cpp/third_party/include/iris/iris_platform.h +++ b/android/src/main/cpp/third_party/include/iris/iris_platform.h @@ -64,14 +64,6 @@ #define IRIS_DEPRECATED #endif -#if defined(IRIS_DEBUG) -#define IRIS_DEBUG_API IRIS_API -#define IRIS_DEBUG_CPP_API IRIS_CPP_API -#else -#define IRIS_DEBUG_API -#define IRIS_DEBUG_CPP_API -#endif - #if defined(__GUNC__) #define COMPILER_IS_GCC #if defined(__MINGW32__) || defined(__MINGW64__) diff --git a/android/src/main/cpp/third_party/include/iris/iris_queue.h b/android/src/main/cpp/third_party/include/iris/iris_queue.h deleted file mode 100644 index ff0fee385..000000000 --- a/android/src/main/cpp/third_party/include/iris/iris_queue.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef __IRIS_QUEUE_H__ -#define __IRIS_QUEUE_H__ - -#include -#include -#include - -template -class QueueBase { - public: - QueueBase() : max_size_(0) {} - - bool add(T *obj) { - std::lock_guard lock(mutex_); - assert(obj != nullptr); - if (max_size_ != 0 && objects_.size() >= max_size_) { return false; } - objects_.emplace_back(obj); - return true; - } - - bool addUnique(T *obj) { - std::lock_guard lock(mutex_); - assert(obj != nullptr); - if (max_size_ != 0 && objects_.size() >= max_size_) { return false; } - - for (auto it = objects_.begin(); it != objects_.end(); it++) { - if (obj == (*it)) { return false; } - } - - objects_.emplace_back(obj); - return true; - } - - bool remove(T *obj) { - std::lock_guard lock(mutex_); - assert(obj != nullptr); - for (auto it = objects_.begin(); it != objects_.end(); it++) { - if (obj == (*it)) { - objects_.erase(it); - return true; - } - } - return false; - } - - int count() { return objects_.size(); } - - void set_maxsize(size_t maxsize) { max_size_ = maxsize; } - - T *get(int i) { - if (objects_.size() > 0) return objects_[i]; - else - return nullptr; - } - - void clear() { - std::lock_guard lock(mutex_); - objects_.clear(); - } - - public: - std::mutex mutex_; - - private: - std::vector objects_; - size_t max_size_; -}; - -#endif \ No newline at end of file diff --git a/android/src/main/cpp/third_party/include/iris/iris_rtc_api_type.h b/android/src/main/cpp/third_party/include/iris/iris_rtc_api_type.h index 6f768ff8e..858c4c561 100644 --- a/android/src/main/cpp/third_party/include/iris/iris_rtc_api_type.h +++ b/android/src/main/cpp/third_party/include/iris/iris_rtc_api_type.h @@ -26,6 +26,7 @@ "RtcEngine_startMediaRenderingTracing" #define FUNC_RTCENGINEEX_STARTMEDIARENDERINGTRACINGEX \ "RtcEngineEx_startMediaRenderingTracingEx" +#define FUNC_RTCENGINEEX_SETPARAMETERSEX "RtcEngineEx_setParametersEx" #define FUNC_RTCENGINE_ENABLEINSTANTMEDIARENDERING \ "RtcEngine_enableInstantMediaRendering" #define FUNC_RTCENGINE_RELEASE "RtcEngine_release" @@ -34,6 +35,7 @@ #define FUNC_RTCENGINE_GETVERSION "RtcEngine_getVersion" #define FUNC_RTCENGINE_GETERRORDESCRIPTION "RtcEngine_getErrorDescription" #define FUNC_RTCENGINE_QUERYCODECCAPABILITY "RtcEngine_queryCodecCapability" +#define FUNC_RTCENGINE_QUERYDEVICESCORE "RtcEngine_queryDeviceScore" #define FUNC_RTCENGINE_JOINCHANNEL "RtcEngine_joinChannel" #define FUNC_RTCENGINE_JOINCHANNEL2 "RtcEngine_joinChannel2" #define FUNC_RTCENGINE_UPDATECHANNELMEDIAOPTIONS \ @@ -74,6 +76,7 @@ #define FUNC_RTCENGINE_SETUPREMOTEVIDEO "RtcEngine_setupRemoteVideo" #define FUNC_RTCENGINE_SETUPLOCALVIDEO "RtcEngine_setupLocalVideo" #define FUNC_RTCENGINE_SETVIDEOSCENARIO "RtcEngine_setVideoScenario" +#define FUNC_RTCENGINE_SETVIDEOQOEPREFERENCE "RtcEngine_setVideoQoEPreference" #define FUNC_RTCENGINE_ENABLEAUDIO "RtcEngine_enableAudio" #define FUNC_RTCENGINE_DISABLEAUDIO "RtcEngine_disableAudio" #define FUNC_RTCENGINE_SETAUDIOPROFILE "RtcEngine_setAudioProfile" @@ -288,9 +291,6 @@ #define FUNC_RTCENGINE_GETCALLID "RtcEngine_getCallId" #define FUNC_RTCENGINE_RATE "RtcEngine_rate" #define FUNC_RTCENGINE_COMPLAIN "RtcEngine_complain" -//#define FUNC_RTCENGINE_ADDPUBLISHSTREAMURL "RtcEngine_addPublishStreamUrl" -//#define FUNC_RTCENGINE_REMOVEPUBLISHSTREAMURL "RtcEngine_removePublishStreamUrl" -//#define FUNC_RTCENGINE_SETLIVETRANSCODING "RtcEngine_setLiveTranscoding" #define FUNC_RTCENGINE_STARTRTMPSTREAMWITHOUTTRANSCODING \ "RtcEngine_startRtmpStreamWithoutTranscoding" #define FUNC_RTCENGINE_STARTRTMPSTREAMWITHTRANSCODING \ @@ -324,7 +324,6 @@ #define FUNC_RTCENGINE_SENDSTREAMMESSAGE "RtcEngine_sendStreamMessage" #define FUNC_RTCENGINE_ADDVIDEOWATERMARK "RtcEngine_addVideoWatermark" #define FUNC_RTCENGINE_ADDVIDEOWATERMARK2 "RtcEngine_addVideoWatermark2" -//#define FUNC_RTCENGINE_CLEARVIDEOWATERMARK "RtcEngine_clearVideoWatermark" #define FUNC_RTCENGINE_CLEARVIDEOWATERMARKS "RtcEngine_clearVideoWatermarks" #define FUNC_RTCENGINE_PAUSEAUDIO "RtcEngine_pauseAudio" #define FUNC_RTCENGINE_RESUMEAUDIO "RtcEngine_resumeAudio" @@ -352,9 +351,6 @@ #define FUNC_RTCENGINE_GETUSERINFOBYUSERACCOUNT \ "RtcEngine_getUserInfoByUserAccount" #define FUNC_RTCENGINE_GETUSERINFOBYUID "RtcEngine_getUserInfoByUid" -#define FUNC_RTCENGINE_STARTCHANNELMEDIARELAY "RtcEngine_startChannelMediaRelay" -#define FUNC_RTCENGINE_UPDATECHANNELMEDIARELAY \ - "RtcEngine_updateChannelMediaRelay" #define FUNC_RTCENGINE_STOPCHANNELMEDIARELAY "RtcEngine_stopChannelMediaRelay" #define FUNC_RTCENGINE_PAUSEALLCHANNELMEDIARELAY \ "RtcEngine_pauseAllChannelMediaRelay" @@ -369,13 +365,7 @@ #define FUNC_RTCENGINE_STOPDIRECTCDNSTREAMING "RtcEngine_stopDirectCdnStreaming" #define FUNC_RTCENGINE_UPDATEDIRECTCDNSTREAMINGMEDIAOPTIONS \ "RtcEngine_updateDirectCdnStreamingMediaOptions" -//to delete -//#define FUNC_RTCENGINE_PUSHDIRECTCDNSTREAMINGCUSTOMVIDEOFRAME \ -// "RtcEngine_pushDirectCdnStreamingCustomVideoFrame" #define FUNC_RTCENGINE_TAKESNAPSHOT "RtcEngine_takeSnapshot" -//to delete -//#define FUNC_RTCENGINE_SETCONTENTINSPECT "RtcEngine_SetContentInspect" -//#define FUNC_RTCENGINE_SWITCHCHANNEL "RtcEngine_switchChannel" #define FUNC_RTCENGINE_STARTRHYTHMPLAYER "RtcEngine_startRhythmPlayer" #define FUNC_RTCENGINE_STOPRHYTHMPLAYER "RtcEngine_stopRhythmPlayer" #define FUNC_RTCENGINE_CONFIGRHYTHMPLAYER "RtcEngine_configRhythmPlayer" @@ -385,8 +375,6 @@ "RtcEngine_adjustCustomAudioPlayoutVolume" #define FUNC_RTCENGINE_SETCLOUDPROXY "RtcEngine_setCloudProxy" #define FUNC_RTCENGINE_SETLOCALACCESSPOINT "RtcEngine_setLocalAccessPoint" -//#define FUNC_RTCENGINE_ENABLEFISHEYECORRECTION \ -// "RtcEngine_enableFishEyeCorrection" #define FUNC_RTCENGINE_SETADVANCEDAUDIOOPTIONS \ "RtcEngine_setAdvancedAudioOptions" #define FUNC_RTCENGINE_SETAVSYNCSOURCE "RtcEngine_setAVSyncSource" @@ -469,7 +457,8 @@ #define FUNC_RTCENGINE_ISFEATUREAVAILABLEONDEVICE \ "RtcEngine_isFeatureAvailableOnDevice" #define FUNC_RTCENGINE_PRELOADCHANNEL "RtcEngine_preloadChannel" -#define FUNC_RTCENGINE_PRELOADCHANNEL2 "RtcEngine_preloadChannel2" +#define FUNC_RTCENGINE_PRELOADCHANNELWITHUSERACCOUNT \ + "RtcEngine_preloadChannelWithUserAccount" #define FUNC_RTCENGINE_UPDATEPRELOADCHANNELTOKEN \ "RtcEngine_updatePreloadChannelToken" // class IRtcEngine end @@ -501,12 +490,10 @@ #define FUNC_MEDIAPLAYER_GETSTREAMCOUNT "MediaPlayer_getStreamCount" #define FUNC_MEDIAPLAYER_GETSTREAMINFO "MediaPlayer_getStreamInfo" #define FUNC_MEDIAPLAYER_SETLOOPCOUNT "MediaPlayer_setLoopCount" -/*#define FUNC_MEDIAPLAYER_MUTEAUDIO "MediaPlayer_muteAudio" -#define FUNC_MEDIAPLAYER_ISAUDIOMUTED "MediaPlayer_isAudioMuted" -#define FUNC_MEDIAPLAYER_MUTEVIDEO "MediaPlayer_muteVideo" -#define FUNC_MEDIAPLAYER_ISVIDEOMUTED "MediaPlayer_isVideoMuted"*/ #define FUNC_MEDIAPLAYER_SETPLAYBACKSPEED "MediaPlayer_setPlaybackSpeed" #define FUNC_MEDIAPLAYER_SELECTAUDIOTRACK "MediaPlayer_selectAudioTrack" +#define FUNC_MEDIAPLAYER_SELECTMULTIAUDIOTRACK \ + "MediaPlayer_selectMultiAudioTrack" #define FUNC_MEDIAPLAYER_SETPLAYEROPTION "MediaPlayer_setPlayerOption" #define FUNC_MEDIAPLAYER_SETPLAYEROPTION2 "MediaPlayer_setPlayerOption2" #define FUNC_MEDIAPLAYER_TAKESCREENSHOT "MediaPlayer_takeScreenshot" @@ -683,6 +670,10 @@ "AudioDeviceManager_getPlaybackDefaultDevice" #define FUNC_AUDIODEVICEMANAGER_GETRECORDINGDEAFULTDEVICE \ "AudioDeviceManager_getRecordingDefaultDevice" +#define FUNC_AUDIODEVICEMANAGER_GETPLAYBACKAUDIODEVICEINFO \ + "AudioDeviceManager_getPlaybackAudioDeviceInfo" +#define FUNC_AUDIODEVICEMANAGER_GETRECORDINGAUDIODEVICEINFO \ + "AudioDeviceManager_getRecordingAudioDeviceInfo" // class IAudioDeviceManager end // class ICloudSpatialAudioEngine start @@ -847,8 +838,6 @@ #define FUNC_RTCENGINEEX_GETUSERINFOBYUIDEX "RtcEngineEx_getUserInfoByUidEx" #define FUNC_RTCENGINEEX_ENABLEDUALSTREAMMODEEX \ "RtcEngineEx_enableDualStreamModeEx" -//#define FUNC_RTCENGINEEX_ADDPUBLISHSTREAMURLEX \ -// "RtcEngineEx_addPublishStreamUrlEx" #define FUNC_RTCENGINEEX_SETSUBSCRIBEVIDEOBLOCKLISTEX \ "RtcEngineEx_setSubscribeVideoBlocklistEx" @@ -881,8 +870,6 @@ "RtcEngineEx_pauseAllChannelMediaRelayEx" #define FUNC_RTCENGINEEX_RESUMEALLCHANNELMEDIARELAYEX \ "RtcEngineEx_resumeAllChannelMediaRelayEx" -#define FUNC_RTCENGINEEX_STARTCHANNELMEDIARELAYEX \ - "RtcEngineEx_startChannelMediaRelayEx" #define FUNC_RTCENGINEEX_STARTRTMPSTREAMWITHTRANSCODINGEX \ "RtcEngineEx_startRtmpStreamWithTranscodingEx" #define FUNC_RTCENGINEEX_STARTRTMPSTREAMWITHOUTTRANSCODINGEX \ @@ -890,8 +877,6 @@ #define FUNC_RTCENGINEEX_STOPCHANNELMEDIARELAYEX \ "RtcEngineEx_stopChannelMediaRelayEx" #define FUNC_RTCENGINEEX_STOPRTMPSTREAMEX "RtcEngineEx_stopRtmpStreamEx" -#define FUNC_RTCENGINEEX_UPDATECHANNELMEDIARELAYEX \ - "RtcEngineEx_updateChannelMediaRelayEx" #define FUNC_RTCENGINEEX_UPDATERTMPTRANSCODINGEX \ "RtcEngineEx_updateRtmpTranscodingEx" #define FUNC_RTCENGINEEX_ADJUSTRECORDINGSIGNALVOLUMEEX \ diff --git a/android/src/main/cpp/third_party/include/iris/iris_rtc_engine.h b/android/src/main/cpp/third_party/include/iris/iris_rtc_engine.h deleted file mode 100644 index 3497e0dbb..000000000 --- a/android/src/main/cpp/third_party/include/iris/iris_rtc_engine.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// Created by LXH on 2021/1/14. -// - -#ifndef IRIS_RTC_ENGINE_H_ -#define IRIS_RTC_ENGINE_H_ - -namespace agora { -namespace iris { -namespace rtc { - -class IRIS_DEBUG_CPP_API IIrisRtcEngine : public IModule { - public: - virtual IModule *device_manager() = 0; - - virtual IModule *media_player() = 0; - - virtual IModule *local_audio_engine() = 0; - - virtual IModule *cloud_audio_engine() = 0; - - virtual IModule *media_recorder() = 0; - - virtual IModule *media_player_cache_manager() = 0; - - virtual IModule *music_center() = 0; -}; - -}// namespace rtc -}// namespace iris -}// namespace agora - -#endif//IRIS_RTC_ENGINE_H_ diff --git a/ios/agora_rtc_engine.podspec b/ios/agora_rtc_engine.podspec index 0349b6371..88006a78e 100644 --- a/ios/agora_rtc_engine.podspec +++ b/ios/agora_rtc_engine.podspec @@ -23,8 +23,8 @@ Pod::Spec.new do |s| puts '[plugin_dev] Found .plugin_dev file, use vendored_frameworks instead.' s.vendored_frameworks = 'libs/*.xcframework' else - s.dependency 'AgoraIrisRTC_iOS', '4.2.6-build.3' - s.dependency 'AgoraRtcEngine_iOS', '4.2.6' + s.dependency 'AgoraIrisRTC_iOS', '4.3.0-dev.10' + s.dependency 'AgoraRtcEngine_iOS_Preview', '4.3.0-dev.9' end s.platform = :ios, '9.0' diff --git a/macos/agora_rtc_engine.podspec b/macos/agora_rtc_engine.podspec index fa1847170..d06d9f07c 100644 --- a/macos/agora_rtc_engine.podspec +++ b/macos/agora_rtc_engine.podspec @@ -21,8 +21,8 @@ A new flutter plugin project. puts '[plugin_dev] Found .plugin_dev file, use vendored_frameworks instead.' s.vendored_frameworks = 'libs/*.framework' else - s.dependency 'AgoraRtcEngine_macOS', '4.2.6' - s.dependency 'AgoraIrisRTC_macOS', '4.2.6-build.3' + s.dependency 'AgoraRtcEngine_macOS_Preview', '4.3.0-dev.9' + s.dependency 'AgoraIrisRTC_macOS', '4.3.0-dev.10' end s.platform = :osx, '10.11' diff --git a/scripts/artifacts_version.sh b/scripts/artifacts_version.sh index d6b6cc892..cf6915660 100644 --- a/scripts/artifacts_version.sh +++ b/scripts/artifacts_version.sh @@ -1,6 +1,6 @@ set -e -export IRIS_CDN_URL_ANDROID="https://download.agora.io/sdk/release/iris_4.2.6-build.3_DCG_Android_Video_20231116_0243.zip" -export IRIS_CDN_URL_IOS="https://download.agora.io/sdk/release/iris_4.2.6-build.3_DCG_iOS_Video_20231116_0243.zip" -export IRIS_CDN_URL_MACOS="https://download.agora.io/sdk/release/iris_4.2.6-build.3_DCG_Mac_Video_20231116_0243.zip" -export IRIS_CDN_URL_WINDOWS="https://download.agora.io/sdk/release/iris_4.2.6-build.3_DCG_Windows_Video_20231116_0243.zip" +export IRIS_CDN_URL_ANDROID="https://download.agora.io/sdk/release/iris_4.3.0-dev.10_DCG_Android_Video_20231207_0514.zip" +export IRIS_CDN_URL_IOS="https://download.agora.io/sdk/release/iris_4.3.0-dev.10_DCG_iOS_Video_20231207_0514.zip" +export IRIS_CDN_URL_MACOS="https://download.agora.io/sdk/release/iris_4.3.0-dev.10_DCG_Mac_Video_20231207_0514.zip" +export IRIS_CDN_URL_WINDOWS="https://download.agora.io/sdk/release/iris_4.3.0-dev.10_DCG_Windows_Video_20231207_0514.zip" diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index 42f4ff576..677b5c544 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -12,8 +12,8 @@ project(${PROJECT_NAME} LANGUAGES CXX) # not be changed set(PLUGIN_NAME "agora_rtc_engine_plugin") -set(IRIS_SDK_DOWNLOAD_URL "https://download.agora.io/sdk/release/iris_4.2.6-build.3_DCG_Windows_Video_20231116_0243.zip") -set(IRIS_SDK_DOWNLOAD_NAME "iris_4.2.6-build.3_DCG_Windows") +set(IRIS_SDK_DOWNLOAD_URL "https://download.agora.io/sdk/release/iris_4.3.0-dev.10_DCG_Windows_Video_20231207_0514.zip") +set(IRIS_SDK_DOWNLOAD_NAME "iris_4.3.0-dev.10_DCG_Windows") set(RTC_SDK_DOWNLOAD_NAME "Agora_Native_SDK_for_Windows_FULL") set(IRIS_SDK_VERSION "v3_6_2_fix.1")